{I" class:ETI"ProcessedAsset;FI"logical_path;TI"(type_station/editables/admin_bar.js;FI" pathname;TI"n/Users/richardadams/github/type_station/app/assets/javascripts/type_station/editables/admin_bar.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+[çTI" length;Ti­ I" digest;TI"%cb909d37fd2ba5eafbfd9f186d06ca64;FI" source;TI"­ (function() { window.TS.AdminBar = (function() { function AdminBar(_at_element) { var drop, template; this.element = _at_element; template = this.element.html(); $('body').append(template); vex.defaultOptions.className = 'vex-theme-os'; $('#ts-admin-bar-edit').on('click', function() { window.TS.enable(); return false; }); $('#ts-admin-bar-cancel').on('click', function() { window.TS.disable(); if (window.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; }); $('#ts-admin-bar-save').on('click', function() { vex.dialog.confirm({ message: 'Are you sure you want to save changes?', callback: function(value) { if (value) { return window.TS.save(); } } }); return false; }); $('#ts-admin-bar input').on('change', function() { var model; model = window.TS.getModel($(this).data('ts-url')); return model.set($(this).data('ts-key'), { field: $(this).data('ts-key'), value: $(this).val(), type: 'text' }); }); drop = new Drop({ target: $('#ts-admin-bar .ts-options i')[0], content: $('#ts-admin-bar-options')[0], position: 'bottom center', openOn: 'click', classes: 'drop-theme-arrows-bounce-dark' }); drop.on('open', function() { $('#ts-page-settings').off('click'); return $('#ts-page-settings').on('click', function() { vex.dialog.buttons.YES.text = 'Save'; return vex.dialog.open({ message: 'Manage page settings', input: "" + ($('#ts-admin-bar-settings').html()), callback: function(data) { var model; if (data) { model = window.TS.getModel($('#ts-admin-bar-settings').data('ts-url')); return vex.dialog.confirm({ message: 'Are you sure you want to save changes?', callback: function(value) { var k, v; if (value) { for (k in data) { v = data[k]; model.set(k, { field: k, value: v, type: 'text' }); } window.TS.save(); return model.save(function() { return window.location.reload(); }); } } }); } } }); }); }); } AdminBar.prototype.enable = function() { $('body').addClass('ts-edit-mode'); $('#ts-admin-bar').removeClass('ts-hidden'); return $('#ts-admin-bar-edit').addClass('ts-hidden'); }; AdminBar.prototype.disable = function() { $('body').removeClass('ts-edit-mode'); $('#ts-admin-bar').addClass('ts-hidden').removeClass('insert-open'); return $('#ts-admin-bar-edit').removeClass('ts-hidden'); }; return AdminBar; })(); }).call(this); ;TI"dependency_digest;TI"%f54aa654935cc2fded84c3b2999f44b9;FI"required_paths;T[I"n/Users/richardadams/github/type_station/app/assets/javascripts/type_station/editables/admin_bar.js.coffee;FI"dependency_paths;T[{I" path;TI"n/Users/richardadams/github/type_station/app/assets/javascripts/type_station/editables/admin_bar.js.coffee;FI" mtime;TI"2015-02-20T16:04:46+00:00;TI" digest;TI"%10f9ee9c23aa6d5d63bc6f32584348d1;FI" _version;TI"%64e62ddc273c2f5847f30d698ca14b67;F