o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1374498084.716162: @value"+{I" class:EFI"ProcessedAsset;FI"logical_path;F"9iugu-ux/components/usecode/iugu-ui-currency-input.jsI" pathname;F"/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-currency-input.js.coffeeI"content_type;FI"application/javascript;FI" mtime;FI"2013-07-10T19:25:37-03:00;FI" length;Fil I" digest;F"%788f7a19dfca410c6b7ea9062a02b889I" source;FI"l (function() { IuguUI.Money = (function() { Money.prototype.defaults = { none: false, hideInput: true }; Money.prototype.el = void 0; Money.fromCentsToMoney = function(cents, locale) { cents = (cents / 100).toFixed(2); return numeral(cents).format("$0,0.00"); }; Money.fromMoneyToCents = function(currency, locale) { var value; value = numeral().unformat(currency); return (value * 100).toFixed(0); }; Money.configureLocale = function() { return numeral.language(i18n.locale.toLowerCase()); }; Money.load = function(context) { var elements, selector; selector = "[data-type='iux.form.money_input']"; if (context) { elements = context.find(selector); } else { elements = $(selector); } if (elements.length === 0) { return; } return elements.each(function() { if ($(this).data("iux.initialized") === true) { return; } new IuguUI.Money({ el: this, context: context }); return $(this).data("iux.initialized", true); }); }; function Money(options) { this.initialize(options); } Money.prototype.initialize = function(options) { var that; _.bindAll(this); this.options = _.extend({}, this.defaults, options); if (!this.options.el) { return null; } this.el = $(this.options.el); this.input_element = this.el; this.decorator = $('', { type: "text", placeholder: this.input_element.attr("placeholder"), value: this.input_element.attr("value"), "class": this.input_element.attr("class") }); this.decorator.insertAfter(this.el); that = this; this.decorator.bind("focus", function() { return $(this).val(IuguUI.Money.fromCentsToMoney(that.input_element.val())); }); this.decorator.bind("blur", function() { that.input_element.val(IuguUI.Money.fromMoneyToCents($(this).val())); that.input_element.trigger("change"); return $(this).val(IuguUI.Money.fromCentsToMoney(that.input_element.val())); }); this.decorator.val(IuguUI.Money.fromCentsToMoney(that.input_element.val())); return this.input_element.hide(); }; Money.prototype.getInput = function() { if (this.input_element) { return $(this.input_element); } return false; }; Money.prototype.configureInputElementValue = function(value) { if (!this.getInput()) { return; } if (this.getInput()) { this.getInput().val(value); } if (this.getInput()) { return this.getInput().trigger("change"); } }; return Money; })(); this.IuguUI.Money = IuguUI.Money; $(function() { return IuguUI.Money.load(); }); }).call(this); ;TI"dependency_digest;F"%8fbf90d40f9897707295752a24672aa4I"required_paths;F["/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-currency-input.js.coffeeI"dependency_paths;F[{I" path;F"/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-currency-input.js.coffeeI" mtime;FI"2013-07-10T19:25:37-03:00;FI" digest;F"%3269b7c5d5f1dfaca862effa84ee5de4I" _version;F"%6776f581a4329e299531e1d52aa59832