Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
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
web-apps
Commits
1f76033e
Commit
1f76033e
authored
Sep 05, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DE] Changed pluigns config.
parent
37a94839
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
1 deletion
+55
-1
apps/documenteditor/main/app/controller/Main.js
apps/documenteditor/main/app/controller/Main.js
+55
-1
No files found.
apps/documenteditor/main/app/controller/Main.js
View file @
1f76033e
...
...
@@ -826,7 +826,7 @@ define([
application
.
getController
(
'
Common.Controllers.ExternalMergeEditor
'
).
setApi
(
this
.
api
).
loadConfig
({
config
:
this
.
editorConfig
,
customization
:
this
.
editorConfig
.
customization
});
pluginsController
.
setApi
(
me
.
api
);
me
.
updatePlugins
List
(
me
.
plugins
);
me
.
updatePlugins
(
me
.
plugins
);
me
.
api
.
asc_registerCallback
(
'
asc_onPluginsInit
'
,
_
.
bind
(
me
.
updatePluginsList
,
me
));
documentHolderController
.
setApi
(
me
.
api
);
...
...
@@ -1721,6 +1721,60 @@ define([
if
(
url
)
this
.
iframePrint
.
src
=
url
;
},
updatePlugins
:
function
(
plugins
)
{
// plugins from config
if
(
!
plugins
||
!
plugins
.
pluginsData
||
plugins
.
pluginsData
.
length
<
1
)
return
;
var
_createXMLHTTPObject
=
function
()
{
var
xmlhttp
;
try
{
xmlhttp
=
new
ActiveXObject
(
"
Msxml2.XMLHTTP
"
);
}
catch
(
e
)
{
try
{
xmlhttp
=
new
ActiveXObject
(
"
Microsoft.XMLHTTP
"
);
}
catch
(
E
)
{
xmlhttp
=
false
;
}
}
if
(
!
xmlhttp
&&
typeof
XMLHttpRequest
!=
'
undefined
'
)
{
xmlhttp
=
new
XMLHttpRequest
();
}
return
xmlhttp
;
};
var
_getPluginJson
=
function
(
plugin
)
{
if
(
!
plugin
)
return
''
;
try
{
var
xhrObj
=
_createXMLHTTPObject
();
if
(
xhrObj
&&
plugin
)
{
xhrObj
.
open
(
'
GET
'
,
plugin
,
false
);
xhrObj
.
send
(
''
);
var
pluginJson
=
eval
(
"
(
"
+
xhrObj
.
responseText
+
"
)
"
);
return
pluginJson
;
}
}
catch
(
e
)
{}
return
null
;
};
var
arr
=
[],
baseUrl
=
plugins
.
url
;
plugins
.
pluginsData
.
forEach
(
function
(
item
){
var
url
=
item
;
if
(
!
/
(
^https
?
:
\/\/)
/i
.
test
(
url
)
&&
!
/
(
^www.
)
/i
.
test
(
item
))
url
=
baseUrl
+
item
;
var
value
=
_getPluginJson
(
url
);
if
(
value
)
arr
.
push
(
value
);
});
if
(
arr
.
length
>
0
)
this
.
updatePluginsList
({
url
:
plugins
.
url
,
pluginsData
:
arr
});
},
updatePluginsList
:
function
(
plugins
)
{
var
pluginStore
=
this
.
getApplication
().
getCollection
(
'
Common.Collections.Plugins
'
),
isEdit
=
this
.
appOptions
.
isEdit
;
...
...
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