{I" class:ETI"BundledAsset;FI"logical_path;TI"(type_station/editables/admin_bar.js;FI" pathname;TI"Q/workspace/app/assets/javascripts/type_station/editables/admin_bar.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+¥*qWI" length;Ti% I" digest;TI"%db2999e30716cf2d240397bd4956f725;FI" source;TI"% (function() { this.TypeStation.AdminBarEditor = (function() { function AdminBarEditor(ts, $el, data) { var $editEditor, $titleEditor, editor, template; this.ts = ts; this.$el = $el; this.data = data; template = this.$el.html(); $('body').append(template); vex.defaultOptions.className = 'vex-theme-os'; $('#ts-admin-bar-edit').on('click', (function(_this) { return function() { _this.ts.enable(); return false; }; })(this)); $('#ts-admin-bar-cancel').on('click', (function(_this) { return function() { _this.ts.disable(); if (_this.ts.isChanged()) { vex.dialog.confirm({ message: 'You have unsaved changes, Do you want to discard them?', callback: function(value) { if (value) { return window.location.reload(); } } }); } return false; }; })(this)); $('#ts-admin-bar-save').on('click', (function(_this) { return function() { vex.dialog.confirm({ message: 'Are you sure you want to save changes?', callback: function(value) { if (value) { return _this.ts.save(); } } }); return false; }; })(this)); $titleEditor = $('#ts-admin-bar-title'); if ($titleEditor.length > 0) { editor = new TypeStation.TextHtmlEditor(this.ts, $titleEditor, $titleEditor.data('ts')); this.ts.editors.set($titleEditor.attr('id'), editor); } $editEditor = $('#ts-admin-bar-settings'); if ($editEditor.length > 0) { editor = new TypeStation.EntityEditor(this.ts, $editEditor, $editEditor.data('ts')); this.ts.editors.set($editEditor.attr('id'), editor); } } AdminBarEditor.prototype.enable = function() { $('#ts-admin-bar').removeClass('ts-hidden'); return $('#ts-admin-bar-edit').addClass('ts-hidden'); }; AdminBarEditor.prototype.disable = function() { $('#ts-admin-bar').addClass('ts-hidden').removeClass('insert-open'); return $('#ts-admin-bar-edit').removeClass('ts-hidden'); }; return AdminBarEditor; })(); }).call(this); ;TI"required_assets_digest;TI"%4c5d8554544132a28cb80d7a5c386eb2;FI" _version;TI"%64e62ddc273c2f5847f30d698ca14b67;F