o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1358772538.278254Îê: @value"Ä{I" class:EFI"BundledAsset;FI"logical_path;FI"web-app/helpers.js;FI" pathname;FI"a/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/web-app/helpers.coffee;FI"content_type;FI"application/javascript;FI" mtime;FI"2013-01-10T12:07:21-02:00;FI" length;Fià I" digest;F"%1eaa9516c128b6d2ca67f0e83e653e9dI" source;FI"à (function() { this.detectLanguage = function() { var language; language = window.navigator.userLanguage || window.navigator.language; return language = language.toLowerCase().replace('-', '').replace('_', ''); }; this.getMousePos = function(event) { var cur_x, cur_y, touch; if (TOUCH_SUPPORT) { touch = event.originalEvent.touches[0] || event.originalEvent.changedTouches[0]; cur_x = touch.pageX; cur_y = touch.pageY; } else { cur_x = event.clientX; cur_y = event.clientY; } return { x: cur_x, y: cur_y }; }; this.distanceFrom = function(x, y, x0, y0) { return Math.sqrt((x -= x0) * x + (y -= y0) * y); }; this.buildParameters = function(_additional_parameters) { if (_additional_parameters == null) { _additional_parameters = {}; } return _.extend(_additional_parameters, { _t: _t, i18n: i18n, _p: _p }); }; this.debug = function(text) { if (!enable_debug) { return; } return console.log(text); }; this.debug_capabilities = function() { return debug('Detected capabilities: ' + $('html').attr('class') + ' ' + navigator.oscpu + ' ' + navigator.platform + navigator.userAgent); }; String.prototype.capitalize = function() { return this.replace(/(^|\s)([a-z])/g, function(m, p1, p2) { return p1 + p2.toUpperCase(); }); }; this._callback_xdr = function() { app.ajax = app._xdr_frame.contentWindow.jQuery.ajax; app.ajaxSetup = app._xdr_frame.contentWindow.jQuery.ajaxSetup; app._features['xdr'] = true; if (Backbone) { return Backbone.ajax = app.ajax; } }; this._features_check = function() { debug('Waiting featured to be loaded...'); if (_.indexOf(_.values(this.app._features), false) !== -1) { return; } if (this.app._features_checker_interval) { clearInterval(this.app._features_checker_interval); } this.app._features_checker_interval = null; debug('All featured loaded'); _.each(this.app._routers, function(index) { return new index; }); if (this.app.main) { this.app.main(); } if (this.app.initialize_backbone_history && Backbone.history) { debug('BackBone History Detected'); return Backbone.history.start({ pushState: true, root: this.app.root }); } }; this.run_webapp = function(run_routes) { if (run_routes == null) { run_routes = false; } debug('Running Application'); if (app_domain && enable_ajax_on_subdomain) { this.app.APP_DOMAIN = app_domain; document.domain = this.app.APP_DOMAIN; } if (this.app.API_IFRAME) { debug('Requested API calls inside