Commit 37c61227 authored by alexey.musinov's avatar alexey.musinov

Merge branch 'develop' of https://github.com/ONLYOFFICE/sdkjs into develop

parents 9c13ae0e 31684a28
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
{ {
this.plugins = []; this.plugins = [];
this.current = null; this.current = null;
this.currentVariation = 0;
this.path = "../../../../sdkjs-plugins/"; this.path = "../../../../sdkjs-plugins/";
this.api = null; this.api = null;
...@@ -124,6 +125,8 @@ ...@@ -124,6 +125,8 @@
if (this.current == null) if (this.current == null)
return false; return false;
this.currentVariation = Math.min(variation, this.current.variations.length - 1);
this.startData = (data == null || data == "") ? new CPluginData() : data; this.startData = (data == null || data == "") ? new CPluginData() : data;
this.startData.setAttribute("guid", guid) this.startData.setAttribute("guid", guid)
this.correctData(this.startData); this.correctData(this.startData);
...@@ -171,9 +174,9 @@ ...@@ -171,9 +174,9 @@
if (this.startData.getAttribute("resize") === true) if (this.startData.getAttribute("resize") === true)
this.startLongAction(); this.startLongAction();
if (this.current.variations[0].isVisual && this.startData.getAttribute("resize") !== true) if (this.current.variations[this.currentVariation].isVisual && this.startData.getAttribute("resize") !== true)
{ {
this.api.asc_fireCallback("asc_onPluginShow", this.current); this.api.asc_fireCallback("asc_onPluginShow", this.current, this.currentVariation);
} }
else else
{ {
...@@ -181,7 +184,7 @@ ...@@ -181,7 +184,7 @@
ifr.name = "plugin_iframe"; ifr.name = "plugin_iframe";
ifr.id = "plugin_iframe"; ifr.id = "plugin_iframe";
var _add = this.current.baseUrl == "" ? this.path : this.current.baseUrl; var _add = this.current.baseUrl == "" ? this.path : this.current.baseUrl;
ifr.src = _add + this.current.variations[0].url; ifr.src = _add + this.current.variations[this.currentVariation].url;
ifr.style.position = 'absolute'; ifr.style.position = 'absolute';
ifr.style.top = '-100px'; ifr.style.top = '-100px';
ifr.style.left = '0px'; ifr.style.left = '0px';
...@@ -219,7 +222,7 @@ ...@@ -219,7 +222,7 @@
init : function() init : function()
{ {
switch (this.current.variations[0].initDataType) switch (this.current.variations[this.currentVariation].initDataType)
{ {
case Asc.EPluginDataType.text: case Asc.EPluginDataType.text:
{ {
...@@ -460,6 +463,25 @@ function TEST_PLUGINS() ...@@ -460,6 +463,25 @@ function TEST_PLUGINS()
buttons : [ { text: "Ok", primary: true }, buttons : [ { text: "Ok", primary: true },
{ text: "Cancel", primary: false } ] { text: "Cancel", primary: false } ]
},
{
description : "about",
url : "chess/index_about.html",
icons : ["chess/icon.png", "chess/icon@2x.png"],
isViewer : true,
EditorsSupport : ["word", "cell", "slide"],
isVisual : true,
isModal : true,
isInsideMode : false,
initDataType : "none",
initData : "",
isUpdateOleOnResize : false,
buttons : [ { "text": "Ok", "primary": true } ]
} }
] ]
}, },
...@@ -669,7 +691,7 @@ function TEST_PLUGINS() ...@@ -669,7 +691,7 @@ function TEST_PLUGINS()
"isVisual" : true, "isVisual" : true,
"isModal" : false, "isModal" : false,
"isInsideMode" : false, "isInsideMode" : true,
"initDataType" : "none", "initDataType" : "none",
"initData" : "", "initData" : "",
......
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