[Cosmo-dev] [contribution]patch for bug 7767,
library to support resizing, splitters, and moveable dialogs.
Jeremy Epstein
eggfree at eggfree.net
Tue May 15 09:37:49 PDT 2007
Hello everyone.
Attached you will find a Subversion patch file to trunk. This patch
provides a simple library to cleanly handle dynamic resizing of DOM
elements. It allows developers to introduce splitters, and create things
such as moveable, resizable windows from any block level primitive. The
library follows OSAF coding standards and minimally integrates with the
dojo package system (it does not depend on any dojo framework
components). I took the liberty of integrating into the current trunk (
obviously not committing) for integration testing etc...
This library can create resizeable elements from special attributes in
mark up (declaratively) and also via javascript calls (procedurally)
Incorporating this patch specifically addresses bug 7767,
"Resize/re-flow UI when window is resized.".
Matthew briefly evaluated this code yesterday to see if there are any
major issues. If anyone has detailed questions about any of the inner
workings, I'd be happy to explain. You will find a test/prototype in
resize.zip. Open the HTML file to see an example showing a live sketch
of how the major parts of the current UI might use this library.
Jeremy
-------------- next part --------------
Index: /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/WEB-INF/jsp/pim/pim.jsp
===================================================================
--- /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/WEB-INF/jsp/pim/pim.jsp (revision 4415)
+++ /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/WEB-INF/jsp/pim/pim.jsp (working copy)
@@ -43,6 +43,7 @@
<title><fmt:message key="App.Welcome"/></title>
<link rel="stylesheet" href="${staticBaseUrl}/templates/default/global.css"/>
+<link rel="stylesheet" href="${staticBaseUrl}/templates/default/ui.css"/>
<c:if test="${not empty relationLinks}">
<link rel="self" type="text/html" href="${relationLinks['pim']}"/>
@@ -57,8 +58,7 @@
<script type="text/javascript">
// Dojo requires
dojo.require('cosmo.app');
-dojo.require('cosmo.app.pim');
-dojo.require('cosmo.ui.global_css');
+dojo.require('cosmo.app.pim.layout');
dojo.require('cosmo.convenience');
dojo.require('cosmo.topics');
dojo.require('cosmo.account.preferences');
@@ -78,6 +78,7 @@
</c:if>
dojo.require("cosmo.ui.event.listeners");
+dojo.hostenv.writeIncludes();
cosmo.ui.event.listeners.hookUpListeners();
</script>
@@ -85,100 +86,12 @@
</head>
<body id="body">
- <div id="menuBarDiv">
- <div id="smallLogoDiv"></div>
- <%-- Begin main nav menu --%>
- <div id="menuNavItems">
- <c:choose>
- <c:when test="${not ticketedView}">
- <%-- Start non-ticketed links --%>
- <authz:authorize ifAnyGranted="ROLE_USER">
- <fmt:message key="Main.Welcome"><fmt:param value="${user.username}"/></fmt:message>
- <span class="menuBarDivider">|</span>
- </authz:authorize>
- <authz:authorize ifAllGranted="ROLE_ROOT">
- <c:url var="consoleUrl" value="/admin/users"/>
- <a href="${consoleUrl}"><fmt:message key="Main.Console"/></a>
- <span class="menuBarDivider">|</span>
- </authz:authorize>
- <a href="javascript:cosmo.account.settings.showDialog();">
- Settings
- </a>
- <span class="menuBarDivider">|</span>
- <span id="accountBrowserLink" style="display: none;">
- <a href="${staticBaseUrl}/browse/${user.username}"
- onclick="window.open('${staticBaseUrl}/browse/${user.username}');
- return false;">
- Account Browser
- </a>
- <span class="menuBarDivider">|</span>
- </span>
- <%-- End non-ticketed links --%>
- </c:when>
- <c:otherwise>
- <%--
- Ticketed version of links
- Add divs for subscribeSelector, signupGraphic via JavaScript DOM
- so we can get accurate offsetWidth as code executes
- --%>
- </c:otherwise>
- </c:choose>
-
- <c:url var="helpUrl"
- value="http://wiki.osafoundation.org/Projects/CosmoHelpRel0dot6"/>
- <a href="${helpUrl}"
- onclick="window.open('${helpUrl}');
- return false;"><fmt:message key="Main.Help"/></a>
-
- <c:if test="${not ticketedView}">
- <authz:authorize ifAnyGranted="ROLE_USER">
- <span class="menuBarDivider">|</span>
- <a href="${staticBaseUrl}/logout">
- <fmt:message key="Main.LogOut"/>
- </a>
- </authz:authorize>
- </c:if>
- </div>
- <%-- End main nav menu --%>
- </div>
- <div id="calDiv">
- <div id="leftSidebarDiv">
- <div id="calSelectNav"></div>
- <div id="jumpToDateDiv"></div>
- <div id="miniCalDiv"></div>
- </div>
- <div id="calTopNavDiv">
- <table cellpadding="0" cellspacing="0">
- <tr>
- <td> </td>
- <td id="viewNavButtons"></td>
- <td> </td>
- <td id="monthHeaderDiv" class="labelTextXL"></td>
- </tr>
- </table>
- </div>
- <div id="dayListDiv"></div>
- <div id="allDayResizeMainDiv" onSelectStart="return false;">
- <div id="allDayHourSpacerDiv"></div>
- <div id="allDayContentDiv"></div>
- </div>
- <div id="allDayResizeHandleDiv"></div>
- <div id="timedScrollingMainDiv" onSelectStart="return false;">
- <div id="timedHourListDiv"></div>
- <div id="timedContentDiv"></div>
- </div>
- <div id="rightSidebarDiv">
- <form method="post" id="calForm" action="">
- <div id="eventInfoDiv"></div>
- </form>
- </div>
- </div>
- <div id="maskDiv">
- <div id="appLoadingMessage">
- Loading the app ...
- </div>
- </div>
-
+ <div id="baseLayout" style="position: absolute;"></div>
+ <div id="maskDiv">
+ <div id="appLoadingMessage">
+ Loading the app ...
+ </div>
+ </div>
</body>
</html>
Index: /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/__package__.js
===================================================================
--- /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/__package__.js (revision 4415)
+++ /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/__package__.js (working copy)
@@ -1,22 +0,0 @@
-/*
- * Copyright 2006 Open Source Applications Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-dojo.provide("cosmo.*");
-
-dojo.kwCompoundRequire({
- common: [] // a generic dependency
-});
-
Index: /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/__package__.js
===================================================================
--- /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/__package__.js (revision 0)
+++ /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/__package__.js (revision 4415)
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2006 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+dojo.provide("cosmo.*");
+
+dojo.kwCompoundRequire({
+ common: [] // a generic dependency
+});
+
Index: /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/app/pim/layout.js
===================================================================
--- /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/app/pim/layout.js (revision 0)
+++ /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/app/pim/layout.js (revision 0)
@@ -0,0 +1,221 @@
+/*
+ * Copyright 2006 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+dojo.provide("cosmo.app.pim.layout");
+
+dojo.require("cosmo.app.pim");
+dojo.require('cosmo.ui.resize')
+dojo.require("cosmo.ui.ContentBox");
+dojo.require("dojo.html.common");
+// -- Create global vars, do not remove despite lack of refs in code
+dojo.require("cosmo.ui.conf");
+dojo.require("cosmo.util.i18n");
+dojo.require('cosmo.convenience');
+// --
+
+cosmo.app.pim.layout = new function () {
+ this.baseLayout = null;
+ this.initBaseLayout = function (node) {
+ this.baseLayout = new cosmo.app.pim.layout.BaseLayout(node);
+ this.baseLayout.render();
+ return this.baseLayout;
+ };
+};
+
+cosmo.app.pim.layout.BaseLayout = function (p) {
+ var params = p || {}
+ this.top = 0;
+ this.left = 0;
+ this.width = 0;
+ this.height = 0;
+ this.domNode = params.domNode;
+ this.menuBar = new cosmo.app.pim.layout.MenuBar({ parent: this });
+ this.mainApp = new cosmo.app.pim.layout.MainApp({ parent: this });
+ this.children = [this.menuBar, this.mainApp];
+ this.renderSelf = function () {
+ /* var viewport = dojo.html.getViewport();
+ var w = viewport.width;
+ var h = viewport.height;
+ // Pare width and height down to avoid
+ // stupid scrollbars showing up
+ w -= 2;
+ h -= 2;
+ this.width = w;
+ this.height = h;
+ this.menuBar.update({
+ top: 0, left: 0,
+ width: this.width, height: TOP_MENU_HEIGHT });
+ this.mainApp.update({
+ top: TOP_MENU_HEIGHT, left: 0,
+ width: this.width, height: (this.height - TOP_MENU_HEIGHT) });
+ this.setPosition();
+ this.setSize();*/
+ cosmo.ui.resize.Viewports.resize()
+ }
+};
+cosmo.app.pim.layout.BaseLayout.prototype =
+ new cosmo.ui.ContentBox();
+
+cosmo.app.pim.layout.MenuBar = function (p) {
+ var params = p || {}
+ for (var n in params) { this[n] = params[n]; }
+
+ var d = _createElem('div');
+ d.id = 'menuBar';
+ document.body.appendChild(d);
+
+ this.domNode = d;
+ this.children = [];
+ this.renderSelf = function () {
+ //render other fun
+ }
+ // create viewport against document body
+
+ var vp = new cosmo.ui.resize.Viewport(d)
+ // add scaling
+ vp.setMinSize([102,52,0,0,100,50]);
+ vp.setMaxSize([1600,1202,0,0,1598,50]);
+ vp.addResize("renderSelf",this.renderSelf) ;
+};
+cosmo.app.pim.layout.MenuBar.prototype =
+ new cosmo.ui.ContentBox();
+
+cosmo.app.pim.layout.MainApp = function (p) {
+
+ var params = p || {}
+ for (var n in params) { this[n] = params[n]; }
+
+ var d = _createElem('div');
+ d.id = 'mainApp';
+
+ this.domNode = document.body;
+ this.centerColumn = new cosmo.app.pim.layout.CenterColumn({ parent: this });
+ this.leftSidebar = new cosmo.app.pim.layout.LeftSidebar({ parent: this });
+ this.rightSidebar = new cosmo.app.pim.layout.RightSidebar({ parent: this });
+ this.children = [this.leftSidebar, this.centerColumn, this.rightSidebar];
+ //JE this method may go away
+ this.renderSelf = function () {
+ //update children
+
+ if (!this.hasBeenRendered) {
+ this.parent.domNode.appendChild(this.domNode);
+ this.hasBeenRendered = true;
+ }
+ }
+};
+cosmo.app.pim.layout.MainApp.prototype =
+ new cosmo.ui.ContentBox();
+
+cosmo.app.pim.layout.LeftSidebar = function (p) {
+ var params = p || {}
+ for (var n in params) { this[n] = params[n]; }
+
+ // create domNodes
+ var d = _createElem('div');
+ d.id = 'leftSidebar';
+ d.className = "viewport"
+ d.style.background = '#f00';
+ d.style.paddingRight = "4px;"
+ var handle = _createElem('a')
+ handle.className = "l-rHandle leftSideHandle"
+ document.body.appendChild(d)
+ d.appendChild(handle)
+
+ this.domNode = d;
+ this.children = [];
+ this.renderSelf = function () {
+ // rendering for childern
+ }
+ var vp = new cosmo.ui.resize.Viewport(d)
+ // add scaling
+ vp.setMinSize([300,152,0,51,200,150]);
+ vp.setMaxSize([1600,1202,0,51,200,1200]);
+ vp.addResize("renderSelf",this.renderSelf) ;
+ var h = new cosmo.ui.resize.Handle(handle)
+ h.addViewport(d.id,"right")
+ h.addViewport('centerColumn','left')
+ h.addCollapse(d.id,"left")
+};
+cosmo.app.pim.layout.LeftSidebar.prototype =
+ new cosmo.ui.ContentBox();
+
+cosmo.app.pim.layout.CenterColumn = function (p) {
+ var params = p || {}
+ for (var n in params) { this[n] = params[n]; }
+ this.children = [];
+ var d = _createElem('div');
+ d.id = 'centerColumn';
+ d.className = "viewport"
+ d.style.background = '#0f0';
+ document.body.appendChild(d);
+
+ this.domNode = d;
+ this.children = [];
+ this.renderSelf = function () {
+ //add any special child rendering
+ }
+ //viewport fun
+ var vp = new cosmo.ui.resize.Viewport(d)
+ // add scaling
+ vp.setMinSize([500,300,201,51,298,298]);
+ vp.setMaxSize([1600,1202,201,51,1398,1200]);
+ vp.addResize("renderSelf",this.renderSelf) ;
+};
+cosmo.app.pim.layout.CenterColumn.prototype =
+ new cosmo.ui.ContentBox();
+
+cosmo.app.pim.layout.RightSidebar = function (p) {
+ var params = p || {}
+ for (var n in params) { this[n] = params[n]; }
+
+ var d = _createElem('div');
+ d.id = 'rightSidebar';
+ d.className = "viewport"
+ d.style.background = '#00f';
+ var handle = _createElem('a')
+ handle.className = "l-rHandle"
+ with (handle.style)
+ {
+ left = "0px"
+ height = "100%"
+ width = "4px"
+ backgroundColor = "rgb(216,216,216)"
+
+ }
+ document.body.appendChild(d)
+ d.appendChild(handle)
+
+
+ this.domNode = d;
+ this.children = [];
+ this.renderSelf = function () {
+ // add special rendering
+ }
+ this.children = [];
+ //viewport fun
+ var vp = new cosmo.ui.resize.Viewport(d)
+ vp.setMinSize([300,152,100,51,298,150]);
+ vp.setMaxSize([1600,1202,1400,51,1598,1200]);
+ vp.addResize("renderSelf",this.renderSelf) ;
+
+ var h = new cosmo.ui.resize.Handle(handle)
+ h.addViewport(d.id,"left")
+ h.addViewport('centerColumn','right')
+ h.addCollapse(d.id,"right")
+};
+cosmo.app.pim.layout.RightSidebar.prototype =
+ new cosmo.ui.ContentBox();
+
Index: /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/app/pim.js
===================================================================
--- /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/app/pim.js (revision 4415)
+++ /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/app/pim.js (working copy)
@@ -59,6 +59,7 @@
*/
cosmo.app.pim = new function () {
+
var self = this;
// Private variable for the list of any deleted subscriptions
var deletedSubscriptions = [];
@@ -65,6 +66,9 @@
// The Cosmo service -- used to talk to the backend
this.serv = null;
+ // The base layout for the PIM -- cosmo.ui.ContentBox obj
+ this.baseLayout = null;
+
// For calculating UI element positions
this.top = 0;
this.left = 0;
@@ -78,8 +82,6 @@
// All-day resizable area, scrolling area for normal events, detail form
// Calculated based on client window size
this.midColWidth = 0;
- // The form on the page -- a CalForm obj
- this.calForm = null;
// Current date for highlighting in the interface
this.currDate = null;
// The path to the currently selected collection
@@ -102,6 +104,9 @@
*/
this.init = function (p) {
+ // Load some dependencies
+ dojo.require("cosmo.app.pim.layout");
+
var params = p || {};
var collectionUid = params.collectionUid;
var ticketKey = params.ticketKey;
@@ -113,6 +118,11 @@
// ===============================
this.serv = cosmo.service.conduits.getAtomPlusEimConduit();
+ if (this.baseLayout = cosmo.app.pim.layout.initBaseLayout({ domNode: $('baseLayout') })) {
+ $('maskDiv').style.display = 'none';
+ }
+ return;
+
// Base layout
// ===============================
// Only in logged-in view
@@ -133,8 +143,8 @@
cosmo.view.cal.viewEnd, this.currDate);
}
// Calendar event detail form
- this.calForm = new CalForm();
- this.calForm.init();
+ //this.calForm = new CalForm();
+ //this.calForm.init();
// Initialize the color set for the cal lozenges
cosmo.view.cal.canvas.calcColors();
@@ -168,7 +178,7 @@
var jpDiv = $('jumpToDateDiv');
// Place jump-to date based on mini-cal pos
if (cosmo.ui.minical.MiniCal.init(cosmo.app.pim, mcDiv)) {
- this.calForm.addJumpToDate(jpDiv);
+ //this.calForm.addJumpToDate(jpDiv);
}
// Top menubar setup and positioning
if (this.setUpMenubar()) {
@@ -175,7 +185,7 @@
this.positionMenubarElements.apply(this);
}
// Add event listeners for form-element behaviors
- this.calForm.setEventListeners();
+ //this.calForm.setEventListeners();
// Final stuff / cleanup
// ===============================
@@ -244,16 +254,6 @@
// Position UI elements
// =========================
- // **** Save these coords for middle-col mask ****
- $('appLoadingMessage').style.width = PROCESSING_ANIM_WIDTH + 'px';
- $('appLoadingMessage').style.top = parseInt((winheight-PROCESSING_ANIM_HEIGHT)/2) + 'px';
- $('appLoadingMessage').style.left = parseInt((winwidth-PROCESSING_ANIM_WIDTH)/2) + 'px';
- //this.uiMask.setPosition(this.top, LEFT_SIDEBAR_WIDTH);
- //this.uiMask.setSize(this.midColWidth-2, this.height);
- // Position the processing animation
- //uiProcessing.setPosition(parseInt((winheight-PROCESSING_ANIM_HEIGHT)/2),
- // parseInt((this.midColWidth-PROCESSING_ANIM_WIDTH)/2));
-
// Menubar
menuBar.setPosition(0, 0);
menuBar.setSize(this.width, TOP_MENU_HEIGHT-1);
@@ -620,7 +620,6 @@
if (this.allDayArea) {
this.allDayArea.cleanup();
}
- this.calForm = null;
this.allDayArea = null;
};
}
Index: /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/EventStamp.js
===================================================================
--- /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/EventStamp.js (revision 4415)
+++ /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/EventStamp.js (working copy)
@@ -38,9 +38,6 @@
var duration = this.getDuration();
var endDate = this.getStartDate().clone();
endDate.addDuration(duration);
- if (this.getAnyTime() || this.getAllDay()){
- endDate.add(dojo.date.dateParts.DAY, -1);
- }
return endDate;
},
@@ -46,10 +43,6 @@
setEndDate: function (/*CosmoDate*/ endDate){
var duration = new cosmo.model.Duration(this.getStartDate(), endDate);
- endDate = endDate.clone();
- if (this.getAnyTime() || this.getAllDay()){
- endDate.add(dojo.date.dateParts.DAY, +1);
- }
this.setDuration(duration);
},
Index: /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/ContentBox.js
===================================================================
--- /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/ContentBox.js (revision 4415)
+++ /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/ContentBox.js (working copy)
@@ -18,48 +18,93 @@
// Generic content container class
// ==============================
-cosmo.ui.ContentBox = function(id) {
- this.id = id;
- this.domNode = document.getElementById(this.id);
- this.style = this.domNode.style;
-
- this.cleanup = function() {
- this.domNode = null;
- };
- this.clearAll = function() {
- while (this.domNode.hasChildNodes()) {
- this.domNode.removeChild(this.domNode.firstChild);
- }
- this.domNode.innerHTML = '';
- };
- this.setPosition = function(top, left) {
- this.setTop(top);
- this.setLeft(left);
- };
- this.setSize = function(width, height) {
- this.setWidth(width);
- this.setHeight(height);
- };
- this.setTop = function(top) {
- this.style.top = parseInt(top) + 'px';
- };
- this.setLeft = function(left) {
- this.style.left = parseInt(left) + 'px';
- };
- this.setWidth = function(width) {
- var w = width.toString();
- var w = w.indexOf('%') > -1 ? w : parseInt(w) + 'px';
- this.style.width = w;
- };
- this.setHeight = function(height) {
- var h = height.toString();
- h = h.indexOf('%') > -1 ? h : parseInt(h) + 'px';
- this.style.height = h;
- };
- this.hide = function() {
- this.style.display = 'none';
+cosmo.ui.ContentBox = function (p) {
+ var params = p || {};
+ this.id = '';
+ this.top = 0;
+ this.left = 0;
+ this.width = 0;
+ this.height = 0;
+ this.domNode = null;
+ this.parent = null;
+ this.children = [];
+ this.hasBeenRendered = false;
+ for (var i in params) { this[i] = params[i] }
+}
+cosmo.ui.ContentBox.prototype.cleanup = function () {
+ this.domNode = null;
+};
+cosmo.ui.ContentBox.prototype.clearAll = function () {
+ while (this.domNode.hasChildNodes()) {
+ this.domNode.removeChild(this.domNode.firstChild);
+ }
+ this.domNode.innerHTML = '';
+};
+cosmo.ui.ContentBox.prototype.setPosition = function (left, top) {
+ this.setTop(top);
+ this.setLeft(left);
+};
+cosmo.ui.ContentBox.prototype.setSize = function (width, height) {
+ this.setWidth(width);
+ this.setHeight(height);
+};
+cosmo.ui.ContentBox.prototype.setTop = function (top) {
+ if (typeof top != 'undefined') {
+ n = top;
+ }
+ else {
+ n = this.top;
+ }
+ this.domNode.style.top = parseInt(n) + 'px';
+};
+cosmo.ui.ContentBox.prototype.setLeft = function (left) {
+ if (typeof left != 'undefined') {
+ n = left;
+ }
+ else {
+ n = this.left;
+ }
+ this.domNode.style.left = parseInt(n) + 'px';
+};
+cosmo.ui.ContentBox.prototype.setWidth = function (width) {
+ if (typeof width != 'undefined') {
+ n = width;
+ }
+ else {
+ n = this.width;
+ }
+ n = n.toString();
+ n = n.indexOf('%') > -1 ? n : parseInt(n) + 'px';
+ this.domNode.style.width = n;
+};
+cosmo.ui.ContentBox.prototype.setHeight = function (height) {
+ if (typeof height != 'undefined') {
+ n = height;
+ }
+ else {
+ n = this.height;
+ }
+ n = n.toString();
+ n = n.indexOf('%') > -1 ? n : parseInt(n) + 'px';
+ this.domNode.style.height = n;
+};
+cosmo.ui.ContentBox.prototype.hide = function () {
+ this.domNode.style.display = 'none';
+};
+cosmo.ui.ContentBox.prototype.show = function () {
+ this.domNode.style.display = 'block';
+};
+cosmo.ui.ContentBox.prototype.renderSelf = function () {};
+cosmo.ui.ContentBox.prototype.update = function (p) {
+ var params = p || {};
+ for (var n in params) { this[n] = params[n]; }
+};
+cosmo.ui.ContentBox.prototype.render = function () {
+ if (typeof this.renderSelf == 'function') {
+ this.renderSelf();
};
- this.show = function() {
- this.style.display = 'block';
- };
-}
+ var ch = this.children;
+ for (var i = 0; i < ch.length; i++) {
+ ch[i].render();
+ }
+};
Index: /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/event/handlers.js
===================================================================
--- /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/event/handlers.js (revision 4415)
+++ /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/event/handlers.js (working copy)
@@ -178,3 +178,9 @@
}
}
+cosmo.ui.event.handlers.resize = function () {
+ //here goes
+ //cosmo.ui.resize.Viewports.resize()
+ //cosmo.app.pim.baseLayout.render();
+}
+
Index: /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/event/listeners.js
===================================================================
--- /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/event/listeners.js (revision 4415)
+++ /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/event/listeners.js (working copy)
@@ -29,6 +29,5 @@
dojo.event.browser.addListener(window, "onload", cosmo.app.init, false);
dojo.event.browser.addListener(window, "onunload", cosmo.ui.event.handlers.cleanup, false);
- // FIXME -- Need to resize/re-render UI on window resize
- //dojo.event.browser.addListener(window, "onresize", cosmo.ui.event.handlers.resize, false);
+ dojo.event.browser.addListener(window, "onresize", cosmo.ui.event.handlers.resize, false);
}
Index: /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/resize.js
===================================================================
--- /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/resize.js (revision 0)
+++ /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/resize.js (revision 0)
@@ -0,0 +1,600 @@
+/*
+ * Copyright 2006 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+/**
+ * @fileoverview This is an implementation for resizable items uzing a function to define
+ * the scaling of an absolutely positioned elements between two "keyframe" prototypes.
+ * This works in two forms: declarative and method based
+ * @author Jeremy Epstein mailto:eggfree at eggfree.net
+ * @license Apache License 2.0
+ */
+//temporarily disabling dojo to isolate it from code handling
+dojo.provide("cosmo.ui.resize");
+/**
+ * viewports is the collection and controller of an individual viewport it also contains the
+ * utility functions used by all viewports
+ */
+
+/**
+ * This is a handy event wrapper so I don't have to rely on anyone else. Feel free to link this
+ * to an alternate event system of your choice.
+ */
+cosmo.ui.resize.EventWrapper = new function(){
+ var activeListeners = {};
+ var self = this;
+ /**
+ * returns mouse position relative to application window.
+ * @param {Event} e
+ */
+ self.isLeftClick = function(e)
+ {
+ if (window.event)
+ return (window.event.button == 1)
+ return (e.button == 0)
+ }
+
+ self.mouseX = function(e)
+ {
+ if (!e)
+ return window.event.clientX
+ return e.clientX
+ }
+ /**
+ * returns mouse position relative to application window.
+ * @param {Event} e
+ */
+ self.mouseY = function(e)
+ {
+ if (!e)
+ return window.event.clientY
+ return e.clientY
+ }
+
+ self.cleanupListeners = function()
+ {
+
+ for (listener in activeListeners)
+ activeListener[listener].element.detachEvent(activeListener[event]);
+ }
+
+ self.listen = function (element, eventType, func)
+ {
+ if (typeof (element.attachEvent) != "undefined")
+ element.attachEvent("on"+eventType, func);
+ else
+ element.addEventListener(eventType, func, false);
+ }
+
+ self.stopListen = function(element,eventType,func)
+ {
+ if(typeof(element.detachEvent) != "undefined")
+ element.detachEvent("on"+eventType, func)
+ else
+ element.removeEventListener(eventType, func,false)
+ }
+ self.cancelBubble = function(event)
+ {
+ if (typeof (window.event) != "undefined")
+ {
+ event.cancelBubble = true;
+ event.returnValue = false
+ }
+ else
+ {
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ }
+}
+
+
+/**
+ * this is the main viewport controller/manager
+ */
+cosmo.ui.resize.Viewports = new function() {
+
+ var self = this;
+ var viewports = {};
+ var handles = {};
+ var Ev = cosmo.ui.resize.EventWrapper
+ /**
+ * Remove Entry this function removes an entry from an object
+ * @param obj an object you want to remove an entry from
+ * @param strKey key value indexing the object in the array.
+ */
+ self.removeEntry = function(obj, strKey)
+ {
+ var tmpObj = {}
+ for(entry in obj)
+ if(entry != strKey)
+ tmpObj[entry] = obj[entry]
+ obj = null;
+ obj = tmpObj;
+ }
+
+ /**
+ * This function derives a "blended" value to determine one length width etc...
+ * @param {int} a
+ * @param {int} b
+ * @param {int} c
+ * @param {int} d
+ * @param {int} e
+ */
+ self.getBlend = function(a,b,c,d,e)
+ {
+ /* this function applies a simple transform to extract a value*/
+ //return Math.min( c,Math.max((c-a)/(d-b)*(e-a)+ a,0) )
+ var baseWidth = Math.max(Math.min(e,d),b)
+ var retVal = a;
+ if (d-b != 0)
+ {
+ retVal = (c-a)/(d-b) *(baseWidth-b)+ a
+ }
+ return retVal
+ }
+
+ /**
+ * This method returns an array of objects with a given editType Value.
+ * @param {string} s_type
+ */
+ self.getElementsByEditType = function(s_type)
+ {
+ var validTypes = ["DIV","IMG","TABLE","A"]
+ var returnEls = []
+ for (var v = 0; v < validTypes.length; v++)
+ {
+ var tmpEls = document.getElementsByTagName(validTypes[v])
+ for (var i=0; i < tmpEls.length ; i++)
+ if (tmpEls[i].getAttribute("type") == s_type)
+ returnEls.push(tmpEls[i]);
+ }
+ return returnEls
+ }
+
+ /**
+ * initializes viewports and handles from markup
+ */
+ self.initialize = function ()
+ {
+ var el
+ var viewportEls = self.getElementsByEditType("viewport")
+ for (var i=0;i <viewportEls.length; i++)
+ new cosmo.ui.resize.Viewport(viewportEls[i]);
+
+ var handle_els = self.getElementsByEditType("handle")
+ for (var i = 0;i < handle_els.length; i++)
+ new cosmo.ui.resize.Handle(handle_els[i]);
+
+ self.resize()
+ Ev.listen(window,"resize", self.resize)
+
+ //window.onresize = function(){alert("hi")}//self.resize
+ }
+
+
+ /**
+ * adds viewport to controller and scaling queue
+ * @param {Object} viewport
+ */
+ self.addViewport = function(viewport){
+ if(typeof(viewports[viewport.id])!= "undefined")
+ {
+ alert("there is already a viewport with id" + viewport.id+".\n please choose another name")
+ return;
+ }
+ viewports[viewport.id] = viewport
+ }
+
+ /**
+ * removes viewport from controller an queue-- shoud cleanup.
+ * @param {string} viewportId guid of viewport
+ */
+ self.removeViewport = function(viewportId) {
+ self.removeEntry(viewports,viewportId)
+ }
+
+ self.getViewport = function(viewportId)
+ {
+ return viewports[viewportId]
+ }
+
+ /**
+ * executes resize when bound to window resize.
+ */
+ self.resize = function()
+ {
+
+ // declare variables
+ var windowWidth;
+ var windowHeight;
+ // obtain current window sizes
+ if (typeof(document.all) == "undefined")
+ {
+ windowWidth = window.innerWidth;
+ windowHeight = window.innerHeight;
+ }
+ else
+ {
+ windowWidth = document.documentElement.clientWidth;
+ windowHeight = document.documentElement.clientHeight;
+ }
+
+ var old_overflow = document.body.style.overflow
+ //iterate through each viewport and scale
+ // I removed shadow calculations as that is handled separately
+ for (viewport in viewports)
+ viewports[viewport].resize(windowHeight,windowWidth);
+ document.body.style.overflow = "hidden"
+
+
+ }
+
+ /**
+ * Utility funciton to parse an integer array.
+ * @param strArray array serialized to string
+ * @return array of integers
+ */
+ self.parseIntArray = function(strArray)
+ {
+ var tmpArr = strArray.split(",")
+ var rtnArr = []
+ for(var i =0;i<tmpArr.length;i++)
+ {
+ var al = parseInt(tmpArr[i])
+ if(!isNaN(al))
+ rtnArr.push(al);
+ }
+ return rtnArr
+ }
+ Ev.listen(window,"load", self.initialize)
+
+
+
+}
+
+
+
+
+/**
+ * the viewport forms the basic resize unit. A viewport is a block element
+ * absolutely positioned.
+ * @param {dom element}el a valid dom element (not an id)
+ * @return {cosmo.ui.resize.viewport} self object for pulling Id
+ */
+cosmo.ui.resize.Viewport = function(el) {
+
+ var self = this;
+ self.id = el.getAttribute("id");
+ /* public variables these work with model factories for
+ * choosing render methods and are intended for interpretation by IDEs
+ * like APTANA
+ */
+ self.SHADOW = "dropShadow";
+ self.NO_SHADOW = "noshadow";
+ self.DIALOG = "dialog";
+ self.FRAME = "frame";
+
+ /* private variables */
+ var minSize = null;
+ var maxSize = null;
+ var resizeChildren = {};
+ var element = el;
+
+ /* 'inherited' functions*/
+ var removeEntry = cosmo.ui.resize.Viewports.removeEntry
+ var parseIntArray = cosmo.ui.resize.Viewports.parseIntArray
+ var getBlend = cosmo.ui.resize.Viewports.getBlend
+
+ /*setters and getters*/
+ this.setMinSize = function(array){minSize = array}
+ this.setMaxSize = function(array){maxSize = array}
+ this.getMinSize = function(){return minSize}
+ this.getMaxSize = function(){return maxSize}
+
+
+ /* constants for use */
+ var SWIDTH = 0;
+ var SHEIGHT = SWIDTH + 1;
+ var LT = SHEIGHT + 1;
+ var TP = LT + 1;
+ var RT = TP + 1;
+ var BM = RT + 1;
+
+
+
+
+
+ /* set minSizealue*/
+ if (element.getAttribute("min")!= null)
+ minSize = parseIntArray(element.getAttribute("min"));
+
+ if (element.getAttribute("max")!= null)
+ maxSize = parseIntArray(element.getAttribute("max"));
+
+ /* public functions*/
+ self.addResize = function (s_key, method){resizeChildren[s_key] = method}
+ self.removeResize = function (entry){removeEntry(resizeChildren,entry)}
+ self.cleanup = function(){
+ arrMin = null;
+ arrMax = null;
+ resizeChildren = null;
+ resizeEl = null;
+ cosmo.ui.resize.viewports.removeViewport(self.id)
+ }
+
+ /**
+ * Rescales the viewport with the default algorithm
+ * @param {int} windowHeight
+ * @param {int} windowWidth
+ */
+ self.resize = function(windowHeight, windowWidth)
+ {
+ var inFrameDimensions = null;
+ var l;
+ var t;
+ var w;
+ var h;
+
+ if (minSize[SWIDTH] > 0)
+ {
+ l = getBlend(minSize[LT],minSize[SWIDTH],maxSize[LT],maxSize[SWIDTH],windowWidth);
+ t = getBlend(minSize[TP],minSize[SHEIGHT],maxSize[TP],maxSize[SHEIGHT],windowHeight);
+ w = getBlend(minSize[RT],minSize[SWIDTH],maxSize[RT],maxSize[SWIDTH],windowWidth) - l;
+ h = getBlend(minSize[BM],minSize[SHEIGHT],maxSize[BM],maxSize[SHEIGHT],windowHeight)- t;
+ inFrameDimensions = self.keepInFrame(l,t,w,h);
+ if (inFrameDimensions != null)
+ {
+ l = inFrameDimensions.left;
+ t = inFrameDimensions.top;
+ w = inFrameDimensions.width;
+ h = inFrameDimensions.height;
+ }
+ h = Math.max(0,h);
+ w = Math.max(0,w);
+ with (element.style)
+ {
+ left = l + "px";
+ top = t + "px";
+ width = w + "px";
+ height = h + "px";
+ if (clip)
+ clip = (typeof (document.all) != "undefined" ? "auto":"rect(2px auto auto 2px)");
+ }
+ element.style.display="block"
+
+ //SHADOW, VISIBILITY ETC..
+ for (method in resizeChildren)
+ {
+ if (typeof(resizeChildren[method]) == "function")
+ resizeChildren[method](l,t,w,h);
+ }
+ self.paintShadow(element,element.id);
+
+ }
+
+ }
+ //initialization complete, add to scaling controller.
+ cosmo.ui.resize.Viewports.addViewport(self)
+ self.paintShadow = function(){}
+ self.keepInFrame = function(){return null}
+ return self
+ }
+
+cosmo.ui.resize.Handles = new function(){
+ var self = this
+ var handles = {}
+ self.directions = {"top":3,"left":2,"bottom":5,"right":4}
+ self.collapse_vectors = {"top":-1,"left":-1,"bottom":1,"right":1}
+
+ /**
+ *
+ * @param {cosmo.ui.resize.handle} handle
+ */
+ this.addHandle = function(handle)
+ {
+ handles[handle.id] = handle
+ }
+
+ this.removeHandle = function(handle)
+ {
+ cosmo.ui.resize.viewports.removeEntry(handles,handle.id)
+
+ }
+
+}
+/**
+ * a handle is a dom element used to change the parameters of a viewport.
+ * @param {domElement} el
+ */
+cosmo.ui.resize.Handle = function(el)
+{
+ var aViewports = el.getAttribute("viewports");
+ var self = this
+ var handle = this
+ var Ev = cosmo.ui.resize.EventWrapper
+ var Controller = cosmo.ui.resize.Handles
+ self.canCollapse = false;
+ if (el.getAttribute("collapse") != null)
+ {
+ self.canCollapse = true;
+ arrCollapse = el.getAttribute("collapse").split(',');
+ self.parentView = cosmo.ui.resize.Viewports.getViewport(arrCollapse[0]);
+ self.vector = arrCollapse[1];
+ }
+
+ /**
+ * Programmatically add a viewport
+ * @param {String} viewportId
+ * @param {String} direction top, left, bottom or right. If you
+ * want a handle to scale a viewport in two directions, you need to make two entries.
+ */
+ self.addViewport = function(viewportId,direction)
+ {
+ self.viewports.push({"viewport":cosmo.ui.resize.Viewports.getViewport(viewportId),"direction":Controller.directions[direction]})
+ }
+
+ /**
+ * Programmatically add a collapse
+ * @param {String} viewportId
+ * @param {String} direction a given handle can collapse a viewport in one direction only.
+ */
+ self.addCollapse = function(viewportId,direction)
+ {
+ self.canCollapse = true;
+ self.parentView = cosmo.ui.resize.Viewports.getViewport(viewportId);
+ self.vector = direction;
+ }
+
+ self.viewports = [];
+ if(aViewports != null)
+ {
+ var affectedEls = aViewports.split(';');
+ for (var i = 0; i + 1 < affectedEls.length; i++)
+ {
+ el_attr = affectedEls[i].split(':')
+ self.viewports.push({"viewport":cosmo.ui.resize.Viewports.getViewport(el_attr[0]),"direction":Controller.directions[el_attr[1]]})
+ }
+ }
+ self.start = null;
+ self.current = null;
+ self.old = null;
+ self.isCollapse = false;
+ self.handle = el;
+ self.startDrag = function(event){
+ if(Ev.isLeftClick(event))
+ {
+ var self = handle
+ self.start = {"x":Ev.mouseX(event),"y":Ev.mouseY(event)};
+ self.current = {"x":Ev.mouseX(event),"y":Ev.mouseY(event)};
+ self.old = {"x":Ev.mouseX(event),"y":Ev.mouseY(event)};
+ self.isDragging = false;
+ Ev.listen(document, "mousemove",self.update );
+ Ev.listen(document, "mouseup", self.endDrag);
+ Ev.stopListen(self.handle, "mousedown", self.startDrag)
+ Ev.cancelBubble(event);
+
+ }
+ };
+ self.update = function(event){
+ var self = handle
+ self.isDragging = true;
+ self.isCollapse = false;
+ self.current = {"x":Ev.mouseX(event),"y":Ev.mouseY(event)};
+ var differenceX = self.current.x - self.old.x;
+ var differenceY = self.current.y - self.old.y;
+ self.old.x = self.current.x
+ self.old.y = self.current.y
+ for (var i = 0; i <self.viewports.length; i++)
+ {
+ var direction = self.viewports[i].direction
+ var minSize = self.viewports[i].viewport.getMinSize()
+ var maxSize = self.viewports[i].viewport.getMaxSize()
+ if (direction % 2 == 0)
+ {
+ minSize[direction] += differenceX
+ maxSize[direction] += differenceX
+ }
+ else
+ {
+ minSize[direction]+= differenceY
+ maxSize[direction]+= differenceY
+ }
+ }
+ cosmo.ui.resize.Viewports.resize()
+ Ev.cancelBubble(event);
+ };
+ /* remove observers*/
+ self.endDrag = function(event){
+ var self = handle
+ Ev.stopListen(document, "mouseup", self.endDrag)
+ Ev.stopListen(document, "mousemove", self.update)
+ Ev.listen(self.handle, "mousedown", self.startDrag);
+ if (!self.isDragging)
+ handle.collapse();
+ self.isDragging = false;
+ };
+
+
+ /* this method collapses in a specific direction. this is similar to the
+ resize handle how this works:
+ c_direction determines which numerical section is modified, and how.*/
+ self.collapse = function(){
+ var self = handle
+ if (!self.canCollapse)
+ return;
+ //var toggle = 1
+ var hX = self.handle.offsetWidth //+self.handle.offsetLeft;
+ var hY = self.handle.offsetHeight //+self.handle.offsetTop;
+ var V = Controller.collapse_vectors[self.vector]
+ var minSize
+ var maxSize
+ var deltaXmin
+ var deltaXMax
+ var deltaYmin
+ var deltaYMax
+ if (self.isCollapse == false)
+ {
+ self.minSize = self.parentView.getMinSize().concat([]);
+ self.maxSize = self.parentView.getMaxSize().concat([]);
+ minSize = self.minSize
+ maxSize = self.maxSize
+ deltaXmin = V *(minSize[4] - minSize[2] - hX);
+ deltaXmax = V *(maxSize[4] - maxSize[2] - hX);
+ deltaYmin = V *(minSize[5] - minSize[3] - hY);
+ deltaYmax = V *(maxSize[5] - maxSize[3] - hY);
+ self.isCollapse = true;
+ }
+ else
+ {
+ minSize = self.minSize
+ maxSize = self.maxSize
+ deltaXmin = -V *(minSize[4] - minSize[2] - hX);
+ deltaXmax = -V *(maxSize[4] - maxSize[2] - hX);
+ deltaYmin = -V *(minSize[5] - minSize[3] - hY);
+ deltaYmax = -V *(maxSize[5] - maxSize[3] - hY);
+ self.isCollapse = false;
+
+ }
+ for (var i = 0; i <self.viewports.length; i++)
+ {
+ minSize = self.viewports[i].viewport.getMinSize()
+ maxSize = self.viewports[i].viewport.getMaxSize()
+ var direction = self.viewports[i].direction
+ if (direction % 2 == 0)
+ {
+ minSize[direction] += deltaXmin;
+ maxSize[direction] += deltaXmax;
+ }
+ else
+ {
+ minSize[direction] += deltaYmin;
+ maxSize[direction] += deltaYmax;
+ }
+ self.viewports[i].viewport.setMinSize(minSize)
+ self.viewports[i].viewport.setMaxSize(maxSize)
+ }
+
+ cosmo.ui.resize.Viewports.resize();
+ }
+
+ Ev.listen(self.handle, "mousedown", self.startDrag);
+}
+
+
+
+
+ //self.listen(window,"unload",self.cleanupListeners)
+
Index: /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/view/cal/canvas.js
===================================================================
--- /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/view/cal/canvas.js (revision 4415)
+++ /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/view/cal/canvas.js (working copy)
@@ -368,8 +368,7 @@
cosmo.view.cal.viewEnd.getTime() > currDateTime) {
currDayClass = ' currentDayDay';
currDayImg = 'url(' + cosmo.env.getImagesUrl() +
- 'day_col_header_background.gif); background-repeat:' +
- ' repeat-x; background-position:0px 0px;'
+ 'day_col_header_background.gif)';
}
else {
currDayClass = '';
@@ -376,7 +375,10 @@
currDayImg = '';
}
// Set background image or set to flat white for day name
- $('dayListDiv' + currDateDay).style.backgroundImage = currDayImg;
+ var d = $('dayListDiv' + currDateDay);
+ d.style.backgroundImage = currDayImg;
+ d.style.backgroundRepeat = 'repeat-x';
+ d.style.backgroundPosition = '0px 0px';
// Set gray or white background for all-day area
$('allDayListDiv' + currDateDay).className = 'allDayListDayDiv' + currDayClass;
// Reset the CSS class on all the rows in the 'today' col
@@ -463,8 +465,10 @@
return 'rgb(' + rgb.join() + ')';
}
var lozengeColors = {};
- var sel = cosmo.app.pim.calForm.form.calSelectElem;
- var index = sel ? sel.selectedIndex : 0;
+
+ //var sel = cosmo.app.pim.calForm.form.calSelectElem;
+ //var index = sel ? sel.selectedIndex : 0;
+ var index = 0;
var hue = hues[index];
var o = {
Index: /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/view/cal.js
===================================================================
--- /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/view/cal.js (revision 4415)
+++ /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/js/cosmo/view/cal.js (working copy)
@@ -1058,7 +1058,7 @@
case 13:
// Go-to date
if (elem.id.toLowerCase() == 'jumpto') {
- cosmo.app.pim.calForm.goJumpToDate();
+ //cosmo.app.pim.calForm.goJumpToDate();
}
// Save an event from the Enter key -- requires:
// * a selected event, not in 'processing' state
Index: /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/templates/default/ui.css
===================================================================
--- /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/templates/default/ui.css (revision 4415)
+++ /Users/jepstein/Documents/Clients/OSAF/cosmo/trunk/cosmo/src/main/webapp/templates/default/ui.css (working copy)
@@ -659,6 +659,7 @@
z-index:10000;
border-top:0px;
border-bottom:0px;
+ display:none;
}
/* Small box that contains 'Processing ...' message inside mask */
#appLoadingMessage {
@@ -1130,3 +1131,49 @@
.collectionDetailsHelpMeCell {
padding-left: 10px;
}
+
+
+
+/* collection handles and viewports*/
+.l-rHandle,.t-bHandle
+{
+ position:absolute;
+ cursor:e-resize;
+ cursor:col-resize;
+ background-color:rgb(216,216,216);
+ display:block;
+}
+
+.t-bHandle
+{
+ cursor: n-resize;
+ cursor:col-resize;
+
+}
+
+.leftSideHandle
+{
+ background-color:rgb(230,230,230);
+ border-top:hidden;
+ border-bottom:hidden;
+ border-left: 1px solid rgb(216,216,216);
+ border-right: 1px solid rgb(216,216,216);
+ width:2px;
+ z-index:30;
+ height:100%;
+ left:100%;
+ margin-left: -3px;
+ position:absolute;
+
+}
+
+.viewport
+{
+ position:absolute;
+ clip:auto;
+ height:20px;
+ width:20px;
+ left:-30px;
+ top:-30px;
+ background-color:rgb(216,216,216);
+ }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: resize.zip
Type: application/zip
Size: 8187 bytes
Desc: not available
Url : http://lists.osafoundation.org/pipermail/cosmo-dev/attachments/20070515/fa2b9b46/resize.zip
More information about the cosmo-dev
mailing list