fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Visual editor - throwing away "[[no class]]" marker
[fnpeditor.git]
/
modules
/
data.js
diff --git
a/modules/data.js
b/modules/data.js
index
5f3fd39
..
36ba172
100644
(file)
--- a/
modules/data.js
+++ b/
modules/data.js
@@
-5,8
+5,7
@@
rng.modules.data = function(sandbox) {
\r
\r
if(doc === '') {
\r
\r
\r
if(doc === '') {
\r
- doc = '<document>\n\
\r
- <section\n\
\r
+ doc = '<section\n\
\r
xmlns="http://nowoczesnapolska.org.pl/sst#"\n\
\r
xmlns:xlink="http://www.w3.org/1999/xlink"\n\
\r
xmlns:dc="http://purl.org/dc/elements/1.1/"\n\
\r
xmlns="http://nowoczesnapolska.org.pl/sst#"\n\
\r
xmlns:xlink="http://www.w3.org/1999/xlink"\n\
\r
xmlns:dc="http://purl.org/dc/elements/1.1/"\n\
\r
@@
-15,8
+14,7
@@
rng.modules.data = function(sandbox) {
<metadata>\n\
\r
</metadata>\n\
\r
<div class="p"></div>\n\
\r
<metadata>\n\
\r
</metadata>\n\
\r
<div class="p"></div>\n\
\r
- </section>\n\
\r
-</document>';
\r
+ </section>';
\r
}
\r
\r
\r
}
\r
\r
\r
@@
-52,10
+50,13
@@
rng.modules.data = function(sandbox) {
sandbox.publish('documentChanged', doc, reason);
\r
},
\r
saveDocument: function() {
\r
sandbox.publish('documentChanged', doc, reason);
\r
},
\r
saveDocument: function() {
\r
+ sandbox.publish('savingStarted');
\r
$.ajax({
\r
method: 'post',
\r
url: '/' + gettext('editor') + '/' + document_id,
\r
$.ajax({
\r
method: 'post',
\r
url: '/' + gettext('editor') + '/' + document_id,
\r
- data: JSON.stringify({document:doc})
\r
+ data: JSON.stringify({document:doc}),
\r
+ success: function() {sandbox.publish('savingEnded', 'success');},
\r
+ error: function() {sandbox.publish('savingEnded', 'error');}
\r
});
\r
}
\r
\r
});
\r
}
\r
\r