From 7a650ebddb39f5c1bfd31c267e8ac7af4e40cdcd Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Tue, 24 May 2016 11:48:59 +0300 Subject: [PATCH] add baseUrl param to plugin --- apps/common/main/lib/controller/Plugins.js | 4 +++- apps/common/main/lib/model/Plugin.js | 1 + apps/common/main/lib/view/Plugins.js | 2 +- apps/documenteditor/main/app/controller/Main.js | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/common/main/lib/controller/Plugins.js b/apps/common/main/lib/controller/Plugins.js index 3490f5273..d13e559ed 100644 --- a/apps/common/main/lib/controller/Plugins.js +++ b/apps/common/main/lib/controller/Plugins.js @@ -93,6 +93,7 @@ define([ var plugin = new Asc.CPlugin(); plugin.set_Name(item.get('name')); plugin.set_Guid(item.get('guid')); + plugin.set_BaseUrl(item.get('baseUrl')); var variations = item.get('variations'), variationsArr = []; variations.forEach(function(itemVar){ @@ -136,9 +137,10 @@ define([ }); } + var _baseUrl = (plugin.get_BaseUrl().length == 0) ? me.panelPlugins.pluginsPath : plugin.get_BaseUrl(); me.pluginDlg = new Common.Views.PluginDlg({ title: plugin.get_Name(), - url: me.panelPlugins.pluginsPath + variation.get_Url(), + url: _baseUrl + variation.get_Url(), buttons: newBtns, toolcallback: _.bind(this.onToolClose, this) }); diff --git a/apps/common/main/lib/model/Plugin.js b/apps/common/main/lib/model/Plugin.js index 2d90128bf..83308797f 100644 --- a/apps/common/main/lib/model/Plugin.js +++ b/apps/common/main/lib/model/Plugin.js @@ -73,6 +73,7 @@ define([ return { id: Common.UI.getId(), name : '', + baseUrl : '', guid: Common.UI.getId(), variations: [], currentVariation: 0, diff --git a/apps/common/main/lib/view/Plugins.js b/apps/common/main/lib/view/Plugins.js index b4817a90c..a93b03f37 100644 --- a/apps/common/main/lib/view/Plugins.js +++ b/apps/common/main/lib/view/Plugins.js @@ -75,7 +75,7 @@ define([ el: $('#plugins-list'), store: this.storePlugins, enableKeyEvents: false, - itemTemplate: _.template('
1) ? 1 : 0] %>); background-position: 0 0;">
') + itemTemplate: _.template('
' + '<%= baseUrl %>' + '<% } else { %>' + this.pluginsPath + '<% } %>' + '<%= variations[currentVariation].get("icons")[(window.devicePixelRatio > 1) ? 1 : 0] %>); background-position: 0 0;">
') }); this.trigger('render:after', this); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index cf31edd2d..c0b75936e 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1730,6 +1730,7 @@ define([ arr.push(new Common.Models.Plugin({ name : item.name, guid: item.guid, + baseUrl : item.baseUrl, variations: variationsArr, currentVariation: 0 }));