{I" class:ETI"BundledAsset;FI"logical_path;TI"type_station/init.js;FI" pathname;TI"_/Users/richardadams/github/type_station/app/assets/javascripts/type_station/init.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+èlâTI" length;Ti¨ I" digest;TI"%a4b11f2913b6cff3520040d7ac8f62ed;FI" source;TI"¨ (function() { window.TS.models = new window.TS.Store; window.TS.editors = new window.TS.Store; window.TS.onSave = function() { if (!window.TS['onSave']) { return null; } }; window.TS.onSaved = function() { if (!window.TS['onSaved']) { return null; } }; window.TS.onEnable = function() { if (!window.TS['onEnable']) { return null; } }; window.TS.onEnabled = function() { if (!window.TS['onEnabled']) { return null; } }; window.TS.onDisable = function() { if (!window.TS['onDisable']) { return null; } }; window.TS.onDisabled = function() { if (!window.TS['onDisabled']) { return null; } }; window.TS.getModel = function(url) { var model; model = this.models.get(url); if (!model) { model = new window.TS.Model(url); this.models.set(url, model); } return model; }; window.TS.enable = function() { window.location.hash = '#!ts-edit-enable'; this.onEnable(); this.editors.each(function(id, editor) { return editor.enable(); }); this.onEnabled(); return $(window).on('beforeunload', (function(_this) { return function() { var dirtyArray; dirtyArray = []; _this.models.each(function(id, model) { return dirtyArray.push(model.isChanged()); }); if ($.grep(dirtyArray, function(a) { return a === true; }).length > 0) { return 'You have unsaved changes. Are you sure you want to leave?'; } else { } }; })(this)); }; window.TS.disable = function() { window.location.hash = '#!ts-edit-disable'; this.onDisable(); this.editors.each(function(id, editor) { return editor.disable(); }); this.onDisabled(); return $(window).off('beforeunload'); }; window.TS.save = function() { this.onSave(); this.models.each(function(id, model) { return model.save(); }); return this.onSaved(); }; window.TS.init = function() { this.editors.set('ts-admin-bar', new window.TS.AdminBar($('#ts-admin-bar-template'))); this.editors.set('ts-editable-text', new window.TS.EditableText($('span.ts-editable-text'))); this.editors.set('ts-editable-html', new window.TS.EditableHtml($('.ts-editable-html'))); this.editors.set('ts-editable-image', new window.TS.EditableImage($('.ts-editable-image'))); this.editors.set('ts-editable-file', new window.TS.EditableFile($('.ts-editable-file'))); this.editors.set('ts-new-page', new window.TS.NewPage($('.ts-new-page'))); this.editors.set('ts-edit-link', new window.TS.EditLink($('.ts-edit-link'))); this.editors.set('ts-link-finder', new window.TS.LinkFinder(null)); this.editors.set('ts-edit-page', new window.TS.EditPage($('.ts-edit-page'))); if (window.location.hash.replace(/^#!/, '') === 'ts-edit-enable') { return window.TS.enable(); } }; }).call(this); ;TI"required_assets_digest;TI"%7e596d64c44e73cdc4752e28c1cd965f;FI" _version;TI"%64e62ddc273c2f5847f30d698ca14b67;F