[DE] Обработка параметров плагина - isViewer (доступен в режиме просмотра), EditorsSupport (для каких редакторов доступен плагин).
This commit is contained in:
parent
7b86f88935
commit
8f0cda5ced
|
@ -1695,36 +1695,44 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
updatePluginsList: function(plugins) {
|
updatePluginsList: function(plugins) {
|
||||||
var pluginStore = this.getApplication().getCollection('Common.Collections.Plugins');
|
var pluginStore = this.getApplication().getCollection('Common.Collections.Plugins'),
|
||||||
|
isEdit = this.appOptions.isEdit;
|
||||||
if (pluginStore && plugins) {
|
if (pluginStore && plugins) {
|
||||||
var arr = [];
|
var arr = [];
|
||||||
plugins.pluginsData.forEach(function(item){
|
plugins.pluginsData.forEach(function(item){
|
||||||
var variations = item.variations,
|
var variations = item.variations,
|
||||||
variationsArr = [];
|
variationsArr = [];
|
||||||
variations.forEach(function(itemVar){
|
variations.forEach(function(itemVar){
|
||||||
variationsArr.push(new Common.Models.PluginVariation({
|
var isSupported = false;
|
||||||
description: itemVar.description,
|
for (var i=0; i<itemVar.EditorsSupport.length; i++){
|
||||||
index: itemVar.index,
|
if (itemVar.EditorsSupport[i]=='word') {
|
||||||
url : itemVar.url,
|
isSupported = true; break;
|
||||||
icons : itemVar.icons,
|
}
|
||||||
isViewer: itemVar.isViewer,
|
}
|
||||||
EditorsSupport: itemVar.EditorsSupport,
|
if (isSupported && (isEdit || itemVar.isViewer))
|
||||||
isVisual: itemVar.isVisual,
|
variationsArr.push(new Common.Models.PluginVariation({
|
||||||
isModal: itemVar.isModal,
|
description: itemVar.description,
|
||||||
isInsideMode: itemVar.isInsideMode,
|
index: itemVar.index,
|
||||||
initDataType: itemVar.initDataType,
|
url : itemVar.url,
|
||||||
initData: itemVar.initData,
|
icons : itemVar.icons,
|
||||||
isUpdateOleOnResize : itemVar.isUpdateOleOnResize,
|
isViewer: itemVar.isViewer,
|
||||||
buttons: itemVar.buttons
|
EditorsSupport: itemVar.EditorsSupport,
|
||||||
}));
|
isVisual: itemVar.isVisual,
|
||||||
|
isModal: itemVar.isModal,
|
||||||
|
isInsideMode: itemVar.isInsideMode,
|
||||||
|
initDataType: itemVar.initDataType,
|
||||||
|
initData: itemVar.initData,
|
||||||
|
isUpdateOleOnResize : itemVar.isUpdateOleOnResize,
|
||||||
|
buttons: itemVar.buttons
|
||||||
|
}));
|
||||||
});
|
});
|
||||||
|
if (variationsArr.length>0)
|
||||||
arr.push(new Common.Models.Plugin({
|
arr.push(new Common.Models.Plugin({
|
||||||
name : item.name,
|
name : item.name,
|
||||||
guid: item.guid,
|
guid: item.guid,
|
||||||
variations: variationsArr,
|
variations: variationsArr,
|
||||||
currentVariation: 0
|
currentVariation: 0
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
pluginStore.reset(arr);
|
pluginStore.reset(arr);
|
||||||
|
|
Loading…
Reference in a new issue