X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/800bc0a9753b761c8b3f7b2eb9320226332c8399..52ac6b59c4e8fcecedb14fb256c2c10e1dc76ce4:/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 4b36ae9e..a518410e 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,22 @@ }); }; + 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 == '' && params.error) + params.error(); + else if (data != self.revision) + params.outdated(); + } + }); + }; + /* * Fetch gallery */