X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/fce465da41831c71697665a594b3f9287856baaa..ec7eb5869c48d69091579e928046b52ee7ae96ae:/src/redakcja/static/js/wiki/wikiapi.js?ds=inline diff --git a/src/redakcja/static/js/wiki/wikiapi.js b/src/redakcja/static/js/wiki/wikiapi.js index f4073ff9..2f1bceb5 100644 --- a/src/redakcja/static/js/wiki/wikiapi.js +++ b/src/redakcja/static/js/wiki/wikiapi.js @@ -198,6 +198,10 @@ WikiDocument.prototype.refreshGallery = function(params) { params = $.extend({}, noops, params); var self = this; + if (!self.galleryLink) { + params['failure'](self, 'Brak galerii.'); + return; + } $.ajax({ method: "GET", url: reverse("ajax_document_gallery", self.galleryLink), @@ -218,7 +222,7 @@ var msg = "Nie udaÅo siÄ wczytaÄ galerii o nazwie: '" + self.galleryLink + "'."; } self.galleryImages = []; - params['failure'](self, "
" + msg + "
"); + params['failure'](self, msg); } }); }; @@ -436,6 +440,10 @@ return text.length; } + /* Temporary workaround for relative images. */ + WikiDocument.prototype.getBase = function() { + return '/media/dynamic/images/' + this.galleryLink + '/'; + }; $.wikiapi.WikiDocument = WikiDocument; })(jQuery);