X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/45fcd6d5e47f5f51e645f12a87776b9b95b2c0b6..ada0c32d0b9ce1f12c5c026b4825bbfd9891ba45:/project/static/js/editor.js?ds=sidebyside diff --git a/project/static/js/editor.js b/project/static/js/editor.js index f9f09003..c12182f3 100644 --- a/project/static/js/editor.js +++ b/project/static/js/editor.js @@ -145,7 +145,8 @@ Editor.prototype.loadConfig = function() { panels: [ {name: 'htmleditor', ratio: 0.5}, {name: 'gallery', ratio: 0.5} - ] + ], + lastUpdate: 0, } try { @@ -197,6 +198,7 @@ Editor.prototype.savePanelOptions = function() { }) }); self.options.panels = panels; + self.options.lastUpdate = (new Date()).getTime() / 1000; $.log($.toJSON(self.options)); $.cookie('options', $.toJSON(self.options), { expires: 7, path: '/'}); } @@ -207,7 +209,7 @@ Editor.prototype.saveToBranch = function(msg) var self = this; $.log('Saving to local branch - panel:', changed_panel); - if(!msg) msg = "Zapis z edytora platformy."; + if(!msg) msg = "Zapis z edytora platformy."; if( changed_panel.length == 0) { $.log('Nothing to save.'); @@ -220,7 +222,13 @@ Editor.prototype.saveToBranch = function(msg) } saveInfo = changed_panel.data('ctrl').saveInfo(); - $.extend(saveInfo.postData, {'commit_message': msg}); + var postData = '' + if(saveInfo.postData instanceof Object) + postData = $.param(saveInfo.postData); + else + postData = saveInfo.postData; + + postData += '&' + $.param({'commit_message': msg}) $.ajax({ url: saveInfo.url, @@ -242,7 +250,7 @@ Editor.prototype.saveToBranch = function(msg) self.showPopup('save-error'); }, type: 'POST', - data: saveInfo.postData + data: postData }); return true;