X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/57a3ad0520284210f945b0e2f91f67233e49d07e..b9166b62220208f49bfd3521e547d60d377ab7c1:/src/redakcja/static/js/wiki/wikiapi.js diff --git a/src/redakcja/static/js/wiki/wikiapi.js b/src/redakcja/static/js/wiki/wikiapi.js index 2f1bceb5..4e3cd2c6 100644 --- a/src/redakcja/static/js/wiki/wikiapi.js +++ b/src/redakcja/static/js/wiki/wikiapi.js @@ -227,30 +227,18 @@ }); }; - /* - * Set document's text - */ - WikiDocument.prototype.setText = function(text) { - return this.setDocumentProperty('text', text); - }; - - /* - * Set document's gallery link - */ - WikiDocument.prototype.setGalleryLink = function(gallery) { - return this.setDocumentProperty('galleryLink', gallery); - }; + /* + * Set document's text + */ + WikiDocument.prototype.setText = function(text, setter) { + if (text == this.text) return; + + this.text = text; + this.has_local_changes = true; - /* - * Set document's property - */ - WikiDocument.prototype.setDocumentProperty = function(property, value) { - if(this[property] !== value) { - this[property] = value; - this.has_local_changes = true; - } - }; + }; + /* * Save text back to the server */