[qo-modules-dev] [45] Fixed problem with missing icons.

[ Thread Index | Date Index | More lists.tuxfamily.org/qo-modules-dev Archives ]


Revision: 45
Author:   mjlecomte
Date:     2008-12-04 18:49:01 +0100 (Thu, 04 Dec 2008)

Log Message:
-----------
Fixed problem with missing icons.

***Please read comments in preload.js for a proposed naming convention using "baseName".  This potentially can automate module usage, but would still be configurable by end user.

Modified Paths:
--------------
    mickael/trunk/ext/v3.0.0-a1/learn/desktop/desktop.html
    mickael/trunk/ext/v3.0.0-a1/learn/desktop/preload.js

Added Paths:
-----------
    mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/
    mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/css/
    mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/css/layoutwin.css
    mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/images/
    mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/images/layoutwin16x16.gif
    mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/images/layoutwin48x48.png
    mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/js/
    mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/js/layoutwin.js

Removed Paths:
-------------
    mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/layoutwindow.js
    mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwindow/


Modified: mickael/trunk/ext/v3.0.0-a1/learn/desktop/desktop.html
===================================================================
--- mickael/trunk/ext/v3.0.0-a1/learn/desktop/desktop.html	2008-12-04 17:25:38 UTC (rev 44)
+++ mickael/trunk/ext/v3.0.0-a1/learn/desktop/desktop.html	2008-12-04 17:49:01 UTC (rev 45)
@@ -7,7 +7,8 @@
 	<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
     <link rel="stylesheet" type="text/css" href="./resources/css/desktop.css" />
 
-    <link rel="stylesheet" type="text/css" href="./system/modules/acc-win/acc-win.css" />
+ 	<!-- TODO: include this file dynamically -->
+    <link rel="stylesheet" type="text/css" href="./js/modules/layoutwin/css/layoutwin.css" />
 
  	<!-- LIBS -->
  	<script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>

Copied: mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin (from rev 42, mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwindow)


Property changes on: mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin
___________________________________________________________________
Name: svn:mergeinfo
   + 

Added: mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/css/layoutwin.css
===================================================================
--- mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/css/layoutwin.css	                        (rev 0)
+++ mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/css/layoutwin.css	2008-12-04 17:49:01 UTC (rev 45)
@@ -0,0 +1,15 @@
+/*
+ * qWikiOffice Desktop 0.7
+ * Copyright(c) 2007-2008, Integrated Technologies, Inc.
+ * licensing@xxxxxxxxxxxxxxx
+ * 
+ * http://www.qwikioffice.com/license
+ */
+
+.layoutwin-icon {
+	background-image: url(../images/layoutwin16x16.gif) !important;
+}
+.demo-layoutwin-shortcut img {
+    background-image: url(../images/layoutwin48x48.png);
+    filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='js/modules/layoutwin/images/layoutwin48x48.png', sizingMethod='scale');
+}
\ No newline at end of file

Added: mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/images/layoutwin16x16.gif
===================================================================
(Binary files differ)


Property changes on: mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/images/layoutwin16x16.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/images/layoutwin48x48.png
===================================================================
(Binary files differ)


Property changes on: mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/images/layoutwin48x48.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Copied: mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/js/layoutwin.js (from rev 42, mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwindow/layoutwindow.js)
===================================================================
--- mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/js/layoutwin.js	                        (rev 0)
+++ mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/js/layoutwin.js	2008-12-04 17:49:01 UTC (rev 45)
@@ -0,0 +1,73 @@
+/**
+ * <p>This class creates a specialized Window for :</p>
+ * 
+ * @class Ext.app.module.Layoutwin
+ * @extends Ext.ux.Module
+ * @author Michael LeComte (<a href="http://extjs.com/forum/member.php?u=6834";>mjlecomte</a>)
+ * @license <a href="http://www.gnu.org/licenses/lgpl.html";>LGPL 3.0</a>
+ * @version 0.01
+ */
+Ext.app.module.Layoutwin = Ext.extend(Ext.ux.Module, {
+
+    /**
+     * @cfg {Boolean} loaded
+     * Whether or not the module will be loaded when this code is applied
+     */
+    loaded: true,
+
+    /** @private */
+    constructor : function (config) {
+        Ext.apply(this, config);
+/*
+        // Panel for the west
+        var nav = new Ext.Panel({
+            title       : 'Navigation',
+            region      : 'west',
+            split       : true,
+            width       : 200,
+            collapsible : true,
+            margins     : '3 0 3 3',
+            cmargins    : '3 3 3 3'
+        }); 
+
+        var center = new Ext.Panel({
+            height: 400,
+            title       : 'Center',
+            region      : 'center',
+            split       : true,
+            width       : 200,
+            margins     : '3 0 3 3',
+            cmargins    : '3 3 3 3'
+        }); 
+*/
+        Ext.apply(this, {
+            title    : 'Layout Window',
+//            autoHeight: true,
+            height: 300,
+            autoEl: {},
+            plain    : true,
+            width: 600
+/*
+            ,
+            items: {
+                height: 200,
+                xtype: 'container',
+                autoEl: {},
+                layout   : 'border',
+                items    : [nav, center2]
+            }
+*/
+        });
+        
+        Ext.app.module.Layoutwin.superclass.constructor.call(this);
+    },
+
+    /** @private */
+    initComponent : function () {
+        //call parent
+        Ext.app.module.Layoutwin.superclass.initComponent.call(this);
+    }
+});
+
+//register the xtype
+Ext.reg('layoutwin', Ext.app.module.Layoutwin);
\ No newline at end of file


Property changes on: mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/js/layoutwin.js
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/layoutwindow.js
===================================================================
--- mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwindow/layoutwindow.js	2008-12-03 22:31:52 UTC (rev 42)
+++ mickael/trunk/ext/v3.0.0-a1/learn/desktop/js/modules/layoutwin/layoutwindow.js	2008-12-04 17:49:01 UTC (rev 45)
@@ -1,73 +0,0 @@
-/**
- * <p>This class creates a specialized Window for :</p>
- * 
- * @class Ext.app.module.LayoutWindow
- * @extends Ext.ux.Module
- * @author Michael LeComte (<a href="http://extjs.com/forum/member.php?u=6834";>mjlecomte</a>)
- * @license <a href="http://www.gnu.org/licenses/lgpl.html";>LGPL 3.0</a>
- * @version 0.01
- */
-Ext.app.module.LayoutWindow = Ext.extend(Ext.ux.Module, {
-
-    /**
-     * @cfg {Boolean} loaded
-     * Whether or not the module will be loaded when this code is applied
-     */
-    loaded: true,
-
-    /** @private */
-    constructor : function (config) {
-        Ext.apply(this, config);
-/*
-        // Panel for the west
-        var nav = new Ext.Panel({
-            title       : 'Navigation',
-            region      : 'west',
-            split       : true,
-            width       : 200,
-            collapsible : true,
-            margins     : '3 0 3 3',
-            cmargins    : '3 3 3 3'
-        }); 
-
-        var center = new Ext.Panel({
-            height: 400,
-            title       : 'Center',
-            region      : 'center',
-            split       : true,
-            width       : 200,
-            margins     : '3 0 3 3',
-            cmargins    : '3 3 3 3'
-        }); 
-*/
-        Ext.apply(this, {
-            title    : 'Layout Window',
-//            autoHeight: true,
-            height: 300,
-            autoEl: {},
-            plain    : true,
-            width: 600
-/*
-            ,
-            items: {
-                height: 200,
-                xtype: 'container',
-                autoEl: {},
-                layout   : 'border',
-                items    : [nav, center2]
-            }
-*/
-        });
-        
-        Ext.app.module.LayoutWindow.superclass.constructor.call(this);
-    },
-
-    /** @private */
-    initComponent : function () {
-        //call parent
-        Ext.app.module.LayoutWindow.superclass.initComponent.call(this);
-    }
-});
-
-//register the xtype
-Ext.reg('grid-win', Ext.app.module.LayoutWindow);
\ No newline at end of file

Modified: mickael/trunk/ext/v3.0.0-a1/learn/desktop/preload.js
===================================================================
--- mickael/trunk/ext/v3.0.0-a1/learn/desktop/preload.js	2008-12-04 17:25:38 UTC (rev 44)
+++ mickael/trunk/ext/v3.0.0-a1/learn/desktop/preload.js	2008-12-04 17:49:01 UTC (rev 45)
@@ -66,32 +66,49 @@
 		/* modules */
         modules: [{
 
-		    //A typical module config object will have this minimum form if not preloaded:
+		    //A typical module config object will have a form something like this:
 
 		    // id (required), must be unique for entire app
-		    id: 'grid-win',
+		    id: 'layoutwin', 
+            
+            // notice the consistent use of the base name: "layoutwin"
+            // this will make it easier to unify and automate referencing module assets
+            // the xtype, css filename, js filename, module folder name, icon name,
+            // and shortcut name all share the same base name.
+            // potentially many of the references could be automated by the platform using
+            // a consistent naming convention like this.
+            // Similar to "baseCls" we could have a property like
+            // "baseName" and then automatically append "-icon", "-shortcut", and use the baseName
+            // to reference the css file, module js file, and even "id" because the platform
+            // manages module instances by using:
+            //     id: baseName + module_instance_counter
 		
-		    xtype : 'grid-win',
+		    xtype: 'layoutwin',
 
+            css: 'js/modules/layoutwin/css/layoutwin.css',
+
+		    iconCls: 'layoutwin-icon',
+		
 		    // To signify that no additional configuration should be retrieved from the server
 		    // just set the 'loaded' config property to true so that the component will not be
 		    // retrieved from the server again.  This property is optional, but the app will
 		    // attempt to load this module until this property is set to true.
-		    loaded : false,
+		    loaded: false,
 
 			// the number of instances of this module that may be run at one time
 			// all launchers except the active apps taskbar will check this before
 			// creating a new instance versus just showing the one instance.
-		    limit : 2,
+		    limit: 2,
 
-		    iconCls: 'acc-icon',
-		
 	    	// defaults will be applied to all launchers
 	        launchDefaults: {
-	            iconCls: 'acc-icon',
-	            shortcutIconCls: 'demo-acc-shortcut',
-	            text: 'Accordion Window',
-	            tooltip: '<b>Accordion Window</b><br />A window with an accordion layout'
+                // note that the icon and shortcut specified in the css file could also
+                // be standardized so that the icon and shortcut images have a consistent filename
+                // across modules instead of the current random filename used.
+	            iconCls: 'layoutwin-icon',
+	            shortcutIconCls: 'layoutwin-shortcut',
+	            text: 'Layout Window',
+	            tooltip: '<b>Layout Window</b><br />A window with a layout'
 	        },
 
 	        // launchers: an array of launcher config objects or just the name of the menu type
@@ -104,7 +121,7 @@
 	        //    start      : seen after clicking on the Start button
 	        //    tray       : Buttons for the system tray (far right of taskbar)
 	        
-		    launchers : [
+		    launchers: [
 
 	            // just specify a string for the name, and any defaults will be applied:
 	            'autorun', 'context', 'quick', 'tray',
@@ -114,9 +131,9 @@
 	                type: 'shortcut',
 	                // notice that these properties are the same as used in 'defaults' config
 	                iconCls: 'acc-icon',
-	                shortcutIconCls: 'demo-acc-shortcut',
-	                text: 'Accordion Window',
-	                tooltip: '<b>Accordion Window</b><br />A window with an accordion layout'
+	                shortcutIconCls: 'layoutwin-shortcut',
+	                text: 'Layout Window',
+    	            tooltip: '<b>Layout Window</b><br />A window with a layout'
 	            },
 
 		        // To add this module to the Start Menu, specify one of the following:
@@ -144,8 +161,8 @@
 
 		    // optionally specify a different load configuration:
 		    loader: {
-                // Option 1: just map to a file
-		        url: 'js/modules/layoutwindow/layoutwindow.js',
+                // Option 1: just map to a file (this bit could be automated if baseName is defined)
+		        url: 'js/modules/layoutwin/js/layoutwin.js',
                 // Option 2: map to backend controller and pass any params backend needs
                 //           so the backend knows what to deliver back to client
 //		        url: 'loader.php',
@@ -156,96 +173,6 @@
 
 		    //As with any class or xtype, specify as much additional configuration as you want may be preconfigured
 		    foo : 'bar'
-        },{
-		    // id (required), must be unique for entire app
-		    id: 'grid-win2',
-		    xtype : 'grid-win',
-		    loaded : false,
-		    limit : 2,
-		    iconCls: 'grid-icon',
-	        launchDefaults: {
-	            iconCls: 'acc-icon',
-	            shortcutIconCls: 'demo-acc-shortcut',
-	            text: 'Accordion Window',
-	            tooltip: '<b>Accordion Window</b><br />A window with an accordion layout'
-	        },
-		    launchers : [
-	            'context', 'quick', 'tray',
-	            {
-	                type: 'shortcut',
-	                iconCls: 'acc-icon',
-	                shortcutIconCls: 'demo-acc-shortcut',
-	                text: 'Accordion Window',
-	                tooltip: '<b>Accordion Window</b><br />A window with an accordion layout'
-	            },
-	            {
-	                type: 'start',
-		        	path: 'start'//'start', 'tool', 'start/Bogus Menu'
-	            }
-		    ],  // end launchers
-		    loader: {
-		        url: 'layoutwindow.js'
-		    }
-        },{
-		    // id (required), must be unique for entire app
-		    id: 'grid-win3',
-		    xtype : 'grid-win',
-		    loaded : false,
-		    limit : 2,
-		    iconCls: 'grid-icon',
-	        launchDefaults: {
-	            iconCls: 'acc-icon',
-	            shortcutIconCls: 'demo-acc-shortcut',
-	            text: 'Accordion Window',
-	            tooltip: '<b>Accordion Window</b><br />A window with an accordion layout'
-	        },
-		    launchers : [
-	            'quick', 'tray',
-	            {
-	                type: 'shortcut',
-	                iconCls: 'acc-icon',
-	                shortcutIconCls: 'demo-acc-shortcut',
-	                text: 'Accordion Window',
-	                tooltip: '<b>Accordion Window</b><br />A window with an accordion layout'
-	            },
-	            {
-	                type: 'start',
-		        	path: 'start'//'start', 'tool', 'start/Bogus Menu'
-	            }
-		    ],  // end launchers
-		    loader: {
-		        url: 'layoutwindow.js'
-		    }
-        },{
-		    // id (required), must be unique for entire app
-		    id: 'grid-win4',
-		    xtype : 'grid-win',
-		    loaded : false,
-		    limit : 2,
-		    iconCls: 'grid-icon',
-	        launchDefaults: {
-	            iconCls: 'acc-icon',
-	            shortcutIconCls: 'demo-acc-shortcut',
-	            text: 'Accordion Window',
-	            tooltip: '<b>Accordion Window</b><br />A window with an accordion layout'
-	        },
-		    launchers : [
-	            'quick', 'tray',
-	            {
-	                type: 'shortcut',
-	                iconCls: 'acc-icon',
-	                shortcutIconCls: 'demo-acc-shortcut',
-	                text: 'Accordion Window',
-	                tooltip: '<b>Accordion Window</b><br />A window with an accordion layout'
-	            },
-	            {
-	                type: 'start',
-		        	path: 'start'//'start', 'tool', 'start/Bogus Menu'
-	            }
-		    ],  // end launchers
-		    loader: {
-		        url: 'layoutwindow.js'
-		    }
         }], // end of modules
         
 		/* privileges */


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/