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),
var msg = "Nie udało się wczytać galerii o nazwie: '" + self.galleryLink + "'.";
}
self.galleryImages = [];
- params['failure'](self, "<p>" + msg + "</p>");
+ params['failure'](self, msg);
}
});
};
return text.length;
}
+ /* Temporary workaround for relative images. */
+ WikiDocument.prototype.getBase = function() {
+ return '/media/dynamic/images/' + this.galleryLink + '/';
+ };
$.wikiapi.WikiDocument = WikiDocument;
})(jQuery);