Skip to content

Commit

Permalink
refactor(plugin): add cSS directly via plugin addCSS, because paths n…
Browse files Browse the repository at this point in the history
…ot reliable across numerous dev environments
  • Loading branch information
Trav84 committed Mar 28, 2016
1 parent 204db17 commit faaaf4a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
2 changes: 0 additions & 2 deletions ckeditor_responsive_tables.module
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
16 changes: 0 additions & 16 deletions css/rt_editor.css

This file was deleted.

17 changes: 15 additions & 2 deletions plugin.js
Original file line number Diff line number Diff line change
@@ -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' );

Expand Down Expand Up @@ -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;' +
'}'
);
}
});

0 comments on commit faaaf4a

Please sign in to comment.