Commit 2daec6d6 authored by Oleg Korshul's avatar Oleg Korshul

signatures

parent e19621fb
......@@ -73,6 +73,8 @@ var c_oAscError = Asc.c_oAscError;
AscCommon.History.UserSaveMode = true;
DesktopOfflineUpdateLocalName(this);
window["DesktopAfterOpen"](this);
this.onUpdateDocumentModified(AscCommon.History.Have_Changes());
};
......@@ -271,6 +273,16 @@ window["DesktopOfflineAppDocumentEndSave"] = function(error)
if (2 == error)
window["Asc"]["editor"].sendEvent("asc_onError", c_oAscError.ID.ConvertationSaveError, c_oAscError.Level.NoCritical);
if (0 == error)
{
if (window.SaveQuestionObjectBeforeSign)
{
var _obj = window.SaveQuestionObjectBeforeSign;
editor.sendEvent("asc_onSignatureClick", _obj.guid, _obj.width, _obj.height);
window.SaveQuestionObjectBeforeSign = null;
}
}
};
window["Asc"]['spreadsheet_api'].prototype["asc_addImageDrawingObject"] = window["Asc"]['spreadsheet_api'].prototype.asc_addImageDrawingObject;
......
......@@ -295,6 +295,15 @@ window["DesktopOfflineAppDocumentSignatures"] = function(_json)
_editor.sendEvent("asc_onUpdateSignatures", _editor.asc_getSignatures(), _editor.asc_getRequestSignatures());
};
window["DesktopSaveQuestionReturn"] = function(isNeedSaved)
{
if (isNeedSaved)
{
var _editor = window["Asc"]["editor"] ? window["Asc"]["editor"] : window.editor;
_editor.asc_Save(false);
}
};
window["OnNativeReturnCallback"] = function(name, obj)
{
var _api = window["Asc"]["editor"] ? window["Asc"]["editor"] : window.editor;
......@@ -307,6 +316,31 @@ window["OnNativeOpenFilenameDialog"] = function(file)
delete window.on_native_open_filename_dialog;
};
window["DesktopAfterOpen"] = function(_api)
{
_api.asc_registerCallback("asc_onSignatureDblClick", function (guid, width, height)
{
var _length = _api.signatures.length;
for (var i = 0; i < _length; i++)
{
if (_api.signatures[i].guid == guid)
{
window["AscDesktopEditor"]["ViewCertificate"](_api.signatures[i].id);
return;
}
}
if (!_api.isDocumentModify)
{
_api.sendEvent("asc_onSignatureClick", guid, width, height);
return;
}
window.SaveQuestionObjectBeforeSign = { guid : guid, width : width, height : height };
window["AscDesktopEditor"]["SaveQuestion"]();
});
};
// меняем среду
//AscBrowser.isSafari = false;
//AscBrowser.isSafariMacOs = false;
......
......@@ -62,6 +62,8 @@ Asc['asc_docs_api'].prototype._OfflineAppDocumentEndLoad = function(_url, _data)
this.WordControl.m_oLogicDocument.Set_FastCollaborativeEditing(false);
this.DocumentOrientation = (null == this.WordControl.m_oLogicDocument) ? true : !this.WordControl.m_oLogicDocument.Orientation;
DesktopOfflineUpdateLocalName(this);
window["DesktopAfterOpen"](this);
};
window["DesktopOfflineAppDocumentEndLoad"] = function(_url, _data)
{
......@@ -201,6 +203,16 @@ window["DesktopOfflineAppDocumentEndSave"] = function(error)
if (2 == error)
editor.sendEvent("asc_onError", c_oAscError.ID.ConvertationSaveError, c_oAscError.Level.Critical);
if (0 == error)
{
if (window.SaveQuestionObjectBeforeSign)
{
var _obj = window.SaveQuestionObjectBeforeSign;
editor.sendEvent("asc_onSignatureClick", _obj.guid, _obj.width, _obj.height);
window.SaveQuestionObjectBeforeSign = null;
}
}
};
Asc['asc_docs_api'].prototype.asc_DownloadAs = function(typeFile, bIsDownloadEvent)
{
......
......@@ -1302,7 +1302,7 @@ CGraphicObjects.prototype =
},
handleSignatureDblClick: function(sGuid, width, height){
editor.sendEvent("asc_onSignatureClick", sGuid, width, height);
editor.sendEvent("asc_onSignatureDblClick", sGuid, width, height);
},
......
......@@ -67,6 +67,8 @@ Asc['asc_docs_api'].prototype._OfflineAppDocumentEndLoad = function(_url, _data)
this.WordControl.m_oLogicDocument.Set_FastCollaborativeEditing(false);
}
DesktopOfflineUpdateLocalName(this);
window["DesktopAfterOpen"](this);
};
window["DesktopOfflineAppDocumentEndLoad"] = function(_url, _data)
{
......@@ -228,6 +230,16 @@ window["DesktopOfflineAppDocumentEndSave"] = function(error)
if (2 == error)
editor.sendEvent("asc_onError", c_oAscError.ID.ConvertationSaveError, c_oAscError.Level.NoCritical);
if (0 == error)
{
if (window.SaveQuestionObjectBeforeSign)
{
var _obj = window.SaveQuestionObjectBeforeSign;
editor.sendEvent("asc_onSignatureClick", _obj.guid, _obj.width, _obj.height);
window.SaveQuestionObjectBeforeSign = null;
}
}
};
Asc['asc_docs_api'].prototype.asc_DownloadAs = function(typeFile, bIsDownloadEvent)
{
......
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