[kupu-checkins] r43594 - in kupu/trunk/kupu: common common/kupudrawers plone/kupu_references

duncan at codespeak.net duncan at codespeak.net
Thu May 24 14:13:46 CEST 2007


Author: duncan
Date: Thu May 24 14:13:44 2007
New Revision: 43594

Modified:
   kupu/trunk/kupu/common/kupudrawers.js
   kupu/trunk/kupu/common/kupudrawers/drawer.xsl
   kupu/trunk/kupu/common/kupudrawerstyles.css
   kupu/trunk/kupu/common/kupueditor.js
   kupu/trunk/kupu/plone/kupu_references/referencebrowser.js
Log:
More style changes in the drawers.
Made any server-side request in the drawers show an hourglass cursor until it completes (new methods busy/notbusy on the editor).

Modified: kupu/trunk/kupu/common/kupudrawers.js
==============================================================================
--- kupu/trunk/kupu/common/kupudrawers.js	(original)
+++ kupu/trunk/kupu/common/kupudrawers.js	Thu May 24 14:13:44 2007
@@ -57,6 +57,7 @@
         this.current_drawer.hide();
         this.current_drawer.editor.resumeEditing();
         this.current_drawer = null;
+        this.editor.notbusy(true);
     };
 };
 
@@ -1245,7 +1246,7 @@
         // library as selected
         this.deselectActiveCollection();
         resultlib.setAttribute("selected", "1");
-
+        
         // now hook the result library into our DOM
         if (this.editor.getBrowserName() == 'IE') {
             resultlib = resultlib.cloneNode(true);
@@ -1256,6 +1257,7 @@
         libraries.appendChild(resultlib);
         this.useCollection(resultlib);
         this.updateDisplay(this.librariespanelid);
+        this.flagSelectedLib(id);
         this.updateDisplay(this.breadcrumbsid);
     };
 
@@ -1286,6 +1288,7 @@
             if (xmlhttp.readyState == 4) {
                 if (xmlhttp.status && xmlhttp.status != 200) {
                     var errmessage = 'Error '+xmlhttp.status+' loading '+(uri||'XML');
+                    self.editor.notbusy(true);
                     alert(errmessage);
                     throw "Error loading XML";
                 };
@@ -1295,6 +1298,7 @@
                     dom.loadXML(xmlhttp.responseText);
                 }
                 callback.apply(self, [dom, uri, extra]);
+                self.editor.notbusy();
             };
         };
         var self = this;
@@ -1308,6 +1312,7 @@
         // something
         body=body?body:null;
 
+        this.editor.busy();
         try {
             xmlhttp.open(method, uri, true);
             xmlhttp.onreadystatechange = _sarissaCallback;
@@ -1325,6 +1330,7 @@
             if (e && e.name && e.message) { // Microsoft
                 e = e.name + ': ' + e.message;
             }
+            this.editor.notbusy(true);
             alert(e);
         }
     };

Modified: kupu/trunk/kupu/common/kupudrawers/drawer.xsl
==============================================================================
--- kupu/trunk/kupu/common/kupudrawers/drawer.xsl	(original)
+++ kupu/trunk/kupu/common/kupudrawers/drawer.xsl	Thu May 24 14:13:44 2007
@@ -180,6 +180,9 @@
             <xsl:attribute name="id">
                 <xsl:value-of select="@id"/>
             </xsl:attribute>
+            <xsl:if test="@selected=1">
+               <xsl:attribute name="class">kupu-libsource-selected</xsl:attribute>
+            </xsl:if>
             <xsl:apply-templates select="icon"/>
             <span class="drawer-item-title">
                <xsl:call-template name="lf2br">
@@ -206,22 +209,24 @@
                     <xsl:otherwise>drawertool.current_drawer.selectItem(this, event)</xsl:otherwise>
                 </xsl:choose>
             </xsl:attribute>
-            <input name="drawer-item-radio">
-                <xsl:attribute name="type">
-                    <xsl:choose>
+            <span>
+               <input name="drawer-item-radio">
+                  <xsl:attribute name="type">
+                     <xsl:choose>
                         <xsl:when test="$multiple='yes'">checkbox</xsl:when>
                         <xsl:otherwise>radio</xsl:otherwise>
-                    </xsl:choose>
-                </xsl:attribute>
-                <xsl:if test="@checked">
-                    <xsl:attribute name="checked">checked</xsl:attribute>
-                </xsl:if>
-                <xsl:if test="not(local-name()='resource')">
-                    <xsl:attribute name="style">visibility:hidden;</xsl:attribute>
-                </xsl:if>
-            </input>
-            <xsl:apply-templates select="icon"/>
-            <xsl:apply-templates select="(label|title)[1]"/>
+                     </xsl:choose>
+                  </xsl:attribute>
+                  <xsl:if test="@checked">
+                     <xsl:attribute name="checked">checked</xsl:attribute>
+                  </xsl:if>
+                  <xsl:if test="not(local-name()='resource')">
+                     <xsl:attribute name="style">visibility:hidden;</xsl:attribute>
+                  </xsl:if>
+               </input>
+               <xsl:apply-templates select="icon"/>
+               <xsl:apply-templates select="(label|title)[1]"/>
+            </span>
         </div>
     </xsl:template>
     <xsl:template match="uploadbutton" mode="currentpanel">

Modified: kupu/trunk/kupu/common/kupudrawerstyles.css
==============================================================================
--- kupu/trunk/kupu/common/kupudrawerstyles.css	(original)
+++ kupu/trunk/kupu/common/kupudrawerstyles.css	Thu May 24 14:13:44 2007
@@ -135,6 +135,7 @@
  padding: 0; 
  border: 0;
  clear:left;
+ border-spacing: 2px;
 }
 
 td.panel {
@@ -143,13 +144,14 @@
 
 td#kupu-librariespanel {
   overflow: auto;
-  width: 105px;
+  width: 130px;
 }
 
 div#kupu-librariesitems {
-  width: 105px;
+  width: 130px;
   white-space: nowrap;
   height: 260px;
+  padding: 0;
 }
 
 td#kupu-resourcespanel {
@@ -160,6 +162,7 @@
 div#kupu-resourceitems {
   white-space: nowrap;
   width: 200px;
+  padding: 0;
 }
 .upload-allowed div#kupu-resourceitems {
   height:236px;
@@ -167,10 +170,7 @@
 
 div#kupu-properties {
   height: 260px;
-}
-
-div#kupu-librariesitems, div#kupu-resourceitems, div#kupu-properties {
-  padding: 6px;
+  padding: 0 6px;
 }
 
 .overflow {
@@ -190,13 +190,32 @@
 div.kupu-libsource, div.kupu-libsource-selected,
 div.kupu-resource, div.kupu-collection {
   cursor: pointer;
-  margin-bottom: 2px;
+  margin-bottom: 0;
+  padding: 2px 2px 2px 20px;
   vertical-align: text-bottom;
   white-space: nowrap;
 }
-.kupu-libsource, .kupu-libsource-selected { margin-left: 20px; }
+
+.kupu-busy, .kupu-busy div, .kupu-busy a:hover {
+  cursor: wait !IMPORTANT;
+}
+
+div.kupu-resource, div.kupu-collection { padding: 0; }
+div.kupu-resource span, div.kupu-collection span { padding: 4px 1ex 4px 0; }
+div.kupu-resource input, div.kupu-collection input {
+  margin-bottom: 5px;
+  background: transparent;
+  border: none;
+}
+
+.drawer-item-radio {
+  vertical-align: text-middle;
+  margin: 0;
+}
+
 .library-icon-library {
-  margin-left: -20px;
+  width:16px; height:16px;
+  margin: 0 2px 0 -18px;
 }
 
 .kupu-image-fields {
@@ -216,17 +235,7 @@
   border: none;
 }
 
-/*div.kupu-libsource-selected {
-  background-repeat: no-repeat;
-}*/
-
-/*div.kupu-libsource-selected span,
- div.kupu-libsource span{
-  margin-top: 3px;
-  display: inline;
-}*/
-
-div.kupu-libsource-selected span {
+div.kupu-libsource-selected {
   background-color: ButtonFace;  
 }
 
@@ -235,18 +244,12 @@
 }
 
 img.library-icon-collection, img.library-icon-resource {
-  margin-right: 5px;
+  padding-right: 5px;
   height: 16px;
   width: 16px;
 }
 
-span.drawer-item-title {
-  padding-left: 2px;
-  padding-right: 2px;
-  padding-top: 2px;
-}
-
-.selected-item span.drawer-item-title {
+.selected-item span {
   background-color:#C0C0C0;
 }
 
@@ -314,6 +317,9 @@
 #kupu-breadcrumbs {
   text-align: left; clear:left;
   padding-left: 1em; padding-right: 1em;
+  height: 20px;
+  width: 600px;
+  overflow:hidden;
 }
 #kupu-breadcrumbs a {
  text-decoration: none;

Modified: kupu/trunk/kupu/common/kupueditor.js
==============================================================================
--- kupu/trunk/kupu/common/kupueditor.js	(original)
+++ kupu/trunk/kupu/common/kupueditor.js	Thu May 24 14:13:44 2007
@@ -813,6 +813,20 @@
         fulleditor.className = fulleditor.className.replace(' '+name, '');
     };
 
+    var busycount = 0;
+    this.busy = function() {
+        if (busycount <= 0) {
+            this.setClass('kupu-busy');
+        }
+        busycount++;
+    }
+    this.notbusy = function(force) {
+        busycount = force?0:busycount?busycount-1:0;
+        if (busycount <= 0) {
+            this.clearClass('kupu-busy');
+        }
+    }
+
     this.suspendEditing = function() {
         this._previous_range = this.getSelection().getRange();
         this.setClass('kupu-modal');

Modified: kupu/trunk/kupu/plone/kupu_references/referencebrowser.js
==============================================================================
--- kupu/trunk/kupu/plone/kupu_references/referencebrowser.js	(original)
+++ kupu/trunk/kupu/plone/kupu_references/referencebrowser.js	Thu May 24 14:13:44 2007
@@ -157,6 +157,8 @@
     this.suspendEditing = function() {};
     this.config = {};
     this._saveSelection = function() {};
+    this.busy = function() {};
+    this.notbusy = function() {};
 };
 
 var drawertool;


More information about the kupu-checkins mailing list