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
a715009e
Commit
a715009e
authored
Mar 03, 2017
by
Maxim Kadushkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Common] refactored plugin's messages
parent
0cc19d46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
22 deletions
+21
-22
apps/api/documents/api.js
apps/api/documents/api.js
+21
-22
No files found.
apps/api/documents/api.js
View file @
a715009e
...
...
@@ -258,30 +258,29 @@
};
var
_onMessage
=
function
(
msg
)
{
if
(
msg
&&
msg
.
frameEditorId
==
placeholderId
)
{
var
events
=
_config
.
events
||
{},
handler
=
events
[
msg
.
event
],
res
;
if
(
msg
.
event
===
'
onRequestEditRights
'
&&
!
handler
)
{
_applyEditRights
(
false
,
'
handler is
\'
n defined
'
);
if
(
msg
)
{
if
(
msg
.
type
===
"
onExternalPluginMessage
"
)
{
_sendCommand
(
msg
);
}
else
if
(
msg
.
event
===
'
onInternalMessage
'
&&
msg
.
data
&&
msg
.
data
.
type
==
'
localstorage
'
)
{
_callLocalStorage
(
msg
.
data
.
data
);
}
else
{
if
(
msg
.
type
===
"
onExternalPluginMessage
"
)
{
_sendCommand
(
msg
);
return
;
}
if
(
msg
.
event
===
'
onReady
'
)
{
_onReady
();
}
if
(
msg
.
frameEditorId
==
placeholderId
)
{
var
events
=
_config
.
events
||
{},
handler
=
events
[
msg
.
event
],
res
;
if
(
msg
.
event
===
'
onRequestEditRights
'
&&
!
handler
)
{
_applyEditRights
(
false
,
'
handler is
\'
n defined
'
);
}
else
if
(
msg
.
event
===
'
onInternalMessage
'
&&
msg
.
data
&&
msg
.
data
.
type
==
'
localstorage
'
)
{
_callLocalStorage
(
msg
.
data
.
data
);
}
else
{
if
(
msg
.
event
===
'
onReady
'
)
{
_onReady
();
}
if
(
handler
)
{
res
=
handler
.
call
(
_self
,
{
target
:
_self
,
data
:
msg
.
data
});
if
(
msg
.
event
===
'
onSave
'
&&
res
!==
false
)
{
_processSaveResult
(
true
);
if
(
handler
)
{
res
=
handler
.
call
(
_self
,
{
target
:
_self
,
data
:
msg
.
data
});
if
(
msg
.
event
===
'
onSave
'
&&
res
!==
false
)
{
_processSaveResult
(
true
);
}
}
}
}
...
...
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