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
4f26ed19
Commit
4f26ed19
authored
May 19, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add signatures view
parent
a410e150
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
127 additions
and
1 deletion
+127
-1
common/Local/common.js
common/Local/common.js
+21
-1
common/apiBase.js
common/apiBase.js
+28
-0
common/apiCommon.js
common/apiCommon.js
+49
-0
word/api.js
word/api.js
+29
-0
No files found.
common/Local/common.js
View file @
4f26ed19
...
...
@@ -240,8 +240,28 @@ window["asc_initAdvancedOptions"] = function(_code)
window
[
"
DesktopOfflineAppDocumentSignatures
"
]
=
function
(
_json
)
{
var
_editor
=
window
[
"
Asc
"
][
"
editor
"
]
?
window
[
"
Asc
"
][
"
editor
"
]
:
window
.
editor
;
_editor
.
signatures
=
[];
var
_signatures
=
JSON
.
parse
(
_json
);
console
.
log
(
_signatures
);
var
_count
=
_signatures
[
"
count
"
];
var
_data
=
_signatures
[
"
data
"
];
var
_sign
;
var
_add_sign
;
for
(
var
i
=
0
;
i
<
_count
;
i
++
)
{
_sign
=
_data
[
i
];
_add_sign
=
new
window
[
"
AscCommon
"
].
asc_CSignarureLine
();
_add_sign
.
guid
=
_sign
[
"
guid
"
];
_add_sign
.
valid
=
_sign
[
"
valid
"
];
_add_sign
.
image
=
(
_add_sign
.
valid
==
0
)
?
_sign
[
"
image_valid
"
]
:
_sign
[
"
image_invalid
"
];
_add_sign
.
signer1
=
_sign
[
"
name
"
];
_add_sign
.
id
=
i
;
_editor
.
signatures
.
push
(
_add_sign
);
}
};
// меняем среду
...
...
common/apiBase.js
View file @
4f26ed19
...
...
@@ -163,6 +163,8 @@
this
.
lastWorkTime
=
0
;
this
.
signatures
=
[];
return
this
;
}
...
...
@@ -1259,6 +1261,32 @@
};
// signatures
baseEditorsApi
.
prototype
.
asc_AddSignarureLine2
=
function
(
_obj
)
{
function
s4
()
{
return
Math
.
floor
((
1
+
Math
.
random
())
*
0x10000
).
toString
(
16
).
substring
(
1
);
}
function
guid
()
{
return
s4
()
+
s4
()
+
'
-
'
+
s4
()
+
'
-
'
+
s4
()
+
'
-
'
+
s4
()
+
'
-
'
+
s4
()
+
s4
()
+
s4
();
}
return
this
.
asc_addSignatureLine
(
guid
(),
_obj
.
asc_getSigner1
(),
_obj
.
asc_getSigner2
(),
_obj
.
asc_getEmail
());
};
baseEditorsApi
.
prototype
.
asc_Sign
=
function
(
guid
)
{
if
(
window
[
"
AscDesktopEditor
"
])
window
[
"
AscDesktopEditor
"
][
"
Sign
"
](
guid
);
};
baseEditorsApi
.
prototype
.
asc_ViewSign
=
function
(
id
)
{
if
(
window
[
"
AscDesktopEditor
"
])
window
[
"
AscDesktopEditor
"
][
"
ViewCertificate
"
](
guid
);
};
baseEditorsApi
.
prototype
.
asc_getSignatures
=
function
()
{
return
this
.
signatures
;
};
baseEditorsApi
.
prototype
.
asc_getSignatureImage
=
function
(
sGuid
)
{
return
""
;
};
...
...
common/apiCommon.js
View file @
4f26ed19
...
...
@@ -121,6 +121,38 @@
View
:
4
};
function
asc_CSignarureLine
()
{
this
.
id
=
undefined
;
this
.
guid
=
""
;
this
.
signer1
=
""
;
this
.
signer2
=
""
;
this
.
email
=
""
;
this
.
instructions
=
""
;
this
.
showDate
=
false
;
this
.
valid
=
0
;
this
.
image
=
""
;
}
asc_CSignarureLine
.
prototype
.
asc_getId
=
function
(){
return
this
.
id
;
};
asc_CSignarureLine
.
prototype
.
asc_setId
=
function
(
v
){
this
.
id
=
v
;
};
asc_CSignarureLine
.
prototype
.
asc_getGuid
=
function
(){
return
this
.
guid
;
};
asc_CSignarureLine
.
prototype
.
asc_setGuid
=
function
(
v
){
this
.
guid
=
v
;
};
asc_CSignarureLine
.
prototype
.
asc_getSigner1
=
function
(){
return
this
.
signer1
;
};
asc_CSignarureLine
.
prototype
.
asc_setSigner1
=
function
(
v
){
this
.
signer1
=
v
;
};
asc_CSignarureLine
.
prototype
.
asc_getSigner2
=
function
(){
return
this
.
signer2
;
};
asc_CSignarureLine
.
prototype
.
asc_setSigner2
=
function
(
v
){
this
.
signer2
=
v
;
};
asc_CSignarureLine
.
prototype
.
asc_getEmail
=
function
(){
return
this
.
email
;
};
asc_CSignarureLine
.
prototype
.
asc_setEmail
=
function
(
v
){
this
.
email
=
v
;
};
asc_CSignarureLine
.
prototype
.
asc_getInstructions
=
function
(){
return
this
.
instructions
;
};
asc_CSignarureLine
.
prototype
.
asc_setInstructions
=
function
(
v
){
this
.
instructions
=
v
;
};
asc_CSignarureLine
.
prototype
.
asc_getShowDate
=
function
(){
return
this
.
showDate
;
};
asc_CSignarureLine
.
prototype
.
asc_setShowDate
=
function
(
v
){
this
.
showDate
=
v
;
};
asc_CSignarureLine
.
prototype
.
asc_getValid
=
function
(){
return
this
.
valid
;
};
asc_CSignarureLine
.
prototype
.
asc_setValid
=
function
(
v
){
this
.
valid
=
v
;
};
/**
* Класс asc_CAscEditorPermissions для прав редакторов
* -----------------------------------------------------------------------------
...
...
@@ -3163,6 +3195,23 @@
prot
[
'
Comment
'
]
=
prot
.
Comment
;
prot
[
'
View
'
]
=
prot
.
View
;
window
[
"
AscCommon
"
][
"
asc_CSignarureLine
"
]
=
window
[
"
AscCommon
"
].
asc_CSignarureLine
=
asc_CSignarureLine
;
prot
=
asc_CSignarureLine
.
prototype
;
prot
[
"
asc_getId
"
]
=
prot
.
asc_getId
;
prot
[
"
asc_setId
"
]
=
prot
.
asc_setId
;
prot
[
"
asc_getGuid
"
]
=
prot
.
asc_getGuid
;
prot
[
"
asc_setGuid
"
]
=
prot
.
asc_setGuid
;
prot
[
"
asc_getSigner1
"
]
=
prot
.
asc_getSigner1
;
prot
[
"
asc_setSigner1
"
]
=
prot
.
asc_setSigner1
;
prot
[
"
asc_getSigner2
"
]
=
prot
.
asc_getSigner2
;
prot
[
"
asc_setSigner2
"
]
=
prot
.
asc_setSigner2
;
prot
[
"
asc_getEmail
"
]
=
prot
.
asc_getEmail
;
prot
[
"
asc_setEmail
"
]
=
prot
.
asc_setEmail
;
prot
[
"
asc_getInstructions
"
]
=
prot
.
asc_getInstructions
;
prot
[
"
asc_setInstructions
"
]
=
prot
.
asc_setInstructions
;
prot
[
"
asc_getShowDate
"
]
=
prot
.
asc_getShowDate
;
prot
[
"
asc_setShowDate
"
]
=
prot
.
asc_setShowDate
;
window
[
"
AscCommon
"
].
asc_CAscEditorPermissions
=
asc_CAscEditorPermissions
;
prot
=
asc_CAscEditorPermissions
.
prototype
;
prot
[
"
asc_getLicenseType
"
]
=
prot
.
asc_getLicenseType
;
...
...
word/api.js
View file @
4f26ed19
...
...
@@ -3501,6 +3501,15 @@ background-repeat: no-repeat;\
}
};
// signatures
asc_docs_api
.
prototype
.
asc_AddSignarureLine2
=
function
(
_obj
)
{
function
s4
()
{
return
Math
.
floor
((
1
+
Math
.
random
())
*
0x10000
).
toString
(
16
).
substring
(
1
);
}
function
guid
()
{
return
s4
()
+
s4
()
+
'
-
'
+
s4
()
+
'
-
'
+
s4
()
+
'
-
'
+
s4
()
+
'
-
'
+
s4
()
+
s4
()
+
s4
();
}
return
this
.
asc_addSignatureLine
(
guid
(),
_obj
.
asc_getSigner1
(),
_obj
.
asc_getSigner2
(),
_obj
.
asc_getEmail
());
};
asc_docs_api
.
prototype
.
asc_addSignatureLine
=
function
(
sGuid
,
sSigner
,
sSigner2
,
sEmail
)
{
if
(
false
===
this
.
WordControl
.
m_oLogicDocument
.
Document_Is_SelectionLocked
(
AscCommon
.
changestype_Document_Content_Add
))
{
...
...
@@ -3519,6 +3528,20 @@ background-repeat: no-repeat;\
return
this
.
WordControl
.
m_oLogicDocument
.
GetAllSignatures
();
};
asc_docs_api
.
prototype
.
asc_Sign
=
function
(
guid
)
{
if
(
window
[
"
AscDesktopEditor
"
])
window
[
"
AscDesktopEditor
"
][
"
Sign
"
](
guid
);
};
asc_docs_api
.
prototype
.
asc_ViewSign
=
function
(
id
)
{
if
(
window
[
"
AscDesktopEditor
"
])
window
[
"
AscDesktopEditor
"
][
"
ViewSertificate
"
](
guid
);
};
//////////////////////////////////////////////////////////////////////////
asc_docs_api
.
prototype
.
IncreaseIndent
=
function
()
{
this
.
WordControl
.
m_oLogicDocument
.
IncreaseIndent
();
...
...
@@ -8244,6 +8267,12 @@ background-repeat: no-repeat;\
// signatures
asc_docs_api
.
prototype
[
"
asc_AddSignarureLine2
"
]
=
asc_docs_api
.
prototype
.
asc_AddSignarureLine2
;
asc_docs_api
.
prototype
[
"
asc_Sign
"
]
=
asc_docs_api
.
prototype
.
asc_Sign
;
asc_docs_api
.
prototype
[
"
asc_ViewSign
"
]
=
asc_docs_api
.
prototype
.
asc_ViewSign
;
asc_docs_api
.
prototype
[
"
asc_getSignatures
"
]
=
asc_docs_api
.
prototype
.
asc_getSignatures
;
CDocInfoProp
.
prototype
[
'
get_PageCount
'
]
=
CDocInfoProp
.
prototype
.
get_PageCount
;
CDocInfoProp
.
prototype
[
'
put_PageCount
'
]
=
CDocInfoProp
.
prototype
.
put_PageCount
;
CDocInfoProp
.
prototype
[
'
get_WordsCount
'
]
=
CDocInfoProp
.
prototype
.
get_WordsCount
;
...
...
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