o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1396340896.23562: @value"X{I" class:ETI"ProcessedAsset;FI"logical_path;TI":locomotive/views/content_types/select_options_view.js;FI" pathname;TI"±/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/engine-89566d497862/app/assets/javascripts/locomotive/views/content_types/select_options_view.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2014-04-01T10:04:05+02:00;TI" length;TiàI" digest;TI"%8528f672c2f0e580ea6e3390157aeefd;FI" source;TI"à(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).ContentTypes || (_base.ContentTypes = {}); Locomotive.Views.ContentTypes.SelectOptionsView = (function(_super) { __extends(SelectOptionsView, _super); function SelectOptionsView() { return SelectOptionsView.__super__.constructor.apply(this, arguments); } SelectOptionsView.prototype.tagName = 'div'; SelectOptionsView.prototype.className = 'list'; SelectOptionsView.prototype.events = { 'click a.add': 'add_entry', 'click span.name': 'edit_entry', 'click a.remove': 'remove_entry', 'click a.drag': 'do_nothing' }; SelectOptionsView.prototype.initialize = function() { _.bindAll(this, 'refresh_position_entries', '_insert_entry'); return this.collection.bind('add', this._insert_entry); }; SelectOptionsView.prototype.render = function() { $(this.el).html(ich.select_options_list()); this.prompt_message = this.$('> ul').data('prompt'); this.render_entries(); this.make_list_sortable(); return this; }; SelectOptionsView.prototype.render_entries = function() { return this.collection.each(this._insert_entry); }; SelectOptionsView.prototype.make_list_sortable = function() { return this.sortable_list = this.$('> ul').sortable({ handle: 'a.drag', items: 'li.entry', update: this.refresh_position_entries }); }; SelectOptionsView.prototype.refresh_position_entries = function() { return this.$('> ul li.entry').each((function(_this) { return function(index, view_dom) { var select_option; select_option = _this.collection.getByCid($(view_dom).data('cid')); return select_option.set({ position: index }); }; })(this)); }; SelectOptionsView.prototype.do_nothing = function(event) { return event.stopPropagation() & event.preventDefault(); }; SelectOptionsView.prototype.add_entry = function(event) { var name; event.stopPropagation() & event.preventDefault(); name = prompt(this.prompt_message); if (name !== '') { return this.collection.add([ { name: name } ]); } }; SelectOptionsView.prototype.edit_entry = function(event) { var name, select_option, span, view_dom; event.stopPropagation() & event.preventDefault(); span = $(event.target); view_dom = span.closest('li'); select_option = this.collection.getByCid(view_dom.data('cid')); if ((name = prompt(this.prompt_message, select_option.get('name'))) !== '') { select_option.set({ name: name }); return span.html(name); } }; SelectOptionsView.prototype.remove_entry = function(event) { var link, select_option, view_dom; event.stopPropagation() & event.preventDefault(); link = $(event.target); view_dom = link.closest('li'); select_option = this.collection.getByCid(view_dom.data('cid')); if (confirm(link.data('confirm'))) { if (select_option.isNew()) { this.collection.remove(select_option); } else { select_option.set({ _destroy: true }); } return view_dom.remove(); } }; SelectOptionsView.prototype._insert_entry = function(select_option) { var view_dom; view_dom = ich.select_option_entry(select_option.toJSON()); view_dom.data('cid', select_option.cid); this.$('> ul').append(view_dom); return this.refresh_position_entries; }; return SelectOptionsView; })(Backbone.View); }).call(this); ;TI"dependency_digest;TI"%978c2922bc2ce50b88838d2aae4a9262;FI"required_paths;T[I"±/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/engine-89566d497862/app/assets/javascripts/locomotive/views/content_types/select_options_view.js.coffee;FI"dependency_paths;T[{I" path;TI"±/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/engine-89566d497862/app/assets/javascripts/locomotive/views/content_types/select_options_view.js.coffee;FI" mtime;TI"2014-04-01T10:04:05+02:00;TI" digest;TI"%64f7e47ab26ceafee8118a6df2de3c7a;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F