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
82638d8f
Commit
82638d8f
authored
May 25, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ef5dc3ed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
29 deletions
+57
-29
common/GlobalLoaders.js
common/GlobalLoaders.js
+56
-28
common/apiBase.js
common/apiBase.js
+1
-1
No files found.
common/GlobalLoaders.js
View file @
82638d8f
...
...
@@ -438,8 +438,10 @@
this
.
bIsLoadDocumentImagesNoByOrder
=
true
;
this
.
nNoByOrderCounter
=
0
;
this
.
loadFontCallBack
=
null
;
this
.
loadFontCallBackArgs
=
null
;
this
.
loadImageCallBackCounter
=
0
;
this
.
loadImageCallBackCounterMax
=
0
;
this
.
loadImageCallBack
=
null
;
this
.
loadImageCallBackArgs
=
null
;
var
oThis
=
this
;
...
...
@@ -620,37 +622,63 @@
oImage
.
Image
.
src
=
oImage
.
src
;
};
this
.
LoadImage
WithCallback
=
function
(
src
,
loadFontCallBack
,
loadFont
CallBackArgs
)
this
.
LoadImage
sWithCallback
=
function
(
arr
,
loadImageCallBack
,
loadImage
CallBackArgs
)
{
if
(
this
.
map_image_index
[
src
])
var
arrAsync
=
[];
var
i
=
0
;
for
(
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
loadFontCallBack
.
call
(
this
.
Api
,
loadFontCallBackArgs
);
if
(
this
.
map_image_index
[
arr
[
i
]]
===
undefined
)
arrAsync
.
push
(
arr
[
i
]);
}
if
(
arrAsync
.
length
==
0
)
{
loadImageCallBack
.
call
(
this
.
Api
,
loadImageCallBackArgs
);
return
;
}
this
.
loadFontCallBack
=
loadFontCallBack
;
this
.
loadFontCallBackArgs
=
loadFontCallBackArgs
;
this
.
loadImageCallBackCounter
=
0
;
this
.
loadImageCallBackCounterMax
=
arrAsync
.
length
;
this
.
loadImageCallBack
=
loadImageCallBack
;
this
.
loadImageCallBackArgs
=
loadImageCallBackArgs
;
var
oImage
=
new
CImage
(
src
);
for
(
i
=
0
;
i
<
arrAsync
.
length
;
i
++
)
{
var
oImage
=
new
CImage
(
arrAsync
[
i
]);
oImage
.
Image
=
new
Image
();
oImage
.
Image
.
parentImage
=
oImage
;
oImage
.
Status
=
ImageLoadStatus
.
Loading
;
this
.
map_image_index
[
oImage
.
src
]
=
oImage
;
oImage
.
Image
.
onload
=
function
(){
oImage
.
Status
=
ImageLoadStatus
.
Complete
;
oThis
.
loadFontCallBack
.
call
(
oThis
.
Api
,
oThis
.
loadFontCallBackArgs
);
oThis
.
loadFontCallBack
=
null
;
oThis
.
loadFontCallBackArgs
=
null
;
oImage
.
Image
.
onload
=
function
()
{
this
.
parentImage
.
Status
=
ImageLoadStatus
.
Complete
;
oThis
.
loadImageCallBackCounter
++
;
if
(
oThis
.
loadImageCallBackCounter
==
oThis
.
loadImageCallBackCounterMax
)
oThis
.
LoadImagesWithCallbackEnd
();
};
oImage
.
Image
.
onerror
=
function
(){
oImage
.
Image
=
null
;
oImage
.
Status
=
ImageLoadStatus
.
Complete
;
oThis
.
loadFontCallBack
.
call
(
oThis
.
Api
,
oThis
.
loadFontCallBackArgs
);
oThis
.
loadFontCallBack
=
null
;
oThis
.
loadFontCallBackArgs
=
null
;
oImage
.
Image
.
onerror
=
function
()
{
this
.
parentImage
.
Image
=
null
;
this
.
parentImage
.
Status
=
ImageLoadStatus
.
Complete
;
if
(
oThis
.
loadImageCallBackCounter
==
oThis
.
loadImageCallBackCounterMax
)
oThis
.
LoadImagesWithCallbackEnd
();
};
//oImage.Image.crossOrigin = 'anonymous';
oImage
.
Image
.
src
=
oImage
.
src
;
}
};
this
.
LoadImagesWithCallbackEnd
=
function
()
{
this
.
loadImageCallBack
.
call
(
this
.
Api
,
this
.
loadImageCallBackArgs
);
this
.
loadImageCallBack
=
null
;
this
.
loadImageCallBackArgs
=
null
;
this
.
loadImageCallBackCounterMax
=
0
;
this
.
loadImageCallBackCounter
=
0
;
};
}
...
...
common/apiBase.js
View file @
82638d8f
...
...
@@ -1306,7 +1306,7 @@
var
_args
=
[
guid
(),
_obj
.
asc_getSigner1
(),
_obj
.
asc_getSigner2
(),
_obj
.
asc_getEmail
(),
_w
,
_h
,
_url
];
this
.
ImageLoader
.
LoadImage
WithCallback
(
_url
,
function
(
_args
)
{
this
.
ImageLoader
.
LoadImage
sWithCallback
([
_url
]
,
function
(
_args
)
{
this
.
asc_addSignatureLine
(
_args
[
0
],
_args
[
1
],
_args
[
2
],
_args
[
3
],
_args
[
4
],
_args
[
5
],
_args
[
6
]);
},
_args
);
};
...
...
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