diff --git a/apps/common/main/lib/controller/Plugins.js b/apps/common/main/lib/controller/Plugins.js index fcbde5ea8d..f891e3eae6 100644 --- a/apps/common/main/lib/controller/Plugins.js +++ b/apps/common/main/lib/controller/Plugins.js @@ -486,7 +486,7 @@ define([ storePlugins.each(function(item){ me.viewPlugins.updatePluginIcons(item); var guid = item.get('guid'); - if (me.viewPlugins.pluginPanels[guid]) { + if (me.viewPlugins.pluginPanels[guid] && item.get('parsedIcons')) { var menu = me.viewPlugins.pluginPanels[guid].menu === 'right' ? iconsInRightMenu : iconsInLeftMenu; menu.push({ guid: guid, @@ -496,13 +496,15 @@ define([ } }); for (var key in this.viewPlugins.customPluginPanels) { - var panel = this.viewPlugins.customPluginPanels[key], - menu = panel.menu === 'right' ? iconsInRightMenu : iconsInLeftMenu; - menu.push({ - guid: panel.frameId, - baseUrl: panel.baseUrl, - parsedIcons: this.viewPlugins.parseIcons(panel.icons) - }); + var panel = this.viewPlugins.customPluginPanels[key]; + if (panel.icons) { + var menu = panel.menu === 'right' ? iconsInRightMenu : iconsInLeftMenu; + menu.push({ + guid: panel.frameId, + baseUrl: panel.baseUrl, + parsedIcons: this.viewPlugins.parseIcons(panel.icons) + }); + } } if (iconsInLeftMenu.length > 0) { me.viewPlugins.fireEvent('pluginsleft:updateicons', [iconsInLeftMenu]); @@ -599,6 +601,12 @@ define([ model = this.viewPlugins.storePlugins.findWhere({guid: pluginGuid}), name = createUniqueName(plugin.get_Name('en')); model.set({menu: menu}); + var icon_url, icon_cls; + if (model.get('parsedIcons')) { + icon_url = model.get('baseUrl') + model.get('parsedIcons')['normal']; + } else { + icon_cls = 'icon toolbar__icon btn-plugin-panel-default'; + } var $button = $('
'), button = new Common.UI.Button({ parentEl: $button, @@ -606,7 +614,8 @@ define([ hint: langName, enableToggle: true, toggleGroup: menu === 'right' ? 'tabpanelbtnsGroup' : 'leftMenuGroup', - iconImg: model.get('baseUrl') + model.get('parsedIcons')['normal'], + iconCls: icon_cls, + iconImg: icon_url, onlyIcon: true, value: pluginGuid, type: 'plugin' @@ -861,11 +870,14 @@ define([ b.visible = (isEdit || b.isViewer !== false); }); + var icons = (typeof itemVar.icons === 'string' && itemVar.icons.indexOf('%') !== -1 || !itemVar.icons2) ? itemVar.icons : itemVar.icons2; + if (!icons) icons = ''; + model.set({ description: description, index: variationsArr.length, url: itemVar.url, - icons: (typeof itemVar.icons === 'string' && itemVar.icons.indexOf('%') !== -1 || !itemVar.icons2) ? itemVar.icons : itemVar.icons2, + icons: icons, buttons: itemVar.buttons, visible: visible, help: itemVar.help @@ -1201,16 +1213,23 @@ define([ var baseUrl = variation.baseUrl || ""; var model = this.viewPlugins.storePlugins.findWhere({guid: guid}); var icons = variation.icons; + var icon_url, icon_cls; if (model) { if ("" === baseUrl) baseUrl = model.get('baseUrl'); - if (!icons) + if (!icons) { + var modes = model.get('variations'); icons = modes[model.get('currentVariation')].get('icons'); + } } - var parsedIcons = this.viewPlugins.parseIcons(icons), + if (!icons) { + icon_cls = 'icon toolbar__icon btn-plugin-panel-default'; + } else { + var parsedIcons = this.viewPlugins.parseIcons(icons); icon_url = baseUrl + parsedIcons['normal']; + } var $button = $(''), button = new Common.UI.Button({ @@ -1219,6 +1238,7 @@ define([ hint: description, enableToggle: true, toggleGroup: menu === 'right' ? 'tabpanelbtnsGroup' : 'leftMenuGroup', + iconCls: icon_cls, iconImg: icon_url, onlyIcon: true, value: frameId, diff --git a/apps/common/main/lib/view/Plugins.js b/apps/common/main/lib/view/Plugins.js index 2ba3ee3803..be2d6138a7 100644 --- a/apps/common/main/lib/view/Plugins.js +++ b/apps/common/main/lib/view/Plugins.js @@ -399,12 +399,13 @@ define([ var modes = model.get('variations'), icons = modes[model.get('currentVariation')].get('icons'); + if (icons === '') return; model.set('parsedIcons', this.parseIcons(icons)); this.updatePluginButton(model); }, updatePluginButton: function(model) { - if (!model.get('visible')) + if (!model.get('visible') || !model.get('parsedIcons')) return null; var btn = model.get('button'), @@ -452,9 +453,14 @@ define([ var modes = model.get('variations'), guid = model.get('guid'), icons = modes[model.get('currentVariation')].get('icons'), - parsedIcons = this.parseIcons(icons), + icon_cls, icon_url; + if (icons === '') { + icon_cls = 'toolbar__icon btn-plugin-default' + } else { + var parsedIcons = this.parseIcons(icons); icon_url = model.get('baseUrl') + parsedIcons['normal']; - model.set('parsedIcons', parsedIcons); + model.set('parsedIcons', parsedIcons); + } var _menu_items = []; _.each(model.get('variations'), function(variation, index) { if (variation.get('visible')) @@ -468,6 +474,7 @@ define([ var _set = Common.enumLock; var btn = new Common.UI.Button({ cls: 'btn-toolbar x-huge icon-top', + iconCls: icon_cls, iconImg: icon_url, caption: model.get('name'), menu: _menu_items.length > 1, diff --git a/apps/common/main/resources/img/toolbar/1.25x/big/btn-plugin-default.png b/apps/common/main/resources/img/toolbar/1.25x/big/btn-plugin-default.png new file mode 100644 index 0000000000..351b6282d9 Binary files /dev/null and b/apps/common/main/resources/img/toolbar/1.25x/big/btn-plugin-default.png differ diff --git a/apps/common/main/resources/img/toolbar/1.25x/btn-plugin-panel-default.png b/apps/common/main/resources/img/toolbar/1.25x/btn-plugin-panel-default.png new file mode 100644 index 0000000000..6bf17766a6 Binary files /dev/null and b/apps/common/main/resources/img/toolbar/1.25x/btn-plugin-panel-default.png differ diff --git a/apps/common/main/resources/img/toolbar/1.5x/big/btn-plugin-default.png b/apps/common/main/resources/img/toolbar/1.5x/big/btn-plugin-default.png new file mode 100644 index 0000000000..92b2d256c2 Binary files /dev/null and b/apps/common/main/resources/img/toolbar/1.5x/big/btn-plugin-default.png differ diff --git a/apps/common/main/resources/img/toolbar/1.5x/btn-plugin-panel-default.png b/apps/common/main/resources/img/toolbar/1.5x/btn-plugin-panel-default.png new file mode 100644 index 0000000000..b32c4773ff Binary files /dev/null and b/apps/common/main/resources/img/toolbar/1.5x/btn-plugin-panel-default.png differ diff --git a/apps/common/main/resources/img/toolbar/1.75x/big/btn-plugin-default.png b/apps/common/main/resources/img/toolbar/1.75x/big/btn-plugin-default.png new file mode 100644 index 0000000000..8212d91de5 Binary files /dev/null and b/apps/common/main/resources/img/toolbar/1.75x/big/btn-plugin-default.png differ diff --git a/apps/common/main/resources/img/toolbar/1.75x/btn-plugin-panel-default.png b/apps/common/main/resources/img/toolbar/1.75x/btn-plugin-panel-default.png new file mode 100644 index 0000000000..351b6282d9 Binary files /dev/null and b/apps/common/main/resources/img/toolbar/1.75x/btn-plugin-panel-default.png differ diff --git a/apps/common/main/resources/img/toolbar/1x/big/btn-plugin-default.png b/apps/common/main/resources/img/toolbar/1x/big/btn-plugin-default.png new file mode 100644 index 0000000000..f3328d1c09 Binary files /dev/null and b/apps/common/main/resources/img/toolbar/1x/big/btn-plugin-default.png differ diff --git a/apps/common/main/resources/img/toolbar/1x/btn-plugin-panel-default.png b/apps/common/main/resources/img/toolbar/1x/btn-plugin-panel-default.png new file mode 100644 index 0000000000..f7ace595fd Binary files /dev/null and b/apps/common/main/resources/img/toolbar/1x/btn-plugin-panel-default.png differ diff --git a/apps/common/main/resources/img/toolbar/2.5x/big/btn-plugin-default.svg b/apps/common/main/resources/img/toolbar/2.5x/big/btn-plugin-default.svg new file mode 100644 index 0000000000..06cdeed99f --- /dev/null +++ b/apps/common/main/resources/img/toolbar/2.5x/big/btn-plugin-default.svg @@ -0,0 +1,6 @@ + diff --git a/apps/common/main/resources/img/toolbar/2.5x/btn-plugin-panel-default.svg b/apps/common/main/resources/img/toolbar/2.5x/btn-plugin-panel-default.svg new file mode 100644 index 0000000000..e9bf40e494 --- /dev/null +++ b/apps/common/main/resources/img/toolbar/2.5x/btn-plugin-panel-default.svg @@ -0,0 +1,6 @@ + diff --git a/apps/common/main/resources/img/toolbar/2x/big/btn-plugin-default.png b/apps/common/main/resources/img/toolbar/2x/big/btn-plugin-default.png new file mode 100644 index 0000000000..2890d836cd Binary files /dev/null and b/apps/common/main/resources/img/toolbar/2x/big/btn-plugin-default.png differ diff --git a/apps/common/main/resources/img/toolbar/2x/btn-plugin-panel-default.png b/apps/common/main/resources/img/toolbar/2x/btn-plugin-panel-default.png new file mode 100644 index 0000000000..2c66105979 Binary files /dev/null and b/apps/common/main/resources/img/toolbar/2x/btn-plugin-panel-default.png differ