import { $gettext } from './gettext'; import Dialog from './dialog.js'; function sprintf(string) { var args = arguments, index = 1; return string.replace(/%(s|u)/g, function(match, modifier) { if (index > args.length) { throw 'Invalid sprintf usage - not enough arguments'; } var value = args[index]; if (modifier === 'u') { value = parseInt(value, 10); } index += 1; return String(value); }); } const Lightbox = { max_width: false, max_height: false, extra_height: 55, // TODO: While this seems to work, hardcoded values suck images: [], current: false, show: function(index) { this.current = index || 0; var image = new Image(); image.onload = $.proxy(this, 'onload', image); image.src = this.getImage().src; }, onload: function(image) { var wrapper = $('
'); $('