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
fada8909
Commit
fada8909
authored
Aug 26, 2016
by
Sergey Luzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loading fonts and images before recalculate in cell
parent
b096c874
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
4 deletions
+62
-4
cell/api.js
cell/api.js
+22
-3
cell/model/Workbook.js
cell/model/Workbook.js
+22
-0
common/apiBase.js
common/apiBase.js
+3
-0
common/plugins.js
common/plugins.js
+15
-1
No files found.
cell/api.js
View file @
fada8909
...
@@ -3225,10 +3225,29 @@ var editor;
...
@@ -3225,10 +3225,29 @@ var editor;
return
true
;
return
true
;
};
};
spreadsheet_api
.
prototype
.
asc_Recalculate
=
function
()
{
spreadsheet_api
.
prototype
.
asc_Recalculate
=
function
()
{
var
t
=
this
;
this
.
_loadFonts
(
this
.
wbModel
.
generateFontMap
(),
function
()
{
History
.
EndTransaction
();
History
.
EndTransaction
();
t
.
_onUpdateAfterApplyChanges
();
this
.
_onUpdateAfterApplyChanges
();
};
spreadsheet_api
.
prototype
.
pre_Paste
=
function
(
_fonts
,
_images
,
callback
)
{
var
oFontMap
=
{};
for
(
var
i
=
0
;
i
<
_fonts
.
length
;
++
i
){
oFontMap
[
_fonts
[
i
].
name
]
=
1
;
}
this
.
_loadFonts
(
oFontMap
,
function
()
{
var
aImages
=
[];
for
(
var
key
in
_images
){
if
(
_images
.
hasOwnProperty
(
key
)){
aImages
.
push
(
_images
[
key
])
}
}
if
(
aImages
.
length
>
0
)
{
window
[
"
Asc
"
][
"
editor
"
].
ImageLoader
.
LoadDocumentImages
(
aImages
,
null
);
}
callback
();
});
});
};
};
...
...
cell/model/Workbook.js
View file @
fada8909
...
@@ -2507,6 +2507,18 @@ Workbook.prototype.generateFontMap2=function(){
...
@@ -2507,6 +2507,18 @@ Workbook.prototype.generateFontMap2=function(){
aRes
.
push
(
new
AscFonts
.
CFont
(
i
,
0
,
""
,
0
));
aRes
.
push
(
new
AscFonts
.
CFont
(
i
,
0
,
""
,
0
));
return
aRes
;
return
aRes
;
};
};
Workbook
.
prototype
.
getAllImageUrls
=
function
(){
var
aImageUrls
=
[];
for
(
var
i
=
0
;
i
<
this
.
aWorksheets
.
length
;
++
i
){
this
.
aWorksheets
[
i
].
getAllImageUrls
(
aImageUrls
);
}
return
aImageUrls
;
};
Workbook
.
prototype
.
reassignImageUrls
=
function
(
oImages
){
for
(
var
i
=
0
;
i
<
this
.
aWorksheets
.
length
;
++
i
){
this
.
aWorksheets
[
i
].
reassignImageUrls
(
oImages
);
}
};
Workbook
.
prototype
.
recalcWB
=
function
(
isRecalcWB
){
Workbook
.
prototype
.
recalcWB
=
function
(
isRecalcWB
){
//todo
//todo
if
(
this
.
dependencyFormulas
.
getNodesLength
()
>
0
)
{
if
(
this
.
dependencyFormulas
.
getNodesLength
()
>
0
)
{
...
@@ -3408,6 +3420,16 @@ Woorksheet.prototype.generateFontMap=function(oFontMap){
...
@@ -3408,6 +3420,16 @@ Woorksheet.prototype.generateFontMap=function(oFontMap){
}
}
}
}
};
};
Woorksheet
.
prototype
.
getAllImageUrls
=
function
(
aImages
){
for
(
var
i
=
0
;
i
<
this
.
Drawings
.
length
;
++
i
){
this
.
Drawings
[
i
].
graphicObject
.
getAllRasterImages
(
aImages
);
}
};
Woorksheet
.
prototype
.
reassignImageUrls
=
function
(
oImages
){
for
(
var
i
=
0
;
i
<
this
.
Drawings
.
length
;
++
i
){
this
.
Drawings
[
i
].
graphicObject
.
Reassign_ImageUrls
(
oImages
);
}
};
Woorksheet
.
prototype
.
clone
=
function
(
sNewId
,
sName
,
tableNames
){
Woorksheet
.
prototype
.
clone
=
function
(
sNewId
,
sName
,
tableNames
){
var
i
,
elem
,
range
;
var
i
,
elem
,
range
;
var
oNewWs
=
new
Woorksheet
(
this
.
workbook
,
this
.
workbook
.
aWorksheets
.
length
,
sNewId
);
var
oNewWs
=
new
Woorksheet
(
this
.
workbook
,
this
.
workbook
.
aWorksheets
.
length
,
sNewId
);
...
...
common/apiBase.js
View file @
fada8909
...
@@ -1021,6 +1021,9 @@
...
@@ -1021,6 +1021,9 @@
baseEditorsApi
.
prototype
.
onKeyUp
=
function
(
e
)
baseEditorsApi
.
prototype
.
onKeyUp
=
function
(
e
)
{
{
};
};
baseEditorsApi
.
prototype
.
pre_Paste
=
function
(
_fonts
,
_images
,
callback
)
{
};
// System input
// System input
baseEditorsApi
.
prototype
.
SetTextBoxInputMode
=
function
(
bIsEnable
)
baseEditorsApi
.
prototype
.
SetTextBoxInputMode
=
function
(
bIsEnable
)
...
...
common/plugins.js
View file @
fada8909
...
@@ -440,7 +440,21 @@
...
@@ -440,7 +440,21 @@
}
}
else
if
(
AscCommon
.
c_oEditorId
.
Spreadsheet
===
editorId
)
else
if
(
AscCommon
.
c_oEditorId
.
Spreadsheet
===
editorId
)
{
{
window
.
g_asc_plugins
.
api
.
asc_Recalculate
();
var
oApi
=
window
.
g_asc_plugins
.
api
;
var
oFonts
=
oApi
.
wbModel
.
_generateFontMap
();
var
aImages
=
oApi
.
wbModel
.
getAllImageUrls
();
var
oImages
=
{};
for
(
var
i
=
0
;
i
<
aImages
.
length
;
i
++
)
{
oImages
[
aImages
[
i
]]
=
aImages
[
i
];
}
window
.
g_asc_plugins
.
images_rename
=
oImages
;
AscCommon
.
Check_LoadingDataBeforePrepaste
(
window
.
g_asc_plugins
.
api
,
oFonts
,
oImages
,
function
(){
oApi
.
wbModel
.
reassignImageUrls
(
window
.
g_asc_plugins
.
images_rename
);
delete
window
.
g_asc_plugins
.
images_rename
;
window
.
g_asc_plugins
.
api
.
asc_Recalculate
();
});
}
}
}
}
}
}
...
...
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