X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/74081c8b2e9a8588505c40257556e17274fc80de..421fbd31647ecb40540f767b1d506e0843dfc3a9:/redakcja/static/js/wiki/wikiapi.js?ds=sidebyside diff --git a/redakcja/static/js/wiki/wikiapi.js b/redakcja/static/js/wiki/wikiapi.js index b6388f11..bce1f897 100644 --- a/redakcja/static/js/wiki/wikiapi.js +++ b/redakcja/static/js/wiki/wikiapi.js @@ -39,6 +39,9 @@ if (vname == "ajax_document_diff") return base_path + "/" + arguments[1] + "/diff"; + if (vname == "ajax_document_rev") + return base_path + "/" + arguments[1] + "/rev"; + if (vname == "ajax_document_addtag") return base_path + "/" + arguments[1] + "/tags"; @@ -152,6 +155,20 @@ }); }; + WikiDocument.prototype.checkRevision = function(params) { + /* this doesn't modify anything, so no locks */ + var self = this; + $.ajax({ + method: "GET", + url: reverse("ajax_document_rev", self.id), + dataType: 'text', + success: function(data) { + if (data != self.revision) + params.error(); + } + }); + }; + /* * Fetch gallery */ @@ -169,7 +186,7 @@ }, error: function() { self.galleryImages = []; - params['failure'](self, "
Nie udaÅo siÄ wczytaÄ gallerii pod nazwÄ : '" + self.galleryLink + "'.
"); + params['failure'](self, "Nie udaÅo siÄ wczytaÄ galerii pod nazwÄ : '" + self.galleryLink + "'.
"); } }); };