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
a893d380
Commit
a893d380
authored
Jul 05, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add recalculate workbook after the plugin
parent
02c70890
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
40 deletions
+48
-40
cell/api.js
cell/api.js
+10
-2
common/plugins.js
common/plugins.js
+38
-38
No files found.
cell/api.js
View file @
a893d380
...
...
@@ -3215,6 +3215,16 @@ var editor;
return
_ret
.
data
;
};
spreadsheet_api
.
prototype
.
asc_canPaste
=
function
()
{
History
.
Create_NewPoint
();
History
.
StartTransaction
();
return
true
;
};
spreadsheet_api
.
prototype
.
asc_Recalculate
=
function
()
{
History
.
EndTransaction
();
this
.
_onUpdateAfterApplyChanges
();
};
spreadsheet_api
.
prototype
.
_onEndLoadSdk
=
function
()
{
History
=
AscCommon
.
History
;
...
...
@@ -3511,6 +3521,4 @@ var editor;
prot
[
"
asc_pluginButtonClick
"
]
=
prot
.
asc_pluginButtonClick
;
prot
[
"
asc_addOleObject
"
]
=
prot
.
asc_addOleObject
;
prot
[
"
asc_editOleObject
"
]
=
prot
.
asc_editOleObject
;
prot
[
"
asc_Recalculate
"
]
=
prot
.
asc_Recalculate
;
prot
[
"
asc_canPaste
"
]
=
prot
.
asc_canPaste
;
})(
window
);
common/plugins.js
View file @
a893d380
...
...
@@ -348,51 +348,51 @@
window
.
g_asc_plugins
.
closeAttackTimer
=
-
1
;
}
if
(
value
&&
value
!=
""
)
{
try
{
if
(
window
.
g_asc_plugins
.
api
.
asc_canPaste
())
{
if
(
value
&&
value
!=
""
)
{
try
{
if
(
window
.
g_asc_plugins
.
api
.
asc_canPaste
())
{
var
_script
=
"
(function(){ var Api = window.g_asc_plugins.api;
\n
"
+
value
+
"
})();
"
;
eval
(
_script
);
var
oLogicDocument
=
window
.
g_asc_plugins
.
api
.
WordControl
?
window
.
g_asc_plugins
.
api
.
WordControl
.
m_oLogicDocument
:
null
;
if
(
pluginData
.
getAttribute
(
"
recalculate
"
)
==
true
)
{
if
(
pluginData
.
getAttribute
(
"
recalculate
"
)
==
true
)
{
var
editorId
=
window
.
g_asc_plugins
.
api
.
getEditorId
();
if
(
AscCommon
.
c_oEditorId
.
Word
===
editorId
)
{
var
oLogicDocument
=
window
.
g_asc_plugins
.
api
.
WordControl
?
window
.
g_asc_plugins
.
api
.
WordControl
.
m_oLogicDocument
:
null
;
var
_fonts
=
oLogicDocument
.
Document_Get_AllFontNames
();
var
_imagesArray
=
oLogicDocument
.
Get_AllImageUrls
();
var
_images
=
{};
for
(
var
i
=
0
;
i
<
_imagesArray
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
_imagesArray
.
length
;
i
++
)
{
_images
[
_imagesArray
[
i
]]
=
_imagesArray
[
i
];
}
window
.
g_asc_plugins
.
images_rename
=
_images
;
AscCommon
.
Check_LoadingDataBeforePrepaste
(
window
.
g_asc_plugins
.
api
,
_fonts
,
_images
,
function
()
{
AscCommon
.
Check_LoadingDataBeforePrepaste
(
window
.
g_asc_plugins
.
api
,
_fonts
,
_images
,
function
()
{
if
(
window
.
g_asc_plugins
.
api
.
WordControl
&&
window
.
g_asc_plugins
.
api
.
WordControl
.
m_oLogicDocument
&&
window
.
g_asc_plugins
.
api
.
WordControl
.
m_oLogicDocument
.
Reassign_ImageUrls
)
{
window
.
g_asc_plugins
.
api
.
WordControl
.
m_oLogicDocument
.
Reassign_ImageUrls
(
window
.
g_asc_plugins
.
images_rename
);
window
.
g_asc_plugins
.
api
.
WordControl
.
m_oLogicDocument
.
Reassign_ImageUrls
)
{
window
.
g_asc_plugins
.
api
.
WordControl
.
m_oLogicDocument
.
Reassign_ImageUrls
(
window
.
g_asc_plugins
.
images_rename
);
}
delete
window
.
g_asc_plugins
.
images_rename
;
window
.
g_asc_plugins
.
api
.
asc_Recalculate
();
});
}
else
if
(
AscCommon
.
c_oEditorId
.
Spreadsheet
===
editorId
)
{
window
.
g_asc_plugins
.
api
.
asc_Recalculate
();
}
}
}
catch
(
err
)
{
}
catch
(
err
)
{
}
}
if
(
"
close
"
==
name
)
if
(
"
close
"
==
name
)
{
window
.
g_asc_plugins
.
close
();
}
}
}
}
if
(
window
.
addEventListener
)
{
...
...
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