/*globals jQuery, window */ /*jslint plusplus: true, nomen: true, regexp: true, vars: true */ (function ($) { "use strict"; function Gallery (data) { this.index = data.index; this.slug = data.slug; this.url = data.url; this.title = data.title; this.$element = null; this.pictures = $.map(data.pictures, function (name) { return { src: this.url + name, title: name.replace(/[_\-]/g, ' ').split('.')[0], thumb: { src: this.url + 'thumbs/' + name } }; }.bind(this)); }; Gallery.prototype.getThumbnailUrl = function () { return this.pictures[0].thumb.src; } Gallery.prototype.getElement = function () { if (!this.$element) { this.$element = this.render().hide().insertAfter(this.index.$element); $('a', this.$element).venobox(); } return this.$element; }; Gallery.prototype.render = function () { return $('