Commit e5f624d5 authored by Alexey.Musinov's avatar Alexey.Musinov

Merge branch 'hotfix/v5.0.1' of https://github.com/ONLYOFFICE/sdkjs into hotfix/v5.0.1

* 'hotfix/v5.0.1' of https://github.com/ONLYOFFICE/sdkjs:
  .
  sogou pinyin chrome input (set window["AscInputMethod"]["SogoudPinyin"] = true)
  added check
  Fix bug 35775 (linux & vivaldi)
  add serverVersion param for version history
parents b1612b73 3e2f34c6
......@@ -3068,8 +3068,8 @@
var documentContent = pasteData.content;
//у родителя(CDocument) проставляю контент. нужно для вставки извне нумерованного списка. ф-ия Internal_GetNumInfo требует наличие этих параграфов в родителе.
var cDocument = documentContent[0] && documentContent[0].Parent instanceof CDocument ? documentContent[0].Parent : null;
if(cDocument.Content && 1 === cDocument.Content.length)
var cDocument = documentContent && documentContent[0] && documentContent[0].Parent instanceof CDocument ? documentContent[0].Parent : null;
if(cDocument && cDocument.Content && 1 === cDocument.Content.length)
{
cDocument.Content = documentContent;
}
......
......@@ -47,6 +47,7 @@
this.changes = null;
this.token = null;
this.isRequested = null;
this.serverVersion = null;
if (newObj) {
this.update(newObj);
......@@ -66,6 +67,7 @@
this.colors = newObj.colors;
this.newChangeId = newObj.currentChangeId;
this.isRequested = newObj.isRequested;
this.serverVersion = newObj.serverVersion;
return bUpdate;
};
asc_CVersionHistory.prototype.applyChanges = function(editor) {
......@@ -98,6 +100,9 @@
asc_CVersionHistory.prototype.asc_setIsRequested = function(val) {
this.isRequested = val;
};
asc_CVersionHistory.prototype.asc_setServerVersion = function(val) {
this.serverVersion = val;
};
window["Asc"].asc_CVersionHistory = window["Asc"]["asc_CVersionHistory"] = asc_CVersionHistory;
prot = asc_CVersionHistory.prototype;
......@@ -108,6 +113,7 @@
prot["asc_setArrColors"] = prot.asc_setArrColors;
prot["asc_setToken"] = prot.asc_setToken;
prot["asc_setIsRequested"] = prot.asc_setIsRequested;
prot["asc_setServerVersion"] = prot.asc_setServerVersion;
})(window);
AscCommon.baseEditorsApi.prototype.asc_showRevision = function(newObj) {
......
......@@ -442,6 +442,7 @@
};
if (versionHistory)
{
rData["serverVersion"] = versionHistory.serverVersion;
rData["closeonerror"] = versionHistory.isRequested;
rData["jwt"] = versionHistory.token;
//чтобы результат пришел только этому соединению, а не всем кто в документе
......
......@@ -54,7 +54,8 @@ var AscBrowser = {
isMozilla : false,
isRetina : false,
isLinuxOS : false,
retinaPixelRatio : 1
retinaPixelRatio : 1,
isVivaldiLinux : false
};
// user agent lower case
......@@ -109,6 +110,8 @@ AscBrowser.isMozilla = !AscBrowser.isIE && (AscBrowser.userAgent.indexOf("firefo
AscBrowser.isLinuxOS = (AscBrowser.userAgent.indexOf(" linux ") > -1);
AscBrowser.isVivaldiLinux = AscBrowser.isLinuxOS && (AscBrowser.userAgent.indexOf("vivaldi") > -1);
AscBrowser.zoom = 1;
AscBrowser.checkZoom = function()
......
......@@ -34,6 +34,8 @@
(function(window, undefined)
{
window["AscInputMethod"] = {};
window["AscInputMethod"]["SogouPinyin"] = false;
///
// такие методы нужны в апи
// baseEditorsApi.prototype.Begin_CompositeInput = function()
......@@ -666,7 +668,8 @@
}
}
if (!this.KeyDownFlag && c_oCompositionState.end == this.compositionState && !this.TextInputAfterComposition && _value != "" && _value != this.ieNonCompositionPrefixConfirm)
var checkInput = (c_oCompositionState.end == this.compositionState && !this.TextInputAfterComposition && _value != "" && _value != this.ieNonCompositionPrefixConfirm) ? true : false;
if (!this.KeyDownFlag && checkInput)
{
ti_console_log("ti: external input");
......@@ -1110,7 +1113,24 @@
if (_code == 13)
this.clear();
var _ret = this.Api.onKeyDown(e);
var isSendToApi = true;
if (window["AscInputMethod"]["SogouPinyin"])
{
if (AscCommon.AscBrowser.isChrome)
{
if ((e.keyCode == 229) && ((e.code == "space") || (e.code == "Space") || (e.key == "Spacebar")))
{
isSendToApi = false;
// no prevent => input enabled (isChromeKeysNoKeyPressPrevent)
}
}
}
if (isSendToApi)
{
var _ret = this.Api.onKeyDown(e);
}
if (!e.defaultPrevented && AscCommon.AscBrowser.isChrome)
this.isChromeKeysNoKeyPressPresent = true;
},
......
......@@ -879,6 +879,16 @@ function CEditorPage(api)
window.editor.EndDemonstration();
});
}
this.m_oBody.HtmlElement.oncontextmenu = function(e)
{
if (AscCommon.AscBrowser.isVivaldiLinux)
{
AscCommon.Window_OnMouseUp(e);
}
AscCommon.stopEvent(e);
return false;
};
}
// --------------------------------------------------------------------------
......
......@@ -561,8 +561,13 @@ function CEditorPage(api)
window.onkeyup = this.onKeyUp;
*/
this.m_oBody.HtmlElement.oncontextmenu = function()
this.m_oBody.HtmlElement.oncontextmenu = function(e)
{
if (AscCommon.AscBrowser.isVivaldiLinux)
{
AscCommon.Window_OnMouseUp(e);
}
AscCommon.stopEvent(e);
return false;
};
//window.oncontextmenu = function() { return false; };
......
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