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
0aaf178f
Commit
0aaf178f
authored
May 24, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugins
parent
b51ce1e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
19 deletions
+48
-19
common/commonDefines.js
common/commonDefines.js
+16
-16
common/plugins.js
common/plugins.js
+32
-3
No files found.
common/commonDefines.js
View file @
0aaf178f
...
@@ -1546,24 +1546,24 @@ window['Asc']['c_oAscMaxCellOrCommentLength'] = window['Asc'].c_oAscMaxCellOrCom
...
@@ -1546,24 +1546,24 @@ window['Asc']['c_oAscMaxCellOrCommentLength'] = window['Asc'].c_oAscMaxCellOrCom
}
}
CPluginVariation
.
prototype
[
"
deserialize
"
]
=
function
(
_object
)
CPluginVariation
.
prototype
[
"
deserialize
"
]
=
function
(
_object
)
{
{
this
.
description
=
_object
[
"
description
"
]
;
this
.
description
=
(
_object
[
"
description
"
]
!=
null
)
?
_object
[
"
description
"
]
:
this
.
description
;
this
.
url
=
_object
[
"
url
"
]
;
this
.
url
=
(
_object
[
"
url
"
]
!=
null
)
?
_object
[
"
url
"
]
:
this
.
url
;
this
.
index
=
_object
[
"
index
"
]
;
this
.
index
=
(
_object
[
"
index
"
]
!=
null
)
?
_object
[
"
index
"
]
:
this
.
index
;
this
.
icons
=
_object
[
"
icons
"
]
;
this
.
icons
=
(
_object
[
"
icons
"
]
!=
null
)
?
_object
[
"
icons
"
]
:
this
.
icons
;
this
.
isViewer
=
_object
[
"
isViewer
"
]
;
this
.
isViewer
=
(
_object
[
"
isViewer
"
]
!=
null
)
?
_object
[
"
isViewer
"
]
:
this
.
isViewer
;
this
.
EditorsSupport
=
_object
[
"
EditorsSupport
"
]
;
this
.
EditorsSupport
=
(
_object
[
"
EditorsSupport
"
]
!=
null
)
?
_object
[
"
EditorsSupport
"
]
:
this
.
EditorsSupport
;
this
.
isVisual
=
_object
[
"
isVisual
"
]
;
this
.
isVisual
=
(
_object
[
"
isVisual
"
]
!=
null
)
?
_object
[
"
isVisual
"
]
:
this
.
isVisual
;
this
.
isModal
=
_object
[
"
isModal
"
]
;
this
.
isModal
=
(
_object
[
"
isModal
"
]
!=
null
)
?
_object
[
"
isModal
"
]
:
this
.
isModal
;
this
.
isInsideMode
=
_object
[
"
isInsideMode
"
]
;
this
.
isInsideMode
=
(
_object
[
"
isInsideMode
"
]
!=
null
)
?
_object
[
"
isInsideMode
"
]
:
this
.
isInsideMode
;
this
.
initDataType
=
_object
[
"
initDataType
"
]
;
this
.
initDataType
=
(
_object
[
"
initDataType
"
]
!=
null
)
?
_object
[
"
initDataType
"
]
:
this
.
initDataType
;
this
.
initData
=
_object
[
"
initData
"
]
;
this
.
initData
=
(
_object
[
"
initData
"
]
!=
null
)
?
_object
[
"
initData
"
]
:
this
.
initData
;
this
.
isUpdateOleOnResize
=
_object
[
"
isUpdateOleOnResize
"
]
;
this
.
isUpdateOleOnResize
=
(
_object
[
"
isUpdateOleOnResize
"
]
!=
null
)
?
_object
[
"
isUpdateOleOnResize
"
]
:
this
.
isUpdateOleOnResize
;
this
.
buttons
=
_object
[
"
buttons
"
]
;
this
.
buttons
=
(
_object
[
"
buttons
"
]
!=
null
)
?
_object
[
"
buttons
"
]
:
this
.
buttons
;
}
}
function
CPlugin
()
function
CPlugin
()
...
@@ -1600,9 +1600,9 @@ window['Asc']['c_oAscMaxCellOrCommentLength'] = window['Asc'].c_oAscMaxCellOrCom
...
@@ -1600,9 +1600,9 @@ window['Asc']['c_oAscMaxCellOrCommentLength'] = window['Asc'].c_oAscMaxCellOrCom
}
}
CPlugin
.
prototype
[
"
deserialize
"
]
=
function
(
_object
)
CPlugin
.
prototype
[
"
deserialize
"
]
=
function
(
_object
)
{
{
this
.
name
=
_object
[
"
name
"
]
;
this
.
name
=
(
_object
[
"
name
"
]
!=
null
)
?
_object
[
"
name
"
]
:
this
.
name
;
this
.
guid
=
_object
[
"
guid
"
]
;
this
.
guid
=
(
_object
[
"
guid
"
]
!=
null
)
?
_object
[
"
guid
"
]
:
this
.
guid
;
this
.
baseUrl
=
_object
[
"
baseUrl
"
]
;
this
.
baseUrl
=
(
_object
[
"
baseUrl
"
]
!=
null
)
?
_object
[
"
baseUrl
"
]
:
this
.
baseUrl
;
this
.
variations
=
[];
this
.
variations
=
[];
for
(
var
i
=
0
;
i
<
_object
[
"
variations
"
].
length
;
i
++
)
for
(
var
i
=
0
;
i
<
_object
[
"
variations
"
].
length
;
i
++
)
{
{
...
...
common/plugins.js
View file @
0aaf178f
...
@@ -47,11 +47,13 @@
...
@@ -47,11 +47,13 @@
{
{
this
.
plugins
=
[];
this
.
plugins
=
[];
this
.
current
=
null
;
this
.
current
=
null
;
this
.
path
=
""
;
this
.
path
=
"
../../../../sdkjs-plugins/
"
;
this
.
api
=
null
;
this
.
api
=
null
;
this
.
startData
=
null
;
this
.
startData
=
null
;
this
.
runAndCloseData
=
null
;
this
.
runAndCloseData
=
null
;
this
.
closeAttackTimer
=
-
1
;
// защита от плагитнов, которые не закрываются
}
}
CPluginsManager
.
prototype
=
CPluginsManager
.
prototype
=
...
@@ -97,8 +99,18 @@
...
@@ -97,8 +99,18 @@
},
},
runResize
:
function
(
data
)
runResize
:
function
(
data
)
{
{
var
guid
=
data
.
getAttribute
(
"
guid
"
);
for
(
var
i
=
0
;
i
<
this
.
plugins
.
length
;
i
++
)
{
if
(
this
.
plugins
[
i
].
guid
==
guid
)
{
if
(
this
.
plugins
[
i
].
variations
[
0
].
isUpdateOleOnResize
!==
true
)
return
;
}
}
data
.
setAttribute
(
"
resize
"
,
true
);
data
.
setAttribute
(
"
resize
"
,
true
);
return
this
.
run
(
data
.
getAttribute
(
"
guid
"
)
,
0
,
data
);
return
this
.
run
(
guid
,
0
,
data
);
},
},
close
:
function
()
close
:
function
()
{
{
...
@@ -144,6 +156,17 @@
...
@@ -144,6 +156,17 @@
buttonClick
:
function
(
id
)
buttonClick
:
function
(
id
)
{
{
if
(
this
.
closeAttackTimer
!=
-
1
)
{
clearTimeout
(
this
.
closeAttackTimer
);
this
.
closeAttackTimer
=
-
1
;
}
if
(
-
1
==
id
)
{
// защита от плохого плагина
this
.
closeAttackTimer
=
setTimeout
(
function
(){
window
.
g_asc_plugins
.
close
();
},
5000
);
}
var
_iframe
=
document
.
getElementById
(
"
plugin_iframe
"
);
var
_iframe
=
document
.
getElementById
(
"
plugin_iframe
"
);
if
(
_iframe
)
if
(
_iframe
)
{
{
...
@@ -252,6 +275,12 @@
...
@@ -252,6 +275,12 @@
}
}
else
if
(
"
close
"
==
name
)
else
if
(
"
close
"
==
name
)
{
{
if
(
window
.
g_asc_plugins
.
closeAttackTimer
!=
-
1
)
{
clearTimeout
(
window
.
g_asc_plugins
.
closeAttackTimer
);
window
.
g_asc_plugins
.
closeAttackTimer
=
-
1
;
}
if
(
value
&&
value
!=
""
)
if
(
value
&&
value
!=
""
)
{
{
try
try
...
@@ -438,7 +467,7 @@ function TEST_PLUGINS()
...
@@ -438,7 +467,7 @@ function TEST_PLUGINS()
initDataType
:
"
ole
"
,
initDataType
:
"
ole
"
,
initData
:
""
,
initData
:
""
,
isUpdateOleOnResize
:
tru
e
,
isUpdateOleOnResize
:
fals
e
,
buttons
:
[
{
text
:
"
Ok
"
,
primary
:
true
},
buttons
:
[
{
text
:
"
Ok
"
,
primary
:
true
},
{
text
:
"
Cancel
"
,
primary
:
false
}
]
{
text
:
"
Cancel
"
,
primary
:
false
}
]
...
...
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