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
303c7501
Commit
303c7501
authored
Aug 09, 2016
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm asc_onAdvancedOptions, asc_setAdvancedOptions
parent
ccf2e293
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
115 additions
and
15 deletions
+115
-15
cell/Local/api.js
cell/Local/api.js
+13
-5
cell/api.js
cell/api.js
+23
-3
common/AdvancedOptions.js
common/AdvancedOptions.js
+12
-0
common/apiBase.js
common/apiBase.js
+2
-2
common/commonDefines.js
common/commonDefines.js
+2
-1
slide/api.js
slide/api.js
+34
-0
word/Local/api.js
word/Local/api.js
+3
-1
word/api.js
word/api.js
+26
-3
No files found.
cell/Local/api.js
View file @
303c7501
...
...
@@ -75,11 +75,17 @@ var c_oAscError = Asc.c_oAscError;
this
.
onUpdateDocumentModified
(
AscCommon
.
History
.
Is_Modified
());
};
asc
[
'
spreadsheet_api
'
].
prototype
.
_onNeedParams
=
function
(
data
)
asc
[
'
spreadsheet_api
'
].
prototype
.
_onNeedParams
=
function
(
data
,
opt_isPassword
)
{
var
options
;
if
(
opt_isPassword
){
options
=
new
AscCommon
.
asc_CAdvancedOptions
(
Asc
.
c_oAscAdvancedOptionsID
.
DRM
);
}
else
{
var
cp
=
JSON
.
parse
(
"
{
\"
codepage
\"
:46,
\"
delimiter
\"
:1}
"
);
cp
[
'
encodings
'
]
=
AscCommon
.
getEncodingParams
();
this
.
handlers
.
trigger
(
"
asc_onAdvancedOptions
"
,
new
AscCommon
.
asc_CAdvancedOptions
(
Asc
.
c_oAscAdvancedOptionsID
.
CSV
,
cp
),
AscCommon
.
c_oAscAdvancedOptionsAction
.
Open
);
options
=
new
AscCommon
.
asc_CAdvancedOptions
(
Asc
.
c_oAscAdvancedOptionsID
.
CSV
,
cp
);
}
this
.
handlers
.
trigger
(
"
asc_onAdvancedOptions
"
,
options
,
AscCommon
.
c_oAscAdvancedOptionsAction
.
Open
);
};
asc
[
'
spreadsheet_api
'
].
prototype
.
asc_addImageDrawingObject
=
function
(
url
)
...
...
@@ -105,7 +111,9 @@ var c_oAscError = Asc.c_oAscError;
window
[
"
Asc
"
][
'
spreadsheet_api
'
].
prototype
.
asc_setAdvancedOptions
=
function
(
idOption
,
option
)
{
if
(
c_oAscAdvancedOptionsID
.
CSV
===
idOption
)
{
window
[
"
AscDesktopEditor
"
][
"
SetAdvancedOptions
"
](
""
+
option
.
asc_getCodePage
(),
""
+
option
.
asc_getDelimiter
());
}
};
window
[
"
Asc
"
][
'
spreadsheet_api
'
].
prototype
[
"
asc_setAdvancedOptions
"
]
=
window
[
"
Asc
"
][
'
spreadsheet_api
'
].
prototype
.
asc_setAdvancedOptions
;
...
...
cell/api.js
View file @
303c7501
...
...
@@ -677,6 +677,24 @@ var editor;
this
.
_asc_downloadAs
(
c_oAscFileType
.
CSV
,
c_oAscAsyncAction
.
DownloadAs
,
options
);
}
break
;
case
c_oAscAdvancedOptionsID
.
DRM
:
// Проверяем тип состояния в данный момент
if
(
this
.
advancedOptionsAction
===
c_oAscAdvancedOptionsAction
.
Open
)
{
var
v
=
{
"
id
"
:
this
.
documentId
,
"
userid
"
:
this
.
documentUserId
,
"
format
"
:
this
.
documentFormat
,
"
vkey
"
:
this
.
documentVKey
,
"
c
"
:
"
reopen
"
,
"
url
"
:
this
.
documentUrl
,
"
title
"
:
this
.
documentTitle
,
"
embeddedfonts
"
:
this
.
isUseEmbeddedCutFonts
,
"
password
"
:
option
.
asc_getPassword
()
};
sendCommand
(
this
,
null
,
v
);
}
break
;
}
};
// Опции страницы (для печати)
...
...
@@ -690,17 +708,19 @@ var editor;
return
this
.
wbModel
.
getWorksheet
(
sheetIndex
).
PagePrintOptions
;
};
spreadsheet_api
.
prototype
.
_onNeedParams
=
function
(
data
)
{
spreadsheet_api
.
prototype
.
_onNeedParams
=
function
(
data
,
opt_isPassword
)
{
var
t
=
this
;
// Проверяем, возможно нам пришли опции для CSV
if
(
this
.
documentOpenOptions
)
{
if
(
this
.
documentOpenOptions
&&
!
opt_isPassword
)
{
var
codePageCsv
=
AscCommon
.
c_oAscEncodingsMap
[
this
.
documentOpenOptions
[
"
codePage
"
]]
||
AscCommon
.
c_oAscCodePageUtf8
,
delimiterCsv
=
this
.
documentOpenOptions
[
"
delimiter
"
];
if
(
null
!=
codePageCsv
&&
null
!=
delimiterCsv
)
{
this
.
asc_setAdvancedOptions
(
c_oAscAdvancedOptionsID
.
CSV
,
new
asc
.
asc_CCSVAdvancedOptions
(
codePageCsv
,
delimiterCsv
));
return
;
}
}
if
(
data
)
{
if
(
opt_isPassword
)
{
t
.
handlers
.
trigger
(
"
asc_onAdvancedOptions
"
,
new
AscCommon
.
asc_CAdvancedOptions
(
c_oAscAdvancedOptionsID
.
DRM
),
this
.
advancedOptionsAction
);
}
else
if
(
data
)
{
AscCommon
.
loadFileContent
(
data
,
function
(
result
)
{
if
(
null
===
result
)
{
t
.
handlers
.
trigger
(
"
asc_onError
"
,
c_oAscError
.
ID
.
Unknown
,
c_oAscError
.
Level
.
Critical
);
...
...
common/AdvancedOptions.js
View file @
303c7501
...
...
@@ -107,6 +107,13 @@
asc_CTXTAdvancedOptions
.
prototype
.
asc_getCodePage
=
function
(){
return
this
.
codePage
;};
asc_CTXTAdvancedOptions
.
prototype
.
asc_setCodePage
=
function
(
v
){
this
.
codePage
=
v
;};
/** @constructor */
function
asc_CDRMAdvancedOptions
(
password
){
this
.
password
=
password
;
}
asc_CDRMAdvancedOptions
.
prototype
.
asc_getPassword
=
function
(){
return
this
.
password
;};
asc_CDRMAdvancedOptions
.
prototype
.
asc_setPassword
=
function
(
v
){
this
.
password
=
v
;};
/** @constructor */
function
asc_CCodePage
(){
this
.
codePageName
=
null
;
...
...
@@ -185,6 +192,11 @@
prot
[
"
asc_getCodePage
"
]
=
prot
.
asc_getCodePage
;
prot
[
"
asc_setCodePage
"
]
=
prot
.
asc_setCodePage
;
window
[
"
Asc
"
].
asc_CDRMAdvancedOptions
=
window
[
"
Asc
"
][
"
asc_CDRMAdvancedOptions
"
]
=
asc_CDRMAdvancedOptions
;
prot
=
asc_CDRMAdvancedOptions
.
prototype
;
prot
[
"
asc_getPassword
"
]
=
prot
.
asc_getPassword
;
prot
[
"
asc_setPassword
"
]
=
prot
.
asc_setPassword
;
prot
=
asc_CCodePage
.
prototype
;
prot
[
"
asc_getCodePageName
"
]
=
prot
.
asc_getCodePageName
;
prot
[
"
asc_setCodePageName
"
]
=
prot
.
asc_setCodePageName
;
...
...
common/apiBase.js
View file @
303c7501
...
...
@@ -431,7 +431,7 @@
baseEditorsApi
.
prototype
.
_onOpenCommand
=
function
(
data
)
{
};
baseEditorsApi
.
prototype
.
_onNeedParams
=
function
(
data
)
baseEditorsApi
.
prototype
.
_onNeedParams
=
function
(
data
,
opt_isPassword
)
{
};
baseEditorsApi
.
prototype
.
asyncServerIdEndLoaded
=
function
()
...
...
@@ -633,7 +633,7 @@
t
.
_onNeedParams
(
input
[
"
data
"
]);
break
;
case
"
needpassword
"
:
t
.
sendEvent
(
"
asc_onError
"
,
Asc
.
c_oAscError
.
ID
.
ConvertationPassword
,
c_oAscError
.
Level
.
Critical
);
t
.
_onNeedParams
(
null
,
true
);
break
;
case
"
err
"
:
t
.
sendEvent
(
"
asc_onError
"
,
AscCommon
.
mapAscServerErrorToAscError
(
parseInt
(
input
[
"
data
"
])),
c_oAscError
.
Level
.
Critical
);
...
...
common/commonDefines.js
View file @
303c7501
...
...
@@ -179,7 +179,8 @@
var
c_oAscAdvancedOptionsID
=
{
CSV
:
0
,
TXT
:
1
TXT
:
1
,
DRM
:
2
};
var
c_oAscAdvancedOptionsAction
=
{
...
...
slide/api.js
View file @
303c7501
...
...
@@ -2059,6 +2059,32 @@ background-repeat: no-repeat;\
asc_docs_api
.
prototype
.
Help
=
function
()
{
};
/*
idOption идентификатор дополнительного параметра, c_oAscAdvancedOptionsID.TXT.
option - какие свойства применить, пока массив. для TXT объект asc_CTXTAdvancedOptions(codepage)
exp: asc_setAdvancedOptions(c_oAscAdvancedOptionsID.TXT, new Asc.asc_CCSVAdvancedOptions(1200) );
*/
asc_docs_api
.
prototype
.
asc_setAdvancedOptions
=
function
(
idOption
,
option
)
{
switch
(
idOption
)
{
case
c_oAscAdvancedOptionsID
.
DRM
:
var
v
=
{
"
id
"
:
this
.
documentId
,
"
userid
"
:
this
.
documentUserId
,
"
format
"
:
this
.
documentFormat
,
"
vkey
"
:
this
.
documentVKey
,
"
c
"
:
"
reopen
"
,
"
url
"
:
this
.
documentUrl
,
"
title
"
:
this
.
documentTitle
,
"
embeddedfonts
"
:
this
.
isUseEmbeddedCutFonts
,
"
password
"
:
option
.
asc_getPassword
()
};
sendCommand
(
this
,
null
,
v
);
break
;
}
};
asc_docs_api
.
prototype
.
startGetDocInfo
=
function
()
{
...
...
@@ -5928,6 +5954,13 @@ background-repeat: no-repeat;\
this
.
asc_fireCallback
(
"
asc_onContextMenu
"
,
Data
);
};
asc_docs_api
.
prototype
.
_onNeedParams
=
function
(
data
,
opt_isPassword
)
{
if
(
opt_isPassword
)
{
this
.
asc_fireCallback
(
"
asc_onAdvancedOptions
"
,
new
AscCommon
.
asc_CAdvancedOptions
(
c_oAscAdvancedOptionsID
.
DRM
),
c_oAscAdvancedOptionsAction
.
Open
);
}
};
asc_docs_api
.
prototype
.
_onOpenCommand
=
function
(
data
)
{
var
t
=
this
;
...
...
@@ -6487,6 +6520,7 @@ background-repeat: no-repeat;\
asc_docs_api
.
prototype
[
'
AddURL
'
]
=
asc_docs_api
.
prototype
.
AddURL
;
asc_docs_api
.
prototype
[
'
Help
'
]
=
asc_docs_api
.
prototype
.
Help
;
asc_docs_api
.
prototype
[
'
startGetDocInfo
'
]
=
asc_docs_api
.
prototype
.
startGetDocInfo
;
asc_docs_api
.
prototype
[
'
asc_setAdvancedOptions
'
]
=
asc_docs_api
.
prototype
.
asc_setAdvancedOptions
;;
asc_docs_api
.
prototype
[
'
stopGetDocInfo
'
]
=
asc_docs_api
.
prototype
.
stopGetDocInfo
;
asc_docs_api
.
prototype
[
'
sync_DocInfoCallback
'
]
=
asc_docs_api
.
prototype
.
sync_DocInfoCallback
;
asc_docs_api
.
prototype
[
'
sync_GetDocInfoStartCallback
'
]
=
asc_docs_api
.
prototype
.
sync_GetDocInfoStartCallback
;
...
...
word/Local/api.js
View file @
303c7501
...
...
@@ -83,7 +83,9 @@ window["DesktopOfflineAppDocumentEndLoad"] = function(_url, _data)
Asc
[
'
asc_docs_api
'
].
prototype
.
asc_setAdvancedOptions
=
function
(
idOption
,
option
)
{
if
(
c_oAscAdvancedOptionsID
.
CSV
===
idOption
)
{
window
[
"
AscDesktopEditor
"
][
"
SetAdvancedOptions
"
](
""
+
option
.
asc_getCodePage
());
}
};
Asc
[
'
asc_docs_api
'
].
prototype
[
"
asc_setAdvancedOptions
"
]
=
Asc
[
'
asc_docs_api
'
].
prototype
.
asc_setAdvancedOptions
;
...
...
word/api.js
View file @
303c7501
...
...
@@ -2177,6 +2177,23 @@ background-repeat: no-repeat;\
this
.
_downloadAs
(
"
save
"
,
c_oAscFileType
.
TXT
,
c_oAscAsyncAction
.
DownloadAs
,
options
,
null
);
}
break
;
case
c_oAscAdvancedOptionsID
.
DRM
:
if
(
this
.
advancedOptionsAction
===
c_oAscAdvancedOptionsAction
.
Open
)
{
var
v
=
{
"
id
"
:
this
.
documentId
,
"
userid
"
:
this
.
documentUserId
,
"
format
"
:
this
.
documentFormat
,
"
vkey
"
:
this
.
documentVKey
,
"
c
"
:
"
reopen
"
,
"
url
"
:
this
.
documentUrl
,
"
title
"
:
this
.
documentTitle
,
"
embeddedfonts
"
:
this
.
isUseEmbeddedCutFonts
,
"
password
"
:
option
.
asc_getPassword
()
};
sendCommand
(
this
,
null
,
v
);
}
break
;
}
};
asc_docs_api
.
prototype
.
SetFontRenderingMode
=
function
(
mode
)
...
...
@@ -7389,10 +7406,16 @@ background-repeat: no-repeat;\
editor
.
SpellCheckApi
.
onSpellCheck
(
response
);
};
asc_docs_api
.
prototype
.
_onNeedParams
=
function
(
data
)
asc_docs_api
.
prototype
.
_onNeedParams
=
function
(
data
,
opt_isPassword
)
{
var
cp
=
{
'
codepage
'
:
AscCommon
.
c_oAscCodePageUtf8
,
'
encodings
'
:
AscCommon
.
getEncodingParams
()};
this
.
asc_fireCallback
(
"
asc_onAdvancedOptions
"
,
new
AscCommon
.
asc_CAdvancedOptions
(
c_oAscAdvancedOptionsID
.
TXT
,
cp
),
this
.
advancedOptionsAction
);
var
options
;
if
(
opt_isPassword
)
{
options
=
new
AscCommon
.
asc_CAdvancedOptions
(
c_oAscAdvancedOptionsID
.
DRM
);
}
else
{
var
cp
=
{
'
codepage
'
:
AscCommon
.
c_oAscCodePageUtf8
,
'
encodings
'
:
AscCommon
.
getEncodingParams
()};
options
=
new
AscCommon
.
asc_CAdvancedOptions
(
c_oAscAdvancedOptionsID
.
TXT
,
cp
);
}
this
.
asc_fireCallback
(
"
asc_onAdvancedOptions
"
,
options
,
this
.
advancedOptionsAction
);
};
asc_docs_api
.
prototype
.
_onOpenCommand
=
function
(
data
)
{
...
...
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