tinymce-rails 3.4.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (222) hide show
  1. data/README.md +57 -0
  2. data/Rakefile +52 -0
  3. data/assets/integration/tinymce.jquery.js +3 -0
  4. data/assets/integration/tinymce.js +2 -0
  5. data/assets/integration/tinymce.preinit.js.erb +1 -0
  6. data/assets/vendor/tinymce/jquery.tinymce.js +1 -0
  7. data/assets/vendor/tinymce/langs/en.js +223 -0
  8. data/assets/vendor/tinymce/license.txt +504 -0
  9. data/assets/vendor/tinymce/plugins/advhr/css/advhr.css +5 -0
  10. data/assets/vendor/tinymce/plugins/advhr/editor_plugin.js +57 -0
  11. data/assets/vendor/tinymce/plugins/advhr/js/rule.js +43 -0
  12. data/assets/vendor/tinymce/plugins/advhr/langs/en_dlg.js +7 -0
  13. data/assets/vendor/tinymce/plugins/advhr/rule.htm +58 -0
  14. data/assets/vendor/tinymce/plugins/advimage/css/advimage.css +13 -0
  15. data/assets/vendor/tinymce/plugins/advimage/editor_plugin.js +50 -0
  16. data/assets/vendor/tinymce/plugins/advimage/image.htm +235 -0
  17. data/assets/vendor/tinymce/plugins/advimage/img/sample.gif +0 -0
  18. data/assets/vendor/tinymce/plugins/advimage/js/image.js +458 -0
  19. data/assets/vendor/tinymce/plugins/advimage/langs/en_dlg.js +45 -0
  20. data/assets/vendor/tinymce/plugins/advlink/css/advlink.css +8 -0
  21. data/assets/vendor/tinymce/plugins/advlink/editor_plugin.js +61 -0
  22. data/assets/vendor/tinymce/plugins/advlink/js/advlink.js +532 -0
  23. data/assets/vendor/tinymce/plugins/advlink/langs/en_dlg.js +54 -0
  24. data/assets/vendor/tinymce/plugins/advlink/link.htm +338 -0
  25. data/assets/vendor/tinymce/plugins/advlist/editor_plugin.js +176 -0
  26. data/assets/vendor/tinymce/plugins/autolink/editor_plugin.js +172 -0
  27. data/assets/vendor/tinymce/plugins/autoresize/editor_plugin.js +137 -0
  28. data/assets/vendor/tinymce/plugins/autosave/editor_plugin.js +431 -0
  29. data/assets/vendor/tinymce/plugins/autosave/langs/en.js +4 -0
  30. data/assets/vendor/tinymce/plugins/bbcode/editor_plugin.js +120 -0
  31. data/assets/vendor/tinymce/plugins/contextmenu/editor_plugin.js +160 -0
  32. data/assets/vendor/tinymce/plugins/directionality/editor_plugin.js +82 -0
  33. data/assets/vendor/tinymce/plugins/emotions/editor_plugin.js +43 -0
  34. data/assets/vendor/tinymce/plugins/emotions/emotions.htm +41 -0
  35. data/assets/vendor/tinymce/plugins/emotions/img/smiley-cool.gif +0 -0
  36. data/assets/vendor/tinymce/plugins/emotions/img/smiley-cry.gif +0 -0
  37. data/assets/vendor/tinymce/plugins/emotions/img/smiley-embarassed.gif +0 -0
  38. data/assets/vendor/tinymce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
  39. data/assets/vendor/tinymce/plugins/emotions/img/smiley-frown.gif +0 -0
  40. data/assets/vendor/tinymce/plugins/emotions/img/smiley-innocent.gif +0 -0
  41. data/assets/vendor/tinymce/plugins/emotions/img/smiley-kiss.gif +0 -0
  42. data/assets/vendor/tinymce/plugins/emotions/img/smiley-laughing.gif +0 -0
  43. data/assets/vendor/tinymce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
  44. data/assets/vendor/tinymce/plugins/emotions/img/smiley-sealed.gif +0 -0
  45. data/assets/vendor/tinymce/plugins/emotions/img/smiley-smile.gif +0 -0
  46. data/assets/vendor/tinymce/plugins/emotions/img/smiley-surprised.gif +0 -0
  47. data/assets/vendor/tinymce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
  48. data/assets/vendor/tinymce/plugins/emotions/img/smiley-undecided.gif +0 -0
  49. data/assets/vendor/tinymce/plugins/emotions/img/smiley-wink.gif +0 -0
  50. data/assets/vendor/tinymce/plugins/emotions/img/smiley-yell.gif +0 -0
  51. data/assets/vendor/tinymce/plugins/emotions/js/emotions.js +22 -0
  52. data/assets/vendor/tinymce/plugins/emotions/langs/en_dlg.js +20 -0
  53. data/assets/vendor/tinymce/plugins/example/dialog.htm +22 -0
  54. data/assets/vendor/tinymce/plugins/example/editor_plugin.js +84 -0
  55. data/assets/vendor/tinymce/plugins/example/img/example.gif +0 -0
  56. data/assets/vendor/tinymce/plugins/example/js/dialog.js +19 -0
  57. data/assets/vendor/tinymce/plugins/example/langs/en.js +3 -0
  58. data/assets/vendor/tinymce/plugins/example/langs/en_dlg.js +3 -0
  59. data/assets/vendor/tinymce/plugins/example_dependency/editor_plugin.js +50 -0
  60. data/assets/vendor/tinymce/plugins/fullpage/css/fullpage.css +143 -0
  61. data/assets/vendor/tinymce/plugins/fullpage/editor_plugin.js +399 -0
  62. data/assets/vendor/tinymce/plugins/fullpage/fullpage.htm +259 -0
  63. data/assets/vendor/tinymce/plugins/fullpage/js/fullpage.js +232 -0
  64. data/assets/vendor/tinymce/plugins/fullpage/langs/en_dlg.js +85 -0
  65. data/assets/vendor/tinymce/plugins/fullscreen/editor_plugin.js +159 -0
  66. data/assets/vendor/tinymce/plugins/fullscreen/fullscreen.htm +109 -0
  67. data/assets/vendor/tinymce/plugins/iespell/editor_plugin.js +54 -0
  68. data/assets/vendor/tinymce/plugins/inlinepopups/editor_plugin.js +696 -0
  69. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  70. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  71. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  72. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  73. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  74. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  75. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  76. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
  77. data/assets/vendor/tinymce/plugins/inlinepopups/template.htm +387 -0
  78. data/assets/vendor/tinymce/plugins/insertdatetime/editor_plugin.js +83 -0
  79. data/assets/vendor/tinymce/plugins/layer/editor_plugin.js +214 -0
  80. data/assets/vendor/tinymce/plugins/legacyoutput/editor_plugin.js +139 -0
  81. data/assets/vendor/tinymce/plugins/lists/editor_plugin.js +688 -0
  82. data/assets/vendor/tinymce/plugins/media/css/media.css +17 -0
  83. data/assets/vendor/tinymce/plugins/media/editor_plugin.js +777 -0
  84. data/assets/vendor/tinymce/plugins/media/js/embed.js +73 -0
  85. data/assets/vendor/tinymce/plugins/media/js/media.js +355 -0
  86. data/assets/vendor/tinymce/plugins/media/langs/en_dlg.js +109 -0
  87. data/assets/vendor/tinymce/plugins/media/media.htm +812 -0
  88. data/assets/vendor/tinymce/plugins/media/moxieplayer.swf +0 -0
  89. data/assets/vendor/tinymce/plugins/nonbreaking/editor_plugin.js +53 -0
  90. data/assets/vendor/tinymce/plugins/noneditable/editor_plugin.js +95 -0
  91. data/assets/vendor/tinymce/plugins/pagebreak/editor_plugin.js +74 -0
  92. data/assets/vendor/tinymce/plugins/paste/editor_plugin.js +942 -0
  93. data/assets/vendor/tinymce/plugins/paste/js/pastetext.js +36 -0
  94. data/assets/vendor/tinymce/plugins/paste/js/pasteword.js +51 -0
  95. data/assets/vendor/tinymce/plugins/paste/langs/en_dlg.js +5 -0
  96. data/assets/vendor/tinymce/plugins/paste/pastetext.htm +27 -0
  97. data/assets/vendor/tinymce/plugins/paste/pasteword.htm +21 -0
  98. data/assets/vendor/tinymce/plugins/preview/editor_plugin.js +53 -0
  99. data/assets/vendor/tinymce/plugins/preview/example.html +28 -0
  100. data/assets/vendor/tinymce/plugins/preview/jscripts/embed.js +73 -0
  101. data/assets/vendor/tinymce/plugins/preview/preview.html +17 -0
  102. data/assets/vendor/tinymce/plugins/print/editor_plugin.js +34 -0
  103. data/assets/vendor/tinymce/plugins/save/editor_plugin.js +101 -0
  104. data/assets/vendor/tinymce/plugins/searchreplace/css/searchreplace.css +6 -0
  105. data/assets/vendor/tinymce/plugins/searchreplace/editor_plugin.js +61 -0
  106. data/assets/vendor/tinymce/plugins/searchreplace/js/searchreplace.js +142 -0
  107. data/assets/vendor/tinymce/plugins/searchreplace/langs/en_dlg.js +16 -0
  108. data/assets/vendor/tinymce/plugins/searchreplace/searchreplace.htm +100 -0
  109. data/assets/vendor/tinymce/plugins/spellchecker/css/content.css +1 -0
  110. data/assets/vendor/tinymce/plugins/spellchecker/editor_plugin.js +434 -0
  111. data/assets/vendor/tinymce/plugins/spellchecker/img/wline.gif +0 -0
  112. data/assets/vendor/tinymce/plugins/style/css/props.css +13 -0
  113. data/assets/vendor/tinymce/plugins/style/editor_plugin.js +55 -0
  114. data/assets/vendor/tinymce/plugins/style/js/props.js +635 -0
  115. data/assets/vendor/tinymce/plugins/style/langs/en_dlg.js +70 -0
  116. data/assets/vendor/tinymce/plugins/style/props.htm +838 -0
  117. data/assets/vendor/tinymce/plugins/tabfocus/editor_plugin.js +114 -0
  118. data/assets/vendor/tinymce/plugins/table/cell.htm +180 -0
  119. data/assets/vendor/tinymce/plugins/table/css/cell.css +17 -0
  120. data/assets/vendor/tinymce/plugins/table/css/row.css +25 -0
  121. data/assets/vendor/tinymce/plugins/table/css/table.css +13 -0
  122. data/assets/vendor/tinymce/plugins/table/editor_plugin.js +1263 -0
  123. data/assets/vendor/tinymce/plugins/table/js/cell.js +319 -0
  124. data/assets/vendor/tinymce/plugins/table/js/merge_cells.js +27 -0
  125. data/assets/vendor/tinymce/plugins/table/js/row.js +237 -0
  126. data/assets/vendor/tinymce/plugins/table/js/table.js +450 -0
  127. data/assets/vendor/tinymce/plugins/table/langs/en_dlg.js +75 -0
  128. data/assets/vendor/tinymce/plugins/table/merge_cells.htm +32 -0
  129. data/assets/vendor/tinymce/plugins/table/row.htm +158 -0
  130. data/assets/vendor/tinymce/plugins/table/table.htm +188 -0
  131. data/assets/vendor/tinymce/plugins/template/blank.htm +12 -0
  132. data/assets/vendor/tinymce/plugins/template/css/template.css +23 -0
  133. data/assets/vendor/tinymce/plugins/template/editor_plugin.js +159 -0
  134. data/assets/vendor/tinymce/plugins/template/js/template.js +106 -0
  135. data/assets/vendor/tinymce/plugins/template/langs/en_dlg.js +15 -0
  136. data/assets/vendor/tinymce/plugins/template/template.htm +31 -0
  137. data/assets/vendor/tinymce/plugins/visualchars/editor_plugin.js +83 -0
  138. data/assets/vendor/tinymce/plugins/wordcount/editor_plugin.js +114 -0
  139. data/assets/vendor/tinymce/plugins/xhtmlxtras/abbr.htm +142 -0
  140. data/assets/vendor/tinymce/plugins/xhtmlxtras/acronym.htm +142 -0
  141. data/assets/vendor/tinymce/plugins/xhtmlxtras/attributes.htm +149 -0
  142. data/assets/vendor/tinymce/plugins/xhtmlxtras/cite.htm +142 -0
  143. data/assets/vendor/tinymce/plugins/xhtmlxtras/css/attributes.css +11 -0
  144. data/assets/vendor/tinymce/plugins/xhtmlxtras/css/popup.css +9 -0
  145. data/assets/vendor/tinymce/plugins/xhtmlxtras/del.htm +162 -0
  146. data/assets/vendor/tinymce/plugins/xhtmlxtras/editor_plugin.js +132 -0
  147. data/assets/vendor/tinymce/plugins/xhtmlxtras/ins.htm +162 -0
  148. data/assets/vendor/tinymce/plugins/xhtmlxtras/js/abbr.js +28 -0
  149. data/assets/vendor/tinymce/plugins/xhtmlxtras/js/acronym.js +28 -0
  150. data/assets/vendor/tinymce/plugins/xhtmlxtras/js/attributes.js +111 -0
  151. data/assets/vendor/tinymce/plugins/xhtmlxtras/js/cite.js +28 -0
  152. data/assets/vendor/tinymce/plugins/xhtmlxtras/js/del.js +53 -0
  153. data/assets/vendor/tinymce/plugins/xhtmlxtras/js/element_common.js +229 -0
  154. data/assets/vendor/tinymce/plugins/xhtmlxtras/js/ins.js +53 -0
  155. data/assets/vendor/tinymce/plugins/xhtmlxtras/langs/en_dlg.js +32 -0
  156. data/assets/vendor/tinymce/themes/advanced/about.htm +52 -0
  157. data/assets/vendor/tinymce/themes/advanced/anchor.htm +26 -0
  158. data/assets/vendor/tinymce/themes/advanced/charmap.htm +51 -0
  159. data/assets/vendor/tinymce/themes/advanced/color_picker.htm +74 -0
  160. data/assets/vendor/tinymce/themes/advanced/editor_template.js +1358 -0
  161. data/assets/vendor/tinymce/themes/advanced/image.htm +80 -0
  162. data/assets/vendor/tinymce/themes/advanced/img/colorpicker.jpg +0 -0
  163. data/assets/vendor/tinymce/themes/advanced/img/flash.gif +0 -0
  164. data/assets/vendor/tinymce/themes/advanced/img/icons.gif +0 -0
  165. data/assets/vendor/tinymce/themes/advanced/img/iframe.gif +0 -0
  166. data/assets/vendor/tinymce/themes/advanced/img/pagebreak.gif +0 -0
  167. data/assets/vendor/tinymce/themes/advanced/img/quicktime.gif +0 -0
  168. data/assets/vendor/tinymce/themes/advanced/img/realmedia.gif +0 -0
  169. data/assets/vendor/tinymce/themes/advanced/img/shockwave.gif +0 -0
  170. data/assets/vendor/tinymce/themes/advanced/img/trans.gif +0 -0
  171. data/assets/vendor/tinymce/themes/advanced/img/video.gif +0 -0
  172. data/assets/vendor/tinymce/themes/advanced/img/windowsmedia.gif +0 -0
  173. data/assets/vendor/tinymce/themes/advanced/js/about.js +73 -0
  174. data/assets/vendor/tinymce/themes/advanced/js/anchor.js +42 -0
  175. data/assets/vendor/tinymce/themes/advanced/js/charmap.js +355 -0
  176. data/assets/vendor/tinymce/themes/advanced/js/color_picker.js +329 -0
  177. data/assets/vendor/tinymce/themes/advanced/js/image.js +247 -0
  178. data/assets/vendor/tinymce/themes/advanced/js/link.js +153 -0
  179. data/assets/vendor/tinymce/themes/advanced/js/source_editor.js +56 -0
  180. data/assets/vendor/tinymce/themes/advanced/langs/en.js +68 -0
  181. data/assets/vendor/tinymce/themes/advanced/langs/en_dlg.js +54 -0
  182. data/assets/vendor/tinymce/themes/advanced/link.htm +57 -0
  183. data/assets/vendor/tinymce/themes/advanced/shortcuts.htm +47 -0
  184. data/assets/vendor/tinymce/themes/advanced/skins/default/content.css +47 -0
  185. data/assets/vendor/tinymce/themes/advanced/skins/default/dialog.css +117 -0
  186. data/assets/vendor/tinymce/themes/advanced/skins/default/img/buttons.png +0 -0
  187. data/assets/vendor/tinymce/themes/advanced/skins/default/img/items.gif +0 -0
  188. data/assets/vendor/tinymce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  189. data/assets/vendor/tinymce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  190. data/assets/vendor/tinymce/themes/advanced/skins/default/img/progress.gif +0 -0
  191. data/assets/vendor/tinymce/themes/advanced/skins/default/img/tabs.gif +0 -0
  192. data/assets/vendor/tinymce/themes/advanced/skins/default/ui.css +214 -0
  193. data/assets/vendor/tinymce/themes/advanced/skins/highcontrast/content.css +23 -0
  194. data/assets/vendor/tinymce/themes/advanced/skins/highcontrast/dialog.css +105 -0
  195. data/assets/vendor/tinymce/themes/advanced/skins/highcontrast/ui.css +102 -0
  196. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/content.css +46 -0
  197. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/dialog.css +117 -0
  198. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  199. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  200. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  201. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/ui.css +217 -0
  202. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/ui_black.css +8 -0
  203. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
  204. data/assets/vendor/tinymce/themes/advanced/source_editor.htm +25 -0
  205. data/assets/vendor/tinymce/themes/simple/editor_template.js +84 -0
  206. data/assets/vendor/tinymce/themes/simple/img/icons.gif +0 -0
  207. data/assets/vendor/tinymce/themes/simple/langs/en.js +11 -0
  208. data/assets/vendor/tinymce/themes/simple/skins/default/content.css +25 -0
  209. data/assets/vendor/tinymce/themes/simple/skins/default/ui.css +32 -0
  210. data/assets/vendor/tinymce/themes/simple/skins/o2k7/content.css +17 -0
  211. data/assets/vendor/tinymce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  212. data/assets/vendor/tinymce/themes/simple/skins/o2k7/ui.css +35 -0
  213. data/assets/vendor/tinymce/tiny_mce.js +15338 -0
  214. data/assets/vendor/tinymce/tiny_mce_popup.js +5 -0
  215. data/assets/vendor/tinymce/utils/editable_selects.js +70 -0
  216. data/assets/vendor/tinymce/utils/form_utils.js +210 -0
  217. data/assets/vendor/tinymce/utils/mctabs.js +162 -0
  218. data/assets/vendor/tinymce/utils/validate.js +252 -0
  219. data/lib/tinymce-rails.rb +2 -0
  220. data/lib/tinymce/railtie.rb +17 -0
  221. data/lib/tinymce/version.rb +3 -0
  222. metadata +300 -0
@@ -0,0 +1,73 @@
1
+ /**
2
+ * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
3
+ */
4
+
5
+ function writeFlash(p) {
6
+ writeEmbed(
7
+ 'D27CDB6E-AE6D-11cf-96B8-444553540000',
8
+ 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
9
+ 'application/x-shockwave-flash',
10
+ p
11
+ );
12
+ }
13
+
14
+ function writeShockWave(p) {
15
+ writeEmbed(
16
+ '166B1BCA-3F9C-11CF-8075-444553540000',
17
+ 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
18
+ 'application/x-director',
19
+ p
20
+ );
21
+ }
22
+
23
+ function writeQuickTime(p) {
24
+ writeEmbed(
25
+ '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
26
+ 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
27
+ 'video/quicktime',
28
+ p
29
+ );
30
+ }
31
+
32
+ function writeRealMedia(p) {
33
+ writeEmbed(
34
+ 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
35
+ 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
36
+ 'audio/x-pn-realaudio-plugin',
37
+ p
38
+ );
39
+ }
40
+
41
+ function writeWindowsMedia(p) {
42
+ p.url = p.src;
43
+ writeEmbed(
44
+ '6BF52A52-394A-11D3-B153-00C04F79FAA6',
45
+ 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
46
+ 'application/x-mplayer2',
47
+ p
48
+ );
49
+ }
50
+
51
+ function writeEmbed(cls, cb, mt, p) {
52
+ var h = '', n;
53
+
54
+ h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
55
+ h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
56
+ h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
57
+ h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
58
+ h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
59
+ h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
60
+ h += '>';
61
+
62
+ for (n in p)
63
+ h += '<param name="' + n + '" value="' + p[n] + '">';
64
+
65
+ h += '<embed type="' + mt + '"';
66
+
67
+ for (n in p)
68
+ h += n + '="' + p[n] + '" ';
69
+
70
+ h += '></embed></object>';
71
+
72
+ document.write(h);
73
+ }
@@ -0,0 +1,355 @@
1
+ (function() {
2
+ var url;
3
+
4
+ if (url = tinyMCEPopup.getParam("media_external_list_url"))
5
+ document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
6
+
7
+ function get(id) {
8
+ return document.getElementById(id);
9
+ }
10
+
11
+ function getVal(id) {
12
+ var elm = get(id);
13
+
14
+ if (elm.nodeName == "SELECT")
15
+ return elm.options[elm.selectedIndex].value;
16
+
17
+ if (elm.type == "checkbox")
18
+ return elm.checked;
19
+
20
+ return elm.value;
21
+ }
22
+
23
+ function setVal(id, value, name) {
24
+ if (typeof(value) != 'undefined') {
25
+ var elm = get(id);
26
+
27
+ if (elm.nodeName == "SELECT")
28
+ selectByValue(document.forms[0], id, value);
29
+ else if (elm.type == "checkbox") {
30
+ if (typeof(value) == 'string') {
31
+ value = value.toLowerCase();
32
+ value = (!name && value === 'true') || (name && value === name.toLowerCase());
33
+ }
34
+ elm.checked = !!value;
35
+ } else
36
+ elm.value = value;
37
+ }
38
+ }
39
+
40
+ window.Media = {
41
+ init : function() {
42
+ var html, editor;
43
+
44
+ this.editor = editor = tinyMCEPopup.editor;
45
+
46
+ // Setup file browsers and color pickers
47
+ get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');
48
+ get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media');
49
+ get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
50
+ get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('filebrowser_altsource1','video_altsource1','media','media');
51
+ get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('filebrowser_altsource2','video_altsource2','media','media');
52
+ get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image');
53
+
54
+ html = this.getMediaListHTML('medialist', 'src', 'media', 'media');
55
+ if (html == "")
56
+ get("linklistrow").style.display = 'none';
57
+ else
58
+ get("linklistcontainer").innerHTML = html;
59
+
60
+ if (isVisible('filebrowser'))
61
+ get('src').style.width = '230px';
62
+
63
+ if (isVisible('filebrowser_altsource1'))
64
+ get('video_altsource1').style.width = '220px';
65
+
66
+ if (isVisible('filebrowser_altsource2'))
67
+ get('video_altsource2').style.width = '220px';
68
+
69
+ if (isVisible('filebrowser_poster'))
70
+ get('video_poster').style.width = '220px';
71
+
72
+ this.data = tinyMCEPopup.getWindowArg('data');
73
+ this.dataToForm();
74
+ this.preview();
75
+ },
76
+
77
+ insert : function() {
78
+ var editor = tinyMCEPopup.editor;
79
+
80
+ this.formToData();
81
+ editor.execCommand('mceRepaint');
82
+ tinyMCEPopup.restoreSelection();
83
+ editor.selection.setNode(editor.plugins.media.dataToImg(this.data));
84
+ tinyMCEPopup.close();
85
+ },
86
+
87
+ preview : function() {
88
+ get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true);
89
+ },
90
+
91
+ moveStates : function(to_form, field) {
92
+ var data = this.data, editor = this.editor, data = this.data,
93
+ mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src;
94
+
95
+ defaultStates = {
96
+ // QuickTime
97
+ quicktime_autoplay : true,
98
+ quicktime_controller : true,
99
+
100
+ // Flash
101
+ flash_play : true,
102
+ flash_loop : true,
103
+ flash_menu : true,
104
+
105
+ // WindowsMedia
106
+ windowsmedia_autostart : true,
107
+ windowsmedia_enablecontextmenu : true,
108
+ windowsmedia_invokeurls : true,
109
+
110
+ // RealMedia
111
+ realmedia_autogotourl : true,
112
+ realmedia_imagestatus : true
113
+ };
114
+
115
+ function parseQueryParams(str) {
116
+ var out = {};
117
+
118
+ if (str) {
119
+ tinymce.each(str.split('&'), function(item) {
120
+ var parts = item.split('=');
121
+
122
+ out[unescape(parts[0])] = unescape(parts[1]);
123
+ });
124
+ }
125
+
126
+ return out;
127
+ };
128
+
129
+ function setOptions(type, names) {
130
+ var i, name, formItemName, value, list;
131
+
132
+ if (type == data.type || type == 'global') {
133
+ names = tinymce.explode(names);
134
+ for (i = 0; i < names.length; i++) {
135
+ name = names[i];
136
+ formItemName = type == 'global' ? name : type + '_' + name;
137
+
138
+ if (type == 'global')
139
+ list = data;
140
+ else if (type == 'video') {
141
+ list = data.video.attrs;
142
+
143
+ if (!list && !to_form)
144
+ data.video.attrs = list = {};
145
+ } else
146
+ list = data.params;
147
+
148
+ if (list) {
149
+ if (to_form) {
150
+ setVal(formItemName, list[name], type == 'video' ? name : '');
151
+ } else {
152
+ delete list[name];
153
+
154
+ value = getVal(formItemName);
155
+ if (type == 'video' && value === true)
156
+ value = name;
157
+
158
+ if (defaultStates[formItemName]) {
159
+ if (value !== defaultStates[formItemName]) {
160
+ value = "" + value;
161
+ list[name] = value;
162
+ }
163
+ } else if (value) {
164
+ value = "" + value;
165
+ list[name] = value;
166
+ }
167
+ }
168
+ }
169
+ }
170
+ }
171
+ }
172
+
173
+ if (!to_form) {
174
+ data.type = get('media_type').options[get('media_type').selectedIndex].value;
175
+ data.width = getVal('width');
176
+ data.height = getVal('height');
177
+
178
+ // Switch type based on extension
179
+ src = getVal('src');
180
+ if (field == 'src') {
181
+ ext = src.replace(/^.*\.([^.]+)$/, '$1');
182
+ if (typeInfo = mediaPlugin.getType(ext))
183
+ data.type = typeInfo.name.toLowerCase();
184
+
185
+ setVal('media_type', data.type);
186
+ }
187
+
188
+ if (data.type == "video") {
189
+ if (!data.video.sources)
190
+ data.video.sources = [];
191
+
192
+ data.video.sources[0] = {src: getVal('src')};
193
+ }
194
+ }
195
+
196
+ // Hide all fieldsets and show the one active
197
+ get('video_options').style.display = 'none';
198
+ get('flash_options').style.display = 'none';
199
+ get('quicktime_options').style.display = 'none';
200
+ get('shockwave_options').style.display = 'none';
201
+ get('windowsmedia_options').style.display = 'none';
202
+ get('realmedia_options').style.display = 'none';
203
+
204
+ if (get(data.type + '_options'))
205
+ get(data.type + '_options').style.display = 'block';
206
+
207
+ setVal('media_type', data.type);
208
+
209
+ setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars');
210
+ setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc');
211
+ setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign');
212
+ setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume');
213
+ setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks');
214
+ setOptions('video', 'poster,autoplay,loop,preload,controls');
215
+ setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height');
216
+
217
+ if (to_form) {
218
+ if (data.type == 'video') {
219
+ if (data.video.sources[0])
220
+ setVal('src', data.video.sources[0].src);
221
+
222
+ src = data.video.sources[1];
223
+ if (src)
224
+ setVal('video_altsource1', src.src);
225
+
226
+ src = data.video.sources[2];
227
+ if (src)
228
+ setVal('video_altsource2', src.src);
229
+ } else {
230
+ // Check flash vars
231
+ if (data.type == 'flash') {
232
+ tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) {
233
+ if (value == '$url')
234
+ data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src;
235
+ });
236
+ }
237
+
238
+ setVal('src', data.params.src);
239
+ }
240
+ } else {
241
+ src = getVal("src");
242
+
243
+ // YouTube
244
+ if (src.match(/youtube.com(.+)v=([^&]+)/)) {
245
+ data.width = 425;
246
+ data.height = 350;
247
+ data.params.frameborder = '0';
248
+ data.type = 'iframe';
249
+ src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
250
+ setVal('src', src);
251
+ setVal('media_type', data.type);
252
+ }
253
+
254
+ // Google video
255
+ if (src.match(/video.google.com(.+)docid=([^&]+)/)) {
256
+ data.width = 425;
257
+ data.height = 326;
258
+ data.type = 'flash';
259
+ src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en';
260
+ setVal('src', src);
261
+ setVal('media_type', data.type);
262
+ }
263
+
264
+ if (data.type == 'video') {
265
+ if (!data.video.sources)
266
+ data.video.sources = [];
267
+
268
+ data.video.sources[0] = {src : src};
269
+
270
+ src = getVal("video_altsource1");
271
+ if (src)
272
+ data.video.sources[1] = {src : src};
273
+
274
+ src = getVal("video_altsource2");
275
+ if (src)
276
+ data.video.sources[2] = {src : src};
277
+ } else
278
+ data.params.src = src;
279
+
280
+ // Set default size
281
+ setVal('width', data.width || 320);
282
+ setVal('height', data.height || 240);
283
+ }
284
+ },
285
+
286
+ dataToForm : function() {
287
+ this.moveStates(true);
288
+ },
289
+
290
+ formToData : function(field) {
291
+ if (field == "width" || field == "height")
292
+ this.changeSize(field);
293
+
294
+ if (field == 'source') {
295
+ this.moveStates(false, field);
296
+ setVal('source', this.editor.plugins.media.dataToHtml(this.data));
297
+ this.panel = 'source';
298
+ } else {
299
+ if (this.panel == 'source') {
300
+ this.data = this.editor.plugins.media.htmlToData(getVal('source'));
301
+ this.dataToForm();
302
+ this.panel = '';
303
+ }
304
+
305
+ this.moveStates(false, field);
306
+ this.preview();
307
+ }
308
+ },
309
+
310
+ beforeResize : function() {
311
+ this.width = parseInt(getVal('width') || "320", 10);
312
+ this.height = parseInt(getVal('height') || "240", 10);
313
+ },
314
+
315
+ changeSize : function(type) {
316
+ var width, height, scale, size;
317
+
318
+ if (get('constrain').checked) {
319
+ width = parseInt(getVal('width') || "320", 10);
320
+ height = parseInt(getVal('height') || "240", 10);
321
+
322
+ if (type == 'width') {
323
+ this.height = Math.round((width / this.width) * height);
324
+ setVal('height', this.height);
325
+ } else {
326
+ this.width = Math.round((height / this.height) * width);
327
+ setVal('width', this.width);
328
+ }
329
+ }
330
+ },
331
+
332
+ getMediaListHTML : function() {
333
+ if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {
334
+ var html = "";
335
+
336
+ html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;Media.formToData(\'src\');">';
337
+ html += '<option value="">---</option>';
338
+
339
+ for (var i=0; i<tinyMCEMediaList.length; i++)
340
+ html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';
341
+
342
+ html += '</select>';
343
+
344
+ return html;
345
+ }
346
+
347
+ return "";
348
+ }
349
+ };
350
+
351
+ tinyMCEPopup.requireLangPack();
352
+ tinyMCEPopup.onInit.add(function() {
353
+ Media.init();
354
+ });
355
+ })();
@@ -0,0 +1,109 @@
1
+ tinyMCE.addI18n('en.media_dlg',{
2
+ title:"Insert / edit embedded media",
3
+ general:"General",
4
+ advanced:"Advanced",
5
+ file:"File/URL",
6
+ list:"List",
7
+ size:"Dimensions",
8
+ preview:"Preview",
9
+ constrain_proportions:"Constrain proportions",
10
+ type:"Type",
11
+ id:"Id",
12
+ name:"Name",
13
+ class_name:"Class",
14
+ vspace:"V-Space",
15
+ hspace:"H-Space",
16
+ play:"Auto play",
17
+ loop:"Loop",
18
+ menu:"Show menu",
19
+ quality:"Quality",
20
+ scale:"Scale",
21
+ align:"Align",
22
+ salign:"SAlign",
23
+ wmode:"WMode",
24
+ bgcolor:"Background",
25
+ base:"Base",
26
+ flashvars:"Flashvars",
27
+ liveconnect:"SWLiveConnect",
28
+ autohref:"AutoHREF",
29
+ cache:"Cache",
30
+ hidden:"Hidden",
31
+ controller:"Controller",
32
+ kioskmode:"Kiosk mode",
33
+ playeveryframe:"Play every frame",
34
+ targetcache:"Target cache",
35
+ correction:"No correction",
36
+ enablejavascript:"Enable JavaScript",
37
+ starttime:"Start time",
38
+ endtime:"End time",
39
+ href:"Href",
40
+ qtsrcchokespeed:"Choke speed",
41
+ target:"Target",
42
+ volume:"Volume",
43
+ autostart:"Auto start",
44
+ enabled:"Enabled",
45
+ fullscreen:"Fullscreen",
46
+ invokeurls:"Invoke URLs",
47
+ mute:"Mute",
48
+ stretchtofit:"Stretch to fit",
49
+ windowlessvideo:"Windowless video",
50
+ balance:"Balance",
51
+ baseurl:"Base URL",
52
+ captioningid:"Captioning id",
53
+ currentmarker:"Current marker",
54
+ currentposition:"Current position",
55
+ defaultframe:"Default frame",
56
+ playcount:"Play count",
57
+ rate:"Rate",
58
+ uimode:"UI Mode",
59
+ flash_options:"Flash options",
60
+ qt_options:"Quicktime options",
61
+ wmp_options:"Windows media player options",
62
+ rmp_options:"Real media player options",
63
+ shockwave_options:"Shockwave options",
64
+ autogotourl:"Auto goto URL",
65
+ center:"Center",
66
+ imagestatus:"Image status",
67
+ maintainaspect:"Maintain aspect",
68
+ nojava:"No java",
69
+ prefetch:"Prefetch",
70
+ shuffle:"Shuffle",
71
+ console:"Console",
72
+ numloop:"Num loops",
73
+ controls:"Controls",
74
+ scriptcallbacks:"Script callbacks",
75
+ swstretchstyle:"Stretch style",
76
+ swstretchhalign:"Stretch H-Align",
77
+ swstretchvalign:"Stretch V-Align",
78
+ sound:"Sound",
79
+ progress:"Progress",
80
+ qtsrc:"QT Src",
81
+ qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..",
82
+ align_top:"Top",
83
+ align_right:"Right",
84
+ align_bottom:"Bottom",
85
+ align_left:"Left",
86
+ align_center:"Center",
87
+ align_top_left:"Top left",
88
+ align_top_right:"Top right",
89
+ align_bottom_left:"Bottom left",
90
+ align_bottom_right:"Bottom right",
91
+ flv_options:"Flash video options",
92
+ flv_scalemode:"Scale mode",
93
+ flv_buffer:"Buffer",
94
+ flv_starttime:"Start time",
95
+ flv_defaultvolume:"Default volumne",
96
+ flv_hiddengui:"Hidden GUI",
97
+ flv_autostart:"Auto start",
98
+ flv_loop:"Loop",
99
+ flv_showscalemodes:"Show scale modes",
100
+ flv_smoothvideo:"Smooth video",
101
+ flv_jscallback:"JS Callback",
102
+ html5_video_options:"HTML5 Video Options",
103
+ altsource1:"Alternative source 1",
104
+ altsource2:"Alternative source 2",
105
+ preload:"Preload",
106
+ poster:"Poster",
107
+
108
+ source:"Source"
109
+ });