spec/dummy/tmp/cache/assets/D02/780/sprockets%2Fc5f75b02d35eab5f502d83176b308d40 in locomotivecms-search-0.3.0 vs spec/dummy/tmp/cache/assets/D02/780/sprockets%2Fc5f75b02d35eab5f502d83176b308d40 in locomotivecms-search-0.3.2

- old
+ new

@@ -1,20 +1,19 @@ -o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1384093243.857242: @value"¹{I" +o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1397482264.621983: @value" {I" class:ETI"ProcessedAsset;FI"logical_path;TI")locomotive/views/shared/form_view.js;FI" pathname;TI"t/Users/didier/Documents/LocomotiveCMS/engine/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;FI"content_type;TI"application/javascript;TI" -mtime;TI"2013-10-25T15:32:29+02:00;TI" length;TiI" digest;TI"%cd7316d1e7a820e758ccf769c8259fa3;FI" source;TI"(function() { - var _base, _ref, +mtime;TI"2014-04-09T15:03:07+02:00;TI" length;TiqI" digest;TI"%d8a579833796e4e7401f147323b5de6b;FI" source;TI"q(function() { + var _base, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; (_base = Locomotive.Views).Shared || (_base.Shared = {}); Locomotive.Views.Shared.FormView = (function(_super) { __extends(FormView, _super); function FormView() { - _ref = FormView.__super__.constructor.apply(this, arguments); - return _ref; + return FormView.__super__.constructor.apply(this, arguments); } FormView.prototype.el = '#content'; FormView.prototype.namespace = null; @@ -29,12 +28,11 @@ }; FormView.prototype.save = function(event) {}; FormView.prototype.save_in_ajax = function(event, options) { - var form, previous_attributes, xhr, - _this = this; + var form, previous_attributes, xhr; event.stopPropagation() & event.preventDefault(); this.trigger_change_event_on_focused_inputs(); form = $(event.target).trigger('ajax:beforeSend'); this.clear_errors(); options || (options = { @@ -45,45 +43,50 @@ previous_attributes = _.clone(this.model.attributes); xhr = this.model.save({}, { headers: options.headers, silent: true }); - xhr.success(function(model, response, _options) { - form.trigger('ajax:complete'); - _this.model.set(previous_attributes); - model.attributes = previous_attributes; - if (options.on_success) { - return options.on_success(model, xhr); - } - }); - return xhr.error(function(model, xhr) { - var errors; - form.trigger('ajax:complete'); - errors = JSON.parse(model.responseText); - _this.show_errors(errors); - if (options.on_error) { - return options.on_error(); - } - }); + xhr.success((function(_this) { + return function(model, response, _options) { + form.trigger('ajax:complete'); + _this.model.set(previous_attributes); + model.attributes = previous_attributes; + if (options.on_success) { + return options.on_success(model, xhr); + } + }; + })(this)); + return xhr.error((function(_this) { + return function(model, xhr) { + var errors; + form.trigger('ajax:complete'); + errors = JSON.parse(model.responseText); + _this.show_errors(errors); + if (options.on_error) { + return options.on_error(); + } + }; + })(this)); }; FormView.prototype.make_title_editable = function() { - var target, title, - _this = this; + var target, title; title = this.$('h2 a.editable'); if (title.size() > 0) { target = this.$("#" + (title.attr('rel'))); target.parent().hide(); - return title.click(function(event) { - var newValue; - event.stopPropagation() & event.preventDefault(); - newValue = prompt(title.attr('title'), title.html()); - if (newValue && newValue !== '') { - title.html(newValue); - return target.val(newValue).trigger('change'); - } - }); + return title.click((function(_this) { + return function(event) { + var newValue; + event.stopPropagation() & event.preventDefault(); + newValue = prompt(title.attr('title'), title.html()); + if (newValue && newValue !== '') { + title.html(newValue); + return target.val(newValue).trigger('change'); + } + }; + })(this)); } }; FormView.prototype.make_inputs_foldable = function() { var self; @@ -106,21 +109,22 @@ }); }; FormView.prototype.trigger_change_event_on_focused_inputs = function() { var input; - input = this.$('form input[type=text]:focus, form input[type=password]:focus, form textarea:focus'); + input = this.$('form input[type=text]:focus, form input[type=password]:focus, form input[type=number]:focus, form textarea:focus'); if (input.size() > 0) { return input.trigger('change'); } }; FormView.prototype.enable_save_with_keys_combination = function() { - var _this = this; - return $.cmd('S', (function() { - return _this.$('form input[type=submit]').trigger('click'); - }), [], { + return $.cmd('S', ((function(_this) { + return function() { + return _this.$('form input[type=submit]').trigger('click'); + }; + })(this)), [], { ignoreCase: true }); }; FormView.prototype.enable_form_notifications = function() { @@ -167,46 +171,50 @@ } return anchor.after(html); }; FormView.prototype._enable_checkbox = function(name, options) { - var model_name, - _this = this; + var model_name; options || (options = {}); model_name = options.model_name || this.model.paramRoot; return this.$("li#" + model_name + "_" + name + "_input input[type=checkbox]").checkToggle({ - on_callback: function() { - _.each(options.features, function(exp) { - return this.$("li#" + model_name + "_" + exp + "_input").hide(); - }); - if (options.on_callback != null) { - options.on_callback(); - } - return _this._hide_last_separator(); - }, - off_callback: function() { - _.each(options.features, function(exp) { - return this.$("li#" + model_name + "_" + exp + "_input").show(); - }); - if (options.off_callback != null) { - options.off_callback(); - } - return _this._hide_last_separator(); - } + on_callback: (function(_this) { + return function() { + _.each(options.features, function(exp) { + return this.$("li#" + model_name + "_" + exp + "_input").hide(); + }); + if (options.on_callback != null) { + options.on_callback(); + } + return _this._hide_last_separator(); + }; + })(this), + off_callback: (function(_this) { + return function() { + _.each(options.features, function(exp) { + return this.$("li#" + model_name + "_" + exp + "_input").show(); + }); + if (options.off_callback != null) { + options.off_callback(); + } + return _this._hide_last_separator(); + }; + })(this) }); }; FormView.prototype._hide_last_separator = function() { - var _this = this; - return _.each(this.$('fieldset'), function(fieldset) { - $(fieldset).find('li.last').removeClass('last'); - return $(_.last($(fieldset).find('li.input:visible'))).addClass('last'); - }); + return _.each(this.$('fieldset'), (function(_this) { + return function(fieldset) { + $(fieldset).find('li.last').removeClass('last'); + return $(_.last($(fieldset).find('li.input:visible'))).addClass('last'); + }; + })(this)); }; return FormView; })(Backbone.View); }).call(this); -;TI"dependency_digest;TI"%a0d26ef6feba78c78ac4e54f7387a4a7;FI"required_paths;T[I"t/Users/didier/Documents/LocomotiveCMS/engine/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;FI"dependency_paths;T[{I" path;TI"t/Users/didier/Documents/LocomotiveCMS/engine/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;FI" -mtime;TI"2013-10-25T15:32:29+02:00;TI" digest;TI"%530d8faa1e59d267e84e809bd2f80524;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F +;TI"dependency_digest;TI"%8381d8cec863e68a661b77e0f4eb7e16;FI"required_paths;T[I"t/Users/didier/Documents/LocomotiveCMS/engine/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;FI"dependency_paths;T[{I" path;TI"t/Users/didier/Documents/LocomotiveCMS/engine/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;FI" +mtime;TI"2014-04-09T15:03:07+02:00;TI" digest;TI"%6b625a8f368e04b11585748da811b133;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F \ No newline at end of file