o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1388436950.175026: @value"g {I" class:EFI"BundledAsset;FI"logical_path;FI""mercury/modals/inserttable.js;FI" pathname;FI"œ/Users/jrissler/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/bundler/gems/mercury-6daffeeb487e/app/assets/javascripts/mercury/modals/inserttable.js.coffee;FI"content_type;FI"application/javascript;FI" mtime;FI"2013-11-20T08:09:45-05:00;FI" length;Fi7 I" digest;F"%513bcf913031e95c1fe792668f18c008I" source;FI"7 (function() { this.Mercury.modalHandlers.insertTable = { initialize: function() { var _this = this; this.table = this.element.find('#table_display table'); this.table.on('click', function(event) { return _this.onCellClick($(event.target)); }); this.element.find('#table_alignment').on('change', function() { return _this.setTableAlignment(); }); this.element.find('#table_border').on('keyup', function() { return _this.setTableBorder(); }); this.element.find('#table_spacing').on('keyup', function() { return _this.setTableCellSpacing(); }); this.element.find('[data-action]').on('click', function(event) { event.preventDefault(); return _this.onActionClick(jQuery(event.target).data('action')); }); this.selectFirstCell(); return this.element.find('form').on('submit', function(event) { event.preventDefault(); _this.submitForm(); return _this.hide(); }); }, selectFirstCell: function() { var firstCell; firstCell = this.table.find('td, th').first(); firstCell.addClass('selected'); return Mercury.tableEditor(this.table, firstCell, ' '); }, onCellClick: function(cell) { this.cell = cell; this.table = this.cell.closest('table'); this.table.find('.selected').removeAttr('class'); this.cell.addClass('selected'); return Mercury.tableEditor(this.table, this.cell, ' '); }, onActionClick: function(action) { if (!action) { return; } return Mercury.tableEditor[action](); }, setTableAlignment: function() { return this.table.attr({ align: this.element.find('#table_alignment').val() }); }, setTableBorder: function() { var border; border = parseInt(this.element.find('#table_border').val(), 10); if (isNaN(border)) { return this.table.removeAttr('border'); } else { return this.table.attr({ border: border }); } }, setTableCellSpacing: function() { var cellspacing; cellspacing = parseInt(this.element.find('#table_spacing').val(), 10); if (isNaN(cellspacing)) { return this.table.removeAttr('cellspacing'); } else { return this.table.attr({ cellspacing: cellspacing }); } }, submitForm: function() { var html, value; this.table.find('.selected').removeAttr('class'); this.table.find('td, th').html('
'); html = jQuery('
').html(this.table).html(); value = html.replace(/^\s+|\n/gm, '').replace(/(<\/.*?>|||)/g, '$1\n'); return Mercury.trigger('action', { action: 'insertTable', value: value }); } }; }).call(this); ;FI"required_assets_digest;F"%7144efcb872b098369e5e5330288b15eI" _version;F"%6776f581a4329e299531e1d52aa59832