Commit 3d536247 authored by Alexey.Musinov's avatar Alexey.Musinov

open documents with password (ios)

parent 83d09cb5
...@@ -363,7 +363,7 @@ window.clearInterval = clearInterval; ...@@ -363,7 +363,7 @@ window.clearInterval = clearInterval;
window.setInterval = setInterval; window.setInterval = setInterval;
var console = { var console = {
log : function(param) { window.native.consoleLog(param); }, log : function(param) { window["native"]["consoleLog"](param); },
time : function (param) {}, time : function (param) {},
timeEnd : function (param) {} timeEnd : function (param) {}
}; };
......
...@@ -3887,6 +3887,8 @@ function OfflineEditor () { ...@@ -3887,6 +3887,8 @@ function OfflineEditor () {
var docInfo = new Asc.asc_CDocInfo(); var docInfo = new Asc.asc_CDocInfo();
docInfo.put_Id(this.initSettings["docKey"]); docInfo.put_Id(this.initSettings["docKey"]);
docInfo.put_Url(this.initSettings["docURL"]);
docInfo.put_Format("xlsx");
docInfo.put_UserInfo(userInfo); docInfo.put_UserInfo(userInfo);
_api.asc_setDocInfo(docInfo); _api.asc_setDocInfo(docInfo);
...@@ -4077,6 +4079,13 @@ function OfflineEditor () { ...@@ -4077,6 +4079,13 @@ function OfflineEditor () {
me.needToUpdateVersion = true; me.needToUpdateVersion = true;
if (callback) callback.call(me); if (callback) callback.call(me);
}); });
_api.asc_registerCallback("asc_onAdvancedOptions", function(options) {
var stream = global_memory_stream_menu;
stream["ClearNoAttack"]();
stream["WriteLong"](options.asc_getOptionId());
window["native"]["OnCallMenuEvent"](22000, stream); // ASC_MENU_EVENT_TYPE_ADVANCED_OPTIONS
});
}; };
this.updateFrozen = function () { this.updateFrozen = function () {
var ws = _api.wb.getWorksheet(); var ws = _api.wb.getWorksheet();
...@@ -7415,6 +7424,12 @@ window["native"]["offline_apply_event"] = function(type,params) { ...@@ -7415,6 +7424,12 @@ window["native"]["offline_apply_event"] = function(type,params) {
case 'session' : case 'session' :
t._onSession(dataObject); t._onSession(dataObject);
break; break;
case 'refreshToken' :
t._onRefreshToken(dataObject["messages"]);
break;
case 'expiredToken' :
t._onExpiredToken();
break;
} }
break; break;
...@@ -7451,6 +7466,12 @@ window["native"]["offline_apply_event"] = function(type,params) { ...@@ -7451,6 +7466,12 @@ window["native"]["offline_apply_event"] = function(type,params) {
break; break;
} }
case 22001: // ASC_MENU_EVENT_TYPE_SET_PASSWORD
{
_api.asc_setDocumentPassword(params[0]);
break;
}
default: default:
break; break;
} }
...@@ -7458,6 +7479,22 @@ window["native"]["offline_apply_event"] = function(type,params) { ...@@ -7458,6 +7479,22 @@ window["native"]["offline_apply_event"] = function(type,params) {
return _return; return _return;
} }
window["Asc"]["spreadsheet_api"].prototype.asc_setDocumentPassword = function(password)
{
var v = {
"id": this.documentId,
"userid": this.documentUserId,
"format": this.documentFormat,
"c": "reopen",
"url": this.documentUrl,
"title": this.documentTitle,
"embeddedfonts": this.isUseEmbeddedCutFonts,
"password": password
};
AscCommon.sendCommand(this, null, v);
};
function testLockedObjects () { function testLockedObjects () {
var ws = _api.wb.getWorksheet(); var ws = _api.wb.getWorksheet();
......
...@@ -2255,6 +2255,12 @@ Asc['asc_docs_api'].prototype["Call_Menu_Event"] = function(type, _params) ...@@ -2255,6 +2255,12 @@ Asc['asc_docs_api'].prototype["Call_Menu_Event"] = function(type, _params)
case 'session' : case 'session' :
t._onSession(dataObject); t._onSession(dataObject);
break; break;
case 'refreshToken' :
t._onRefreshToken(dataObject["messages"]);
break;
case 'expiredToken' :
t._onExpiredToken();
break;
} }
break; break;
...@@ -2294,12 +2300,42 @@ Asc['asc_docs_api'].prototype["Call_Menu_Event"] = function(type, _params) ...@@ -2294,12 +2300,42 @@ Asc['asc_docs_api'].prototype["Call_Menu_Event"] = function(type, _params)
break; break;
} }
case 21001: // ASC_COAUTH_EVENT_TYPE_LOAD_URL_IMAGE
{
_api.WordControl.m_oDrawingDocument.ClearCachePages();
_api.WordControl.m_oDrawingDocument.FirePaint();
break;
}
case 22001: // ASC_MENU_EVENT_TYPE_SET_PASSWORD
{
_api.asc_setDocumentPassword(_params[0]);
break;
}
default: default:
break; break;
} }
return _return; return _return;
}; };
Asc['asc_docs_api'].prototype.asc_setDocumentPassword = function(password)
{
var v = {
"id": this.documentId,
"userid": this.documentUserId,
"format": this.documentFormat,
"c": "reopen",
"url": this.documentUrl,
"title": this.documentTitle,
"embeddedfonts": this.isUseEmbeddedCutFonts,
"password": password
};
AscCommon.sendCommand(this, null, v);
};
function asc_menu_WriteHeaderFooterPr(_hdrftrPr, _stream) function asc_menu_WriteHeaderFooterPr(_hdrftrPr, _stream)
{ {
if (_hdrftrPr.Type !== undefined && _hdrftrPr.Type !== null) if (_hdrftrPr.Type !== undefined && _hdrftrPr.Type !== null)
...@@ -5787,10 +5823,19 @@ function NativeOpenFile3(_params, documentInfo) ...@@ -5787,10 +5823,19 @@ function NativeOpenFile3(_params, documentInfo)
var docInfo = new Asc.asc_CDocInfo(); var docInfo = new Asc.asc_CDocInfo();
docInfo.put_Id(window.documentInfo["docKey"]); docInfo.put_Id(window.documentInfo["docKey"]);
docInfo.put_Url(window.documentInfo["docURL"]);
docInfo.put_Format("docx");
docInfo.put_UserInfo(userInfo); docInfo.put_UserInfo(userInfo);
_api.asc_setDocInfo(docInfo); _api.asc_setDocInfo(docInfo);
_api.asc_registerCallback("asc_onAdvancedOptions", function(options) {
var stream = global_memory_stream_menu;
stream["ClearNoAttack"]();
stream["WriteLong"](options.asc_getOptionId());
window["native"]["OnCallMenuEvent"](22000, stream); // ASC_MENU_EVENT_TYPE_ADVANCED_OPTIONS
});
if (window.documentInfo["iscoauthoring"]) { if (window.documentInfo["iscoauthoring"]) {
_api.isSpellCheckEnable = false; _api.isSpellCheckEnable = false;
...@@ -6000,7 +6045,6 @@ Asc['asc_docs_api'].prototype.openDocument = function(sData) ...@@ -6000,7 +6045,6 @@ Asc['asc_docs_api'].prototype.openDocument = function(sData)
}; };
window["AscCommon"].getFullImageSrc2 = function (src) { window["AscCommon"].getFullImageSrc2 = function (src) {
var start = src.slice(0, 6); var start = src.slice(0, 6);
if (0 === start.indexOf('theme') && editor.ThemeLoader){ if (0 === start.indexOf('theme') && editor.ThemeLoader){
return editor.ThemeLoader.ThemesUrlAbs + src; return editor.ThemeLoader.ThemesUrlAbs + src;
......
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