diff --git a/ckeditor_responsive_tables.module b/ckeditor_responsive_tables.module index 8dc48c5..83d1bd2 100644 --- a/ckeditor_responsive_tables.module +++ b/ckeditor_responsive_tables.module @@ -23,7 +23,5 @@ function ckeditor_responsive_tables_wysiwyg_plugin($editor, $version) { function ckeditor_responsive_tables_wysiwyg_editor_settings_alter(&$settings, $context) { if ($context['profile']->editor == 'ckeditor') { $settings['allowedContent'] = TRUE; - //Add in our CSS that applies *only* to the editor when it is open - $settings['contentsCss'][] = "sites/all/modules/contrib/ckeditor_responsive_tables/css/rt_editor.css"; } } \ No newline at end of file diff --git a/css/rt_editor.css b/css/rt_editor.css deleted file mode 100644 index 0f0fb3f..0000000 --- a/css/rt_editor.css +++ /dev/null @@ -1,16 +0,0 @@ -/* These rules apply only the tables created by this module in CKEditor. These styles make the table easy to view and enter data into in, but do not reflect how it necessarily looks on the page */ - -/* Pulls the table off the editor edges and centers it to make it a bit easier to edit */ -table.tablesaw { - width: 95%; - margin: 0 auto; -} -/* Adds in borders for the TH's and TD's to better denote where to enter data, especially when the table is empty, important because CKeditor has a long list of classes/elements targeting this - and it's not practical to out-class/element them */ -table.tablesaw td { - border: 1px dotted #d8d8d8 !important; -} -/* Header slightly different to denote it's separate from the body elements */ -table.tablesaw th { - border: 2px solid #d8d8d8 !important; -} \ No newline at end of file diff --git a/plugin.js b/plugin.js index 308eaf3..4a5a76b 100644 --- a/plugin.js +++ b/plugin.js @@ -1,7 +1,6 @@ CKEDITOR.plugins.add( 'responsive_tables', { icons: 'icon', init: function( editor ) { - //CKEDITOR.dialog.add( 'tableDialog', this.path + 'dialogs/responsive_tables.js' ); CKEDITOR.dialog.add( 'openTableDialog', this.path + 'dialogs/responsive_tables.js' ); CKEDITOR.dialog.add( 'RT-tableProperties', this.path + 'dialogs/responsive_tables.js' ); @@ -48,6 +47,20 @@ CKEDITOR.plugins.add( 'responsive_tables', { }; } ); } - + }, + //Special case CSS that is loaded directly into ckeditor + onLoad: function() { + CKEDITOR.addCss( + 'table.tablesaw {' + + 'width: 95%;' + + 'margin: 0 auto;' + + '}' + + 'table.tablesaw td {' + + 'border: 1px dotted #d8d8d8 !important;' + + '}' + + 'table.tablesaw th {' + + 'border: 2px solid #d8d8d8 !important;' + + '}' + ); } }); \ No newline at end of file