Commit cf1218fd authored by Boris Kocherov's avatar Boris Kocherov

erp5_officejs_onlyoffice_sdkjs: new version from:

https://lab.nexedi.com/bk/sdkjs/commits/merge_jio_xmla.171114
parent 55da9892
...@@ -20,9 +20,7 @@ ...@@ -20,9 +20,7 @@
"../common/apiBase.js", "../common/apiBase.js",
"../common/Private/license.js", "../common/Private/license.js",
"../word/apiCommon.js", "../word/apiCommon.js",
"../cell/api.js", "../cell/api.js"
"../common/Local/license.js",
"../common/Local/jio.js"
], ],
"common": [ "common": [
"../common/downloaderfiles.js", "../common/downloaderfiles.js",
...@@ -140,18 +138,21 @@ ...@@ -140,18 +138,21 @@
"../cell/model/PivotTables.js", "../cell/model/PivotTables.js",
"../word/Editor/DocumentContentElementBase.js", "../word/Editor/DocumentContentElementBase.js",
"../word/Editor/ParagraphContentBase.js",
"../word/Editor/Bookmarks.js",
"../word/Editor/Comments.js", "../word/Editor/Comments.js",
"../word/Editor/CommentsChanges.js", "../word/Editor/CommentsChanges.js",
"../word/Editor/Styles.js", "../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js", "../word/Editor/StylesChanges.js",
"../word/Editor/RevisionsChange.js", "../word/Editor/RevisionsChange.js",
"../word/Editor/FlowObjects.js", "../word/Editor/FlowObjects.js",
"../word/Editor/ParagraphContent.js", "../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js",
"../word/Editor/Paragraph/ParaTextPr.js", "../word/Editor/Paragraph/ParaTextPr.js",
"../word/Editor/Paragraph/ParaTextPrChanges.js", "../word/Editor/Paragraph/ParaTextPrChanges.js",
"../word/Editor/Paragraph/ParaDrawing.js", "../word/Editor/Paragraph/ParaDrawing.js",
"../word/Editor/Paragraph/ParaDrawingChanges.js", "../word/Editor/Paragraph/ParaDrawingChanges.js",
"../word/Editor/Paragraph/ComplexFieldInstruction.js",
"../word/Editor/Paragraph/ComplexField.js",
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js", "../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
...@@ -218,9 +219,7 @@ ...@@ -218,9 +219,7 @@
"../common/text_input.js", "../common/text_input.js",
"../common/Drawings/Format/OleObject.js", "../common/Drawings/Format/OleObject.js",
"../common/Drawings/Format/DrawingContent.js", "../common/Drawings/Format/DrawingContent.js",
"../common/plugins.js", "../common/plugins.js"
"../common/Local/common_jio.js",
"../cell/Local/api_jio.js"
], ],
"private": [ "private": [
"../cell/Private/comments.js" "../cell/Private/comments.js"
...@@ -276,6 +275,8 @@ ...@@ -276,6 +275,8 @@
"../common/externs/jquery-3.2.js", "../common/externs/jquery-3.2.js",
"../common/externs/xregexp-3.0.0.js", "../common/externs/xregexp-3.0.0.js",
"../common/externs/sockjs.js", "../common/externs/sockjs.js",
"../common/externs/Xmla.js",
"../common/externs/rsvp-2.0.4.js",
"../common/externs/jszip.min.js", "../common/externs/jszip.min.js",
"../common/externs/jszip-utils.js" "../common/externs/jszip-utils.js"
], ],
......
...@@ -20,11 +20,8 @@ ...@@ -20,11 +20,8 @@
"../common/apiBase.js", "../common/apiBase.js",
"../common/Private/license.js", "../common/Private/license.js",
"../word/apiCommon.js", "../word/apiCommon.js",
"../slide/api.js", "../slide/api.js"
"../common/Local/license.js", ],
"../common/Local/empty_slide.js",
"../common/Local/jio.js"
],
"common": [ "common": [
"../common/downloaderfiles.js", "../common/downloaderfiles.js",
"../common/NumFormat.js", "../common/NumFormat.js",
...@@ -151,6 +148,8 @@ ...@@ -151,6 +148,8 @@
"../word/Editor/Paragraph/ParaTextPrChanges.js", "../word/Editor/Paragraph/ParaTextPrChanges.js",
"../word/Editor/Paragraph/ParaDrawing.js", "../word/Editor/Paragraph/ParaDrawing.js",
"../word/Editor/Paragraph/ParaDrawingChanges.js", "../word/Editor/Paragraph/ParaDrawingChanges.js",
"../word/Editor/Paragraph/ComplexFieldInstruction.js",
"../word/Editor/Paragraph/ComplexField.js",
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js", "../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
...@@ -207,9 +206,7 @@ ...@@ -207,9 +206,7 @@
"../common/text_input.js", "../common/text_input.js",
"../common/Drawings/Format/OleObject.js", "../common/Drawings/Format/OleObject.js",
"../common/Drawings/Format/DrawingContent.js", "../common/Drawings/Format/DrawingContent.js",
"../common/plugins.js", "../common/plugins.js"
"../common/Local/common_jio.js",
"../slide/Local/api_jio.js"
], ],
"private": [ "private": [
"../slide/Private/comments.js", "../slide/Private/comments.js",
...@@ -227,20 +224,16 @@ ...@@ -227,20 +224,16 @@
] ]
}, },
"mobile_banners": { "mobile_banners": {
"min": [ "min": [
"../common/Native/native.js", "../common/Native/Wrappers/memory.js"
"../common/Native/jquery_native.js",
"../../web-apps/vendor/xregexp/xregexp-all-min.js"
], ],
"common": [] "common": []
}, },
"mobile": [ "mobile": [
"../common/Native/Wrappers/memory.js",
"../common/Native/Wrappers/TextMeasurerWrapper.js", "../common/Native/Wrappers/TextMeasurerWrapper.js",
"../common/Native/Wrappers/DrawingStream.js", "../common/Native/Wrappers/DrawingStream.js",
"../common/Native/Wrappers/ShapeDrawer.js", "../common/Native/Wrappers/ShapeDrawer.js",
"../common/Native/Wrappers/Overlay.js", "../common/Native/Wrappers/Overlay.js",
"../slide/Native/native.js",
"../slide/Native/Wrappers/api.js", "../slide/Native/Wrappers/api.js",
"../slide/Native/Wrappers/HtmlPage.js", "../slide/Native/Wrappers/HtmlPage.js",
"../slide/Native/Wrappers/DrawingDocument.js", "../slide/Native/Wrappers/DrawingDocument.js",
......
...@@ -20,10 +20,8 @@ ...@@ -20,10 +20,8 @@
"../common/apiBase.js", "../common/apiBase.js",
"../common/Private/license.js", "../common/Private/license.js",
"../word/apiCommon.js", "../word/apiCommon.js",
"../word/api.js", "../word/api.js"
"../common/Local/license.js", ],
"../common/Local/jio.js"
],
"common": [ "common": [
"../common/downloaderfiles.js", "../common/downloaderfiles.js",
"../common/NumFormat.js", "../common/NumFormat.js",
...@@ -109,18 +107,21 @@ ...@@ -109,18 +107,21 @@
"../word/Editor/GraphicObjects/GraphicPage.js", "../word/Editor/GraphicObjects/GraphicPage.js",
"../word/Editor/GraphicObjects/WrapManager.js", "../word/Editor/GraphicObjects/WrapManager.js",
"../word/Editor/DocumentContentElementBase.js", "../word/Editor/DocumentContentElementBase.js",
"../word/Editor/ParagraphContentBase.js",
"../word/Editor/Comments.js", "../word/Editor/Comments.js",
"../word/Editor/CommentsChanges.js", "../word/Editor/CommentsChanges.js",
"../word/Editor/Bookmarks.js",
"../word/Editor/Styles.js", "../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js", "../word/Editor/StylesChanges.js",
"../word/Editor/RevisionsChange.js", "../word/Editor/RevisionsChange.js",
"../word/Editor/FlowObjects.js", "../word/Editor/FlowObjects.js",
"../word/Editor/ParagraphContent.js", "../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js",
"../word/Editor/Paragraph/ParaTextPr.js", "../word/Editor/Paragraph/ParaTextPr.js",
"../word/Editor/Paragraph/ParaTextPrChanges.js", "../word/Editor/Paragraph/ParaTextPrChanges.js",
"../word/Editor/Paragraph/ParaDrawing.js", "../word/Editor/Paragraph/ParaDrawing.js",
"../word/Editor/Paragraph/ParaDrawingChanges.js", "../word/Editor/Paragraph/ParaDrawingChanges.js",
"../word/Editor/Paragraph/ComplexFieldInstruction.js",
"../word/Editor/Paragraph/ComplexField.js",
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js", "../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
...@@ -195,9 +196,7 @@ ...@@ -195,9 +196,7 @@
"../common/text_input.js", "../common/text_input.js",
"../common/Drawings/Format/OleObject.js", "../common/Drawings/Format/OleObject.js",
"../common/Drawings/Format/DrawingContent.js", "../common/Drawings/Format/DrawingContent.js",
"../common/plugins.js", "../common/plugins.js"
"../common/Local/common_jio.js",
"../word/Local/api_jio.js"
], ],
"private": [ "private": [
"../common/Private/versionHistory.js", "../common/Private/versionHistory.js",
......
...@@ -87,7 +87,6 @@ onlyoffice/sdkjs/build/configs/webexcel.json\n ...@@ -87,7 +87,6 @@ onlyoffice/sdkjs/build/configs/webexcel.json\n
onlyoffice/sdkjs/build/configs/webpowerpoint.json\n onlyoffice/sdkjs/build/configs/webpowerpoint.json\n
onlyoffice/sdkjs/build/configs/webword.json\n onlyoffice/sdkjs/build/configs/webword.json\n
onlyoffice/sdkjs/cell/Local/api.js\n onlyoffice/sdkjs/cell/Local/api.js\n
onlyoffice/sdkjs/cell/Local/api_jio.js\n
onlyoffice/sdkjs/cell/Private/comments.js\n onlyoffice/sdkjs/cell/Private/comments.js\n
onlyoffice/sdkjs/cell/api.js\n onlyoffice/sdkjs/cell/api.js\n
onlyoffice/sdkjs/cell/apiBuilder.js\n onlyoffice/sdkjs/cell/apiBuilder.js\n
...@@ -207,9 +206,6 @@ onlyoffice/sdkjs/common/Images/plus_copy_2x.png\n ...@@ -207,9 +206,6 @@ onlyoffice/sdkjs/common/Images/plus_copy_2x.png\n
onlyoffice/sdkjs/common/Images/text_copy.png\n onlyoffice/sdkjs/common/Images/text_copy.png\n
onlyoffice/sdkjs/common/Images/text_copy_2x.png\n onlyoffice/sdkjs/common/Images/text_copy_2x.png\n
onlyoffice/sdkjs/common/Local/common.js\n onlyoffice/sdkjs/common/Local/common.js\n
onlyoffice/sdkjs/common/Local/common_jio.js\n
onlyoffice/sdkjs/common/Local/empty_slide.js\n
onlyoffice/sdkjs/common/Local/jio.js\n
onlyoffice/sdkjs/common/Local/license.js\n onlyoffice/sdkjs/common/Local/license.js\n
onlyoffice/sdkjs/common/Merge/NodejsEnv.js\n onlyoffice/sdkjs/common/Merge/NodejsEnv.js\n
onlyoffice/sdkjs/common/Native/Wrappers/DrawingDocument.js\n onlyoffice/sdkjs/common/Native/Wrappers/DrawingDocument.js\n
...@@ -248,12 +244,6 @@ onlyoffice/sdkjs/common/docscoapicommon.js\n ...@@ -248,12 +244,6 @@ onlyoffice/sdkjs/common/docscoapicommon.js\n
onlyoffice/sdkjs/common/downloaderfiles.js\n onlyoffice/sdkjs/common/downloaderfiles.js\n
onlyoffice/sdkjs/common/easysax.js\n onlyoffice/sdkjs/common/easysax.js\n
onlyoffice/sdkjs/common/editorscommon.js\n onlyoffice/sdkjs/common/editorscommon.js\n
onlyoffice/sdkjs/common/externs/global.js\n
onlyoffice/sdkjs/common/externs/jquery-3.2.js\n
onlyoffice/sdkjs/common/externs/jszip-utils.js\n
onlyoffice/sdkjs/common/externs/jszip.min.js\n
onlyoffice/sdkjs/common/externs/sockjs.js\n
onlyoffice/sdkjs/common/externs/xregexp-3.0.0.js\n
onlyoffice/sdkjs/common/openxml.js\n onlyoffice/sdkjs/common/openxml.js\n
onlyoffice/sdkjs/common/pluginBase.js\n onlyoffice/sdkjs/common/pluginBase.js\n
onlyoffice/sdkjs/common/plugins.js\n onlyoffice/sdkjs/common/plugins.js\n
...@@ -282,11 +272,9 @@ onlyoffice/sdkjs/slide/Editor/Format/SlideMaster.js\n ...@@ -282,11 +272,9 @@ onlyoffice/sdkjs/slide/Editor/Format/SlideMaster.js\n
onlyoffice/sdkjs/slide/Editor/Format/StylesPrototype.js\n onlyoffice/sdkjs/slide/Editor/Format/StylesPrototype.js\n
onlyoffice/sdkjs/slide/Editor/Format/TextBodyPrototype.js\n onlyoffice/sdkjs/slide/Editor/Format/TextBodyPrototype.js\n
onlyoffice/sdkjs/slide/Local/api.js\n onlyoffice/sdkjs/slide/Local/api.js\n
onlyoffice/sdkjs/slide/Local/api_jio.js\n
onlyoffice/sdkjs/slide/Native/Wrappers/DrawingDocument.js\n onlyoffice/sdkjs/slide/Native/Wrappers/DrawingDocument.js\n
onlyoffice/sdkjs/slide/Native/Wrappers/HtmlPage.js\n onlyoffice/sdkjs/slide/Native/Wrappers/HtmlPage.js\n
onlyoffice/sdkjs/slide/Native/Wrappers/api.js\n onlyoffice/sdkjs/slide/Native/Wrappers/api.js\n
onlyoffice/sdkjs/slide/Native/native.js\n
onlyoffice/sdkjs/slide/Private/comments.js\n onlyoffice/sdkjs/slide/Private/comments.js\n
onlyoffice/sdkjs/slide/Texture/Canvas.png\n onlyoffice/sdkjs/slide/Texture/Canvas.png\n
onlyoffice/sdkjs/slide/Texture/Carton.png\n onlyoffice/sdkjs/slide/Texture/Carton.png\n
...@@ -344,6 +332,7 @@ onlyoffice/sdkjs/word/Drawing/ShapeDrawer.js\n ...@@ -344,6 +332,7 @@ onlyoffice/sdkjs/word/Drawing/ShapeDrawer.js\n
onlyoffice/sdkjs/word/Drawing/documentrenderer.js\n onlyoffice/sdkjs/word/Drawing/documentrenderer.js\n
onlyoffice/sdkjs/word/Drawing/mobileTouchManager.js\n onlyoffice/sdkjs/word/Drawing/mobileTouchManager.js\n
onlyoffice/sdkjs/word/Drawing/translations.js\n onlyoffice/sdkjs/word/Drawing/translations.js\n
onlyoffice/sdkjs/word/Editor/Bookmarks.js\n
onlyoffice/sdkjs/word/Editor/CollaborativeEditing.js\n onlyoffice/sdkjs/word/Editor/CollaborativeEditing.js\n
onlyoffice/sdkjs/word/Editor/Comments.js\n onlyoffice/sdkjs/word/Editor/Comments.js\n
onlyoffice/sdkjs/word/Editor/CommentsChanges.js\n onlyoffice/sdkjs/word/Editor/CommentsChanges.js\n
...@@ -382,6 +371,8 @@ onlyoffice/sdkjs/word/Editor/MathChanges.js\n ...@@ -382,6 +371,8 @@ onlyoffice/sdkjs/word/Editor/MathChanges.js\n
onlyoffice/sdkjs/word/Editor/Numbering.js\n onlyoffice/sdkjs/word/Editor/Numbering.js\n
onlyoffice/sdkjs/word/Editor/NumberingChanges.js\n onlyoffice/sdkjs/word/Editor/NumberingChanges.js\n
onlyoffice/sdkjs/word/Editor/Paragraph.js\n onlyoffice/sdkjs/word/Editor/Paragraph.js\n
onlyoffice/sdkjs/word/Editor/Paragraph/ComplexField.js\n
onlyoffice/sdkjs/word/Editor/Paragraph/ComplexFieldInstruction.js\n
onlyoffice/sdkjs/word/Editor/Paragraph/ParaDrawing.js\n onlyoffice/sdkjs/word/Editor/Paragraph/ParaDrawing.js\n
onlyoffice/sdkjs/word/Editor/Paragraph/ParaDrawingChanges.js\n onlyoffice/sdkjs/word/Editor/Paragraph/ParaDrawingChanges.js\n
onlyoffice/sdkjs/word/Editor/Paragraph/ParaTextPr.js\n onlyoffice/sdkjs/word/Editor/Paragraph/ParaTextPr.js\n
...@@ -413,7 +404,6 @@ onlyoffice/sdkjs/word/Editor/Table/TableRecalculate.js\n ...@@ -413,7 +404,6 @@ onlyoffice/sdkjs/word/Editor/Table/TableRecalculate.js\n
onlyoffice/sdkjs/word/Editor/Table/TableRow.js\n onlyoffice/sdkjs/word/Editor/Table/TableRow.js\n
onlyoffice/sdkjs/word/Editor/Table/TableRowChanges.js\n onlyoffice/sdkjs/word/Editor/Table/TableRowChanges.js\n
onlyoffice/sdkjs/word/Local/api.js\n onlyoffice/sdkjs/word/Local/api.js\n
onlyoffice/sdkjs/word/Local/api_jio.js\n
onlyoffice/sdkjs/word/Local/documentrenderer.js\n onlyoffice/sdkjs/word/Local/documentrenderer.js\n
onlyoffice/sdkjs/word/Local/local.html\n onlyoffice/sdkjs/word/Local/local.html\n
onlyoffice/sdkjs/word/Math/accent.js\n onlyoffice/sdkjs/word/Math/accent.js\n
......
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
"use strict";
// Import
var c_oAscError = Asc.c_oAscError;
/////////////////////////////////////////////////////////
////////////// OPEN ////////////////////////
/////////////////////////////////////////////////////////
(/**
* @param {jQuery} $
* @param {Window} window
* @param {undefined} undefined
*/
function($, window, undefined) {
var asc = window["Asc"];
var prot;
asc['spreadsheet_api'].prototype._OfflineAppDocumentStartLoad = function()
{
this.asc_registerCallback('asc_onDocumentContentReady', function(){
DesktopOfflineUpdateLocalName(window["Asc"]["editor"]);
//setTimeout(function(){window["UpdateInstallPlugins"]();}, 10);
});
this.jio_open();
};
asc['spreadsheet_api'].prototype._OfflineAppDocumentEndLoad = function(_url, _data)
{
//AscCommon.g_oIdCounter.m_sUserId = window["AscDesktopEditor"]["CheckUserId"]();
if (_data == "")
{
this.sendEvent("asc_onError", c_oAscError.ID.ConvertationOpenError, c_oAscError.Level.Critical);
return;
}
this.openDocument(_data);
AscCommon.History.UserSaveMode = true;
DesktopOfflineUpdateLocalName(this);
this.onUpdateDocumentModified(AscCommon.History.Have_Changes());
};
asc['spreadsheet_api'].prototype._onNeedParams = function(data, opt_isPassword)
{
var options;
if(opt_isPassword){
options = new AscCommon.asc_CAdvancedOptions(Asc.c_oAscAdvancedOptionsID.DRM);
} else {
var cp = JSON.parse("{\"codepage\":46,\"delimiter\":1}");
cp['encodings'] = AscCommon.getEncodingParams();
options = new AscCommon.asc_CAdvancedOptions(Asc.c_oAscAdvancedOptionsID.CSV, cp);
}
this.handlers.trigger("asc_onAdvancedOptions", options, AscCommon.c_oAscAdvancedOptionsAction.Open);
};
})(jQuery, window);
window["Asc"]['spreadsheet_api'].prototype.asc_setAdvancedOptions = function(idOption, option)
{
if (window["Asc"].c_oAscAdvancedOptionsID.CSV === idOption) {
var _param = "";
_param += ("<m_nCsvTxtEncoding>" + option.asc_getCodePage() + "</m_nCsvTxtEncoding>");
_param += ("<m_nCsvDelimiter>" + option.asc_getDelimiter() + "</m_nCsvDelimiter>");
window["AscDesktopEditor"]["SetAdvancedOptions"](_param);
}
else if (window["Asc"].c_oAscAdvancedOptionsID.DRM === idOption) {
var _param = "";
_param += ("<m_sPassword>" + AscCommon.CopyPasteCorrectString(option.asc_getPassword()) + "</m_sPassword>");
window["AscDesktopEditor"]["SetAdvancedOptions"](_param);
}
};
window["Asc"]['spreadsheet_api'].prototype["asc_setAdvancedOptions"] = window["Asc"]['spreadsheet_api'].prototype.asc_setAdvancedOptions;
window["DesktopOfflineAppDocumentEndLoad"] = function(_url, _data)
{
AscCommon.g_oDocumentUrls.documentUrl = _url;
if (AscCommon.g_oDocumentUrls.documentUrl.indexOf("file:") != 0)
{
if (AscCommon.g_oDocumentUrls.documentUrl.indexOf("/") != 0)
AscCommon.g_oDocumentUrls.documentUrl = "/" + AscCommon.g_oDocumentUrls.documentUrl;
AscCommon.g_oDocumentUrls.documentUrl = "file://" + AscCommon.g_oDocumentUrls.documentUrl;
}
window["Asc"]["editor"]._OfflineAppDocumentEndLoad(_data);
};
/////////////////////////////////////////////////////////
////////////// CHANGES /////////////////////
/////////////////////////////////////////////////////////
AscCommon.CHistory.prototype.Reset_SavedIndex = function(IsUserSave)
{
this.SavedIndex = (null === this.SavedIndex && -1 === this.Index ? null : this.Index);
if (true === this.Is_UserSaveMode())
{
if (true === IsUserSave)
{
this.UserSavedIndex = this.Index;
this.ForceSave = false;
}
}
else
{
this.ForceSave = false;
}
};
AscCommon.CHistory.prototype.Have_Changes = function(IsNotUserSave, IsNoSavedNoModifyed)
{
var checkIndex = (this.Is_UserSaveMode() && !IsNotUserSave) ? this.UserSavedIndex : this.SavedIndex;
if (-1 === this.Index && null === checkIndex && false === this.ForceSave)
{
if (window["AscDesktopEditor"])
{
if (0 != window["AscDesktopEditor"]["LocalFileGetOpenChangesCount"]())
return true;
if (!window["AscDesktopEditor"]["LocalFileGetSaved"]() && IsNoSavedNoModifyed !== true)
return true;
}
return false;
}
return (this.Index != checkIndex || true === this.ForceSave);
};
window["DesktopOfflineAppDocumentApplyChanges"] = function(_changes)
{
for (var i = 0, l = _changes.length; i < l; ++i)
{
window["Asc"]["editor"].CoAuthoringApi.onSaveChanges(_changes[i], null, true);
}
};
/////////////////////////////////////////////////////////
//////////////// SAVE //////////////////////
/////////////////////////////////////////////////////////
window["Asc"]['spreadsheet_api'].prototype.asc_DownloadAs = function(typeFile, bIsDownloadEvent)
{
this.asc_Save(false, true);
};
window["Asc"]['spreadsheet_api'].prototype.asc_isOffline = function()
{
return true;
};
window["DesktopOfflineAppDocumentStartSave"] = function(isSaveAs)
{
window["Asc"]["editor"].sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction, Asc.c_oAscAsyncAction.Save);
var _param = "";
if (isSaveAs === true)
_param += "saveas=true;";
if (AscCommon.AscBrowser.isRetina)
_param += "retina=true;";
window["AscDesktopEditor"]["LocalFileSave"](_param);
};
window["DesktopOfflineAppDocumentEndSave"] = function(error)
{
window["Asc"]["editor"].sync_EndAction(Asc.c_oAscAsyncActionType.BlockInteraction, Asc.c_oAscAsyncAction.Save);
if (0 == error)
DesktopOfflineUpdateLocalName(window["Asc"]["editor"]);
else
AscCommon.History.UserSavedIndex = window["Asc"]["editor"].LastUserSavedIndex;
window["Asc"]["editor"].onUpdateDocumentModified(AscCommon.History.Have_Changes());
window["Asc"]["editor"].LastUserSavedIndex = undefined;
if (2 == error)
window["Asc"]["editor"].sendEvent("asc_onError", c_oAscError.ID.ConvertationSaveError, c_oAscError.Level.NoCritical);
};
window["Asc"]['spreadsheet_api'].prototype["asc_addImageDrawingObject"] = window["Asc"]['spreadsheet_api'].prototype.asc_addImageDrawingObject;
window["Asc"]['spreadsheet_api'].prototype["asc_showImageFileDialog"] = window["Asc"]['spreadsheet_api'].prototype.asc_showImageFileDialog;
window["Asc"]['spreadsheet_api'].prototype["asc_Save"] = window["Asc"]['spreadsheet_api'].prototype.asc_Save;
window["Asc"]['spreadsheet_api'].prototype["asc_DownloadAs"] = window["Asc"]['spreadsheet_api'].prototype.asc_DownloadAs;
window["Asc"]['spreadsheet_api'].prototype["asc_isOffline"] = window["Asc"]['spreadsheet_api'].prototype.asc_isOffline;
window["Asc"]['spreadsheet_api'].prototype["asc_addImage"] = window["Asc"]['spreadsheet_api'].prototype.asc_addImage;
window["DesktopOfflineAppDocumentAddImageEnd"] = function(url)
{
if (url == "")
return;
var ws = window["Asc"]["editor"].wb.getWorksheet();
if (ws)
{
var _url = window["AscDesktopEditor"]["LocalFileGetImageUrl"](url);
ws.objectRender.addImageDrawingObject(AscCommon.g_oDocumentUrls.getImageUrl(_url) , null);
}
};
window["on_editor_native_message"] = function(sCommand, sParam)
{
if (!window["Asc"]["editor"])
return;
if (sCommand == "save")
window["Asc"]["editor"].asc_Save();
else if (sCommand == "saveAs")
window["Asc"]["editor"].asc_Save(false, true);
else if (sCommand == "print")
window["Asc"]["editor"].asc_Print();
};
\ No newline at end of file
/* /*
* (c) Copyright Ascensio System SIA 2010-2017 * (c) Copyright Ascensio System SIA 2010-2017
* *
* This program is a free software product. You can redistribute it and/or * This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL) * modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with * version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement * that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights. * of any third-party rights.
* *
* This program is distributed WITHOUT ANY WARRANTY; without even the implied * This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* *
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, * You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021. * EU, LV-1021.
* *
* The interactive user interfaces in modified source and object code versions * The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under * of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3. * Section 5 of the GNU AGPL version 3.
* *
* Pursuant to Section 7(b) of the License you must retain the original Product * Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to * logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks. * grant you any rights under trademark law for use of our trademarks.
* *
* All the Product's GUI elements, including illustrations and icon sets, as * All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the * well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License * Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* *
*/ */
"use strict"; "use strict";
(/** (/**
* @param {Window} window * @param {Window} window
* @param {undefined} undefined * @param {undefined} undefined
*/ */
function(window, undefined) { function(window, undefined) {
var asc = window["Asc"]; var asc = window["Asc"];
var prot; var prot;
asc['spreadsheet_api'].prototype.asc_addComment = function(oComment) { asc['spreadsheet_api'].prototype.asc_addComment = function(oComment) {
var oPlace = oComment.bDocument ? this.wb : this.wb.getWorksheet(); var oPlace = oComment.bDocument ? this.wb : this.wb.getWorksheet();
oPlace.cellCommentator.addComment(oComment); oPlace.cellCommentator.addComment(oComment);
}; };
prot = asc['spreadsheet_api'].prototype; prot = asc['spreadsheet_api'].prototype;
prot['asc_addComment'] = prot.asc_addComment; prot['asc_addComment'] = prot.asc_addComment;
AscCommonExcel.CCellCommentator.prototype.addComment = function(comment, bIsNotUpdate) { AscCommonExcel.CCellCommentator.prototype.addComment = function(comment, bIsNotUpdate) {
var t = this; var t = this;
var oComment = comment; var oComment = comment;
var bChange = false; var bChange = false;
oComment.wsId = this.model.getId(); oComment.wsId = this.model.getId();
oComment.setId(); oComment.setId();
if (!oComment.bDocument) { if (!oComment.bDocument) {
if (!bIsNotUpdate) { if (!bIsNotUpdate) {
var activeCell = this.model.selectionRange.activeCell; var activeCell = this.model.selectionRange.activeCell;
oComment.asc_putCol(activeCell.col); oComment.asc_putCol(activeCell.col);
oComment.asc_putRow(activeCell.row); oComment.asc_putRow(activeCell.row);
} }
var existComments = this.getComments(oComment.nCol, oComment.nRow); var existComments = this.getComments(oComment.nCol, oComment.nRow);
if (existComments.length) { if (existComments.length) {
oComment = existComments[0]; oComment = existComments[0];
bChange = true; bChange = true;
} }
} }
var onAddCommentCallback = function (isSuccess) { var onAddCommentCallback = function (isSuccess) {
if (false === isSuccess) if (false === isSuccess)
return; return;
t._addComment(oComment, bChange, bIsNotUpdate); t._addComment(oComment, bChange, bIsNotUpdate);
}; };
if (bIsNotUpdate) { if (bIsNotUpdate) {
onAddCommentCallback(true); onAddCommentCallback(true);
} else { } else {
this.isLockedComment(oComment, onAddCommentCallback); this.isLockedComment(oComment, onAddCommentCallback);
} }
}; };
})(window); })(window);
@charset "UTF-8"; @charset "UTF-8";
/* /*
* Worksheet canvas * Worksheet canvas
* -------------------------------------------------------- * --------------------------------------------------------
*/ */
#ws-canvas-outer { #ws-canvas-outer {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
#ws-canvas { #ws-canvas {
border: 0; border: 0;
} }
#ws-canvas-overlay, #ws-canvas-graphic, #ws-canvas-graphic-overlay { #ws-canvas-overlay, #ws-canvas-graphic, #ws-canvas-graphic-overlay {
border: 0; border: 0;
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
z-index: 1; z-index: 1;
} }
/* /*
* Worksheet scroll bars * Worksheet scroll bars
* -------------------------------------------------------- * --------------------------------------------------------
*/ */
#ws-v-scrollbar { #ws-v-scrollbar {
position: absolute; position: absolute;
right: 0; right: 0;
width: 19px; width: 19px;
top: -1px; top: -1px;
bottom: 18px; bottom: 18px;
overflow: hidden; overflow: hidden;
z-index: 10; z-index: 10;
} }
#ws-v-scroll-helper { #ws-v-scroll-helper {
width: 1px; width: 1px;
} }
#ws-h-scrollbar { #ws-h-scrollbar {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
height: 19px; height: 19px;
left: 0; left: 0;
right: 18px; right: 18px;
overflow: hidden; overflow: hidden;
z-index: 10; z-index: 10;
} }
#ws-h-scroll-helper { #ws-h-scroll-helper {
height: 1px; height: 1px;
} }
#ws-scrollbar-corner { #ws-scrollbar-corner {
position: absolute; position: absolute;
right: 0; right: 0;
bottom: 0; bottom: 0;
width: 18px; width: 18px;
height: 18px; height: 18px;
background-color: #DCE2E8; background-color: #DCE2E8;
border: 0; border: 0;
z-index: 10; z-index: 10;
} }
/* Scrollbars common */ /* Scrollbars common */
#ws-v-scrollbar .jspVerticalBar, #ws-v-scrollbar .jspVerticalBar,
#ws-h-scrollbar .jspHorizontalBar, #ws-h-scrollbar .jspHorizontalBar,
#ws-v-scrollbar .jspTrack, #ws-v-scrollbar .jspTrack,
#ws-h-scrollbar .jspTrack { #ws-h-scrollbar .jspTrack {
background-color: #DCE2E8; background-color: #DCE2E8;
} }
#ws-v-scrollbar .jspDrag, #ws-v-scrollbar .jspDrag,
#ws-h-scrollbar .jspDrag { #ws-h-scrollbar .jspDrag {
background-color: #C0C0C0; background-color: #C0C0C0;
} }
#ws-v-scrollbar .jspDrag.jspHover, #ws-v-scrollbar .jspDrag.jspHover,
#ws-v-scrollbar .jspDrag.jspActive, #ws-v-scrollbar .jspDrag.jspActive,
#ws-h-scrollbar .jspDrag.jspHover, #ws-h-scrollbar .jspDrag.jspHover,
#ws-h-scrollbar .jspDrag.jspActive { #ws-h-scrollbar .jspDrag.jspActive {
background-color: #808080; background-color: #808080;
} }
/* Vertical scrollbar */ /* Vertical scrollbar */
#ws-v-scrollbar .jspVerticalBar { #ws-v-scrollbar .jspVerticalBar {
width: 7px; width: 7px;
border-left: 1px solid #C1C6CC; border-left: 1px solid #C1C6CC;
} }
#ws-v-scrollbar .jspTrack { #ws-v-scrollbar .jspTrack {
width: 8px; width: 8px;
} }
/* Horizontal scrollbar */ /* Horizontal scrollbar */
#ws-h-scrollbar .jspHorizontalBar { #ws-h-scrollbar .jspHorizontalBar {
height: 7px; height: 7px;
border-top: 1px solid #C1C6CC; border-top: 1px solid #C1C6CC;
} }
#ws-h-scrollbar .jspTrack { #ws-h-scrollbar .jspTrack {
height: 8px; height: 8px;
} }
@charset "UTF-8"; @charset "UTF-8";
/* /*
* Worksheet canvas * Worksheet canvas
* -------------------------------------------------------- * --------------------------------------------------------
*/ */
#ws-canvas-outer { #ws-canvas-outer {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
right: 14px; right: 14px;
bottom: 14px; bottom: 14px;
overflow: hidden; overflow: hidden;
} }
#ws-canvas { #ws-canvas {
border: 0; border: 0;
-webkit-user-select: none; -webkit-user-select: none;
} }
#ws-canvas-overlay, #ws-canvas-graphic, #ws-canvas-graphic-overlay { #ws-canvas-overlay, #ws-canvas-graphic, #ws-canvas-graphic-overlay {
-webkit-user-select: none; -webkit-user-select: none;
border: 0; border: 0;
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
z-index: 1; z-index: 1;
} }
/* /*
* Worksheet scroll bars * Worksheet scroll bars
* -------------------------------------------------------- * --------------------------------------------------------
*/ */
#ws-v-scrollbar { #ws-v-scrollbar {
position: absolute; position: absolute;
right: 0; right: 0;
width: 14px; width: 14px;
top: 0px; top: 0px;
bottom: 14px; bottom: 14px;
overflow: hidden; overflow: hidden;
z-index: 10; z-index: 10;
background-color: #f1f1f1; background-color: #f1f1f1;
} }
#ws-v-scroll-helper { #ws-v-scroll-helper {
width: 1px; width: 1px;
} }
#ws-h-scrollbar { #ws-h-scrollbar {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
height: 14px; height: 14px;
left: 0px; left: 0px;
right: 14px; right: 14px;
overflow: hidden; overflow: hidden;
z-index: 10; z-index: 10;
background-color: #f1f1f1; background-color: #f1f1f1;
} }
#ws-h-scroll-helper { #ws-h-scroll-helper {
height: 1px; height: 1px;
} }
#ws-scrollbar-corner { #ws-scrollbar-corner {
position: absolute; position: absolute;
right: 0; right: 0;
bottom: 0; bottom: 0;
width: 14px; width: 14px;
height: 14px; height: 14px;
background-color: #F4F4F4; background-color: #F4F4F4;
border: 0; border: 0;
z-index: 10; z-index: 10;
} }
/* Scrollbars common */ /* Scrollbars common */
#ws-v-scrollbar .jspVerticalBar, #ws-v-scrollbar .jspVerticalBar,
#ws-h-scrollbar .jspHorizontalBar, #ws-h-scrollbar .jspHorizontalBar,
#ws-v-scrollbar .jspTrack, #ws-v-scrollbar .jspTrack,
#ws-h-scrollbar .jspTrack { #ws-h-scrollbar .jspTrack {
background-color: #DCE2E8; background-color: #DCE2E8;
} }
#ws-v-scrollbar .jspDrag, #ws-v-scrollbar .jspDrag,
#ws-h-scrollbar .jspDrag { #ws-h-scrollbar .jspDrag {
background-color: #C0C0C0; background-color: #C0C0C0;
} }
#ws-v-scrollbar .jspDrag.jspHover, #ws-v-scrollbar .jspDrag.jspHover,
#ws-v-scrollbar .jspDrag.jspActive, #ws-v-scrollbar .jspDrag.jspActive,
#ws-h-scrollbar .jspDrag.jspHover, #ws-h-scrollbar .jspDrag.jspHover,
#ws-h-scrollbar .jspDrag.jspActive { #ws-h-scrollbar .jspDrag.jspActive {
background-color: #808080; background-color: #808080;
} }
/* Vertical scrollbar */ /* Vertical scrollbar */
#ws-v-scrollbar .jspVerticalBar { #ws-v-scrollbar .jspVerticalBar {
width: 7px; width: 7px;
border-left: 1px solid #C1C6CC; border-left: 1px solid #C1C6CC;
} }
#ws-v-scrollbar .jspTrack { #ws-v-scrollbar .jspTrack {
width: 8px; width: 8px;
} }
/* Horizontal scrollbar */ /* Horizontal scrollbar */
#ws-h-scrollbar .jspHorizontalBar { #ws-h-scrollbar .jspHorizontalBar {
height: 7px; height: 7px;
border-top: 1px solid #C1C6CC; border-top: 1px solid #C1C6CC;
} }
#ws-h-scrollbar .jspTrack { #ws-h-scrollbar .jspTrack {
height: 8px; height: 8px;
} }
/* /*
* Cell editor * Cell editor
* -------------------------------------------------------- * --------------------------------------------------------
*/ */
#ce-canvas-outer { #ce-canvas-outer {
position: absolute; position: absolute;
border: 0; border: 0;
overflow: hidden; overflow: hidden;
} }
#ce-canvas, #ce-canvas,
#ce-canvas-overlay { #ce-canvas-overlay {
border: 0; border: 0;
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
} }
#ce-cursor { #ce-cursor {
position: absolute; position: absolute;
background-color: #000; background-color: #000;
width: 1px; width: 1px;
height: 11pt; height: 11pt;
cursor: text; cursor: text;
} }
#apiPopUpSelector { #apiPopUpSelector {
position: absolute; position: absolute;
} }
#apiPopUpList { #apiPopUpList {
width: 100%; width: 100%;
height: 100%; height: 100%;
max-height: 210px; max-height: 210px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
} }
#apiPopUpList li { #apiPopUpList li {
max-width: 500px; max-width: 500px;
} }
\ No newline at end of file
...@@ -640,7 +640,7 @@ ...@@ -640,7 +640,7 @@
return this; return this;
}; };
DrawingContext.prototype.save = function () { DrawingContext.prototype.save = function () {
this.nctx["PD_Save"](); this.nctx["PD_Save"]();
return this; return this;
......
...@@ -415,8 +415,8 @@ ...@@ -415,8 +415,8 @@
t.newTextFormat = opt.fragments[first.index].format.clone(); t.newTextFormat = opt.fragments[first.index].format.clone();
} }
t._setFormatProperty(t.newTextFormat, prop, val); t._setFormatProperty(t.newTextFormat, prop, val);
t._update();
} }
} }
}; };
...@@ -809,15 +809,15 @@ ...@@ -809,15 +809,15 @@
var bbox = AscCommonExcel.g_oRangeCache.getActiveRange(this.options.cellName); var bbox = AscCommonExcel.g_oRangeCache.getActiveRange(this.options.cellName);
this._formula = new AscCommonExcel.parserFormula(s.substr(1), null, ws); this._formula = new AscCommonExcel.parserFormula(s.substr(1), null, ws);
this._formula.parse(true, true); var refPos = this._formula.parse(true, true);
var r, offset, _e, _s, wsName = null, refStr, isName = false, _sColorPos; var r, offset, _e, _s, wsName = null, refStr, isName = false, _sColorPos;
if (this._formula.RefPos && this._formula.RefPos.length > 0) { if (refPos && refPos.length > 0) {
for (var index = 0; index < this._formula.RefPos.length; index++) { for (var index = 0; index < refPos.length; index++) {
wsName = null; wsName = null;
isName = false; isName = false;
r = this._formula.RefPos[index]; r = refPos[index];
offset = r.end; offset = r.end;
_e = r.end; _e = r.end;
...@@ -935,12 +935,12 @@ ...@@ -935,12 +935,12 @@
var bbox = AscCommonExcel.g_oRangeCache.getActiveRange(this.options.cellName); var bbox = AscCommonExcel.g_oRangeCache.getActiveRange(this.options.cellName);
this._formula = new AscCommonExcel.parserFormula(s.substr(1), null, ws); this._formula = new AscCommonExcel.parserFormula(s.substr(1), null, ws);
this._formula.parse(true, true); var refPos = this._formula.parse(true, true);
if (this._formula.RefPos && this._formula.RefPos.length > 0) { if (refPos && refPos.length > 0) {
for (var index = 0; index < this._formula.RefPos.length; index++) { for (var index = 0; index < refPos.length; index++) {
wsName = null; wsName = null;
r = this._formula.RefPos[index]; r = refPos[index];
offset = r.end; offset = r.end;
_e = r.end; _e = r.end;
...@@ -1491,6 +1491,7 @@ ...@@ -1491,6 +1491,7 @@
}; };
CellEditor.prototype._moveCursor = function (kind, pos) { CellEditor.prototype._moveCursor = function (kind, pos) {
this.newTextFormat = null;
var t = this; var t = this;
this.sAutoComplete = null; this.sAutoComplete = null;
switch (kind) { switch (kind) {
...@@ -2119,7 +2120,7 @@ ...@@ -2119,7 +2120,7 @@
if ( !tmp ) { if ( !tmp ) {
return; return;
} }
tmp = this.options.fragments[tmp.index].format; tmp = this.newTextFormat || this.options.fragments[tmp.index].format;
var va = tmp.getVerticalAlign(); var va = tmp.getVerticalAlign();
var fc = tmp.getColor(); var fc = tmp.getColor();
var result = new AscCommonExcel.asc_CFont(); var result = new AscCommonExcel.asc_CFont();
...@@ -2640,6 +2641,8 @@ ...@@ -2640,6 +2641,8 @@
this._moveCursor(kPosition, startWord); this._moveCursor(kPosition, startWord);
this._selectChars(kPosition, endWord); this._selectChars(kPosition, endWord);
} }
} else if (2 === event.button) {
this.handlers.trigger('onContextMenu', event);
} }
return true; return true;
}; };
...@@ -2647,7 +2650,6 @@ ...@@ -2647,7 +2650,6 @@
/** @param event {MouseEvent} */ /** @param event {MouseEvent} */
CellEditor.prototype._onMouseUp = function (event) { CellEditor.prototype._onMouseUp = function (event) {
if (2 === event.button) { if (2 === event.button) {
this.handlers.trigger('onContextMenu', event);
return true; return true;
} }
this.isSelectMode = c_oAscCellEditorSelectState.no; this.isSelectMode = c_oAscCellEditorSelectState.no;
......
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