From d629e1b74f846b750d4ac76426920ab1a0fbd86e Mon Sep 17 00:00:00 2001 From: Marc Lee Date: Fri, 15 Jun 2012 14:17:18 +1000 Subject: [PATCH] pulling the configuration of tinyMCE from a configuration file instead --- .../shared/_rich_editor_javascript.html.erb | 6 ++-- .../shared/editor_engines/_tiny_mce.html.erb | 33 ++++--------------- config/tinymce.yml | 18 ++++++++++ 3 files changed, 27 insertions(+), 30 deletions(-) create mode 100644 config/tinymce.yml diff --git a/app/views/shared/_rich_editor_javascript.html.erb b/app/views/shared/_rich_editor_javascript.html.erb index 0d9a63a..dba30f1 100644 --- a/app/views/shared/_rich_editor_javascript.html.erb +++ b/app/views/shared/_rich_editor_javascript.html.erb @@ -4,6 +4,6 @@ <% ids = @editor_configuration[:ids].split %> <% if is_enabled and ids.any? %> - <%= render :partial => "shared/editor_engines/#{@editor_configuration[:current_editor].underscore}", - :locals => { :ids => ids } %> -<% end %> \ No newline at end of file + <%= render :partial => "shared/editor_engines/#{@editor_configuration[:current_editor].underscore}", + :locals => { :ids => ids } %> +<% end %> diff --git a/app/views/shared/editor_engines/_tiny_mce.html.erb b/app/views/shared/editor_engines/_tiny_mce.html.erb index ed31e78..eac5bed 100644 --- a/app/views/shared/editor_engines/_tiny_mce.html.erb +++ b/app/views/shared/editor_engines/_tiny_mce.html.erb @@ -1,29 +1,8 @@ - diff --git a/config/tinymce.yml b/config/tinymce.yml new file mode 100644 index 0000000..da7c7aa --- /dev/null +++ b/config/tinymce.yml @@ -0,0 +1,18 @@ +mode : "exact" +theme : "advanced" +language : "<%= I18n.locale.to_s.split('-')[0].downcase %>" +skin : "o2k7" +width : "594" +plugins : "safari,style,layer,table,advhr,advimage,inlinepopups,insertdatetime,preview,media,searchreplace,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template" + +# Theme options +theme_advanced_buttons1 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,fullscreen,|,charmap,media,advhr,|,visualchars,blockquote" +theme_advanced_buttons2 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,sub,sup,|,bullist,numlist,|,outdent,indent,blockquote,|," +theme_advanced_buttons3 : "styleselect,formatselect,fontselect,fontsizeselect,|,forecolor,backcolor" +theme_advanced_buttons4 : "tablecontrols,|,hr,removeformat,visualaid" +theme_advanced_toolbar_location : "top" +theme_advanced_toolbar_align : "left" +theme_advanced_statusbar_location : "top" +theme_advanced_resizing : false + +