Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
3d536247
Commit
3d536247
authored
Apr 06, 2017
by
Alexey.Musinov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
open documents with password (ios)
parent
83d09cb5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
201 additions
and
120 deletions
+201
-120
cell/native/common.js
cell/native/common.js
+8
-8
cell/native/native.js
cell/native/native.js
+94
-57
common/Native/Wrappers/api.js
common/Native/Wrappers/api.js
+99
-55
No files found.
cell/native/common.js
View file @
3d536247
...
...
@@ -363,7 +363,7 @@ window.clearInterval = clearInterval;
window
.
setInterval
=
setInterval
;
var
console
=
{
log
:
function
(
param
)
{
window
.
native
.
consoleLog
(
param
);
},
log
:
function
(
param
)
{
window
[
"
native
"
][
"
consoleLog
"
]
(
param
);
},
time
:
function
(
param
)
{},
timeEnd
:
function
(
param
)
{}
};
...
...
cell/native/native.js
View file @
3d536247
...
...
@@ -3887,6 +3887,8 @@ function OfflineEditor () {
var
docInfo
=
new
Asc
.
asc_CDocInfo
();
docInfo
.
put_Id
(
this
.
initSettings
[
"
docKey
"
]);
docInfo
.
put_Url
(
this
.
initSettings
[
"
docURL
"
]);
docInfo
.
put_Format
(
"
xlsx
"
);
docInfo
.
put_UserInfo
(
userInfo
);
_api
.
asc_setDocInfo
(
docInfo
);
...
...
@@ -4077,6 +4079,13 @@ function OfflineEditor () {
me
.
needToUpdateVersion
=
true
;
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
()
{
var
ws
=
_api
.
wb
.
getWorksheet
();
...
...
@@ -7415,6 +7424,12 @@ window["native"]["offline_apply_event"] = function(type,params) {
case
'
session
'
:
t
.
_onSession
(
dataObject
);
break
;
case
'
refreshToken
'
:
t
.
_onRefreshToken
(
dataObject
[
"
messages
"
]);
break
;
case
'
expiredToken
'
:
t
.
_onExpiredToken
();
break
;
}
break
;
...
...
@@ -7451,6 +7466,12 @@ window["native"]["offline_apply_event"] = function(type,params) {
break
;
}
case
22001
:
// ASC_MENU_EVENT_TYPE_SET_PASSWORD
{
_api
.
asc_setDocumentPassword
(
params
[
0
]);
break
;
}
default
:
break
;
}
...
...
@@ -7458,6 +7479,22 @@ window["native"]["offline_apply_event"] = function(type,params) {
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
()
{
var
ws
=
_api
.
wb
.
getWorksheet
();
...
...
common/Native/Wrappers/api.js
View file @
3d536247
...
...
@@ -2255,6 +2255,12 @@ Asc['asc_docs_api'].prototype["Call_Menu_Event"] = function(type, _params)
case
'
session
'
:
t
.
_onSession
(
dataObject
);
break
;
case
'
refreshToken
'
:
t
.
_onRefreshToken
(
dataObject
[
"
messages
"
]);
break
;
case
'
expiredToken
'
:
t
.
_onExpiredToken
();
break
;
}
break
;
...
...
@@ -2294,12 +2300,42 @@ Asc['asc_docs_api'].prototype["Call_Menu_Event"] = function(type, _params)
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
:
break
;
}
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
)
{
if
(
_hdrftrPr
.
Type
!==
undefined
&&
_hdrftrPr
.
Type
!==
null
)
...
...
@@ -5787,10 +5823,19 @@ function NativeOpenFile3(_params, documentInfo)
var
docInfo
=
new
Asc
.
asc_CDocInfo
();
docInfo
.
put_Id
(
window
.
documentInfo
[
"
docKey
"
]);
docInfo
.
put_Url
(
window
.
documentInfo
[
"
docURL
"
]);
docInfo
.
put_Format
(
"
docx
"
);
docInfo
.
put_UserInfo
(
userInfo
);
_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
"
])
{
_api
.
isSpellCheckEnable
=
false
;
...
...
@@ -6000,7 +6045,6 @@ Asc['asc_docs_api'].prototype.openDocument = function(sData)
};
window
[
"
AscCommon
"
].
getFullImageSrc2
=
function
(
src
)
{
var
start
=
src
.
slice
(
0
,
6
);
if
(
0
===
start
.
indexOf
(
'
theme
'
)
&&
editor
.
ThemeLoader
){
return
editor
.
ThemeLoader
.
ThemesUrlAbs
+
src
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment