Нет описания

tinymce_setup.js 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. function CustomFileBrowser(field_name, url, type, win) {
  2. var cmsURL = '/admin/filebrowser/browse/?pop=2';
  3. cmsURL = cmsURL + '&type=' + type;
  4. tinyMCE.activeEditor.windowManager.open({
  5. file: cmsURL,
  6. width: 980, // Your dimensions may differ - toy around with them!
  7. height: 500,
  8. resizable: 'yes',
  9. scrollbars: 'yes',
  10. inline: 'no', // This parameter only has an effect if you use the inlinepopups plugin!
  11. close_previous: 'no'
  12. }, {
  13. window: win,
  14. input: field_name,
  15. editor_id: tinyMCE.selectedInstance.editorId
  16. });
  17. return false;
  18. }
  19. tinyMCE.init({
  20. // see http://www.tinymce.com/wiki.php/Configuration
  21. // Init
  22. mode: 'textareas',
  23. theme: 'advanced',
  24. skin: 'grappelli',
  25. // General
  26. accessibility_warnings: false,
  27. browsers: 'gecko,msie,safari,opera',
  28. dialog_type: 'window',
  29. editor_deselector: 'mceNoEditor',
  30. keep_styles: false,
  31. language: 'en',
  32. object_resizing: false,
  33. plugins: 'advimage,advlink,fullscreen,paste,media,searchreplace,grappelli,template',
  34. // directionality : "rtl",
  35. // Callbacks
  36. file_browser_callback: 'CustomFileBrowser',
  37. // Cleanup/Output
  38. element_format: 'xhtml',
  39. fix_list_elements: true,
  40. forced_root_block: 'p',
  41. // style formsts overrides theme_advanced_styles
  42. // see http://www.tinymce.com/wiki.php/Configuration:style_formats
  43. style_formats: [
  44. {title: 'Paragraph Small', block : 'p', classes: 'p_small'},
  45. {title: 'Paragraph ImageCaption', block : 'p', classes: 'p_caption'},
  46. {title: 'Clearfix', block : 'p', classes: 'clearfix'},
  47. {title: 'Code', block : 'p', classes: 'code'}
  48. ],
  49. verify_html: true,
  50. // URL
  51. relative_urls: false,
  52. remove_script_host: true,
  53. // Layout
  54. width: 758,
  55. height: 300,
  56. indentation: '10px',
  57. // Content CSS
  58. // customize your content ...
  59. // content_css : "css/example.css",
  60. // Theme Advanced
  61. theme_advanced_toolbar_location: 'top',
  62. theme_advanced_toolbar_align: 'left',
  63. theme_advanced_statusbar_location: 'bottom',
  64. theme_advanced_buttons1: 'formatselect,styleselect,|,bold,italic,underline,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull,|,undo,redo,|,link,unlink,|,image,|,fullscreen,|,grappelli_adv',
  65. theme_advanced_buttons2: 'search,|,pasteword,template,media,charmap,|,code,|,table,cleanup,grappelli_documentstructure',
  66. theme_advanced_buttons3: '',
  67. theme_advanced_path: false,
  68. theme_advanced_blockformats: 'p,h1,h2,h3,h4,pre',
  69. theme_advanced_resizing: true,
  70. theme_advanced_resize_horizontal: false,
  71. theme_advanced_resizing_use_cookie: true,
  72. // Templates
  73. // see http://www.tinymce.com/wiki.php/Plugin:template
  74. // please note that you need to add the URLs (src) to your url-patterns
  75. // with django.views.generic.simple.direct_to_template
  76. template_templates : [
  77. {
  78. title : '2 Columns',
  79. src : '/path/to/your/template/',
  80. description : '2 Columns.'
  81. },
  82. {
  83. title : '4 Columns',
  84. src : '/path/to/your/template/',
  85. description : '4 Columns.'
  86. }
  87. ],
  88. // Image Plugin
  89. // see http://www.tinymce.com/wiki.php/Plugin:advimage
  90. theme_advanced_styles: 'Image Left=img_left;Image Right=img_right;Image Block=img_block',
  91. advimage_update_dimensions_onchange: true,
  92. // Link Settings
  93. // see http://www.tinymce.com/wiki.php/Plugin:advlink
  94. advlink_styles: 'Internal Link=internal;External Link=external',
  95. // Media Plugin
  96. // see http://www.tinymce.com/wiki.php/Plugin:media
  97. media_strict: true,
  98. // Grappelli Settings
  99. grappelli_adv_hidden: false,
  100. grappelli_show_documentstructure: 'on'
  101. // Elements
  102. // valid_elements: '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|'
  103. // + 'onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|'
  104. // + 'onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|'
  105. // + 'name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,'
  106. // + '#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|'
  107. // + 'src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,'
  108. // + '-blockquote,-table[border=0|cellspacing|cellpadding|width|frame|rules|'
  109. // + 'height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|'
  110. // + 'height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,'
  111. // + '#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor'
  112. // + '|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,'
  113. // + '-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face'
  114. // + '|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],'
  115. // + 'object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width'
  116. // + '|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,'
  117. // + 'button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|'
  118. // + 'valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],'
  119. // + 'input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value],'
  120. // + 'kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],'
  121. // + 'q[cite],samp,select[disabled|multiple|name|size],small,'
  122. // + 'textarea[cols|rows|disabled|name|readonly],tt,var,big',
  123. // extended_valid_elements : 'embed[width|height|name|flashvars|src|bgcolor|align|play|'
  124. // + 'loop|quality|allowscriptaccess|type|pluginspage]'
  125. });