0011996: add fallback app icon
authorCornelius Weiß <c.weiss@metaways.de>
Thu, 30 Jun 2016 11:18:42 +0000 (13:18 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 4 Jul 2016 11:04:16 +0000 (13:04 +0200)
https://forge.tine20.org/view.php?id=11996

Change-Id: I84ecec985903aeb57fb3893db4a280d3ca5ffd0a
Reviewed-on: http://gerrit.tine20.com/customers/3290
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/css/Tinebase.css
tine20/Tinebase/js/Application.js
tine20/Tinebase/js/ApplicationStarter.js
tine20/Tinebase/js/extFixes.js
tine20/Tinebase/js/widgets/grid/GridPanel.js

index 49b4086..0fc1cfc 100644 (file)
@@ -7,6 +7,16 @@ html, body {
     height:100%;
 }
 
     height:100%;
 }
 
+.ApplicationIconCls {
+    background-image:url(../../images/oxygen/16x16/apps/preferences-plugin.png); !important;
+}
+.x-btn-medium .ApplicationIconCls {
+    background-image:url(../../images/oxygen/22x22/apps/preferences-plugin.png); !important;
+}
+.x-btn-large .ApplicationIconCls {
+    background-image:url(../../images/oxygen/32x32/apps/preferences-plugin.png); !important;
+}
+
 /* ----- actions -------------------------------------------------------------*/
 .action_add {
     background-image:url(../../images/oxygen/16x16/actions/list-add.png) !important;
 /* ----- actions -------------------------------------------------------------*/
 .action_add {
     background-image:url(../../images/oxygen/16x16/actions/list-add.png) !important;
index 205a5fb..ad37a3f 100644 (file)
@@ -71,7 +71,12 @@ Ext.extend(Tine.Tinebase.Application, Ext.util.Observable , {
      * @return {String}
      */
     getIconCls: function(target) {
      * @return {String}
      */
     getIconCls: function(target) {
-        return this.appName + 'IconCls';
+        var iconCls = this.appName + 'IconCls';
+        if (! Ext.util.CSS.getRule('.' + iconCls)) {
+            iconCls = 'ApplicationIconCls';
+        }
+
+        return iconCls;
     },
     
     /**
     },
     
     /**
index c1f88a9..8d1bc77 100644 (file)
@@ -556,9 +556,13 @@ Tine.Tinebase.ApplicationStarter = {
                     
                     // add model to global add splitbutton if set
                     if (modelConfig.hasOwnProperty('splitButton') && modelConfig.splitButton == true) {
                     
                     // add model to global add splitbutton if set
                     if (modelConfig.hasOwnProperty('splitButton') && modelConfig.splitButton == true) {
+                        var iconCls = appName + modelName;
+                        if (! Ext.util.CSS.getRule('.' + iconCls)) {
+                            iconCls = 'ApplicationIconCls';
+                        }
                         Ext.ux.ItemRegistry.registerItem('Tine.widgets.grid.GridPanel.addButton', {
                             text: Tine[appName].i18n._('New ' + modelName), 
                         Ext.ux.ItemRegistry.registerItem('Tine.widgets.grid.GridPanel.addButton', {
                             text: Tine[appName].i18n._('New ' + modelName), 
-                            iconCls: appName + modelName,
+                            iconCls: iconCls,
                             scope: Tine.Tinebase.appMgr.get(appName),
                             handler: (function() {
                                 var ms = this.getMainScreen(),
                             scope: Tine.Tinebase.appMgr.get(appName),
                             handler: (function() {
                                 var ms = this.getMainScreen(),
index 5c2bc3f..2b5e143 100644 (file)
@@ -608,13 +608,22 @@ Ext.util.CSS = function(){
                 rules = {};
             }
             try{// try catch for cross domain access issue
                 rules = {};
             }
             try{// try catch for cross domain access issue
-                var ssRules = ss.cssRules || ss.rules;
+                var ssRules = ss.cssRules || ss.rules,
+                    sel,
+                    selParts;
                 for(var j = ssRules.length-1; j >= 0; --j){
                     // nested rules
                     if (ssRules[j].styleSheet) {
                         Ext.util.CSS.cacheStyleSheet(ssRules[j].styleSheet);
                     } else {
                 for(var j = ssRules.length-1; j >= 0; --j){
                     // nested rules
                     if (ssRules[j].styleSheet) {
                         Ext.util.CSS.cacheStyleSheet(ssRules[j].styleSheet);
                     } else {
-                        rules[ssRules[j].selectorText.toLowerCase()] = ssRules[j];
+                        sel = ssRules[j].selectorText.toLowerCase();
+                        rules[sel] = ssRules[j];
+                        selParts = sel.split(', ');
+                        if (selParts.length > 1) {
+                            for(var p = selParts.length-1; p >= 0; --p){
+                                rules[selParts[p]] = ssRules[j];
+                            }
+                        }
                     }
                 }
             }catch(e){}
                     }
                 }
             }catch(e){}
index d2da094..d99f30c 100644 (file)
@@ -384,7 +384,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 }
             }, this);
         }
                 }
             }, this);
         }
-        
+
         Tine.widgets.grid.GridPanel.superclass.initComponent.call(this);
     },
 
         Tine.widgets.grid.GridPanel.superclass.initComponent.call(this);
     },
 
@@ -567,7 +567,11 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
      * @private
      */
     initActions: function() {
      * @private
      */
     initActions: function() {
-
+        this.newRecordIcon =  this.newRecordIcon!== null ? this.newRecordIcon : this.app.appName + 'IconCls';
+        if (! Ext.util.CSS.getRule('.' + this.newRecordIcon)) {
+            this.newRecordIcon = 'ApplicationIconCls';
+        }
+        
         var services = Tine.Tinebase.registry.get('serviceMap').services;
         
         this.action_editInNewWindow = new Ext.Action({
         var services = Tine.Tinebase.registry.get('serviceMap').services;
         
         this.action_editInNewWindow = new Ext.Action({
@@ -602,7 +606,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             actionType: 'add',
             text: this.i18nAddActionText ? this.app.i18n._hidden(this.i18nAddActionText) : String.format(i18n._('Add {0}'), this.i18nRecordName),
             handler: this.onEditInNewWindow.createDelegate(this, [{actionType: 'add'}]),
             actionType: 'add',
             text: this.i18nAddActionText ? this.app.i18n._hidden(this.i18nAddActionText) : String.format(i18n._('Add {0}'), this.i18nRecordName),
             handler: this.onEditInNewWindow.createDelegate(this, [{actionType: 'add'}]),
-            iconCls: (this.newRecordIcon !== null) ? this.newRecordIcon : this.app.appName + 'IconCls',
+            iconCls: this.newRecordIcon,
             scope: this
         }) : null;
 
             scope: this
         }) : null;