Commit df6949da authored by Alexey Golubev's avatar Alexey Golubev

Merge branch 'hotfix/v4.1.5'

parents 7adfe8a5 cef6dfae
......@@ -3,15 +3,15 @@ call npm install -g grunt-cli
call npm install
rem call grunt --level=WHITESPACE_ONLY --desktop=true --formatting=PRETTY_PRINT
call grunt --level=ADVANCED --desktop=true
copy ..\word\sdk-all.js ..\..\core\build\jsdesktop\word\sdk-all.js
copy ..\slide\sdk-all.js ..\..\core\build\jsdesktop\slide\sdk-all.js
copy ..\cell\sdk-all.js ..\..\core\build\jsdesktop\cell\sdk-all.js
copy ..\word\sdk-all.js ..\..\core\build\jsdesktop\sdkjs\word\sdk-all.js
copy ..\slide\sdk-all.js ..\..\core\build\jsdesktop\sdkjs\slide\sdk-all.js
copy ..\cell\sdk-all.js ..\..\core\build\jsdesktop\sdkjs\cell\sdk-all.js
copy ..\word\sdk-all-min.js ..\..\core\build\jsdesktop\word\sdk-all-min.js
copy ..\slide\sdk-all-min.js ..\..\core\build\jsdesktop\slide\sdk-all-min.js
copy ..\cell\sdk-all-min.js ..\..\core\build\jsdesktop\cell\sdk-all-min.js
copy ..\word\sdk-all-min.js ..\..\core\build\jsdesktop\sdkjs\word\sdk-all-min.js
copy ..\slide\sdk-all-min.js ..\..\core\build\jsdesktop\sdkjs\slide\sdk-all-min.js
copy ..\cell\sdk-all-min.js ..\..\core\build\jsdesktop\sdkjs\cell\sdk-all-min.js
copy ..\common\Native\native.js ..\..\core\build\jsdesktop\common\Native\native.js
copy ..\common\Native\native.js ..\..\core\build\jsdesktop\sdkjs\common\Native\native.js
copy ..\word\sdk-all.js ..\..\core-ext\desktop-sdk-wrapper\test\src\build\win_64\Debug\Local\editors\sdkjs\word\sdk-all.js
copy ..\slide\sdk-all.js ..\..\core-ext\desktop-sdk-wrapper\test\src\build\win_64\Debug\Local\editors\sdkjs\slide\sdk-all.js
......
......@@ -53,6 +53,8 @@ var c_oAscError = Asc.c_oAscError;
{
this.asc_registerCallback('asc_onDocumentContentReady', function(){
DesktopOfflineUpdateLocalName(window["Asc"]["editor"]);
setTimeout(function(){window["UpdateInstallPlugins"]();}, 10);
});
window["AscDesktopEditor"]["LocalStartOpen"]();
......
......@@ -456,7 +456,7 @@ var editor;
spreadsheet_api.prototype.asc_Copy = function() {
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Copy"]();
window["asc_desktop_copypaste"](this, "Copy");
return true;
}
return AscCommon.g_clipboardBase.Button_Copy();
......@@ -465,7 +465,7 @@ var editor;
spreadsheet_api.prototype.asc_Paste = function() {
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Paste"]();
window["asc_desktop_copypaste"](this, "Paste");
return true;
}
if (!AscCommon.g_clipboardBase.IsWorking()) {
......@@ -477,7 +477,7 @@ var editor;
spreadsheet_api.prototype.asc_Cut = function() {
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Cut"]();
window["asc_desktop_copypaste"](this, "Cut");
return true;
}
return AscCommon.g_clipboardBase.Button_Cut();
......
......@@ -575,7 +575,7 @@ CImageShape.prototype.draw = function(graphics, transform)
graphics.SetIntegerGrid(false);
graphics.transform3(_transform, false);
var shape_drawer = new AscCommon.CShapeDrawer();
if(this.pen || this.brush)
if(this.getObjectType() !== AscDFH.historyitem_type_OleObject && (this.pen || this.brush))
{
shape_drawer.fromShape2(this, graphics, this.spPr.geometry);
shape_drawer.draw(this.spPr.geometry);
......
......@@ -2021,7 +2021,7 @@
if (this.HtmlPage.m_oApi.isMobileVersion)
{
var _w = this.HtmlPage.m_oEditor.HtmlElement.width;
if (this.bIsRetinaSupport)
if (this.HtmlPage.bIsRetinaSupport)
{
_w >>= 1;
}
......
......@@ -199,6 +199,7 @@ window["NativeCorrectImageUrlOnPaste"] = function(url)
window["UpdateInstallPlugins"] = function()
{
var _plugins = JSON.parse(window["AscDesktopEditor"]["GetInstallPlugins"]());
_plugins["url"] = _plugins["url"].replace(" ", "%20");
var _editor = window["Asc"]["editor"] ? window["Asc"]["editor"] : window.editor;
_editor.sendEvent("asc_onPluginsInit", _plugins);
};
......@@ -232,6 +233,17 @@ window["asc_initAdvancedOptions"] = function(_code)
_editor._onNeedParams(undefined, (_code == 90 || _code == 91) ? true : undefined);
};
// copy/paste focus error!!!
window["asc_desktop_copypaste"] = function(_api, _method)
{
var bIsFocus = _api.asc_IsFocus();
if (!bIsFocus)
_api.asc_enableKeyEvents(true);
window["AscDesktopEditor"][_method]();
if (!bIsFocus)
_api.asc_enableKeyEvents(false);
}
// меняем среду
//AscBrowser.isSafari = false;
//AscBrowser.isSafariMacOs = false;
......
......@@ -772,7 +772,10 @@
baseEditorsApi.prototype.asc_loadLocalImageAndAction = function(sLocalImage, fCallback)
{
this.ImageLoader.LoadImage(AscCommon.getFullImageSrc2(sLocalImage), 1);
var _loadedUrl = this.ImageLoader.LoadImage(AscCommon.getFullImageSrc2(sLocalImage), 1);
if (_loadedUrl != null)
fCallback(_loadedUrl);
else
this.asc_replaceLoadImageCallback(fCallback);
};
......@@ -803,6 +806,9 @@
baseEditorsApi.prototype.asc_addOleObject = function(oPluginData)
{
if(this.isViewMode){
return;
}
Asc.CPluginData_wrap(oPluginData);
var oThis = this;
var sImgSrc = oPluginData.getAttribute("imgSrc");
......@@ -826,6 +832,9 @@
baseEditorsApi.prototype.asc_editOleObject = function(oPluginData)
{
if(this.isViewMode){
return;
}
Asc.CPluginData_wrap(oPluginData);
var oThis = this;
var bResize = oPluginData.getAttribute("resize");
......
......@@ -160,6 +160,8 @@
// еще один режим для ie & edge
this.IsUseInputEventOnlyWithCtx = (AscCommon.AscBrowser.isIE) ? true : false;
this.IsInitialInputContext = false;
this.IsDisableKeyPress = false;
}
CTextInput.prototype =
......@@ -234,14 +236,32 @@
var oThis = this;
this.HtmlArea["onkeydown"] = function(e)
{
if (AscCommon.AscBrowser.isSafariMacOs)
{
var cmdButton = (e.ctrlKey || e.metaKey) ? true : false;
var buttonCode = ((e.keyCode == 67) || (e.keyCode == 88) || (e.keyCode == 86));
if (cmdButton && buttonCode)
oThis.IsDisableKeyPress = true;
else
oThis.IsDisableKeyPress = false;
}
return oThis.onKeyDown(e);
};
this.HtmlArea["onkeypress"] = function(e)
{
if (oThis.IsDisableKeyPress == true)
{
// macOS Sierra send keypress before copy event
oThis.IsDisableKeyPress = false;
var cmdButton = (e.ctrlKey || e.metaKey) ? true : false;
if (cmdButton)
return;
}
return oThis.onKeyPress(e);
};
this.HtmlArea["onkeyup"] = function(e)
{
oThis.IsDisableKeyPress = false;
return oThis.onKeyUp(e);
};
......@@ -1529,6 +1549,13 @@
this.InterfaceEnableKeyEvents = value;
if (true == this.InterfaceEnableKeyEvents)
{
if (document.activeElement)
{
var _id = document.activeElement.id;
if (_id == "area_id" || _id == "plugin_iframe")
return;
}
this.HtmlArea.focus();
}
},
......
......@@ -5100,6 +5100,7 @@ CPresentation.prototype =
return true;
}
}
this.Document_UpdateInterfaceState();
}
},
......
......@@ -42,6 +42,8 @@ Asc['asc_docs_api'].prototype._OfflineAppDocumentStartLoad = function()
{
this.asc_registerCallback('asc_onDocumentContentReady', function(){
DesktopOfflineUpdateLocalName(editor);
setTimeout(function(){window["UpdateInstallPlugins"]();}, 10);
});
AscCommon.History.UserSaveMode = true;
......
......@@ -1824,7 +1824,7 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Copy"]();
window["asc_desktop_copypaste"](this, "Copy");
return true;
}
return AscCommon.g_clipboardBase.Button_Copy();
......@@ -1837,7 +1837,7 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Cut"]();
window["asc_desktop_copypaste"](this, "Cut");
return true;
}
return AscCommon.g_clipboardBase.Button_Cut();
......@@ -1846,7 +1846,7 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Paste"]();
window["asc_desktop_copypaste"](this, "Paste");
return true;
}
......@@ -3958,6 +3958,17 @@ background-repeat: no-repeat;\
else
{
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
if (window["AscDesktopEditor"])
{
var _url = window["AscDesktopEditor"]["LocalFileGetImageUrl"](sImageUrl);
_url = g_oDocumentUrls.getImageUrl(_url);
ImagePr.ImageUrl = _url;
fApplyCallback();
this.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
return;
}
this.fCurCallback = function(input)
{
if (null != input && "imgurl" == input["type"])
......
......@@ -1853,7 +1853,7 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Copy"]();
window["asc_desktop_copypaste"](this, "Copy");
return true;
}
return AscCommon.g_clipboardBase.Button_Copy();
......@@ -1866,7 +1866,7 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Cut"]();
window["asc_desktop_copypaste"](this, "Cut");
return true;
}
return AscCommon.g_clipboardBase.Button_Cut();
......@@ -1875,7 +1875,7 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Paste"]();
window["asc_desktop_copypaste"](this, "Paste");
return true;
}
if (!this.WordControl.m_oLogicDocument)
......
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