Skip to content

Commit

Permalink
add custom_config.js with minimal toolbar set
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnorth committed Dec 10, 2009
1 parent 3705a26 commit 4107f4f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/admin/shared/_ckeditor.html.erb
Expand Up @@ -5,9 +5,9 @@ window.onload = function()
$('textarea').each(function(){
CKEDITOR.replace(this.id,
{
customConfig: '<%= javascript_path('/ckeditor/custom_config.js') %>',
height: 350,
});
})
}

</script>
42 changes: 42 additions & 0 deletions public/ckeditor/custom_config.js
@@ -0,0 +1,42 @@
CKEDITOR.addStylesSet( 'custom_styles',
[
// Inline Styles
{ name : 'Deleted Text', element : 'del' },
{ name : 'Inserted Text', element : 'ins' },
{ name : 'Small', element : 'small' },

// Object Styles
{ name : 'Image Left', element : 'img', attributes : { 'class' : 'left' } },
{ name : 'Image Right', element : 'img', attributes : { 'class' : 'right' } },

{ name : 'Alphabetical', element : 'ol', attributes : { 'type' : 'a' } },
{ name : 'Numeric', element : 'ol', attributes : { 'type' : '1' } },
{ name : 'Roman', element : 'ol', attributes : { 'type' : 'I' } },

]);


CKEDITOR.editorConfig = function( config )
{

config.startupMode = 'source';

config.toolbar_custom =
[
['Format','Styles'],
['Cut','Copy','Paste','PasteText','PasteWord'],
['Undo','Redo','-','SelectAll','RemoveFormat'],
['FontFormat','Style'],
['Bold','Italic'],
['NumberedList','BulletedList'],
['Image','Table','SpecialChar'],
['Link','Unlink','Anchor'],
['FitWindow','ShowBlocks','Source'],
];

config.toolbar = 'custom';

config.stylesCombo_stylesSet = 'custom_styles';
config.format_tags = 'h2;h3;h4;p';

};

0 comments on commit 4107f4f

Please sign in to comment.