Module: Caboose::ApplicationHelper

Defined in:
app/helpers/caboose/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#caboose_tinymceObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/helpers/caboose/application_helper.rb', line 3

def caboose_tinymce
  return "
<script src='//tinymce.cachefly.net/4.0/tinymce.min.js'></script>
<script type='text/javascript'>
//<![CDATA[
tinyMCE.init({
  selector: 'textarea.tinymce',
  width: '800px',
  height: '300px',
  convert_urls: false,
  plugins: 'advlist autolink lists link image charmap print preview hr anchor pagebreak searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking table contextmenu directionality emoticons template paste textcolor caboose',
  toolbar1: 'caboose_save caboose_cancel | bold italic forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
  image_advtab: true,
  external_plugins: { 'caboose': '#{Caboose::cdn_domain == '/' ? '' : "//#{Caboose::cdn_domain}"}/assets/tinymce/plugins/caboose/plugin.js' },
  setup: function(editor) {
var control = ModelBinder.tinymce_control(editor.id);     
editor.on('keyup', function(e) { control.tinymce_change(editor); });
  }
});
//]]>
</script>\n"
end

#parent_categoriesObject



26
27
28
# File 'app/helpers/caboose/application_helper.rb', line 26

def parent_categories
  Caboose::Category.find(1).children.where(:status => 'Active')
end