1 rng.modules.data = function(sandbox) {
\r
3 var doc = sandbox.getBootstrappedData().document;
\r
4 var document_id = sandbox.getBootstrappedData().document_id;
\r
10 xmlns="http://nowoczesnapolska.org.pl/sst#"\n\
\r
11 xmlns:xlink="http://www.w3.org/1999/xlink"\n\
\r
12 xmlns:dc="http://purl.org/dc/elements/1.1/"\n\
\r
13 xmlns:dcterms="http://purl.org/dc/terms/"\n\
\r
17 <div class="p"></div>\n\
\r
23 function readCookie(name) {
\r
24 var nameEQ = escape(name) + "=";
\r
25 var ca = document.cookie.split(';');
\r
26 for (var i = 0; i < ca.length; i++) {
\r
28 while (c.charAt(0) == ' ') c = c.substring(1, c.length);
\r
29 if (c.indexOf(nameEQ) == 0) return unescape(c.substring(nameEQ.length, c.length));
\r
36 beforeSend: function(xhr, settings) {
\r
37 if (!(/^(GET|HEAD|OPTIONS|TRACE)$/.test(settings.type))) {
\r
38 xhr.setRequestHeader("X-CSRFToken", readCookie('csrftoken'));
\r
45 sandbox.publish('ready');
\r
47 getDocument: function() {
\r
50 commitDocument: function(newDocument, reason) {
\r
52 sandbox.publish('documentChanged', doc, reason);
\r
54 saveDocument: function() {
\r
57 url: '/editor/' + document_id,
\r
58 data: JSON.stringify({document:doc})
\r