spud_core 0.9.22 → 1.0.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/glyphicons-halflings-regular.eot +0 -0
  3. data/app/assets/images/glyphicons-halflings-regular.svg +229 -0
  4. data/app/assets/images/glyphicons-halflings-regular.ttf +0 -0
  5. data/app/assets/images/glyphicons-halflings-regular.woff +0 -0
  6. data/app/assets/javascripts/spud/admin/application.js +5 -2
  7. data/app/assets/javascripts/spud/admin/editor.js +55 -21
  8. data/app/assets/javascripts/spud/admin/preinit.js +1 -1
  9. data/app/assets/libs/bootstrap3/css/bootstrap-theme.css +397 -0
  10. data/app/assets/libs/bootstrap3/css/bootstrap-theme.min.css +7 -0
  11. data/app/assets/libs/bootstrap3/css/bootstrap.css.erb +7118 -0
  12. data/app/assets/libs/bootstrap3/css/bootstrap.min.css +7 -0
  13. data/app/assets/libs/bootstrap3/fonts/glyphicons-halflings-regular.eot +0 -0
  14. data/app/assets/libs/bootstrap3/fonts/glyphicons-halflings-regular.svg +229 -0
  15. data/app/assets/libs/bootstrap3/fonts/glyphicons-halflings-regular.ttf +0 -0
  16. data/app/assets/libs/bootstrap3/fonts/glyphicons-halflings-regular.woff +0 -0
  17. data/app/assets/libs/bootstrap3/js/bootstrap.js +2006 -0
  18. data/app/assets/libs/bootstrap3/js/bootstrap.min.js +7 -0
  19. data/app/assets/stylesheets/spud/admin/{application.css → application.css.erb} +4 -4
  20. data/app/assets/stylesheets/spud/admin/navbar.css +31 -0
  21. data/app/controllers/spud/admin/users_controller.rb +6 -2
  22. data/app/controllers/spud/application_controller.rb +0 -1
  23. data/app/controllers/spud/sitemaps_controller.rb +1 -1
  24. data/app/controllers/spud/users_controller.rb +10 -4
  25. data/app/models/spud_admin_permission.rb +0 -2
  26. data/app/models/spud_user.rb +0 -2
  27. data/app/views/spud/admin/users/index.html.erb +1 -1
  28. data/config/routes.rb +1 -0
  29. data/lib/spud_core/configuration.rb +13 -3
  30. data/lib/spud_core/engine.rb +3 -7
  31. data/lib/spud_core/version.rb +1 -1
  32. data/spec/controllers/spud/sitemap_controllers_spec.rb +6 -5
  33. data/spec/dummy/config/environments/development.rb +1 -5
  34. data/spec/dummy/config/environments/production.rb +2 -0
  35. data/spec/dummy/config/environments/test.rb +1 -5
  36. metadata +104 -190
  37. data/app/assets/libs/tiny_mce/jquery.tinymce.js +0 -1
  38. data/app/assets/libs/tiny_mce/langs/en.js +0 -1
  39. data/app/assets/libs/tiny_mce/license.txt +0 -504
  40. data/app/assets/libs/tiny_mce/plugins/advhr/css/advhr.css +0 -5
  41. data/app/assets/libs/tiny_mce/plugins/advhr/editor_plugin.js +0 -1
  42. data/app/assets/libs/tiny_mce/plugins/advhr/editor_plugin_src.js +0 -57
  43. data/app/assets/libs/tiny_mce/plugins/advhr/js/rule.js +0 -43
  44. data/app/assets/libs/tiny_mce/plugins/advhr/langs/en_dlg.js +0 -1
  45. data/app/assets/libs/tiny_mce/plugins/advhr/rule.htm +0 -58
  46. data/app/assets/libs/tiny_mce/plugins/advimage/css/advimage.css +0 -13
  47. data/app/assets/libs/tiny_mce/plugins/advimage/editor_plugin.js +0 -1
  48. data/app/assets/libs/tiny_mce/plugins/advimage/editor_plugin_src.js +0 -50
  49. data/app/assets/libs/tiny_mce/plugins/advimage/image.htm +0 -235
  50. data/app/assets/libs/tiny_mce/plugins/advimage/img/sample.gif +0 -0
  51. data/app/assets/libs/tiny_mce/plugins/advimage/js/image.js +0 -462
  52. data/app/assets/libs/tiny_mce/plugins/advimage/langs/en_dlg.js +0 -1
  53. data/app/assets/libs/tiny_mce/plugins/advlink/css/advlink.css +0 -8
  54. data/app/assets/libs/tiny_mce/plugins/advlink/editor_plugin.js +0 -1
  55. data/app/assets/libs/tiny_mce/plugins/advlink/editor_plugin_src.js +0 -61
  56. data/app/assets/libs/tiny_mce/plugins/advlink/js/advlink.js +0 -539
  57. data/app/assets/libs/tiny_mce/plugins/advlink/langs/en_dlg.js +0 -1
  58. data/app/assets/libs/tiny_mce/plugins/advlink/link.htm +0 -338
  59. data/app/assets/libs/tiny_mce/plugins/advlist/editor_plugin.js +0 -1
  60. data/app/assets/libs/tiny_mce/plugins/advlist/editor_plugin_src.js +0 -176
  61. data/app/assets/libs/tiny_mce/plugins/autolink/editor_plugin.js +0 -1
  62. data/app/assets/libs/tiny_mce/plugins/autolink/editor_plugin_src.js +0 -174
  63. data/app/assets/libs/tiny_mce/plugins/autoresize/editor_plugin.js +0 -1
  64. data/app/assets/libs/tiny_mce/plugins/autoresize/editor_plugin_src.js +0 -119
  65. data/app/assets/libs/tiny_mce/plugins/contextmenu/editor_plugin.js +0 -1
  66. data/app/assets/libs/tiny_mce/plugins/contextmenu/editor_plugin_src.js +0 -161
  67. data/app/assets/libs/tiny_mce/plugins/directionality/editor_plugin.js +0 -1
  68. data/app/assets/libs/tiny_mce/plugins/directionality/editor_plugin_src.js +0 -82
  69. data/app/assets/libs/tiny_mce/plugins/example/dialog.htm +0 -22
  70. data/app/assets/libs/tiny_mce/plugins/example/editor_plugin.js +0 -1
  71. data/app/assets/libs/tiny_mce/plugins/example/editor_plugin_src.js +0 -84
  72. data/app/assets/libs/tiny_mce/plugins/example/img/example.gif +0 -0
  73. data/app/assets/libs/tiny_mce/plugins/example/js/dialog.js +0 -19
  74. data/app/assets/libs/tiny_mce/plugins/example/langs/en.js +0 -3
  75. data/app/assets/libs/tiny_mce/plugins/example/langs/en_dlg.js +0 -3
  76. data/app/assets/libs/tiny_mce/plugins/example_dependency/editor_plugin.js +0 -1
  77. data/app/assets/libs/tiny_mce/plugins/example_dependency/editor_plugin_src.js +0 -50
  78. data/app/assets/libs/tiny_mce/plugins/iespell/editor_plugin.js +0 -1
  79. data/app/assets/libs/tiny_mce/plugins/iespell/editor_plugin_src.js +0 -54
  80. data/app/assets/libs/tiny_mce/plugins/inlinepopups/editor_plugin.js +0 -1
  81. data/app/assets/libs/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +0 -699
  82. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  83. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  84. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  85. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  86. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  87. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  88. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  89. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +0 -90
  90. data/app/assets/libs/tiny_mce/plugins/inlinepopups/template.htm +0 -387
  91. data/app/assets/libs/tiny_mce/plugins/layer/editor_plugin.js +0 -1
  92. data/app/assets/libs/tiny_mce/plugins/layer/editor_plugin_src.js +0 -262
  93. data/app/assets/libs/tiny_mce/plugins/lists/editor_plugin.js +0 -1
  94. data/app/assets/libs/tiny_mce/plugins/lists/editor_plugin_src.js +0 -951
  95. data/app/assets/libs/tiny_mce/plugins/media/css/media.css +0 -17
  96. data/app/assets/libs/tiny_mce/plugins/media/editor_plugin.js +0 -1
  97. data/app/assets/libs/tiny_mce/plugins/media/editor_plugin_src.js +0 -890
  98. data/app/assets/libs/tiny_mce/plugins/media/js/embed.js +0 -73
  99. data/app/assets/libs/tiny_mce/plugins/media/js/media.js +0 -470
  100. data/app/assets/libs/tiny_mce/plugins/media/langs/en_dlg.js +0 -1
  101. data/app/assets/libs/tiny_mce/plugins/media/media.htm +0 -922
  102. data/app/assets/libs/tiny_mce/plugins/media/moxieplayer.swf +0 -0
  103. data/app/assets/libs/tiny_mce/plugins/paste/editor_plugin.js +0 -1
  104. data/app/assets/libs/tiny_mce/plugins/paste/editor_plugin_src.js +0 -871
  105. data/app/assets/libs/tiny_mce/plugins/paste/js/pastetext.js +0 -36
  106. data/app/assets/libs/tiny_mce/plugins/paste/js/pasteword.js +0 -51
  107. data/app/assets/libs/tiny_mce/plugins/paste/langs/en_dlg.js +0 -1
  108. data/app/assets/libs/tiny_mce/plugins/paste/pastetext.htm +0 -27
  109. data/app/assets/libs/tiny_mce/plugins/paste/pasteword.htm +0 -21
  110. data/app/assets/libs/tiny_mce/plugins/spellchecker/css/content.css +0 -1
  111. data/app/assets/libs/tiny_mce/plugins/spellchecker/editor_plugin.js +0 -1
  112. data/app/assets/libs/tiny_mce/plugins/spellchecker/editor_plugin_src.js +0 -436
  113. data/app/assets/libs/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
  114. data/app/assets/libs/tiny_mce/plugins/style/css/props.css +0 -14
  115. data/app/assets/libs/tiny_mce/plugins/style/editor_plugin.js +0 -1
  116. data/app/assets/libs/tiny_mce/plugins/style/editor_plugin_src.js +0 -71
  117. data/app/assets/libs/tiny_mce/plugins/style/js/props.js +0 -709
  118. data/app/assets/libs/tiny_mce/plugins/style/langs/en_dlg.js +0 -1
  119. data/app/assets/libs/tiny_mce/plugins/style/props.htm +0 -845
  120. data/app/assets/libs/tiny_mce/plugins/style/readme.txt +0 -19
  121. data/app/assets/libs/tiny_mce/plugins/table/cell.htm +0 -180
  122. data/app/assets/libs/tiny_mce/plugins/table/css/cell.css +0 -17
  123. data/app/assets/libs/tiny_mce/plugins/table/css/row.css +0 -25
  124. data/app/assets/libs/tiny_mce/plugins/table/css/table.css +0 -13
  125. data/app/assets/libs/tiny_mce/plugins/table/editor_plugin.js +0 -1
  126. data/app/assets/libs/tiny_mce/plugins/table/editor_plugin_src.js +0 -1428
  127. data/app/assets/libs/tiny_mce/plugins/table/js/cell.js +0 -319
  128. data/app/assets/libs/tiny_mce/plugins/table/js/merge_cells.js +0 -27
  129. data/app/assets/libs/tiny_mce/plugins/table/js/row.js +0 -237
  130. data/app/assets/libs/tiny_mce/plugins/table/js/table.js +0 -489
  131. data/app/assets/libs/tiny_mce/plugins/table/langs/en_dlg.js +0 -1
  132. data/app/assets/libs/tiny_mce/plugins/table/merge_cells.htm +0 -32
  133. data/app/assets/libs/tiny_mce/plugins/table/row.htm +0 -158
  134. data/app/assets/libs/tiny_mce/plugins/table/table.htm +0 -188
  135. data/app/assets/libs/tiny_mce/themes/advanced/about.htm +0 -52
  136. data/app/assets/libs/tiny_mce/themes/advanced/anchor.htm +0 -26
  137. data/app/assets/libs/tiny_mce/themes/advanced/charmap.htm +0 -55
  138. data/app/assets/libs/tiny_mce/themes/advanced/color_picker.htm +0 -70
  139. data/app/assets/libs/tiny_mce/themes/advanced/editor_template.js +0 -1
  140. data/app/assets/libs/tiny_mce/themes/advanced/editor_template_src.js +0 -1467
  141. data/app/assets/libs/tiny_mce/themes/advanced/image.htm +0 -80
  142. data/app/assets/libs/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
  143. data/app/assets/libs/tiny_mce/themes/advanced/img/flash.gif +0 -0
  144. data/app/assets/libs/tiny_mce/themes/advanced/img/icons.gif +0 -0
  145. data/app/assets/libs/tiny_mce/themes/advanced/img/iframe.gif +0 -0
  146. data/app/assets/libs/tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
  147. data/app/assets/libs/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
  148. data/app/assets/libs/tiny_mce/themes/advanced/img/realmedia.gif +0 -0
  149. data/app/assets/libs/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
  150. data/app/assets/libs/tiny_mce/themes/advanced/img/trans.gif +0 -0
  151. data/app/assets/libs/tiny_mce/themes/advanced/img/video.gif +0 -0
  152. data/app/assets/libs/tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
  153. data/app/assets/libs/tiny_mce/themes/advanced/js/about.js +0 -73
  154. data/app/assets/libs/tiny_mce/themes/advanced/js/anchor.js +0 -44
  155. data/app/assets/libs/tiny_mce/themes/advanced/js/charmap.js +0 -363
  156. data/app/assets/libs/tiny_mce/themes/advanced/js/color_picker.js +0 -345
  157. data/app/assets/libs/tiny_mce/themes/advanced/js/image.js +0 -251
  158. data/app/assets/libs/tiny_mce/themes/advanced/js/link.js +0 -153
  159. data/app/assets/libs/tiny_mce/themes/advanced/js/source_editor.js +0 -78
  160. data/app/assets/libs/tiny_mce/themes/advanced/langs/en.js +0 -1
  161. data/app/assets/libs/tiny_mce/themes/advanced/langs/en_dlg.js +0 -1
  162. data/app/assets/libs/tiny_mce/themes/advanced/link.htm +0 -57
  163. data/app/assets/libs/tiny_mce/themes/advanced/shortcuts.htm +0 -47
  164. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/content.css +0 -51
  165. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/dialog.css +0 -118
  166. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  167. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  168. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  169. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  170. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
  171. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  172. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/ui.css +0 -215
  173. data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/content.css +0 -25
  174. data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +0 -106
  175. data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/ui.css +0 -102
  176. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/content.css +0 -49
  177. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/dialog.css +0 -118
  178. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  179. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  180. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  181. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui.css +0 -218
  182. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +0 -8
  183. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +0 -5
  184. data/app/assets/libs/tiny_mce/themes/advanced/source_editor.htm +0 -25
  185. data/app/assets/libs/tiny_mce/themes/simple/editor_template.js +0 -1
  186. data/app/assets/libs/tiny_mce/themes/simple/editor_template_src.js +0 -84
  187. data/app/assets/libs/tiny_mce/themes/simple/img/icons.gif +0 -0
  188. data/app/assets/libs/tiny_mce/themes/simple/langs/en.js +0 -1
  189. data/app/assets/libs/tiny_mce/themes/simple/skins/default/content.css +0 -25
  190. data/app/assets/libs/tiny_mce/themes/simple/skins/default/ui.css +0 -32
  191. data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/content.css +0 -17
  192. data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  193. data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/ui.css +0 -35
  194. data/app/assets/libs/tiny_mce/tiny_mce.js +0 -1
  195. data/app/assets/libs/tiny_mce/tiny_mce_popup.js +0 -5
  196. data/app/assets/libs/tiny_mce/tiny_mce_src.js +0 -16753
  197. data/app/assets/libs/tiny_mce/utils/editable_selects.js +0 -70
  198. data/app/assets/libs/tiny_mce/utils/form_utils.js +0 -210
  199. data/app/assets/libs/tiny_mce/utils/mctabs.js +0 -162
  200. data/app/assets/libs/tiny_mce/utils/validate.js +0 -252
  201. data/app/assets/stylesheets/spud/admin/settings.css +0 -4
  202. data/app/assets/stylesheets/spud/admin/users.css +0 -4
  203. data/app/assets/stylesheets/spud/password_resets.css +0 -4
  204. data/app/assets/stylesheets/spud/setup.css +0 -4
  205. data/app/assets/stylesheets/spud/sitemaps.css +0 -4
  206. data/app/assets/stylesheets/spud/user_sessions.css +0 -4
  207. data/app/assets/stylesheets/spud/users.css +0 -4
  208. /data/app/assets/{libs/tiny_mce → javascripts/tinymce}/plugins/tableDropdown/editor_plugin.js +0 -0
@@ -1,890 +0,0 @@
1
- /**
2
- * editor_plugin_src.js
3
- *
4
- * Copyright 2009, Moxiecode Systems AB
5
- * Released under LGPL License.
6
- *
7
- * License: http://tinymce.moxiecode.com/license
8
- * Contributing: http://tinymce.moxiecode.com/contributing
9
- */
10
-
11
- (function() {
12
- var rootAttributes = tinymce.explode('id,name,width,height,style,align,class,hspace,vspace,bgcolor,type'), excludedAttrs = tinymce.makeMap(rootAttributes.join(',')), Node = tinymce.html.Node,
13
- mediaTypes, scriptRegExp, JSON = tinymce.util.JSON, mimeTypes;
14
-
15
- // Media types supported by this plugin
16
- mediaTypes = [
17
- // Type, clsid:s, mime types, codebase
18
- ["Flash", "d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],
19
- ["ShockWave", "166b1bca-3f9c-11cf-8075-444553540000", "application/x-director", "http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],
20
- ["WindowsMedia", "6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a", "application/x-mplayer2", "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],
21
- ["QuickTime", "02bf25d5-8c17-4b23-bc80-d3488abddc6b", "video/quicktime", "http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],
22
- ["RealMedia", "cfcdaa03-8be4-11cf-b84b-0020afbbccfa", "audio/x-pn-realaudio-plugin", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],
23
- ["Java", "8ad9c840-044e-11d1-b3e9-00805f499d93", "application/x-java-applet", "http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],
24
- ["Silverlight", "dfeaf541-f3e1-4c24-acac-99c30715084a", "application/x-silverlight-2"],
25
- ["Iframe"],
26
- ["Video"],
27
- ["EmbeddedAudio"],
28
- ["Audio"]
29
- ];
30
-
31
- function toArray(obj) {
32
- var undef, out, i;
33
-
34
- if (obj && !obj.splice) {
35
- out = [];
36
-
37
- for (i = 0; true; i++) {
38
- if (obj[i])
39
- out[i] = obj[i];
40
- else
41
- break;
42
- }
43
-
44
- return out;
45
- }
46
-
47
- return obj;
48
- };
49
-
50
- tinymce.create('tinymce.plugins.MediaPlugin', {
51
- init : function(ed, url) {
52
- var self = this, lookup = {}, i, y, item, name;
53
-
54
- function isMediaImg(node) {
55
- return node && node.nodeName === 'IMG' && ed.dom.hasClass(node, 'mceItemMedia');
56
- };
57
-
58
- self.editor = ed;
59
- self.url = url;
60
-
61
- // Parse media types into a lookup table
62
- scriptRegExp = '';
63
- for (i = 0; i < mediaTypes.length; i++) {
64
- name = mediaTypes[i][0];
65
-
66
- item = {
67
- name : name,
68
- clsids : tinymce.explode(mediaTypes[i][1] || ''),
69
- mimes : tinymce.explode(mediaTypes[i][2] || ''),
70
- codebase : mediaTypes[i][3]
71
- };
72
-
73
- for (y = 0; y < item.clsids.length; y++)
74
- lookup['clsid:' + item.clsids[y]] = item;
75
-
76
- for (y = 0; y < item.mimes.length; y++)
77
- lookup[item.mimes[y]] = item;
78
-
79
- lookup['mceItem' + name] = item;
80
- lookup[name.toLowerCase()] = item;
81
-
82
- scriptRegExp += (scriptRegExp ? '|' : '') + name;
83
- }
84
-
85
- // Handle the media_types setting
86
- tinymce.each(ed.getParam("media_types",
87
- "video=mp4,m4v,ogv,webm;" +
88
- "silverlight=xap;" +
89
- "flash=swf,flv;" +
90
- "shockwave=dcr;" +
91
- "quicktime=mov,qt,mpg,mpeg;" +
92
- "shockwave=dcr;" +
93
- "windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;" +
94
- "realmedia=rm,ra,ram;" +
95
- "java=jar;" +
96
- "audio=mp3,ogg"
97
- ).split(';'), function(item) {
98
- var i, extensions, type;
99
-
100
- item = item.split(/=/);
101
- extensions = tinymce.explode(item[1].toLowerCase());
102
- for (i = 0; i < extensions.length; i++) {
103
- type = lookup[item[0].toLowerCase()];
104
-
105
- if (type)
106
- lookup[extensions[i]] = type;
107
- }
108
- });
109
-
110
- scriptRegExp = new RegExp('write(' + scriptRegExp + ')\\(([^)]+)\\)');
111
- self.lookup = lookup;
112
-
113
- ed.onPreInit.add(function() {
114
- // Allow video elements
115
- ed.schema.addValidElements('object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]');
116
-
117
- // Convert video elements to image placeholder
118
- ed.parser.addNodeFilter('object,embed,video,audio,script,iframe', function(nodes) {
119
- var i = nodes.length;
120
-
121
- while (i--)
122
- self.objectToImg(nodes[i]);
123
- });
124
-
125
- // Convert image placeholders to video elements
126
- ed.serializer.addNodeFilter('img', function(nodes, name, args) {
127
- var i = nodes.length, node;
128
-
129
- while (i--) {
130
- node = nodes[i];
131
- if ((node.attr('class') || '').indexOf('mceItemMedia') !== -1)
132
- self.imgToObject(node, args);
133
- }
134
- });
135
- });
136
-
137
- ed.onInit.add(function() {
138
- // Display "media" instead of "img" in element path
139
- if (ed.theme && ed.theme.onResolveName) {
140
- ed.theme.onResolveName.add(function(theme, path_object) {
141
- if (path_object.name === 'img' && ed.dom.hasClass(path_object.node, 'mceItemMedia'))
142
- path_object.name = 'media';
143
- });
144
- }
145
-
146
- // Add contect menu if it's loaded
147
- if (ed && ed.plugins.contextmenu) {
148
- ed.plugins.contextmenu.onContextMenu.add(function(plugin, menu, element) {
149
- if (element.nodeName === 'IMG' && element.className.indexOf('mceItemMedia') !== -1)
150
- menu.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});
151
- });
152
- }
153
- });
154
-
155
- // Register commands
156
- ed.addCommand('mceMedia', function() {
157
- var data, img;
158
-
159
- img = ed.selection.getNode();
160
- if (isMediaImg(img)) {
161
- data = ed.dom.getAttrib(img, 'data-mce-json');
162
- if (data) {
163
- data = JSON.parse(data);
164
-
165
- // Add some extra properties to the data object
166
- tinymce.each(rootAttributes, function(name) {
167
- var value = ed.dom.getAttrib(img, name);
168
-
169
- if (value)
170
- data[name] = value;
171
- });
172
-
173
- data.type = self.getType(img.className).name.toLowerCase();
174
- }
175
- }
176
-
177
- if (!data) {
178
- data = {
179
- type : 'flash',
180
- video: {sources:[]},
181
- params: {}
182
- };
183
- }
184
-
185
- ed.windowManager.open({
186
- file : url + '/media.htm',
187
- width : 430 + parseInt(ed.getLang('media.delta_width', 0)),
188
- height : 500 + parseInt(ed.getLang('media.delta_height', 0)),
189
- inline : 1
190
- }, {
191
- plugin_url : url,
192
- data : data
193
- });
194
- });
195
-
196
- // Register buttons
197
- ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'});
198
-
199
- // Update media selection status
200
- ed.onNodeChange.add(function(ed, cm, node) {
201
- cm.setActive('media', isMediaImg(node));
202
- });
203
- },
204
-
205
- convertUrl : function(url, force_absolute) {
206
- var self = this, editor = self.editor, settings = editor.settings,
207
- urlConverter = settings.url_converter,
208
- urlConverterScope = settings.url_converter_scope || self;
209
-
210
- if (!url)
211
- return url;
212
-
213
- if (force_absolute)
214
- return editor.documentBaseURI.toAbsolute(url);
215
-
216
- return urlConverter.call(urlConverterScope, url, 'src', 'object');
217
- },
218
-
219
- getInfo : function() {
220
- return {
221
- longname : 'Media',
222
- author : 'Moxiecode Systems AB',
223
- authorurl : 'http://tinymce.moxiecode.com',
224
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',
225
- version : tinymce.majorVersion + "." + tinymce.minorVersion
226
- };
227
- },
228
-
229
- /**
230
- * Converts the JSON data object to an img node.
231
- */
232
- dataToImg : function(data, force_absolute) {
233
- var self = this, editor = self.editor, baseUri = editor.documentBaseURI, sources, attrs, img, i;
234
-
235
- data.params.src = self.convertUrl(data.params.src, force_absolute);
236
-
237
- attrs = data.video.attrs;
238
- if (attrs)
239
- attrs.src = self.convertUrl(attrs.src, force_absolute);
240
-
241
- if (attrs)
242
- attrs.poster = self.convertUrl(attrs.poster, force_absolute);
243
-
244
- sources = toArray(data.video.sources);
245
- if (sources) {
246
- for (i = 0; i < sources.length; i++)
247
- sources[i].src = self.convertUrl(sources[i].src, force_absolute);
248
- }
249
-
250
- img = self.editor.dom.create('img', {
251
- id : data.id,
252
- style : data.style,
253
- align : data.align,
254
- hspace : data.hspace,
255
- vspace : data.vspace,
256
- src : self.editor.theme.url + '/img/trans.gif',
257
- 'class' : 'mceItemMedia mceItem' + self.getType(data.type).name,
258
- 'data-mce-json' : JSON.serialize(data, "'")
259
- });
260
-
261
- img.width = data.width || (data.type == 'audio' ? "300" : "320");
262
- img.height = data.height || (data.type == 'audio' ? "32" : "240");
263
-
264
- return img;
265
- },
266
-
267
- /**
268
- * Converts the JSON data object to a HTML string.
269
- */
270
- dataToHtml : function(data, force_absolute) {
271
- return this.editor.serializer.serialize(this.dataToImg(data, force_absolute), {forced_root_block : '', force_absolute : force_absolute});
272
- },
273
-
274
- /**
275
- * Converts the JSON data object to a HTML string.
276
- */
277
- htmlToData : function(html) {
278
- var fragment, img, data;
279
-
280
- data = {
281
- type : 'flash',
282
- video: {sources:[]},
283
- params: {}
284
- };
285
-
286
- fragment = this.editor.parser.parse(html);
287
- img = fragment.getAll('img')[0];
288
-
289
- if (img) {
290
- data = JSON.parse(img.attr('data-mce-json'));
291
- data.type = this.getType(img.attr('class')).name.toLowerCase();
292
-
293
- // Add some extra properties to the data object
294
- tinymce.each(rootAttributes, function(name) {
295
- var value = img.attr(name);
296
-
297
- if (value)
298
- data[name] = value;
299
- });
300
- }
301
-
302
- return data;
303
- },
304
-
305
- /**
306
- * Get type item by extension, class, clsid or mime type.
307
- *
308
- * @method getType
309
- * @param {String} value Value to get type item by.
310
- * @return {Object} Type item object or undefined.
311
- */
312
- getType : function(value) {
313
- var i, values, typeItem;
314
-
315
- // Find type by checking the classes
316
- values = tinymce.explode(value, ' ');
317
- for (i = 0; i < values.length; i++) {
318
- typeItem = this.lookup[values[i]];
319
-
320
- if (typeItem)
321
- return typeItem;
322
- }
323
- },
324
-
325
- /**
326
- * Converts a tinymce.html.Node image element to video/object/embed.
327
- */
328
- imgToObject : function(node, args) {
329
- var self = this, editor = self.editor, video, object, embed, iframe, name, value, data,
330
- source, sources, params, param, typeItem, i, item, mp4Source, replacement,
331
- posterSrc, style, audio;
332
-
333
- // Adds the flash player
334
- function addPlayer(video_src, poster_src) {
335
- var baseUri, flashVars, flashVarsOutput, params, flashPlayer;
336
-
337
- flashPlayer = editor.getParam('flash_video_player_url', self.convertUrl(self.url + '/moxieplayer.swf'));
338
- if (flashPlayer) {
339
- baseUri = editor.documentBaseURI;
340
- data.params.src = flashPlayer;
341
-
342
- // Convert the movie url to absolute urls
343
- if (editor.getParam('flash_video_player_absvideourl', true)) {
344
- video_src = baseUri.toAbsolute(video_src || '', true);
345
- poster_src = baseUri.toAbsolute(poster_src || '', true);
346
- }
347
-
348
- // Generate flash vars
349
- flashVarsOutput = '';
350
- flashVars = editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'});
351
- tinymce.each(flashVars, function(value, name) {
352
- // Replace $url and $poster variables in flashvars value
353
- value = value.replace(/\$url/, video_src || '');
354
- value = value.replace(/\$poster/, poster_src || '');
355
-
356
- if (value.length > 0)
357
- flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value);
358
- });
359
-
360
- if (flashVarsOutput.length)
361
- data.params.flashvars = flashVarsOutput;
362
-
363
- params = editor.getParam('flash_video_player_params', {
364
- allowfullscreen: true,
365
- allowscriptaccess: true
366
- });
367
-
368
- tinymce.each(params, function(value, name) {
369
- data.params[name] = "" + value;
370
- });
371
- }
372
- };
373
-
374
- data = node.attr('data-mce-json');
375
- if (!data)
376
- return;
377
-
378
- data = JSON.parse(data);
379
- typeItem = this.getType(node.attr('class'));
380
-
381
- style = node.attr('data-mce-style')
382
- if (!style) {
383
- style = node.attr('style');
384
-
385
- if (style)
386
- style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img'));
387
- }
388
-
389
- // Handle iframe
390
- if (typeItem.name === 'Iframe') {
391
- replacement = new Node('iframe', 1);
392
-
393
- tinymce.each(rootAttributes, function(name) {
394
- var value = node.attr(name);
395
-
396
- if (name == 'class' && value)
397
- value = value.replace(/mceItem.+ ?/g, '');
398
-
399
- if (value && value.length > 0)
400
- replacement.attr(name, value);
401
- });
402
-
403
- for (name in data.params)
404
- replacement.attr(name, data.params[name]);
405
-
406
- replacement.attr({
407
- style: style,
408
- src: data.params.src
409
- });
410
-
411
- node.replace(replacement);
412
-
413
- return;
414
- }
415
-
416
- // Handle scripts
417
- if (this.editor.settings.media_use_script) {
418
- replacement = new Node('script', 1).attr('type', 'text/javascript');
419
-
420
- value = new Node('#text', 3);
421
- value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, {
422
- width: node.attr('width'),
423
- height: node.attr('height')
424
- })) + ');';
425
-
426
- replacement.append(value);
427
- node.replace(replacement);
428
-
429
- return;
430
- }
431
-
432
- // Add HTML5 video element
433
- if (typeItem.name === 'Video' && data.video.sources[0]) {
434
- // Create new object element
435
- video = new Node('video', 1).attr(tinymce.extend({
436
- id : node.attr('id'),
437
- width: node.attr('width'),
438
- height: node.attr('height'),
439
- style : style
440
- }, data.video.attrs));
441
-
442
- // Get poster source and use that for flash fallback
443
- if (data.video.attrs)
444
- posterSrc = data.video.attrs.poster;
445
-
446
- sources = data.video.sources = toArray(data.video.sources);
447
- for (i = 0; i < sources.length; i++) {
448
- if (/\.mp4$/.test(sources[i].src))
449
- mp4Source = sources[i].src;
450
- }
451
-
452
- if (!sources[0].type) {
453
- video.attr('src', sources[0].src);
454
- sources.splice(0, 1);
455
- }
456
-
457
- for (i = 0; i < sources.length; i++) {
458
- source = new Node('source', 1).attr(sources[i]);
459
- source.shortEnded = true;
460
- video.append(source);
461
- }
462
-
463
- // Create flash fallback for video if we have a mp4 source
464
- if (mp4Source) {
465
- addPlayer(mp4Source, posterSrc);
466
- typeItem = self.getType('flash');
467
- } else
468
- data.params.src = '';
469
- }
470
-
471
- // Add HTML5 audio element
472
- if (typeItem.name === 'Audio' && data.video.sources[0]) {
473
- // Create new object element
474
- audio = new Node('audio', 1).attr(tinymce.extend({
475
- id : node.attr('id'),
476
- width: node.attr('width'),
477
- height: node.attr('height'),
478
- style : style
479
- }, data.video.attrs));
480
-
481
- // Get poster source and use that for flash fallback
482
- if (data.video.attrs)
483
- posterSrc = data.video.attrs.poster;
484
-
485
- sources = data.video.sources = toArray(data.video.sources);
486
- if (!sources[0].type) {
487
- audio.attr('src', sources[0].src);
488
- sources.splice(0, 1);
489
- }
490
-
491
- for (i = 0; i < sources.length; i++) {
492
- source = new Node('source', 1).attr(sources[i]);
493
- source.shortEnded = true;
494
- audio.append(source);
495
- }
496
-
497
- data.params.src = '';
498
- }
499
-
500
- if (typeItem.name === 'EmbeddedAudio') {
501
- embed = new Node('embed', 1);
502
- embed.shortEnded = true;
503
- embed.attr({
504
- id: node.attr('id'),
505
- width: node.attr('width'),
506
- height: node.attr('height'),
507
- style : style,
508
- type: node.attr('type')
509
- });
510
-
511
- for (name in data.params)
512
- embed.attr(name, data.params[name]);
513
-
514
- tinymce.each(rootAttributes, function(name) {
515
- if (data[name] && name != 'type')
516
- embed.attr(name, data[name]);
517
- });
518
-
519
- data.params.src = '';
520
- }
521
-
522
- // Do we have a params src then we can generate object
523
- if (data.params.src) {
524
- // Is flv movie add player for it
525
- if (/\.flv$/i.test(data.params.src))
526
- addPlayer(data.params.src, '');
527
-
528
- if (args && args.force_absolute)
529
- data.params.src = editor.documentBaseURI.toAbsolute(data.params.src);
530
-
531
- // Create new object element
532
- object = new Node('object', 1).attr({
533
- id : node.attr('id'),
534
- width: node.attr('width'),
535
- height: node.attr('height'),
536
- style : style
537
- });
538
-
539
- tinymce.each(rootAttributes, function(name) {
540
- var value = data[name];
541
-
542
- if (name == 'class' && value)
543
- value = value.replace(/mceItem.+ ?/g, '');
544
-
545
- if (value && name != 'type')
546
- object.attr(name, value);
547
- });
548
-
549
- // Add params
550
- for (name in data.params) {
551
- param = new Node('param', 1);
552
- param.shortEnded = true;
553
- value = data.params[name];
554
-
555
- // Windows media needs to use url instead of src for the media URL
556
- if (name === 'src' && typeItem.name === 'WindowsMedia')
557
- name = 'url';
558
-
559
- param.attr({name: name, value: value});
560
- object.append(param);
561
- }
562
-
563
- // Setup add type and classid if strict is disabled
564
- if (this.editor.getParam('media_strict', true)) {
565
- object.attr({
566
- data: data.params.src,
567
- type: typeItem.mimes[0]
568
- });
569
- } else {
570
- object.attr({
571
- classid: "clsid:" + typeItem.clsids[0],
572
- codebase: typeItem.codebase
573
- });
574
-
575
- embed = new Node('embed', 1);
576
- embed.shortEnded = true;
577
- embed.attr({
578
- id: node.attr('id'),
579
- width: node.attr('width'),
580
- height: node.attr('height'),
581
- style : style,
582
- type: typeItem.mimes[0]
583
- });
584
-
585
- for (name in data.params)
586
- embed.attr(name, data.params[name]);
587
-
588
- tinymce.each(rootAttributes, function(name) {
589
- if (data[name] && name != 'type')
590
- embed.attr(name, data[name]);
591
- });
592
-
593
- object.append(embed);
594
- }
595
-
596
- // Insert raw HTML
597
- if (data.object_html) {
598
- value = new Node('#text', 3);
599
- value.raw = true;
600
- value.value = data.object_html;
601
- object.append(value);
602
- }
603
-
604
- // Append object to video element if it exists
605
- if (video)
606
- video.append(object);
607
- }
608
-
609
- if (video) {
610
- // Insert raw HTML
611
- if (data.video_html) {
612
- value = new Node('#text', 3);
613
- value.raw = true;
614
- value.value = data.video_html;
615
- video.append(value);
616
- }
617
- }
618
-
619
- if (audio) {
620
- // Insert raw HTML
621
- if (data.video_html) {
622
- value = new Node('#text', 3);
623
- value.raw = true;
624
- value.value = data.video_html;
625
- audio.append(value);
626
- }
627
- }
628
-
629
- var n = video || audio || object || embed;
630
- if (n)
631
- node.replace(n);
632
- else
633
- node.remove();
634
- },
635
-
636
- /**
637
- * Converts a tinymce.html.Node video/object/embed to an img element.
638
- *
639
- * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this:
640
- * <img class="mceItemMedia mceItemFlash" width="100" height="100" data-mce-json="{..}" />
641
- *
642
- * The JSON structure will be like this:
643
- * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}}
644
- */
645
- objectToImg : function(node) {
646
- var object, embed, video, iframe, img, name, id, width, height, style, i, html,
647
- param, params, source, sources, data, type, lookup = this.lookup,
648
- matches, attrs, urlConverter = this.editor.settings.url_converter,
649
- urlConverterScope = this.editor.settings.url_converter_scope,
650
- hspace, vspace, align, bgcolor;
651
-
652
- function getInnerHTML(node) {
653
- return new tinymce.html.Serializer({
654
- inner: true,
655
- validate: false
656
- }).serialize(node);
657
- };
658
-
659
- function lookupAttribute(o, attr) {
660
- return lookup[(o.attr(attr) || '').toLowerCase()];
661
- }
662
-
663
- function lookupExtension(src) {
664
- var ext = src.replace(/^.*\.([^.]+)$/, '$1');
665
- return lookup[ext.toLowerCase() || ''];
666
- }
667
-
668
- // If node isn't in document
669
- if (!node.parent)
670
- return;
671
-
672
- // Handle media scripts
673
- if (node.name === 'script') {
674
- if (node.firstChild)
675
- matches = scriptRegExp.exec(node.firstChild.value);
676
-
677
- if (!matches)
678
- return;
679
-
680
- type = matches[1];
681
- data = {video : {}, params : JSON.parse(matches[2])};
682
- width = data.params.width;
683
- height = data.params.height;
684
- }
685
-
686
- // Setup data objects
687
- data = data || {
688
- video : {},
689
- params : {}
690
- };
691
-
692
- // Setup new image object
693
- img = new Node('img', 1);
694
- img.attr({
695
- src : this.editor.theme.url + '/img/trans.gif'
696
- });
697
-
698
- // Video element
699
- name = node.name;
700
- if (name === 'video' || name == 'audio') {
701
- video = node;
702
- object = node.getAll('object')[0];
703
- embed = node.getAll('embed')[0];
704
- width = video.attr('width');
705
- height = video.attr('height');
706
- id = video.attr('id');
707
- data.video = {attrs : {}, sources : []};
708
-
709
- // Get all video attributes
710
- attrs = data.video.attrs;
711
- for (name in video.attributes.map)
712
- attrs[name] = video.attributes.map[name];
713
-
714
- source = node.attr('src');
715
- if (source)
716
- data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)});
717
-
718
- // Get all sources
719
- sources = video.getAll("source");
720
- for (i = 0; i < sources.length; i++) {
721
- source = sources[i].remove();
722
-
723
- data.video.sources.push({
724
- src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'),
725
- type: source.attr('type'),
726
- media: source.attr('media')
727
- });
728
- }
729
-
730
- // Convert the poster URL
731
- if (attrs.poster)
732
- attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name);
733
- }
734
-
735
- // Object element
736
- if (node.name === 'object') {
737
- object = node;
738
- embed = node.getAll('embed')[0];
739
- }
740
-
741
- // Embed element
742
- if (node.name === 'embed')
743
- embed = node;
744
-
745
- // Iframe element
746
- if (node.name === 'iframe') {
747
- iframe = node;
748
- type = 'Iframe';
749
- }
750
-
751
- if (object) {
752
- // Get width/height
753
- width = width || object.attr('width');
754
- height = height || object.attr('height');
755
- style = style || object.attr('style');
756
- id = id || object.attr('id');
757
- hspace = hspace || object.attr('hspace');
758
- vspace = vspace || object.attr('vspace');
759
- align = align || object.attr('align');
760
- bgcolor = bgcolor || object.attr('bgcolor');
761
- data.name = object.attr('name');
762
-
763
- // Get all object params
764
- params = object.getAll("param");
765
- for (i = 0; i < params.length; i++) {
766
- param = params[i];
767
- name = param.remove().attr('name');
768
-
769
- if (!excludedAttrs[name])
770
- data.params[name] = param.attr('value');
771
- }
772
-
773
- data.params.src = data.params.src || object.attr('data');
774
- }
775
-
776
- if (embed) {
777
- // Get width/height
778
- width = width || embed.attr('width');
779
- height = height || embed.attr('height');
780
- style = style || embed.attr('style');
781
- id = id || embed.attr('id');
782
- hspace = hspace || embed.attr('hspace');
783
- vspace = vspace || embed.attr('vspace');
784
- align = align || embed.attr('align');
785
- bgcolor = bgcolor || embed.attr('bgcolor');
786
-
787
- // Get all embed attributes
788
- for (name in embed.attributes.map) {
789
- if (!excludedAttrs[name] && !data.params[name])
790
- data.params[name] = embed.attributes.map[name];
791
- }
792
- }
793
-
794
- if (iframe) {
795
- // Get width/height
796
- width = iframe.attr('width');
797
- height = iframe.attr('height');
798
- style = style || iframe.attr('style');
799
- id = iframe.attr('id');
800
- hspace = iframe.attr('hspace');
801
- vspace = iframe.attr('vspace');
802
- align = iframe.attr('align');
803
- bgcolor = iframe.attr('bgcolor');
804
-
805
- tinymce.each(rootAttributes, function(name) {
806
- img.attr(name, iframe.attr(name));
807
- });
808
-
809
- // Get all iframe attributes
810
- for (name in iframe.attributes.map) {
811
- if (!excludedAttrs[name] && !data.params[name])
812
- data.params[name] = iframe.attributes.map[name];
813
- }
814
- }
815
-
816
- // Use src not movie
817
- if (data.params.movie) {
818
- data.params.src = data.params.src || data.params.movie;
819
- delete data.params.movie;
820
- }
821
-
822
- // Convert the URL to relative/absolute depending on configuration
823
- if (data.params.src)
824
- data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object');
825
-
826
- if (video) {
827
- if (node.name === 'video')
828
- type = lookup.video.name;
829
- else if (node.name === 'audio')
830
- type = lookup.audio.name;
831
- }
832
-
833
- if (object && !type)
834
- type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name;
835
-
836
- if (embed && !type)
837
- type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name;
838
-
839
- // for embedded audio we preserve the original specified type
840
- if (embed && type == 'EmbeddedAudio') {
841
- data.params.type = embed.attr('type');
842
- }
843
-
844
- // Replace the video/object/embed element with a placeholder image containing the data
845
- node.replace(img);
846
-
847
- // Remove embed
848
- if (embed)
849
- embed.remove();
850
-
851
- // Serialize the inner HTML of the object element
852
- if (object) {
853
- html = getInnerHTML(object.remove());
854
-
855
- if (html)
856
- data.object_html = html;
857
- }
858
-
859
- // Serialize the inner HTML of the video element
860
- if (video) {
861
- html = getInnerHTML(video.remove());
862
-
863
- if (html)
864
- data.video_html = html;
865
- }
866
-
867
- data.hspace = hspace;
868
- data.vspace = vspace;
869
- data.align = align;
870
- data.bgcolor = bgcolor;
871
-
872
- // Set width/height of placeholder
873
- img.attr({
874
- id : id,
875
- 'class' : 'mceItemMedia mceItem' + (type || 'Flash'),
876
- style : style,
877
- width : width || (node.name == 'audio' ? "300" : "320"),
878
- height : height || (node.name == 'audio' ? "32" : "240"),
879
- hspace : hspace,
880
- vspace : vspace,
881
- align : align,
882
- bgcolor : bgcolor,
883
- "data-mce-json" : JSON.serialize(data, "'")
884
- });
885
- }
886
- });
887
-
888
- // Register plugin
889
- tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin);
890
- })();