Commit 7a650ebd authored by Oleg Korshul's avatar Oleg Korshul

add baseUrl param to plugin

parent 2d7812fe
...@@ -93,6 +93,7 @@ define([ ...@@ -93,6 +93,7 @@ define([
var plugin = new Asc.CPlugin(); var plugin = new Asc.CPlugin();
plugin.set_Name(item.get('name')); plugin.set_Name(item.get('name'));
plugin.set_Guid(item.get('guid')); plugin.set_Guid(item.get('guid'));
plugin.set_BaseUrl(item.get('baseUrl'));
var variations = item.get('variations'), var variations = item.get('variations'),
variationsArr = []; variationsArr = [];
variations.forEach(function(itemVar){ variations.forEach(function(itemVar){
...@@ -136,9 +137,10 @@ define([ ...@@ -136,9 +137,10 @@ define([
}); });
} }
var _baseUrl = (plugin.get_BaseUrl().length == 0) ? me.panelPlugins.pluginsPath : plugin.get_BaseUrl();
me.pluginDlg = new Common.Views.PluginDlg({ me.pluginDlg = new Common.Views.PluginDlg({
title: plugin.get_Name(), title: plugin.get_Name(),
url: me.panelPlugins.pluginsPath + variation.get_Url(), url: _baseUrl + variation.get_Url(),
buttons: newBtns, buttons: newBtns,
toolcallback: _.bind(this.onToolClose, this) toolcallback: _.bind(this.onToolClose, this)
}); });
......
...@@ -73,6 +73,7 @@ define([ ...@@ -73,6 +73,7 @@ define([
return { return {
id: Common.UI.getId(), id: Common.UI.getId(),
name : '', name : '',
baseUrl : '',
guid: Common.UI.getId(), guid: Common.UI.getId(),
variations: [], variations: [],
currentVariation: 0, currentVariation: 0,
......
...@@ -75,7 +75,7 @@ define([ ...@@ -75,7 +75,7 @@ define([
el: $('#plugins-list'), el: $('#plugins-list'),
store: this.storePlugins, store: this.storePlugins,
enableKeyEvents: false, enableKeyEvents: false,
itemTemplate: _.template('<div id="<%= id %>" class="item-plugins" style="background-image: url(' + this.pluginsPath + '<%= variations[currentVariation].get("icons")[(window.devicePixelRatio > 1) ? 1 : 0] %>); background-position: 0 0;"></div>') itemTemplate: _.template('<div id="<%= id %>" class="item-plugins" style="background-image: url(' + '<% if (baseUrl !=="") { %>' + '<%= baseUrl %>' + '<% } else { %>' + this.pluginsPath + '<% } %>' + '<%= variations[currentVariation].get("icons")[(window.devicePixelRatio > 1) ? 1 : 0] %>); background-position: 0 0;"></div>')
}); });
this.trigger('render:after', this); this.trigger('render:after', this);
......
...@@ -1730,6 +1730,7 @@ define([ ...@@ -1730,6 +1730,7 @@ define([
arr.push(new Common.Models.Plugin({ arr.push(new Common.Models.Plugin({
name : item.name, name : item.name,
guid: item.guid, guid: item.guid,
baseUrl : item.baseUrl,
variations: variationsArr, variations: variationsArr,
currentVariation: 0 currentVariation: 0
})); }));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment