(function() { var base, base1, slice = [].slice; window.startApp = function() { if ((ELA.router == null) && ELA.loadedData && $('html').hasClass('wf-active')) { ELA.router = new ELA.Router(); return Backbone.history.start(); } }; WebFont.load({ custom: { families: ['Roboto:n3,n4,n5'] }, active: startApp }); if (/iP(od|ad|hone)/.test(navigator.userAgent)) { $('html').addClass('ios'); } Hammer.defaults.preset = [ [ Hammer.Rotate, { enable: false } ], [ Hammer.Pinch, { enable: false }, ['rotate'] ], [ Hammer.Swipe, { enable: false } ], [ Hammer.Pan, { enable: false }, ['swipe'] ], [Hammer.Tap], [ Hammer.Tap, { event: 'doubletap', taps: 2 }, ['tap'] ], [Hammer.Press] ]; window.ELA = {}; window.debug = function() { var args, first; args = 1 <= arguments.length ? slice.call(arguments, 0) : []; if (ELA.debug) { first = args[0]; if (_.isFunction(first)) { return first(); } else { return console.log.apply(console, args); } } }; window.HAML || (window.HAML = {}); (base = window.HAML).cleanValue || (base.cleanValue = function(text) { if (text === null || text === void 0) { return ''; } else { return text; } }); (base1 = window.HAML).escape || (base1.escape = function(text) { return ("" + text).replace(/&/g, '&').replace(//g, '>').replace(/\"/g, '"'); }); window.delay = function(timeout, callback) { if (callback == null) { callback = null; } if (_.isFunction(timeout)) { return setTimeout(timeout, 0); } else { return setTimeout(callback, timeout); } }; String.prototype.toFunction = function() { var arr, elem, fn, i, len; arr = this.split('.'); fn = window || this; for (i = 0, len = arr.length; i < len; i++) { elem = arr[i]; fn = fn[elem]; } if (!_.isFunction(fn)) { throw new Error(this + " seems not to describe a function"); } return fn; }; window.t = function() { var i, len, options, str, translation, translations; translations = 1 <= arguments.length ? slice.call(arguments, 0) : []; options = _.isObject(_.last(translations)) ? translations.pop() : {}; for (i = 0, len = translations.length; i < len; i++) { translation = translations[i]; str = ELA.labels[translation]; if (str) { return str.replace(/{{([a-zA-Z0-9_]+)}}/g, function(match, v) { return options[v]; }); } } if (options.defaultValue != null) { return options.defaultValue; } if ((str == null) && options.returnNull) { return null; } return translations + " not found"; }; window.flattenObject = function(obj, result, path) { var key, newObj, newPath; if (result == null) { result = {}; } if (path == null) { path = []; } for (key in obj) { newObj = obj[key]; newPath = path.slice(); newPath.push(key); if (typeof newObj === 'object') { flattenObject(newObj, result, newPath); } else { result[newPath.join('.')] = newObj; } } return result; }; _.containsAny = function() { var arr, values; arr = arguments[0], values = 2 <= arguments.length ? slice.call(arguments, 1) : []; if (_.isArray(values[0])) { values = values[0]; } return _.some(values, function(value) { return _.contains(arr, value); }); }; }).call(this);