Commit b724d87c authored by Sergey Luzyanin's avatar Sergey Luzyanin

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

parents d8f58de5 b491df5c
......@@ -721,6 +721,7 @@
}
}
var tmp = this.skipTLUpdate;
this.skipTLUpdate = false;
// Вставим форумулу в текущую позицию
this._addChars( functionName );
......@@ -728,6 +729,7 @@
if ( !isDefName ) {
this._moveCursor( kPosition, this.cursorPos - 1 );
}
this.cellEditor.skipTLUpdate = tmp;
};
CellEditor.prototype.replaceText = function ( pos, len, newText ) {
......
......@@ -1818,7 +1818,7 @@
// Вставка формулы в редактор
WorkbookView.prototype.insertFormulaInEditor = function(name, type, autoComplete) {
var t = this, ws = this.getWorksheet(), cursorPos, isNotFunction;
var t = this, ws = this.getWorksheet(), cursorPos, isNotFunction, tmp;
if (c_oAscPopUpSelectorType.None === type) {
this.getWorksheet().setSelectionInfo("value", name, /*onlyActive*/true);
......@@ -1838,7 +1838,10 @@
} else {
this.skipHelpSelector = true;
}
tmp = this.cellEditor.skipTLUpdate;
this.cellEditor.skipTLUpdate = false;
this.cellEditor.replaceText(this.lastFormulaPos, this.lastFormulaNameLength, name);
this.cellEditor.skipTLUpdate = tmp;
} else if (false === this.cellEditor.insertFormula(name, isNotFunction)) {
// Не смогли вставить формулу, закроем редактор, с сохранением текста
this.cellEditor.close(true);
......@@ -2284,7 +2287,11 @@
if (res) {
t.model.editDefinesNames(oldName, newName);
t.handlers.trigger("asc_onEditDefName", oldName, newName);
//условие исключает второй вызов asc_onRefreshDefNameList(первый в unlockDefName)
if(!(t.collaborativeEditing.getCollaborativeEditing() && t.collaborativeEditing.getFast()))
{
t.handlers.trigger("asc_onRefreshDefNameList");
}
} else {
t.handlers.trigger("asc_onError", c_oAscError.ID.LockCreateDefName, c_oAscError.Level.NoCritical);
}
......
......@@ -1546,24 +1546,24 @@ window['Asc']['c_oAscMaxCellOrCommentLength'] = window['Asc'].c_oAscMaxCellOrCom
}
CPluginVariation.prototype["deserialize"] = function(_object)
{
this.description = _object["description"];
this.url = _object["url"];
this.index = _object["index"];
this.description = (_object["description"] != null) ? _object["description"] : this.description;
this.url = (_object["url"] != null) ? _object["url"] : this.url;
this.index = (_object["index"] != null) ? _object["index"] : this.index;
this.icons = _object["icons"];
this.isViewer = _object["isViewer"];
this.EditorsSupport = _object["EditorsSupport"];
this.icons = (_object["icons"] != null) ? _object["icons"] : this.icons;
this.isViewer = (_object["isViewer"] != null) ? _object["isViewer"] : this.isViewer;
this.EditorsSupport = (_object["EditorsSupport"] != null) ? _object["EditorsSupport"] : this.EditorsSupport;
this.isVisual = _object["isVisual"];
this.isModal = _object["isModal"];
this.isInsideMode = _object["isInsideMode"];
this.isVisual = (_object["isVisual"] != null) ? _object["isVisual"] : this.isVisual;
this.isModal = (_object["isModal"] != null) ? _object["isModal"] : this.isModal;
this.isInsideMode = (_object["isInsideMode"] != null) ? _object["isInsideMode"] : this.isInsideMode;
this.initDataType = _object["initDataType"];
this.initData = _object["initData"];
this.initDataType = (_object["initDataType"] != null) ? _object["initDataType"] : this.initDataType;
this.initData = (_object["initData"] != null) ? _object["initData"] : this.initData;
this.isUpdateOleOnResize = _object["isUpdateOleOnResize"];
this.isUpdateOleOnResize = (_object["isUpdateOleOnResize"] != null) ? _object["isUpdateOleOnResize"] : this.isUpdateOleOnResize;
this.buttons = _object["buttons"];
this.buttons = (_object["buttons"] != null) ? _object["buttons"] : this.buttons;
}
function CPlugin()
......@@ -1600,9 +1600,9 @@ window['Asc']['c_oAscMaxCellOrCommentLength'] = window['Asc'].c_oAscMaxCellOrCom
}
CPlugin.prototype["deserialize"] = function(_object)
{
this.name = _object["name"];
this.guid = _object["guid"];
this.baseUrl = _object["baseUrl"];
this.name = (_object["name"] != null) ? _object["name"] : this.name;
this.guid = (_object["guid"] != null) ? _object["guid"] : this.guid;
this.baseUrl = (_object["baseUrl"] != null) ? _object["baseUrl"] : this.baseUrl;
this.variations = [];
for (var i = 0; i < _object["variations"].length; i++)
{
......
......@@ -2704,6 +2704,7 @@ window["SetDoctRendererParams"] = function(_params)
window["AscCommon"].convertUnicodeToUTF16 = convertUnicodeToUTF16;
window["AscCommon"].convertUTF16toUnicode = convertUTF16toUnicode;
window["AscCommon"].build_local_rx = build_local_rx;
window["AscCommon"].GetFileExtension = GetFileExtension;
window["AscCommon"].changeFileExtention = changeFileExtention;
window["AscCommon"].getExtentionByFormat = getExtentionByFormat;
window["AscCommon"].InitOnMessage = InitOnMessage;
......
......@@ -47,11 +47,13 @@
{
this.plugins = [];
this.current = null;
this.path = "";
this.path = "../../../../sdkjs-plugins/";
this.api = null;
this.startData = null;
this.runAndCloseData = null;
this.closeAttackTimer = -1; // защита от плагитнов, которые не закрываются
}
CPluginsManager.prototype =
......@@ -97,8 +99,18 @@
},
runResize : function(data)
{
var guid = data.getAttribute("guid");
for (var i = 0; i < this.plugins.length; i++)
{
if (this.plugins[i].guid == guid)
{
if (this.plugins[i].variations[0].isUpdateOleOnResize !== true)
return;
}
}
data.setAttribute("resize", true);
return this.run(data.getAttribute("guid"), 0, data);
return this.run(guid, 0, data);
},
close : function()
{
......@@ -144,6 +156,17 @@
buttonClick : function(id)
{
if (this.closeAttackTimer != -1)
{
clearTimeout(this.closeAttackTimer);
this.closeAttackTimer = -1;
}
if (-1 == id)
{
// защита от плохого плагина
this.closeAttackTimer = setTimeout(function(){ window.g_asc_plugins.close(); }, 5000);
}
var _iframe = document.getElementById("plugin_iframe");
if (_iframe)
{
......@@ -252,6 +275,12 @@
}
else if ("close" == name)
{
if (window.g_asc_plugins.closeAttackTimer != -1)
{
clearTimeout(window.g_asc_plugins.closeAttackTimer);
window.g_asc_plugins.closeAttackTimer = -1;
}
if (value && value != "")
{
try
......@@ -438,7 +467,7 @@ function TEST_PLUGINS()
initDataType : "ole",
initData : "",
isUpdateOleOnResize : true,
isUpdateOleOnResize : false,
buttons : [ { text: "Ok", primary: true },
{ text: "Cancel", primary: false } ]
......
......@@ -2093,7 +2093,7 @@ asc_docs_api.prototype.asc_PasteData = function(_format, data1, data2)
"id": this.documentId,
"c": 'pathurl',
"title": this.documentTitle,
"data": 'origin'
"data": 'origin.' + this.documentFormat
};
var t = this;
t.fCurCallback = function(input)
......@@ -7437,6 +7437,9 @@ window["asc_nativeOnSpellCheck"] = function (response)
oAdditionalData["outputformat"] = filetype;
oAdditionalData["title"] = AscCommon.changeFileExtention(this.documentTitle, AscCommon.getExtentionByFormat(filetype));
oAdditionalData["savetype"] = AscCommon.c_oAscSaveTypes.CompleteAll;
if ('savefromorigin' === command) {
oAdditionalData["format"] = this.documentFormat;
}
if (DownloadType.Print === options.downloadType)
{
oAdditionalData["inline"] = 1;
......
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