Guest User

Untitled

a guest
Jan 22nd, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. -# WYSIWYG Editor JavaScripts
  2.  
  3. - if current_user.wysiwyg_editor
  4. = javascript_include_tag 'elrte.full'
  5. :coffeescript
  6. $ ->
  7. defaultHeight = 280
  8. defaultToolbar = 'normal'
  9. defaultWidth = null
  10.  
  11. elRTE.prototype.options.panels.photoEmbedPanel = [
  12. 'bold'
  13. 'italic'
  14. 'justifyleft'
  15. 'justifycenter'
  16. 'justifyright'
  17. 'insertunorderedlist'
  18. 'link'
  19. ]
  20. elRTE.prototype.options.toolbars.photoEmbedToolbar = ['photoEmbedPanel']
  21.  
  22.  
  23. elRTE.prototype.options.panels.simplePanel = [
  24. 'bold', 'italic', 'underline', 'forecolor', 'justifyleft', 'justifyright',
  25. 'justifycenter', 'justifyfull', 'insertorderedlist', 'insertunorderedlist',
  26. 'link', 'image', 'redo','undo','formatblock']
  27.  
  28. elRTE.prototype.options.toolbars.simpleToolBar = ['simplePanel']
  29.  
  30. $('textarea:not(.no-wysiwyg)').each ->
  31. $area = $(this)
  32. height = if $area.data('wysiwygHeight') then parseInt($area.data('wysiwygHeight'), 10) else defaultHeight
  33. width = if $area.data('wysiwygWidth') then parseInt($area.data('wysiwygWidth'), 10) else defaultWidth
  34. toolbar = if $area.data('wysiwygToolbar') then $area.data('wysiwygToolbar') else defaultToolbar
  35.  
  36. $area.elrte
  37. cssClass: 'el-rte'
  38. height: height
  39. width: width
  40. toolbar: 'simpleToolBar'
  41. cssfiles: [ '/stylesheets/elrte-inner.css' ]
  42. - else
  43. -# TODO: Add JS includes for MarkItUp!
  44. = javascript_include_tag 'markitup/jquery.markitup.js', 'markitup/sets/default/set.js'
  45. :coffeescript
  46. $ ->
  47. $('textarea').markItUp mySettings
Add Comment
Please, Sign In to add comment