Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
5555075b
Commit
5555075b
authored
Mar 15, 2018
by
Piotr Gawron
Browse files
plugin is registered on the server before plugin resgister method is called
parent
2fd6bd4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend-js/src/main/js/plugin/Plugin.js
View file @
5555075b
...
...
@@ -51,6 +51,8 @@ Plugin.prototype.load = function () {
var
options
=
self
.
getOptions
();
var
hash
;
var
error
=
false
;
var
registerPromise
=
null
;
return
ServerConnector
.
sendRequest
({
url
:
options
.
url
,
...
...
@@ -59,9 +61,7 @@ Plugin.prototype.load = function () {
}).
then
(
function
(
content
)
{
hash
=
Functions
.
computeMD5
(
content
);
var
pluginData
=
undefined
;
var
error
=
false
;
try
{
var
registerPromise
=
null
;
// noinspection JSUnusedLocalSymbols
var
minervaDefine
=
function
(
pluginFunction
)
{
try
{
...
...
@@ -86,21 +86,22 @@ Plugin.prototype.load = function () {
error
=
e
;
}
};
content
+=
"
//# sourceURL=
"
+
options
.
url
;
eval
(
content
);
}
catch
(
e
)
{
error
=
e
;
}
if
(
error
)
{
return
Promise
.
reject
(
error
);
}
return
registerPromise
;
}).
then
(
function
()
{
return
ServerConnector
.
registerPlugin
({
hash
:
hash
,
url
:
options
.
url
,
name
:
self
.
getName
(),
version
:
self
.
getVersion
()
});
}).
then
(
function
()
{
if
(
error
)
{
return
Promise
.
reject
(
error
);
}
return
registerPromise
;
});
};
...
...
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