From 42cc1b2f4070fb921f8d5d8fe54350d2d9e2563a Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Tue, 9 Aug 2011 11:34:20 -0700 Subject: [PATCH] Make it work better with TinyMCE --- app/views/cms/_text_editor_sidebar.rhtml | 20 +------------------- app/views/cms/_textile_quick_reference.rhtml | 20 ++++++++++++++++++++ public/javascripts/article.js | 2 +- public/stylesheets/application.css | 5 +++++ 4 files changed, 27 insertions(+), 20 deletions(-) create mode 100644 app/views/cms/_textile_quick_reference.rhtml diff --git a/app/views/cms/_text_editor_sidebar.rhtml b/app/views/cms/_text_editor_sidebar.rhtml index 9c417f8..4669555 100644 --- a/app/views/cms/_text_editor_sidebar.rhtml +++ b/app/views/cms/_text_editor_sidebar.rhtml @@ -1,23 +1,5 @@
-
-

- <%= _('Textile markup quick reference') %> - <%= link_to(_('(show)'), '#', :id => 'textile-quickref-show') %> - <%= link_to(_('(hide)'), '#', :id => 'textile-quickref-hide', :style => 'display: none') %> -

- -
+ <%= render(:partial => 'textile_quick_reference') if @article.is_a?(TextileArticle) %>

Media upload

diff --git a/app/views/cms/_textile_quick_reference.rhtml b/app/views/cms/_textile_quick_reference.rhtml new file mode 100644 index 0000000..dc227ac --- /dev/null +++ b/app/views/cms/_textile_quick_reference.rhtml @@ -0,0 +1,20 @@ +
+

+ <%= _('Textile markup quick reference') %> + <%= link_to(_('(show)'), '#', :id => 'textile-quickref-show') %> + <%= link_to(_('(hide)'), '#', :id => 'textile-quickref-hide', :style => 'display: none') %> +

+ +
+ diff --git a/public/javascripts/article.js b/public/javascripts/article.js index 24108bc..8a761d3 100644 --- a/public/javascripts/article.js +++ b/public/javascripts/article.js @@ -27,7 +27,7 @@ jQuery(function($) { var html_for_items = ''; $.each(items, function(i, item) { if (item.content_type && item.content_type.match(/^image/)) { - html_for_items += '
  • ' + item.url + '
    ' + item.title + '
  • '; + html_for_items += '

  • ' + item.title + '
  • '; } else { html_for_items += '
  • ' + item.title + '
  • '; } diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index aa3ae76..b8abe9c 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -3417,6 +3417,11 @@ div.with_media_panel .formfield input { background-repeat: no-repeat; background-position: top right ; } +.text-editor-sidebar img { + max-height: 96px; + max-width: 96px; + border: 1px solid #d3d7cf; +} /* ==> public/stylesheets/controller_contact.css <== */ /*** SELECT CITY ***/ -- libgit2 0.21.2