add baseUrl param to plugin

This commit is contained in:
Oleg Korshul 2016-05-24 11:48:59 +03:00
parent 2d7812fe48
commit 7a650ebddb
4 changed files with 6 additions and 2 deletions

View file

@ -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)
});

View file

@ -73,6 +73,7 @@ define([
return {
id: Common.UI.getId(),
name : '',
baseUrl : '',
guid: Common.UI.getId(),
variations: [],
currentVariation: 0,

View file

@ -75,7 +75,7 @@ define([
el: $('#plugins-list'),
store: this.storePlugins,
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);

View file

@ -1730,6 +1730,7 @@ define([
arr.push(new Common.Models.Plugin({
name : item.name,
guid: item.guid,
baseUrl : item.baseUrl,
variations: variationsArr,
currentVariation: 0
}));