{I" class:ETI"ProcessedAsset;FI"logical_path;TI""mercury/modals/inserttable.js;FI" pathname;TI"’/home/edik/.rvm/gems/ruby-2.0.0-p247@very_simple_cms/bundler/gems/mercury-3e0245e33195/app/assets/javascripts/mercury/modals/inserttable.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+½¡9RI" length;Ti6 I" digest;TI"%a51b738365a85ba01b6c6141744a03d4;FI" source;TI"6 (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); ;TI"dependency_digest;TI"%050176fbb7b4e3eec1346891ab6f5c68;FI"required_paths;T[I"’/home/edik/.rvm/gems/ruby-2.0.0-p247@very_simple_cms/bundler/gems/mercury-3e0245e33195/app/assets/javascripts/mercury/modals/inserttable.js.coffee;FI"dependency_paths;T[{I" path;TI"’/home/edik/.rvm/gems/ruby-2.0.0-p247@very_simple_cms/bundler/gems/mercury-3e0245e33195/app/assets/javascripts/mercury/modals/inserttable.js.coffee;FI" mtime;TI"2013-09-18T16:51:09+04:00;TI" digest;TI"%3846bde847300d66a40803d46a4962f4;FI" _version;TI"%2cf3622cbba861b85d33ffabfa420c13;F