compass-jquery-plugin 0.3.2.6 → 0.3.2.7.nil
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -1
- data/VERSION.yml +2 -2
- data/lib/handle_js_files.rb +21 -2
- data/templates/dynatree/jquery.dynatree.js +23 -20
- data/templates/dynatree/jquery.dynatree.min.js +38 -38
- data/templates/dynatree/jquery/dynatree/aero.scss +1 -1
- data/templates/dynatree/jquery/dynatree/aqua.scss +1 -1
- data/templates/dynatree/jquery/dynatree/crystal.scss +1 -1
- data/templates/dynatree/jquery/dynatree/xp.scss +2 -2
- data/templates/ical/jquery/ical.scss +10 -10
- data/templates/jqgrid/i18n/jqgrid/locale-lt.js +134 -0
- data/templates/jqgrid/i18n/jqgrid/locale-lt.min.js +7 -0
- data/templates/jqgrid/jquery.jqGrid.js +155 -65
- data/templates/jqgrid/jquery.jqGrid.min.js +396 -393
- data/templates/jqgrid/manifest.rb +2 -0
- data/templates/jqtouch/jquery.jqtouch.js +166 -195
- data/templates/jqtouch/jquery.jqtouch.min.js +1 -1
- data/templates/jqtouch/jquery/touch/apple.scss +5 -5
- data/templates/jqtouch/jquery/touch/default.scss +5 -5
- data/templates/jqtouch/jquery/touch/jqt.scss +12 -7
- data/templates/jqtouch/jquery/touch/jqtouch.scss +11 -13
- data/templates/jquery/history.adapter.jquery.js +54 -67
- data/templates/jquery/history.adapter.jquery.min.js +2 -2
- data/templates/jquery/history.html4.js +587 -680
- data/templates/jquery/history.html4.min.js +8 -18
- data/templates/jquery/history.js +1670 -1289
- data/templates/jquery/history.min.js +25 -21
- data/templates/jquery/i18n/jquery.ui/datepicker-ar.js +1 -1
- data/templates/jquery/i18n/jquery.ui/datepicker-ar.min.js +1 -1
- data/templates/jquery/i18n/jquery.ui/datepicker-tj.js +23 -0
- data/templates/jquery/i18n/jquery.ui/datepicker-tj.min.js +2 -0
- data/templates/jquery/jquery-ui.js +97 -61
- data/templates/jquery/jquery-ui.min.js +175 -175
- data/templates/jquery/jquery.dst.js +86 -151
- data/templates/jquery/jquery/ui/_theme.scss +13 -13
- data/templates/jquery/json2.js +214 -214
- data/templates/jquery/manifest.rb +2 -0
- data/templates/mobile/jquery.mobile.js +324 -225
- data/templates/mobile/jquery.mobile.min.js +4 -4
- data/templates/mobile/jquery/mobile/_base.scss +60 -48
- data/templates/mobile/jquery/mobile/default.scss +57 -80
- data/templates/mobile/jquery/mobile/default/icons-18-black.png +0 -0
- data/templates/mobile/jquery/mobile/default/icons-18-white.png +0 -0
- data/templates/mobile/jquery/mobile/default/icons-36-black.png +0 -0
- data/templates/mobile/jquery/mobile/default/icons-36-white.png +0 -0
- data/templates/mobile/jquery/mobile/valencia.scss +61 -73
- data/templates/mobile/jquery/mobile/valencia/icons-18-black.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/icons-18-white.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/icons-36-black.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/icons-36-white.png +0 -0
- data/templates/mobile/manifest.rb +0 -8
- data/templates/ribbon/jquery/ribbon/office.scss +12 -12
- data/templates/ribbon/jquery/ribbon/windows7.scss +12 -12
- data/templates/tiny_mce/manifest.rb +16 -0
- data/templates/tiny_mce/tiny_mce/jquery.tinymce.js +1 -1
- data/templates/tiny_mce/tiny_mce/langs/de.js +1 -0
- data/templates/tiny_mce/tiny_mce/langs/en.js +1 -222
- data/templates/tiny_mce/tiny_mce/plugins/advhr/css/advhr.css +1 -5
- data/templates/tiny_mce/tiny_mce/plugins/advhr/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/advhr/editor_plugin_src.js +1 -57
- data/templates/tiny_mce/tiny_mce/plugins/advhr/js/rule.js +1 -43
- data/templates/tiny_mce/tiny_mce/plugins/advhr/langs/de_dlg.js +1 -0
- data/templates/tiny_mce/tiny_mce/plugins/advhr/langs/en_dlg.js +1 -7
- data/templates/tiny_mce/tiny_mce/plugins/advhr/rule.htm +1 -58
- data/templates/tiny_mce/tiny_mce/plugins/advimage/css/advimage.css +1 -13
- data/templates/tiny_mce/tiny_mce/plugins/advimage/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/advimage/editor_plugin_src.js +1 -50
- data/templates/tiny_mce/tiny_mce/plugins/advimage/image.htm +1 -235
- data/templates/tiny_mce/tiny_mce/plugins/advimage/js/image.js +1 -445
- data/templates/tiny_mce/tiny_mce/plugins/advimage/langs/de_dlg.js +1 -0
- data/templates/tiny_mce/tiny_mce/plugins/advimage/langs/en_dlg.js +1 -45
- data/templates/tiny_mce/tiny_mce/plugins/advlink/css/advlink.css +1 -8
- data/templates/tiny_mce/tiny_mce/plugins/advlink/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/advlink/editor_plugin_src.js +1 -61
- data/templates/tiny_mce/tiny_mce/plugins/advlink/js/advlink.js +1 -525
- data/templates/tiny_mce/tiny_mce/plugins/advlink/langs/de_dlg.js +1 -0
- data/templates/tiny_mce/tiny_mce/plugins/advlink/langs/en_dlg.js +1 -54
- data/templates/tiny_mce/tiny_mce/plugins/advlink/link.htm +1 -338
- data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin_src.js +1 -154
- data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin_src.js +1 -119
- data/templates/tiny_mce/tiny_mce/plugins/autosave/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/autosave/editor_plugin_src.js +1 -431
- data/templates/tiny_mce/tiny_mce/plugins/autosave/langs/en.js +1 -4
- data/templates/tiny_mce/tiny_mce/plugins/bbcode/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/bbcode/editor_plugin_src.js +1 -120
- data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin_src.js +1 -154
- data/templates/tiny_mce/tiny_mce/plugins/directionality/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/directionality/editor_plugin_src.js +1 -82
- data/templates/tiny_mce/tiny_mce/plugins/emotions/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/emotions/editor_plugin_src.js +1 -43
- data/templates/tiny_mce/tiny_mce/plugins/emotions/emotions.htm +1 -41
- data/templates/tiny_mce/tiny_mce/plugins/emotions/js/emotions.js +1 -22
- data/templates/tiny_mce/tiny_mce/plugins/emotions/langs/de_dlg.js +1 -0
- data/templates/tiny_mce/tiny_mce/plugins/emotions/langs/en_dlg.js +1 -20
- data/templates/tiny_mce/tiny_mce/plugins/example/dialog.htm +1 -22
- data/templates/tiny_mce/tiny_mce/plugins/example/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/example/editor_plugin_src.js +1 -84
- data/templates/tiny_mce/tiny_mce/plugins/example/js/dialog.js +1 -19
- data/templates/tiny_mce/tiny_mce/plugins/example/langs/en.js +1 -3
- data/templates/tiny_mce/tiny_mce/plugins/example/langs/en_dlg.js +1 -3
- data/templates/tiny_mce/tiny_mce/plugins/fullpage/css/fullpage.css +1 -182
- data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin_src.js +1 -166
- data/templates/tiny_mce/tiny_mce/plugins/fullpage/fullpage.htm +1 -571
- data/templates/tiny_mce/tiny_mce/plugins/fullpage/js/fullpage.js +1 -492
- data/templates/tiny_mce/tiny_mce/plugins/fullpage/langs/de_dlg.js +1 -0
- data/templates/tiny_mce/tiny_mce/plugins/fullpage/langs/en_dlg.js +1 -85
- data/templates/tiny_mce/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/fullscreen/editor_plugin_src.js +1 -159
- data/templates/tiny_mce/tiny_mce/plugins/fullscreen/fullscreen.htm +1 -109
- data/templates/tiny_mce/tiny_mce/plugins/iespell/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/iespell/editor_plugin_src.js +1 -54
- data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +1 -696
- data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +1 -90
- data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/template.htm +1 -387
- data/templates/tiny_mce/tiny_mce/plugins/insertdatetime/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +1 -83
- data/templates/tiny_mce/tiny_mce/plugins/layer/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/layer/editor_plugin_src.js +1 -214
- data/templates/tiny_mce/tiny_mce/plugins/legacyoutput/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +1 -139
- data/templates/tiny_mce/tiny_mce/plugins/media/css/media.css +1 -17
- data/templates/tiny_mce/tiny_mce/plugins/media/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/media/editor_plugin_src.js +1 -770
- data/templates/tiny_mce/tiny_mce/plugins/media/js/embed.js +1 -73
- data/templates/tiny_mce/tiny_mce/plugins/media/js/media.js +1 -340
- data/templates/tiny_mce/tiny_mce/plugins/media/langs/de_dlg.js +1 -0
- data/templates/tiny_mce/tiny_mce/plugins/media/langs/en_dlg.js +1 -109
- data/templates/tiny_mce/tiny_mce/plugins/media/media.htm +1 -812
- data/templates/tiny_mce/tiny_mce/plugins/nonbreaking/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +1 -53
- data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin_src.js +1 -90
- data/templates/tiny_mce/tiny_mce/plugins/pagebreak/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/pagebreak/editor_plugin_src.js +1 -74
- data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin_src.js +1 -899
- data/templates/tiny_mce/tiny_mce/plugins/paste/js/pastetext.js +1 -36
- data/templates/tiny_mce/tiny_mce/plugins/paste/js/pasteword.js +1 -51
- data/templates/tiny_mce/tiny_mce/plugins/paste/langs/de_dlg.js +1 -0
- data/templates/tiny_mce/tiny_mce/plugins/paste/langs/en_dlg.js +1 -5
- data/templates/tiny_mce/tiny_mce/plugins/paste/pastetext.htm +1 -27
- data/templates/tiny_mce/tiny_mce/plugins/paste/pasteword.htm +1 -21
- data/templates/tiny_mce/tiny_mce/plugins/preview/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/preview/editor_plugin_src.js +1 -53
- data/templates/tiny_mce/tiny_mce/plugins/preview/example.html +17 -16
- data/templates/tiny_mce/tiny_mce/plugins/preview/jscripts/embed.js +1 -73
- data/templates/tiny_mce/tiny_mce/plugins/preview/preview.html +10 -9
- data/templates/tiny_mce/tiny_mce/plugins/print/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/print/editor_plugin_src.js +1 -34
- data/templates/tiny_mce/tiny_mce/plugins/save/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/save/editor_plugin_src.js +1 -101
- data/templates/tiny_mce/tiny_mce/plugins/searchreplace/css/searchreplace.css +1 -6
- data/templates/tiny_mce/tiny_mce/plugins/searchreplace/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/searchreplace/editor_plugin_src.js +1 -61
- data/templates/tiny_mce/tiny_mce/plugins/searchreplace/js/searchreplace.js +1 -140
- data/templates/tiny_mce/tiny_mce/plugins/searchreplace/langs/de_dlg.js +1 -0
- data/templates/tiny_mce/tiny_mce/plugins/searchreplace/langs/en_dlg.js +1 -16
- data/templates/tiny_mce/tiny_mce/plugins/searchreplace/searchreplace.htm +1 -100
- data/templates/tiny_mce/tiny_mce/plugins/spellchecker/css/content.css +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin_src.js +1 -415
- data/templates/tiny_mce/tiny_mce/plugins/style/css/props.css +1 -13
- data/templates/tiny_mce/tiny_mce/plugins/style/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/style/editor_plugin_src.js +1 -55
- data/templates/tiny_mce/tiny_mce/plugins/style/js/props.js +1 -635
- data/templates/tiny_mce/tiny_mce/plugins/style/langs/de_dlg.js +1 -0
- data/templates/tiny_mce/tiny_mce/plugins/style/langs/en_dlg.js +1 -70
- data/templates/tiny_mce/tiny_mce/plugins/style/props.htm +1 -838
- data/templates/tiny_mce/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/tabfocus/editor_plugin_src.js +1 -114
- data/templates/tiny_mce/tiny_mce/plugins/table/cell.htm +1 -178
- data/templates/tiny_mce/tiny_mce/plugins/table/css/cell.css +1 -17
- data/templates/tiny_mce/tiny_mce/plugins/table/css/row.css +1 -25
- data/templates/tiny_mce/tiny_mce/plugins/table/css/table.css +1 -13
- data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin_src.js +1 -1183
- data/templates/tiny_mce/tiny_mce/plugins/table/js/cell.js +1 -284
- data/templates/tiny_mce/tiny_mce/plugins/table/js/merge_cells.js +1 -27
- data/templates/tiny_mce/tiny_mce/plugins/table/js/row.js +1 -232
- data/templates/tiny_mce/tiny_mce/plugins/table/js/table.js +1 -450
- data/templates/tiny_mce/tiny_mce/plugins/table/langs/de_dlg.js +1 -0
- data/templates/tiny_mce/tiny_mce/plugins/table/langs/en_dlg.js +1 -74
- data/templates/tiny_mce/tiny_mce/plugins/table/merge_cells.htm +1 -32
- data/templates/tiny_mce/tiny_mce/plugins/table/row.htm +1 -157
- data/templates/tiny_mce/tiny_mce/plugins/table/table.htm +1 -188
- data/templates/tiny_mce/tiny_mce/plugins/template/blank.htm +1 -12
- data/templates/tiny_mce/tiny_mce/plugins/template/css/template.css +1 -23
- data/templates/tiny_mce/tiny_mce/plugins/template/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/template/editor_plugin_src.js +1 -159
- data/templates/tiny_mce/tiny_mce/plugins/template/js/template.js +1 -106
- data/templates/tiny_mce/tiny_mce/plugins/template/langs/de_dlg.js +1 -0
- data/templates/tiny_mce/tiny_mce/plugins/template/langs/en_dlg.js +1 -15
- data/templates/tiny_mce/tiny_mce/plugins/template/template.htm +1 -31
- data/templates/tiny_mce/tiny_mce/plugins/visualchars/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/visualchars/editor_plugin_src.js +1 -83
- data/templates/tiny_mce/tiny_mce/plugins/wordcount/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/wordcount/editor_plugin_src.js +1 -114
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/abbr.htm +1 -142
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/acronym.htm +1 -142
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/attributes.htm +1 -149
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/cite.htm +1 -142
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/css/attributes.css +1 -11
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/css/popup.css +1 -9
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/del.htm +1 -162
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +1 -132
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/ins.htm +1 -162
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/abbr.js +1 -28
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/acronym.js +1 -28
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/attributes.js +1 -125
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/cite.js +1 -28
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/del.js +1 -53
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/element_common.js +1 -229
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/ins.js +1 -53
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/langs/de_dlg.js +1 -0
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +1 -32
- data/templates/tiny_mce/tiny_mce/themes/advanced/about.htm +1 -52
- data/templates/tiny_mce/tiny_mce/themes/advanced/anchor.htm +1 -26
- data/templates/tiny_mce/tiny_mce/themes/advanced/charmap.htm +1 -51
- data/templates/tiny_mce/tiny_mce/themes/advanced/color_picker.htm +1 -74
- data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template.js +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template_src.js +1 -1328
- data/templates/tiny_mce/tiny_mce/themes/advanced/image.htm +1 -80
- data/templates/tiny_mce/tiny_mce/themes/advanced/js/about.js +1 -73
- data/templates/tiny_mce/tiny_mce/themes/advanced/js/anchor.js +1 -42
- data/templates/tiny_mce/tiny_mce/themes/advanced/js/charmap.js +1 -354
- data/templates/tiny_mce/tiny_mce/themes/advanced/js/color_picker.js +1 -329
- data/templates/tiny_mce/tiny_mce/themes/advanced/js/image.js +1 -247
- data/templates/tiny_mce/tiny_mce/themes/advanced/js/link.js +1 -153
- data/templates/tiny_mce/tiny_mce/themes/advanced/js/source_editor.js +1 -56
- data/templates/tiny_mce/tiny_mce/themes/advanced/langs/de.js +1 -0
- data/templates/tiny_mce/tiny_mce/themes/advanced/langs/de_dlg.js +1 -0
- data/templates/tiny_mce/tiny_mce/themes/advanced/langs/en.js +1 -68
- data/templates/tiny_mce/tiny_mce/themes/advanced/langs/en_dlg.js +1 -54
- data/templates/tiny_mce/tiny_mce/themes/advanced/link.htm +1 -57
- data/templates/tiny_mce/tiny_mce/themes/advanced/shortcuts.htm +1 -47
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/content.css +1 -47
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/dialog.css +1 -117
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/ui.css +1 -213
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/content.css +1 -23
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +1 -105
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/ui.css +1 -101
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/content.css +1 -46
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/dialog.css +1 -116
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui.css +1 -215
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +1 -8
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +1 -5
- data/templates/tiny_mce/tiny_mce/themes/advanced/source_editor.htm +1 -25
- data/templates/tiny_mce/tiny_mce/themes/simple/editor_template.js +1 -1
- data/templates/tiny_mce/tiny_mce/themes/simple/editor_template_src.js +1 -84
- data/templates/tiny_mce/tiny_mce/themes/simple/langs/de.js +1 -0
- data/templates/tiny_mce/tiny_mce/themes/simple/langs/en.js +1 -11
- data/templates/tiny_mce/tiny_mce/themes/simple/skins/default/content.css +1 -25
- data/templates/tiny_mce/tiny_mce/themes/simple/skins/default/ui.css +1 -32
- data/templates/tiny_mce/tiny_mce/themes/simple/skins/o2k7/content.css +1 -17
- data/templates/tiny_mce/tiny_mce/themes/simple/skins/o2k7/ui.css +1 -35
- data/templates/tiny_mce/tiny_mce/tiny_mce.js +1 -1
- data/templates/tiny_mce/tiny_mce/tiny_mce_popup.js +1 -5
- data/templates/tiny_mce/tiny_mce/utils/editable_selects.js +1 -70
- data/templates/tiny_mce/tiny_mce/utils/form_utils.js +1 -207
- data/templates/tiny_mce/tiny_mce/utils/mctabs.js +1 -162
- data/templates/tiny_mce/tiny_mce/utils/validate.js +1 -252
- metadata +32 -17
- data/templates/mobile/jquery/mobile/default/form-check-off.png +0 -0
- data/templates/mobile/jquery/mobile/default/form-check-on.png +0 -0
- data/templates/mobile/jquery/mobile/default/form-radio-off.png +0 -0
- data/templates/mobile/jquery/mobile/default/form-radio-on.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/form-check-off.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/form-check-on.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/form-radio-off.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/form-radio-on.png +0 -0
@@ -1,17 +1 @@
|
|
1
|
-
#id
|
2
|
-
#hspace, #vspace { width: 50px }
|
3
|
-
#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px }
|
4
|
-
#flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px }
|
5
|
-
#width, #height { width: 40px }
|
6
|
-
#src, #media_type { width: 250px }
|
7
|
-
#class { width: 120px }
|
8
|
-
#prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto }
|
9
|
-
.panel_wrapper div.current { height: 420px; overflow: auto }
|
10
|
-
#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none }
|
11
|
-
.mceAddSelectValue { background-color: #DDDDDD }
|
12
|
-
#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px }
|
13
|
-
#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px }
|
14
|
-
#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px }
|
15
|
-
#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px }
|
16
|
-
#qt_qtsrc { width: 200px }
|
17
|
-
iframe {border: 1px solid gray}
|
1
|
+
#id,#name,#hspace,#vspace,#class_name,#align{width:100px}#hspace,#vspace{width:50px}#flash_quality,#flash_align,#flash_scale,#flash_salign,#flash_wmode{width:100px}#flash_base,#flash_flashvars,#html5_altsource1,#html5_altsource2,#html5_poster{width:240px}#width,#height{width:40px}#src,#media_type{width:250px}#class{width:120px}#prev{margin:0;border:1px solid black;width:380px;height:260px;overflow:auto}.panel_wrapper div.current{height:420px;overflow:auto}#flash_options,#shockwave_options,#qt_options,#wmp_options,#rmp_options{display:none}.mceAddSelectValue{background-color:#ddd}#qt_starttime,#qt_endtime,#qt_fov,#qt_href,#qt_moveid,#qt_moviename,#qt_node,#qt_pan,#qt_qtsrc,#qt_qtsrcchokespeed,#qt_target,#qt_tilt,#qt_urlsubstituten,#qt_volume{width:70px}#wmp_balance,#wmp_baseurl,#wmp_captioningid,#wmp_currentmarker,#wmp_currentposition,#wmp_defaultframe,#wmp_playcount,#wmp_rate,#wmp_uimode,#wmp_volume{width:70px}#rmp_console,#rmp_numloop,#rmp_controls,#rmp_scriptcallbacks{width:70px}#shockwave_swvolume,#shockwave_swframe,#shockwave_swurl,#shockwave_swstretchvalign,#shockwave_swstretchhalign,#shockwave_swstretchstyle{width:90px}#qt_qtsrc{width:200px}iframe{border:1px solid gray}
|
@@ -1 +1 @@
|
|
1
|
-
(function(){var d=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),h=tinymce.makeMap(d.join(",")),b=tinymce.html.Node,f,a,g=tinymce.util.JSON,e;f=[["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"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["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"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["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"],["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"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"]];function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){var r=this,l={},m,p,q,k;function o(i){return i&&i.nodeName==="IMG"&&n.dom.hasClass(i,"mceItemMedia")}r.editor=n;r.url=j;a="";for(m=0;m<f.length;m++){k=f[m][0];q={name:k,clsids:tinymce.explode(f[m][1]||""),mimes:tinymce.explode(f[m][2]||""),codebase:f[m][3]};for(p=0;p<q.clsids.length;p++){l["clsid:"+q.clsids[p]]=q}for(p=0;p<q.mimes.length;p++){l[q.mimes[p]]=q}l["mceItem"+k]=q;l[k.toLowerCase()]=q;a+=(a?"|":"")+k}tinymce.each(n.getParam("media_types","video=mp4,m4v,ogv,webm;silverlight=xap;flash=swf,flv;shockwave=dcr;quicktime=mov,qt,mpg,mp3,mpeg;shockwave=dcr;windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;realmedia=rm,ra,ram;java=jar").split(";"),function(v){var s,u,t;v=v.split(/=/);u=tinymce.explode(v[1].toLowerCase());for(s=0;s<u.length;s++){t=l[v[0].toLowerCase()];if(t){l[u[s]]=t}}});a=new RegExp("write("+a+")\\(([^)]+)\\)");r.lookup=l;n.onPreInit.add(function(){n.schema.addValidElements("object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]");n.parser.addNodeFilter("object,embed,video,audio,script,iframe",function(s){var t=s.length;while(t--){r.objectToImg(s[t])}});n.serializer.addNodeFilter("img",function(s,u,t){var v=s.length,w;while(v--){w=s[v];if((w.attr("class")||"").indexOf("mceItemMedia")!==-1){r.imgToObject(w,t)}}})});n.onInit.add(function(){if(n.theme&&n.theme.onResolveName){n.theme.onResolveName.add(function(i,s){if(s.name==="img"&&n.dom.hasClass(s.node,"mceItemMedia")){s.name="media"}})}if(n&&n.plugins.contextmenu){n.plugins.contextmenu.onContextMenu.add(function(s,t,i){if(i.nodeName==="IMG"&&i.className.indexOf("mceItemMedia")!==-1){t.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});n.addCommand("mceMedia",function(){var s,i;i=n.selection.getNode();if(o(i)){s=g.parse(n.dom.getAttrib(i,"data-mce-json"));tinymce.each(d,function(t){var u=n.dom.getAttrib(i,t);if(u){s[t]=u}});s.type=r.getType(i.className).name.toLowerCase()}if(!s){s={type:"flash",video:{sources:[]},params:{}}}n.windowManager.open({file:j+"/media.htm",width:430+parseInt(n.getLang("media.delta_width",0)),height:500+parseInt(n.getLang("media.delta_height",0)),inline:1},{plugin_url:j,data:s})});n.addButton("media",{title:"media.desc",cmd:"mceMedia"});n.onNodeChange.add(function(s,i,t){i.setActive("media",o(t))})},convertUrl:function(k,n){var j=this,m=j.editor,l=m.settings,o=l.url_converter,i=l.url_converter_scope||j;if(!k){return k}if(n){return m.documentBaseURI.toAbsolute(k)}return o.call(i,k,"src","object")},getInfo:function(){return{longname:"Media",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media",version:tinymce.majorVersion+"."+tinymce.minorVersion}},dataToImg:function(m,k){var r=this,o=r.editor,p=o.documentBaseURI,j,q,n,l;m.params.src=r.convertUrl(m.params.src,k);q=m.video.attrs;if(q){q.src=r.convertUrl(q.src,k)}if(q){q.poster=r.convertUrl(q.poster,k)}j=c(m.video.sources);if(j){for(l=0;l<j.length;l++){j[l].src=r.convertUrl(j[l].src,k)}}n=r.editor.dom.create("img",{id:m.id,style:m.style,align:m.align,src:r.editor.theme.url+"/img/trans.gif","class":"mceItemMedia mceItem"+r.getType(m.type).name,"data-mce-json":g.serialize(m,"'")});n.width=m.width||"320";n.height=m.height||"240";return n},dataToHtml:function(i,j){return this.editor.serializer.serialize(this.dataToImg(i,j),{force_absolute:j})},htmlToData:function(k){var j,i,l;l={type:"flash",video:{sources:[]},params:{}};j=this.editor.parser.parse(k);i=j.getAll("img")[0];if(i){l=g.parse(i.attr("data-mce-json"));l.type=this.getType(i.attr("class")).name.toLowerCase();tinymce.each(d,function(m){var n=i.attr(m);if(n){l[m]=n}})}return l},getType:function(m){var k,j,l;j=tinymce.explode(m," ");for(k=0;k<j.length;k++){l=this.lookup[j[k]];if(l){return l}}},imgToObject:function(x,n){var t=this,o=t.editor,A,E,j,s,F,w,D,u,k,C,r,p,y,B,m,v,l,z;function q(i,G){var K,J,L,I,H;H=o.getParam("flash_video_player_url",t.convertUrl(t.url+"/moxieplayer.swf"));if(H){K=o.documentBaseURI;D.params.src=H;if(o.getParam("flash_video_player_absvideourl",true)){i=K.toAbsolute(i||"",true);G=K.toAbsolute(G||"",true)}L="";J=o.getParam("flash_video_player_flashvars",{url:"$url",poster:"$poster"});tinymce.each(J,function(N,M){N=N.replace(/\$url/,i||"");N=N.replace(/\$poster/,G||"");if(N.length>0){L+=(L?"&":"")+M+"="+escape(N)}});if(L.length){D.params.flashvars=L}I=o.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(I,function(N,M){D.params[M]=""+N})}}D=g.parse(x.attr("data-mce-json"));p=this.getType(x.attr("class"));z=x.attr("data-mce-style");if(!z){z=x.attr("style");if(z){z=o.dom.serializeStyle(o.dom.parseStyle(z,"img"))}}if(p.name==="Iframe"){v=new b("iframe",1);tinymce.each(d,function(i){var G=x.attr(i);if(i=="class"&&G){G=G.replace(/mceItem.+ ?/g,"")}if(G&&G.length>0){v.attr(i,G)}});for(F in D.params){v.attr(F,D.params[F])}v.attr({style:z,src:D.params.src});x.replace(v);return}if(this.editor.settings.media_use_script){v=new b("script",1).attr("type","text/javascript");w=new b("#text",3);w.value="write"+p.name+"("+g.serialize(tinymce.extend(D.params,{width:x.attr("width"),height:x.attr("height")}))+");";v.append(w);x.replace(v);return}if(p.name==="Video"&&D.video.sources[0]){A=new b("video",1).attr(tinymce.extend({id:x.attr("id"),width:x.attr("width"),height:x.attr("height"),style:z},D.video.attrs));if(D.video.attrs){l=D.video.attrs.poster}k=D.video.sources=c(D.video.sources);for(y=0;y<k.length;y++){if(/\.mp4$/.test(k[y].src)){m=k[y].src}}if(!k[0].type){A.attr("src",k[0].src);k.splice(0,1)}for(y=0;y<k.length;y++){u=new b("source",1).attr(k[y]);u.shortEnded=true;A.append(u)}if(m){q(m,l);p=t.getType("flash")}else{D.params.src=""}}if(D.params.src){if(/\.flv$/i.test(D.params.src)){q(D.params.src,"")}if(n&&n.force_absolute){D.params.src=o.documentBaseURI.toAbsolute(D.params.src)}E=new b("object",1).attr({id:x.attr("id"),width:x.attr("width"),height:x.attr("height"),style:z});tinymce.each(d,function(i){if(D[i]&&i!="type"){E.attr(i,D[i])}});for(F in D.params){r=new b("param",1);r.shortEnded=true;w=D.params[F];if(F==="src"&&p.name==="WindowsMedia"){F="url"}r.attr({name:F,value:w});E.append(r)}if(this.editor.getParam("media_strict",true)){E.attr({data:D.params.src,type:p.mimes[0]})}else{E.attr({classid:"clsid:"+p.clsids[0],codebase:p.codebase});j=new b("embed",1);j.shortEnded=true;j.attr({id:x.attr("id"),width:x.attr("width"),height:x.attr("height"),style:z,type:p.mimes[0]});for(F in D.params){j.attr(F,D.params[F])}tinymce.each(d,function(i){if(D[i]&&i!="type"){j.attr(i,D[i])}});E.append(j)}if(D.object_html){w=new b("#text",3);w.raw=true;w.value=D.object_html;E.append(w)}if(A){A.append(E)}}if(A){if(D.video_html){w=new b("#text",3);w.raw=true;w.value=D.video_html;A.append(w)}}if(A||E){x.replace(A||E)}else{x.remove()}},objectToImg:function(y){var F,j,A,p,G,H,u,w,t,B,z,q,o,D,x,k,E,n,C=this.lookup,l,v,s=this.editor.settings.url_converter,m=this.editor.settings.url_converter_scope;function r(i){return new tinymce.html.Serializer({inner:true,validate:false}).serialize(i)}if(!y.parent){return}if(y.name==="script"){if(y.firstChild){l=a.exec(y.firstChild.value)}if(!l){return}n=l[1];E={video:{},params:g.parse(l[2])};w=E.params.width;t=E.params.height}E=E||{video:{},params:{}};G=new b("img",1);G.attr({src:this.editor.theme.url+"/img/trans.gif"});H=y.name;if(H==="video"){A=y;F=y.getAll("object")[0];j=y.getAll("embed")[0];w=A.attr("width");t=A.attr("height");u=A.attr("id");E.video={attrs:{},sources:[]};v=E.video.attrs;for(H in A.attributes.map){v[H]=A.attributes.map[H]}x=y.attr("src");if(x){E.video.sources.push({src:s.call(m,x,"src","video")})}k=A.getAll("source");for(z=0;z<k.length;z++){x=k[z].remove();E.video.sources.push({src:s.call(m,x.attr("src"),"src","source"),type:x.attr("type"),media:x.attr("media")})}if(v.poster){v.poster=s.call(m,v.poster,"poster","video")}}if(y.name==="object"){F=y;j=y.getAll("embed")[0]}if(y.name==="embed"){j=y}if(y.name==="iframe"){p=y;n="Iframe"}if(F){w=w||F.attr("width");t=t||F.attr("height");B=B||F.attr("style");u=u||F.attr("id");D=F.getAll("param");for(z=0;z<D.length;z++){o=D[z];H=o.remove().attr("name");if(!h[H]){E.params[H]=o.attr("value")}}E.params.src=E.params.src||F.attr("data")}if(j){w=w||j.attr("width");t=t||j.attr("height");B=B||j.attr("style");u=u||j.attr("id");for(H in j.attributes.map){if(!h[H]&&!E.params[H]){E.params[H]=j.attributes.map[H]}}}if(p){w=p.attr("width");t=p.attr("height");B=B||p.attr("style");u=p.attr("id");tinymce.each(d,function(i){G.attr(i,p.attr(i))});for(H in p.attributes.map){if(!h[H]&&!E.params[H]){E.params[H]=p.attributes.map[H]}}}if(E.params.movie){E.params.src=E.params.src||E.params.movie;delete E.params.movie}if(E.params.src){E.params.src=s.call(m,E.params.src,"src","object")}if(A){n=C.video.name}if(F&&!n){n=(C[(F.attr("clsid")||"").toLowerCase()]||C[(F.attr("type")||"").toLowerCase()]||{}).name}if(j&&!n){n=(C[(j.attr("type")||"").toLowerCase()]||{}).name}y.replace(G);if(j){j.remove()}if(F){q=r(F.remove());if(q){E.object_html=q}}if(A){q=r(A.remove());if(q){E.video_html=q}}G.attr({id:u,"class":"mceItemMedia mceItem"+(n||"Flash"),style:B,width:w||"320",height:t||"240","data-mce-json":g.serialize(E,"'")})}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
|
1
|
+
(function(){var o=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),k=tinymce.makeMap(o.join(",")),i=tinymce.html.Node,m,j,l=tinymce.util.JSON,n;m=[["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"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["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"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["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"],["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"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"]];function p(a){var b,d,c;if(a&&!a.splice){d=[];for(c=0;true;c++){if(a[c]){d[c]=a[c]}else{break}}return d}return a}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(e,s){var a=this,g={},f,c,b,h;function d(q){return q&&q.nodeName==="IMG"&&e.dom.hasClass(q,"mceItemMedia")}a.editor=e;a.url=s;j="";for(f=0;f<m.length;f++){h=m[f][0];b={name:h,clsids:tinymce.explode(m[f][1]||""),mimes:tinymce.explode(m[f][2]||""),codebase:m[f][3]};for(c=0;c<b.clsids.length;c++){g["clsid:"+b.clsids[c]]=b}for(c=0;c<b.mimes.length;c++){g[b.mimes[c]]=b}g["mceItem"+h]=b;g[h.toLowerCase()]=b;j+=(j?"|":"")+h}tinymce.each(e.getParam("media_types","video=mp4,m4v,ogv,webm;silverlight=xap;flash=swf,flv;shockwave=dcr;quicktime=mov,qt,mpg,mp3,mpeg;shockwave=dcr;windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;realmedia=rm,ra,ram;java=jar").split(";"),function(q){var x,r,w;q=q.split(/=/);r=tinymce.explode(q[1].toLowerCase());for(x=0;x<r.length;x++){w=g[q[0].toLowerCase()];if(w){g[r[x]]=w}}});j=new RegExp("write("+j+")\\(([^)]+)\\)");a.lookup=g;e.onPreInit.add(function(){e.schema.addValidElements("object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]");e.parser.addNodeFilter("object,embed,video,audio,script,iframe",function(r){var q=r.length;while(q--){a.objectToImg(r[q])}});e.serializer.addNodeFilter("img",function(z,x,y){var r=z.length,q;while(r--){q=z[r];if((q.attr("class")||"").indexOf("mceItemMedia")!==-1){a.imgToObject(q,y)}}})});e.onInit.add(function(){if(e.theme&&e.theme.onResolveName){e.theme.onResolveName.add(function(q,r){if(r.name==="img"&&e.dom.hasClass(r.node,"mceItemMedia")){r.name="media"}})}if(e&&e.plugins.contextmenu){e.plugins.contextmenu.onContextMenu.add(function(u,r,q){if(q.nodeName==="IMG"&&q.className.indexOf("mceItemMedia")!==-1){r.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});e.addCommand("mceMedia",function(){var r,q;q=e.selection.getNode();if(d(q)){r=l.parse(e.dom.getAttrib(q,"data-mce-json"));tinymce.each(o,function(w){var v=e.dom.getAttrib(q,w);if(v){r[w]=v}});r.type=a.getType(q.className).name.toLowerCase()}if(!r){r={type:"flash",video:{sources:[]},params:{}}}e.windowManager.open({file:s+"/media.htm",width:430+parseInt(e.getLang("media.delta_width",0)),height:500+parseInt(e.getLang("media.delta_height",0)),inline:1},{plugin_url:s,data:r})});e.addButton("media",{title:"media.desc",cmd:"mceMedia"});e.onNodeChange.add(function(u,r,q){r.setActive("media",d(q))})},convertUrl:function(c,g){var d=this,a=d.editor,b=a.settings,f=b.url_converter,e=b.url_converter_scope||d;if(!c){return c}if(g){return a.documentBaseURI.toAbsolute(c)}return f.call(e,c,"src","object")},getInfo:function(){return{longname:"Media",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media",version:tinymce.majorVersion+"."+tinymce.minorVersion}},dataToImg:function(f,h){var a=this,d=a.editor,c=d.documentBaseURI,s,b,e,g;f.params.src=a.convertUrl(f.params.src,h);b=f.video.attrs;if(b){b.src=a.convertUrl(b.src,h)}if(b){b.poster=a.convertUrl(b.poster,h)}s=p(f.video.sources);if(s){for(g=0;g<s.length;g++){s[g].src=a.convertUrl(s[g].src,h)}}e=a.editor.dom.create("img",{id:f.id,style:f.style,align:f.align,src:a.editor.theme.url+"/img/trans.gif","class":"mceItemMedia mceItem"+a.getType(f.type).name,"data-mce-json":l.serialize(f,"'")});e.width=f.width||"320";e.height=f.height||"240";return e},dataToHtml:function(b,a){return this.editor.serializer.serialize(this.dataToImg(b,a),{force_absolute:a})},htmlToData:function(b){var c,d,a;a={type:"flash",video:{sources:[]},params:{}};c=this.editor.parser.parse(b);d=c.getAll("img")[0];if(d){a=l.parse(d.attr("data-mce-json"));a.type=this.getType(d.attr("class")).name.toLowerCase();tinymce.each(o,function(e){var f=d.attr(e);if(f){a[e]=f}})}return a},getType:function(a){var c,d,b;d=tinymce.explode(a," ");for(c=0;c<d.length;c++){b=this.lookup[d[c]];if(b){return b}}},imgToObject:function(c,Q){var G=this,P=G.editor,N,h,U,H,f,d,I,g,T,J,K,O,b,M,R,e,S,a;function L(v,w){var r,s,q,t,u;u=P.getParam("flash_video_player_url",G.convertUrl(G.url+"/moxieplayer.swf"));if(u){r=P.documentBaseURI;I.params.src=u;if(P.getParam("flash_video_player_absvideourl",true)){v=r.toAbsolute(v||"",true);w=r.toAbsolute(w||"",true)}q="";s=P.getParam("flash_video_player_flashvars",{url:"$url",poster:"$poster"});tinymce.each(s,function(x,y){x=x.replace(/\$url/,v||"");x=x.replace(/\$poster/,w||"");if(x.length>0){q+=(q?"&":"")+y+"="+escape(x)}});if(q.length){I.params.flashvars=q}t=P.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(t,function(x,y){I.params[y]=""+x})}}I=l.parse(c.attr("data-mce-json"));O=this.getType(c.attr("class"));a=c.attr("data-mce-style");if(!a){a=c.attr("style");if(a){a=P.dom.serializeStyle(P.dom.parseStyle(a,"img"))}}if(O.name==="Iframe"){e=new i("iframe",1);tinymce.each(o,function(q){var r=c.attr(q);if(q=="class"&&r){r=r.replace(/mceItem.+ ?/g,"")}if(r&&r.length>0){e.attr(q,r)}});for(f in I.params){e.attr(f,I.params[f])}e.attr({style:a,src:I.params.src});c.replace(e);return}if(this.editor.settings.media_use_script){e=new i("script",1).attr("type","text/javascript");d=new i("#text",3);d.value="write"+O.name+"("+l.serialize(tinymce.extend(I.params,{width:c.attr("width"),height:c.attr("height")}))+");";e.append(d);c.replace(e);return}if(O.name==="Video"&&I.video.sources[0]){N=new i("video",1).attr(tinymce.extend({id:c.attr("id"),width:c.attr("width"),height:c.attr("height"),style:a},I.video.attrs));if(I.video.attrs){S=I.video.attrs.poster}T=I.video.sources=p(I.video.sources);for(b=0;b<T.length;b++){if(/\.mp4$/.test(T[b].src)){R=T[b].src}}if(!T[0].type){N.attr("src",T[0].src);T.splice(0,1)}for(b=0;b<T.length;b++){g=new i("source",1).attr(T[b]);g.shortEnded=true;N.append(g)}if(R){L(R,S);O=G.getType("flash")}else{I.params.src=""}}if(I.params.src){if(/\.flv$/i.test(I.params.src)){L(I.params.src,"")}if(Q&&Q.force_absolute){I.params.src=P.documentBaseURI.toAbsolute(I.params.src)}h=new i("object",1).attr({id:c.attr("id"),width:c.attr("width"),height:c.attr("height"),style:a});tinymce.each(o,function(q){if(I[q]&&q!="type"){h.attr(q,I[q])}});for(f in I.params){K=new i("param",1);K.shortEnded=true;d=I.params[f];if(f==="src"&&O.name==="WindowsMedia"){f="url"}K.attr({name:f,value:d});h.append(K)}if(this.editor.getParam("media_strict",true)){h.attr({data:I.params.src,type:O.mimes[0]})}else{h.attr({classid:"clsid:"+O.clsids[0],codebase:O.codebase});U=new i("embed",1);U.shortEnded=true;U.attr({id:c.attr("id"),width:c.attr("width"),height:c.attr("height"),style:a,type:O.mimes[0]});for(f in I.params){U.attr(f,I.params[f])}tinymce.each(o,function(q){if(I[q]&&q!="type"){U.attr(q,I[q])}});h.append(U)}if(I.object_html){d=new i("#text",3);d.raw=true;d.value=I.object_html;h.append(d)}if(N){N.append(h)}}if(N){if(I.video_html){d=new i("#text",3);d.raw=true;d.value=I.video_html;N.append(d)}}if(N||h){c.replace(N||h)}else{c.remove()}},objectToImg:function(b){var h,Y,R,S,g,d,I,e,K,P,a,Q,T,M,c,X,J,U,O=this.lookup,W,f,L=this.editor.settings.url_converter,V=this.editor.settings.url_converter_scope;function N(q){return new tinymce.html.Serializer({inner:true,validate:false}).serialize(q)}if(!b.parent){return}if(b.name==="script"){if(b.firstChild){W=j.exec(b.firstChild.value)}if(!W){return}U=W[1];J={video:{},params:l.parse(W[2])};e=J.params.width;K=J.params.height}J=J||{video:{},params:{}};g=new i("img",1);g.attr({src:this.editor.theme.url+"/img/trans.gif"});d=b.name;if(d==="video"){R=b;h=b.getAll("object")[0];Y=b.getAll("embed")[0];e=R.attr("width");K=R.attr("height");I=R.attr("id");J.video={attrs:{},sources:[]};f=J.video.attrs;for(d in R.attributes.map){f[d]=R.attributes.map[d]}c=b.attr("src");if(c){J.video.sources.push({src:L.call(V,c,"src","video")})}X=R.getAll("source");for(a=0;a<X.length;a++){c=X[a].remove();J.video.sources.push({src:L.call(V,c.attr("src"),"src","source"),type:c.attr("type"),media:c.attr("media")})}if(f.poster){f.poster=L.call(V,f.poster,"poster","video")}}if(b.name==="object"){h=b;Y=b.getAll("embed")[0]}if(b.name==="embed"){Y=b}if(b.name==="iframe"){S=b;U="Iframe"}if(h){e=e||h.attr("width");K=K||h.attr("height");P=P||h.attr("style");I=I||h.attr("id");M=h.getAll("param");for(a=0;a<M.length;a++){T=M[a];d=T.remove().attr("name");if(!k[d]){J.params[d]=T.attr("value")}}J.params.src=J.params.src||h.attr("data")}if(Y){e=e||Y.attr("width");K=K||Y.attr("height");P=P||Y.attr("style");I=I||Y.attr("id");for(d in Y.attributes.map){if(!k[d]&&!J.params[d]){J.params[d]=Y.attributes.map[d]}}}if(S){e=S.attr("width");K=S.attr("height");P=P||S.attr("style");I=S.attr("id");tinymce.each(o,function(q){g.attr(q,S.attr(q))});for(d in S.attributes.map){if(!k[d]&&!J.params[d]){J.params[d]=S.attributes.map[d]}}}if(J.params.movie){J.params.src=J.params.src||J.params.movie;delete J.params.movie}if(J.params.src){J.params.src=L.call(V,J.params.src,"src","object")}if(R){U=O.video.name}if(h&&!U){U=(O[(h.attr("clsid")||"").toLowerCase()]||O[(h.attr("type")||"").toLowerCase()]||{}).name}if(Y&&!U){U=(O[(Y.attr("type")||"").toLowerCase()]||{}).name}b.replace(g);if(Y){Y.remove()}if(h){Q=N(h.remove());if(Q){J.object_html=Q}}if(R){Q=N(R.remove());if(Q){J.video_html=Q}}g.attr({id:I,"class":"mceItemMedia mceItem"+(U||"Flash"),style:P,width:e||"320",height:K||"240","data-mce-json":l.serialize(J,"'")})}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
|
@@ -1,770 +1 @@
|
|
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
|
-
];
|
28
|
-
|
29
|
-
function toArray(obj) {
|
30
|
-
var undef, out, i;
|
31
|
-
|
32
|
-
if (obj && !obj.splice) {
|
33
|
-
out = [];
|
34
|
-
|
35
|
-
for (i = 0; true; i++) {
|
36
|
-
if (obj[i])
|
37
|
-
out[i] = obj[i];
|
38
|
-
else
|
39
|
-
break;
|
40
|
-
}
|
41
|
-
|
42
|
-
return out;
|
43
|
-
}
|
44
|
-
|
45
|
-
return obj;
|
46
|
-
};
|
47
|
-
|
48
|
-
tinymce.create('tinymce.plugins.MediaPlugin', {
|
49
|
-
init : function(ed, url) {
|
50
|
-
var self = this, lookup = {}, i, y, item, name;
|
51
|
-
|
52
|
-
function isMediaImg(node) {
|
53
|
-
return node && node.nodeName === 'IMG' && ed.dom.hasClass(node, 'mceItemMedia');
|
54
|
-
};
|
55
|
-
|
56
|
-
self.editor = ed;
|
57
|
-
self.url = url;
|
58
|
-
|
59
|
-
// Parse media types into a lookup table
|
60
|
-
scriptRegExp = '';
|
61
|
-
for (i = 0; i < mediaTypes.length; i++) {
|
62
|
-
name = mediaTypes[i][0];
|
63
|
-
|
64
|
-
item = {
|
65
|
-
name : name,
|
66
|
-
clsids : tinymce.explode(mediaTypes[i][1] || ''),
|
67
|
-
mimes : tinymce.explode(mediaTypes[i][2] || ''),
|
68
|
-
codebase : mediaTypes[i][3]
|
69
|
-
};
|
70
|
-
|
71
|
-
for (y = 0; y < item.clsids.length; y++)
|
72
|
-
lookup['clsid:' + item.clsids[y]] = item;
|
73
|
-
|
74
|
-
for (y = 0; y < item.mimes.length; y++)
|
75
|
-
lookup[item.mimes[y]] = item;
|
76
|
-
|
77
|
-
lookup['mceItem' + name] = item;
|
78
|
-
lookup[name.toLowerCase()] = item;
|
79
|
-
|
80
|
-
scriptRegExp += (scriptRegExp ? '|' : '') + name;
|
81
|
-
}
|
82
|
-
|
83
|
-
// Handle the media_types setting
|
84
|
-
tinymce.each(ed.getParam("media_types",
|
85
|
-
"video=mp4,m4v,ogv,webm;" +
|
86
|
-
"silverlight=xap;" +
|
87
|
-
"flash=swf,flv;" +
|
88
|
-
"shockwave=dcr;" +
|
89
|
-
"quicktime=mov,qt,mpg,mp3,mpeg;" +
|
90
|
-
"shockwave=dcr;" +
|
91
|
-
"windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;" +
|
92
|
-
"realmedia=rm,ra,ram;" +
|
93
|
-
"java=jar"
|
94
|
-
).split(';'), function(item) {
|
95
|
-
var i, extensions, type;
|
96
|
-
|
97
|
-
item = item.split(/=/);
|
98
|
-
extensions = tinymce.explode(item[1].toLowerCase());
|
99
|
-
for (i = 0; i < extensions.length; i++) {
|
100
|
-
type = lookup[item[0].toLowerCase()];
|
101
|
-
|
102
|
-
if (type)
|
103
|
-
lookup[extensions[i]] = type;
|
104
|
-
}
|
105
|
-
});
|
106
|
-
|
107
|
-
scriptRegExp = new RegExp('write(' + scriptRegExp + ')\\(([^)]+)\\)');
|
108
|
-
self.lookup = lookup;
|
109
|
-
|
110
|
-
ed.onPreInit.add(function() {
|
111
|
-
// Allow video elements
|
112
|
-
ed.schema.addValidElements('object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]');
|
113
|
-
|
114
|
-
// Convert video elements to image placeholder
|
115
|
-
ed.parser.addNodeFilter('object,embed,video,audio,script,iframe', function(nodes) {
|
116
|
-
var i = nodes.length;
|
117
|
-
|
118
|
-
while (i--)
|
119
|
-
self.objectToImg(nodes[i]);
|
120
|
-
});
|
121
|
-
|
122
|
-
// Convert image placeholders to video elements
|
123
|
-
ed.serializer.addNodeFilter('img', function(nodes, name, args) {
|
124
|
-
var i = nodes.length, node;
|
125
|
-
|
126
|
-
while (i--) {
|
127
|
-
node = nodes[i];
|
128
|
-
if ((node.attr('class') || '').indexOf('mceItemMedia') !== -1)
|
129
|
-
self.imgToObject(node, args);
|
130
|
-
}
|
131
|
-
});
|
132
|
-
});
|
133
|
-
|
134
|
-
ed.onInit.add(function() {
|
135
|
-
// Display "media" instead of "img" in element path
|
136
|
-
if (ed.theme && ed.theme.onResolveName) {
|
137
|
-
ed.theme.onResolveName.add(function(theme, path_object) {
|
138
|
-
if (path_object.name === 'img' && ed.dom.hasClass(path_object.node, 'mceItemMedia'))
|
139
|
-
path_object.name = 'media';
|
140
|
-
});
|
141
|
-
}
|
142
|
-
|
143
|
-
// Add contect menu if it's loaded
|
144
|
-
if (ed && ed.plugins.contextmenu) {
|
145
|
-
ed.plugins.contextmenu.onContextMenu.add(function(plugin, menu, element) {
|
146
|
-
if (element.nodeName === 'IMG' && element.className.indexOf('mceItemMedia') !== -1)
|
147
|
-
menu.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});
|
148
|
-
});
|
149
|
-
}
|
150
|
-
});
|
151
|
-
|
152
|
-
// Register commands
|
153
|
-
ed.addCommand('mceMedia', function() {
|
154
|
-
var data, img;
|
155
|
-
|
156
|
-
img = ed.selection.getNode();
|
157
|
-
if (isMediaImg(img)) {
|
158
|
-
data = JSON.parse(ed.dom.getAttrib(img, 'data-mce-json'));
|
159
|
-
|
160
|
-
// Add some extra properties to the data object
|
161
|
-
tinymce.each(rootAttributes, function(name) {
|
162
|
-
var value = ed.dom.getAttrib(img, name);
|
163
|
-
|
164
|
-
if (value)
|
165
|
-
data[name] = value;
|
166
|
-
});
|
167
|
-
|
168
|
-
data.type = self.getType(img.className).name.toLowerCase();
|
169
|
-
}
|
170
|
-
|
171
|
-
if (!data) {
|
172
|
-
data = {
|
173
|
-
type : 'flash',
|
174
|
-
video: {sources:[]},
|
175
|
-
params: {}
|
176
|
-
};
|
177
|
-
}
|
178
|
-
|
179
|
-
ed.windowManager.open({
|
180
|
-
file : url + '/media.htm',
|
181
|
-
width : 430 + parseInt(ed.getLang('media.delta_width', 0)),
|
182
|
-
height : 500 + parseInt(ed.getLang('media.delta_height', 0)),
|
183
|
-
inline : 1
|
184
|
-
}, {
|
185
|
-
plugin_url : url,
|
186
|
-
data : data
|
187
|
-
});
|
188
|
-
});
|
189
|
-
|
190
|
-
// Register buttons
|
191
|
-
ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'});
|
192
|
-
|
193
|
-
// Update media selection status
|
194
|
-
ed.onNodeChange.add(function(ed, cm, node) {
|
195
|
-
cm.setActive('media', isMediaImg(node));
|
196
|
-
});
|
197
|
-
},
|
198
|
-
|
199
|
-
convertUrl : function(url, force_absolute) {
|
200
|
-
var self = this, editor = self.editor, settings = editor.settings,
|
201
|
-
urlConverter = settings.url_converter,
|
202
|
-
urlConverterScope = settings.url_converter_scope || self;
|
203
|
-
|
204
|
-
if (!url)
|
205
|
-
return url;
|
206
|
-
|
207
|
-
if (force_absolute)
|
208
|
-
return editor.documentBaseURI.toAbsolute(url);
|
209
|
-
|
210
|
-
return urlConverter.call(urlConverterScope, url, 'src', 'object');
|
211
|
-
},
|
212
|
-
|
213
|
-
getInfo : function() {
|
214
|
-
return {
|
215
|
-
longname : 'Media',
|
216
|
-
author : 'Moxiecode Systems AB',
|
217
|
-
authorurl : 'http://tinymce.moxiecode.com',
|
218
|
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',
|
219
|
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
220
|
-
};
|
221
|
-
},
|
222
|
-
|
223
|
-
/**
|
224
|
-
* Converts the JSON data object to an img node.
|
225
|
-
*/
|
226
|
-
dataToImg : function(data, force_absolute) {
|
227
|
-
var self = this, editor = self.editor, baseUri = editor.documentBaseURI, sources, attrs, img, i;
|
228
|
-
|
229
|
-
data.params.src = self.convertUrl(data.params.src, force_absolute);
|
230
|
-
|
231
|
-
attrs = data.video.attrs;
|
232
|
-
if (attrs)
|
233
|
-
attrs.src = self.convertUrl(attrs.src, force_absolute);
|
234
|
-
|
235
|
-
if (attrs)
|
236
|
-
attrs.poster = self.convertUrl(attrs.poster, force_absolute);
|
237
|
-
|
238
|
-
sources = toArray(data.video.sources);
|
239
|
-
if (sources) {
|
240
|
-
for (i = 0; i < sources.length; i++)
|
241
|
-
sources[i].src = self.convertUrl(sources[i].src, force_absolute);
|
242
|
-
}
|
243
|
-
|
244
|
-
img = self.editor.dom.create('img', {
|
245
|
-
id : data.id,
|
246
|
-
style : data.style,
|
247
|
-
align : data.align,
|
248
|
-
src : self.editor.theme.url + '/img/trans.gif',
|
249
|
-
'class' : 'mceItemMedia mceItem' + self.getType(data.type).name,
|
250
|
-
'data-mce-json' : JSON.serialize(data, "'")
|
251
|
-
});
|
252
|
-
|
253
|
-
img.width = data.width || "320";
|
254
|
-
img.height = data.height || "240";
|
255
|
-
|
256
|
-
return img;
|
257
|
-
},
|
258
|
-
|
259
|
-
/**
|
260
|
-
* Converts the JSON data object to a HTML string.
|
261
|
-
*/
|
262
|
-
dataToHtml : function(data, force_absolute) {
|
263
|
-
return this.editor.serializer.serialize(this.dataToImg(data, force_absolute), {force_absolute : force_absolute});
|
264
|
-
},
|
265
|
-
|
266
|
-
/**
|
267
|
-
* Converts the JSON data object to a HTML string.
|
268
|
-
*/
|
269
|
-
htmlToData : function(html) {
|
270
|
-
var fragment, img, data;
|
271
|
-
|
272
|
-
data = {
|
273
|
-
type : 'flash',
|
274
|
-
video: {sources:[]},
|
275
|
-
params: {}
|
276
|
-
};
|
277
|
-
|
278
|
-
fragment = this.editor.parser.parse(html);
|
279
|
-
img = fragment.getAll('img')[0];
|
280
|
-
|
281
|
-
if (img) {
|
282
|
-
data = JSON.parse(img.attr('data-mce-json'));
|
283
|
-
data.type = this.getType(img.attr('class')).name.toLowerCase();
|
284
|
-
|
285
|
-
// Add some extra properties to the data object
|
286
|
-
tinymce.each(rootAttributes, function(name) {
|
287
|
-
var value = img.attr(name);
|
288
|
-
|
289
|
-
if (value)
|
290
|
-
data[name] = value;
|
291
|
-
});
|
292
|
-
}
|
293
|
-
|
294
|
-
return data;
|
295
|
-
},
|
296
|
-
|
297
|
-
/**
|
298
|
-
* Get type item by extension, class, clsid or mime type.
|
299
|
-
*
|
300
|
-
* @method getType
|
301
|
-
* @param {String} value Value to get type item by.
|
302
|
-
* @return {Object} Type item object or undefined.
|
303
|
-
*/
|
304
|
-
getType : function(value) {
|
305
|
-
var i, values, typeItem;
|
306
|
-
|
307
|
-
// Find type by checking the classes
|
308
|
-
values = tinymce.explode(value, ' ');
|
309
|
-
for (i = 0; i < values.length; i++) {
|
310
|
-
typeItem = this.lookup[values[i]];
|
311
|
-
|
312
|
-
if (typeItem)
|
313
|
-
return typeItem;
|
314
|
-
}
|
315
|
-
},
|
316
|
-
|
317
|
-
/**
|
318
|
-
* Converts a tinymce.html.Node image element to video/object/embed.
|
319
|
-
*/
|
320
|
-
imgToObject : function(node, args) {
|
321
|
-
var self = this, editor = self.editor, video, object, embed, iframe, name, value, data,
|
322
|
-
source, sources, params, param, typeItem, i, item, mp4Source, replacement,
|
323
|
-
posterSrc, style;
|
324
|
-
|
325
|
-
// Adds the flash player
|
326
|
-
function addPlayer(video_src, poster_src) {
|
327
|
-
var baseUri, flashVars, flashVarsOutput, params, flashPlayer;
|
328
|
-
|
329
|
-
flashPlayer = editor.getParam('flash_video_player_url', self.convertUrl(self.url + '/moxieplayer.swf'));
|
330
|
-
if (flashPlayer) {
|
331
|
-
baseUri = editor.documentBaseURI;
|
332
|
-
data.params.src = flashPlayer;
|
333
|
-
|
334
|
-
// Convert the movie url to absolute urls
|
335
|
-
if (editor.getParam('flash_video_player_absvideourl', true)) {
|
336
|
-
video_src = baseUri.toAbsolute(video_src || '', true);
|
337
|
-
poster_src = baseUri.toAbsolute(poster_src || '', true);
|
338
|
-
}
|
339
|
-
|
340
|
-
// Generate flash vars
|
341
|
-
flashVarsOutput = '';
|
342
|
-
flashVars = editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'});
|
343
|
-
tinymce.each(flashVars, function(value, name) {
|
344
|
-
// Replace $url and $poster variables in flashvars value
|
345
|
-
value = value.replace(/\$url/, video_src || '');
|
346
|
-
value = value.replace(/\$poster/, poster_src || '');
|
347
|
-
|
348
|
-
if (value.length > 0)
|
349
|
-
flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value);
|
350
|
-
});
|
351
|
-
|
352
|
-
if (flashVarsOutput.length)
|
353
|
-
data.params.flashvars = flashVarsOutput;
|
354
|
-
|
355
|
-
params = editor.getParam('flash_video_player_params', {
|
356
|
-
allowfullscreen: true,
|
357
|
-
allowscriptaccess: true
|
358
|
-
});
|
359
|
-
|
360
|
-
tinymce.each(params, function(value, name) {
|
361
|
-
data.params[name] = "" + value;
|
362
|
-
});
|
363
|
-
}
|
364
|
-
};
|
365
|
-
|
366
|
-
data = JSON.parse(node.attr('data-mce-json'));
|
367
|
-
typeItem = this.getType(node.attr('class'));
|
368
|
-
|
369
|
-
style = node.attr('data-mce-style')
|
370
|
-
if (!style) {
|
371
|
-
style = node.attr('style');
|
372
|
-
|
373
|
-
if (style)
|
374
|
-
style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img'));
|
375
|
-
}
|
376
|
-
|
377
|
-
// Handle iframe
|
378
|
-
if (typeItem.name === 'Iframe') {
|
379
|
-
replacement = new Node('iframe', 1);
|
380
|
-
|
381
|
-
tinymce.each(rootAttributes, function(name) {
|
382
|
-
var value = node.attr(name);
|
383
|
-
|
384
|
-
if (name == 'class' && value)
|
385
|
-
value = value.replace(/mceItem.+ ?/g, '');
|
386
|
-
|
387
|
-
if (value && value.length > 0)
|
388
|
-
replacement.attr(name, value);
|
389
|
-
});
|
390
|
-
|
391
|
-
for (name in data.params)
|
392
|
-
replacement.attr(name, data.params[name]);
|
393
|
-
|
394
|
-
replacement.attr({
|
395
|
-
style: style,
|
396
|
-
src: data.params.src
|
397
|
-
});
|
398
|
-
|
399
|
-
node.replace(replacement);
|
400
|
-
|
401
|
-
return;
|
402
|
-
}
|
403
|
-
|
404
|
-
// Handle scripts
|
405
|
-
if (this.editor.settings.media_use_script) {
|
406
|
-
replacement = new Node('script', 1).attr('type', 'text/javascript');
|
407
|
-
|
408
|
-
value = new Node('#text', 3);
|
409
|
-
value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, {
|
410
|
-
width: node.attr('width'),
|
411
|
-
height: node.attr('height')
|
412
|
-
})) + ');';
|
413
|
-
|
414
|
-
replacement.append(value);
|
415
|
-
node.replace(replacement);
|
416
|
-
|
417
|
-
return;
|
418
|
-
}
|
419
|
-
|
420
|
-
// Add HTML5 video element
|
421
|
-
if (typeItem.name === 'Video' && data.video.sources[0]) {
|
422
|
-
// Create new object element
|
423
|
-
video = new Node('video', 1).attr(tinymce.extend({
|
424
|
-
id : node.attr('id'),
|
425
|
-
width: node.attr('width'),
|
426
|
-
height: node.attr('height'),
|
427
|
-
style : style
|
428
|
-
}, data.video.attrs));
|
429
|
-
|
430
|
-
// Get poster source and use that for flash fallback
|
431
|
-
if (data.video.attrs)
|
432
|
-
posterSrc = data.video.attrs.poster;
|
433
|
-
|
434
|
-
sources = data.video.sources = toArray(data.video.sources);
|
435
|
-
for (i = 0; i < sources.length; i++) {
|
436
|
-
if (/\.mp4$/.test(sources[i].src))
|
437
|
-
mp4Source = sources[i].src;
|
438
|
-
}
|
439
|
-
|
440
|
-
if (!sources[0].type) {
|
441
|
-
video.attr('src', sources[0].src);
|
442
|
-
sources.splice(0, 1);
|
443
|
-
}
|
444
|
-
|
445
|
-
for (i = 0; i < sources.length; i++) {
|
446
|
-
source = new Node('source', 1).attr(sources[i]);
|
447
|
-
source.shortEnded = true;
|
448
|
-
video.append(source);
|
449
|
-
}
|
450
|
-
|
451
|
-
// Create flash fallback for video if we have a mp4 source
|
452
|
-
if (mp4Source) {
|
453
|
-
addPlayer(mp4Source, posterSrc);
|
454
|
-
typeItem = self.getType('flash');
|
455
|
-
} else
|
456
|
-
data.params.src = '';
|
457
|
-
}
|
458
|
-
|
459
|
-
// Do we have a params src then we can generate object
|
460
|
-
if (data.params.src) {
|
461
|
-
// Is flv movie add player for it
|
462
|
-
if (/\.flv$/i.test(data.params.src))
|
463
|
-
addPlayer(data.params.src, '');
|
464
|
-
|
465
|
-
if (args && args.force_absolute)
|
466
|
-
data.params.src = editor.documentBaseURI.toAbsolute(data.params.src);
|
467
|
-
|
468
|
-
// Create new object element
|
469
|
-
object = new Node('object', 1).attr({
|
470
|
-
id : node.attr('id'),
|
471
|
-
width: node.attr('width'),
|
472
|
-
height: node.attr('height'),
|
473
|
-
style : style
|
474
|
-
});
|
475
|
-
|
476
|
-
tinymce.each(rootAttributes, function(name) {
|
477
|
-
if (data[name] && name != 'type')
|
478
|
-
object.attr(name, data[name]);
|
479
|
-
});
|
480
|
-
|
481
|
-
// Add params
|
482
|
-
for (name in data.params) {
|
483
|
-
param = new Node('param', 1);
|
484
|
-
param.shortEnded = true;
|
485
|
-
value = data.params[name];
|
486
|
-
|
487
|
-
// Windows media needs to use url instead of src for the media URL
|
488
|
-
if (name === 'src' && typeItem.name === 'WindowsMedia')
|
489
|
-
name = 'url';
|
490
|
-
|
491
|
-
param.attr({name: name, value: value});
|
492
|
-
object.append(param);
|
493
|
-
}
|
494
|
-
|
495
|
-
// Setup add type and classid if strict is disabled
|
496
|
-
if (this.editor.getParam('media_strict', true)) {
|
497
|
-
object.attr({
|
498
|
-
data: data.params.src,
|
499
|
-
type: typeItem.mimes[0]
|
500
|
-
});
|
501
|
-
} else {
|
502
|
-
object.attr({
|
503
|
-
classid: "clsid:" + typeItem.clsids[0],
|
504
|
-
codebase: typeItem.codebase
|
505
|
-
});
|
506
|
-
|
507
|
-
embed = new Node('embed', 1);
|
508
|
-
embed.shortEnded = true;
|
509
|
-
embed.attr({
|
510
|
-
id: node.attr('id'),
|
511
|
-
width: node.attr('width'),
|
512
|
-
height: node.attr('height'),
|
513
|
-
style : style,
|
514
|
-
type: typeItem.mimes[0]
|
515
|
-
});
|
516
|
-
|
517
|
-
for (name in data.params)
|
518
|
-
embed.attr(name, data.params[name]);
|
519
|
-
|
520
|
-
tinymce.each(rootAttributes, function(name) {
|
521
|
-
if (data[name] && name != 'type')
|
522
|
-
embed.attr(name, data[name]);
|
523
|
-
});
|
524
|
-
|
525
|
-
object.append(embed);
|
526
|
-
}
|
527
|
-
|
528
|
-
// Insert raw HTML
|
529
|
-
if (data.object_html) {
|
530
|
-
value = new Node('#text', 3);
|
531
|
-
value.raw = true;
|
532
|
-
value.value = data.object_html;
|
533
|
-
object.append(value);
|
534
|
-
}
|
535
|
-
|
536
|
-
// Append object to video element if it exists
|
537
|
-
if (video)
|
538
|
-
video.append(object);
|
539
|
-
}
|
540
|
-
|
541
|
-
if (video) {
|
542
|
-
// Insert raw HTML
|
543
|
-
if (data.video_html) {
|
544
|
-
value = new Node('#text', 3);
|
545
|
-
value.raw = true;
|
546
|
-
value.value = data.video_html;
|
547
|
-
video.append(value);
|
548
|
-
}
|
549
|
-
}
|
550
|
-
|
551
|
-
if (video || object)
|
552
|
-
node.replace(video || object);
|
553
|
-
else
|
554
|
-
node.remove();
|
555
|
-
},
|
556
|
-
|
557
|
-
/**
|
558
|
-
* Converts a tinymce.html.Node video/object/embed to an img element.
|
559
|
-
*
|
560
|
-
* The video/object/embed will be converted into an image placeholder with a JSON data attribute like this:
|
561
|
-
* <img class="mceItemMedia mceItemFlash" width="100" height="100" data-mce-json="{..}" />
|
562
|
-
*
|
563
|
-
* The JSON structure will be like this:
|
564
|
-
* {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}}
|
565
|
-
*/
|
566
|
-
objectToImg : function(node) {
|
567
|
-
var object, embed, video, iframe, img, name, id, width, height, style, i, html,
|
568
|
-
param, params, source, sources, data, type, lookup = this.lookup,
|
569
|
-
matches, attrs, urlConverter = this.editor.settings.url_converter,
|
570
|
-
urlConverterScope = this.editor.settings.url_converter_scope;
|
571
|
-
|
572
|
-
function getInnerHTML(node) {
|
573
|
-
return new tinymce.html.Serializer({
|
574
|
-
inner: true,
|
575
|
-
validate: false
|
576
|
-
}).serialize(node);
|
577
|
-
};
|
578
|
-
|
579
|
-
// If node isn't in document
|
580
|
-
if (!node.parent)
|
581
|
-
return;
|
582
|
-
|
583
|
-
// Handle media scripts
|
584
|
-
if (node.name === 'script') {
|
585
|
-
if (node.firstChild)
|
586
|
-
matches = scriptRegExp.exec(node.firstChild.value);
|
587
|
-
|
588
|
-
if (!matches)
|
589
|
-
return;
|
590
|
-
|
591
|
-
type = matches[1];
|
592
|
-
data = {video : {}, params : JSON.parse(matches[2])};
|
593
|
-
width = data.params.width;
|
594
|
-
height = data.params.height;
|
595
|
-
}
|
596
|
-
|
597
|
-
// Setup data objects
|
598
|
-
data = data || {
|
599
|
-
video : {},
|
600
|
-
params : {}
|
601
|
-
};
|
602
|
-
|
603
|
-
// Setup new image object
|
604
|
-
img = new Node('img', 1);
|
605
|
-
img.attr({
|
606
|
-
src : this.editor.theme.url + '/img/trans.gif'
|
607
|
-
});
|
608
|
-
|
609
|
-
// Video element
|
610
|
-
name = node.name;
|
611
|
-
if (name === 'video') {
|
612
|
-
video = node;
|
613
|
-
object = node.getAll('object')[0];
|
614
|
-
embed = node.getAll('embed')[0];
|
615
|
-
width = video.attr('width');
|
616
|
-
height = video.attr('height');
|
617
|
-
id = video.attr('id');
|
618
|
-
data.video = {attrs : {}, sources : []};
|
619
|
-
|
620
|
-
// Get all video attributes
|
621
|
-
attrs = data.video.attrs;
|
622
|
-
for (name in video.attributes.map)
|
623
|
-
attrs[name] = video.attributes.map[name];
|
624
|
-
|
625
|
-
source = node.attr('src');
|
626
|
-
if (source)
|
627
|
-
data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', 'video')});
|
628
|
-
|
629
|
-
// Get all sources
|
630
|
-
sources = video.getAll("source");
|
631
|
-
for (i = 0; i < sources.length; i++) {
|
632
|
-
source = sources[i].remove();
|
633
|
-
|
634
|
-
data.video.sources.push({
|
635
|
-
src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'),
|
636
|
-
type: source.attr('type'),
|
637
|
-
media: source.attr('media')
|
638
|
-
});
|
639
|
-
}
|
640
|
-
|
641
|
-
// Convert the poster URL
|
642
|
-
if (attrs.poster)
|
643
|
-
attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', 'video');
|
644
|
-
}
|
645
|
-
|
646
|
-
// Object element
|
647
|
-
if (node.name === 'object') {
|
648
|
-
object = node;
|
649
|
-
embed = node.getAll('embed')[0];
|
650
|
-
}
|
651
|
-
|
652
|
-
// Embed element
|
653
|
-
if (node.name === 'embed')
|
654
|
-
embed = node;
|
655
|
-
|
656
|
-
// Iframe element
|
657
|
-
if (node.name === 'iframe') {
|
658
|
-
iframe = node;
|
659
|
-
type = 'Iframe';
|
660
|
-
}
|
661
|
-
|
662
|
-
if (object) {
|
663
|
-
// Get width/height
|
664
|
-
width = width || object.attr('width');
|
665
|
-
height = height || object.attr('height');
|
666
|
-
style = style || object.attr('style');
|
667
|
-
id = id || object.attr('id');
|
668
|
-
|
669
|
-
// Get all object params
|
670
|
-
params = object.getAll("param");
|
671
|
-
for (i = 0; i < params.length; i++) {
|
672
|
-
param = params[i];
|
673
|
-
name = param.remove().attr('name');
|
674
|
-
|
675
|
-
if (!excludedAttrs[name])
|
676
|
-
data.params[name] = param.attr('value');
|
677
|
-
}
|
678
|
-
|
679
|
-
data.params.src = data.params.src || object.attr('data');
|
680
|
-
}
|
681
|
-
|
682
|
-
if (embed) {
|
683
|
-
// Get width/height
|
684
|
-
width = width || embed.attr('width');
|
685
|
-
height = height || embed.attr('height');
|
686
|
-
style = style || embed.attr('style');
|
687
|
-
id = id || embed.attr('id');
|
688
|
-
|
689
|
-
// Get all embed attributes
|
690
|
-
for (name in embed.attributes.map) {
|
691
|
-
if (!excludedAttrs[name] && !data.params[name])
|
692
|
-
data.params[name] = embed.attributes.map[name];
|
693
|
-
}
|
694
|
-
}
|
695
|
-
|
696
|
-
if (iframe) {
|
697
|
-
// Get width/height
|
698
|
-
width = iframe.attr('width');
|
699
|
-
height = iframe.attr('height');
|
700
|
-
style = style || iframe.attr('style');
|
701
|
-
id = iframe.attr('id');
|
702
|
-
|
703
|
-
tinymce.each(rootAttributes, function(name) {
|
704
|
-
img.attr(name, iframe.attr(name));
|
705
|
-
});
|
706
|
-
|
707
|
-
// Get all iframe attributes
|
708
|
-
for (name in iframe.attributes.map) {
|
709
|
-
if (!excludedAttrs[name] && !data.params[name])
|
710
|
-
data.params[name] = iframe.attributes.map[name];
|
711
|
-
}
|
712
|
-
}
|
713
|
-
|
714
|
-
// Use src not movie
|
715
|
-
if (data.params.movie) {
|
716
|
-
data.params.src = data.params.src || data.params.movie;
|
717
|
-
delete data.params.movie;
|
718
|
-
}
|
719
|
-
|
720
|
-
// Convert the URL to relative/absolute depending on configuration
|
721
|
-
if (data.params.src)
|
722
|
-
data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object');
|
723
|
-
|
724
|
-
if (video)
|
725
|
-
type = lookup.video.name;
|
726
|
-
|
727
|
-
if (object && !type)
|
728
|
-
type = (lookup[(object.attr('clsid') || '').toLowerCase()] || lookup[(object.attr('type') || '').toLowerCase()] || {}).name;
|
729
|
-
|
730
|
-
if (embed && !type)
|
731
|
-
type = (lookup[(embed.attr('type') || '').toLowerCase()] || {}).name;
|
732
|
-
|
733
|
-
// Replace the video/object/embed element with a placeholder image containing the data
|
734
|
-
node.replace(img);
|
735
|
-
|
736
|
-
// Remove embed
|
737
|
-
if (embed)
|
738
|
-
embed.remove();
|
739
|
-
|
740
|
-
// Serialize the inner HTML of the object element
|
741
|
-
if (object) {
|
742
|
-
html = getInnerHTML(object.remove());
|
743
|
-
|
744
|
-
if (html)
|
745
|
-
data.object_html = html;
|
746
|
-
}
|
747
|
-
|
748
|
-
// Serialize the inner HTML of the video element
|
749
|
-
if (video) {
|
750
|
-
html = getInnerHTML(video.remove());
|
751
|
-
|
752
|
-
if (html)
|
753
|
-
data.video_html = html;
|
754
|
-
}
|
755
|
-
|
756
|
-
// Set width/height of placeholder
|
757
|
-
img.attr({
|
758
|
-
id : id,
|
759
|
-
'class' : 'mceItemMedia mceItem' + (type || 'Flash'),
|
760
|
-
style : style,
|
761
|
-
width : width || "320",
|
762
|
-
height : height || "240",
|
763
|
-
"data-mce-json" : JSON.serialize(data, "'")
|
764
|
-
});
|
765
|
-
}
|
766
|
-
});
|
767
|
-
|
768
|
-
// Register plugin
|
769
|
-
tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin);
|
770
|
-
})();
|
1
|
+
(function(){var d=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),h=tinymce.makeMap(d.join(",")),b=tinymce.html.Node,f,a,g=tinymce.util.JSON,e;f=[["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"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["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"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["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"],["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"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"]];function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){var r=this,l={},m,p,q,k;function o(i){return i&&i.nodeName==="IMG"&&n.dom.hasClass(i,"mceItemMedia")}r.editor=n;r.url=j;a="";for(m=0;m<f.length;m++){k=f[m][0];q={name:k,clsids:tinymce.explode(f[m][1]||""),mimes:tinymce.explode(f[m][2]||""),codebase:f[m][3]};for(p=0;p<q.clsids.length;p++){l["clsid:"+q.clsids[p]]=q}for(p=0;p<q.mimes.length;p++){l[q.mimes[p]]=q}l["mceItem"+k]=q;l[k.toLowerCase()]=q;a+=(a?"|":"")+k}tinymce.each(n.getParam("media_types","video=mp4,m4v,ogv,webm;silverlight=xap;flash=swf,flv;shockwave=dcr;quicktime=mov,qt,mpg,mp3,mpeg;shockwave=dcr;windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;realmedia=rm,ra,ram;java=jar").split(";"),function(v){var s,u,t;v=v.split(/=/);u=tinymce.explode(v[1].toLowerCase());for(s=0;s<u.length;s++){t=l[v[0].toLowerCase()];if(t){l[u[s]]=t}}});a=new RegExp("write("+a+")\\(([^)]+)\\)");r.lookup=l;n.onPreInit.add(function(){n.schema.addValidElements("object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]");n.parser.addNodeFilter("object,embed,video,audio,script,iframe",function(s){var t=s.length;while(t--){r.objectToImg(s[t])}});n.serializer.addNodeFilter("img",function(s,u,t){var v=s.length,w;while(v--){w=s[v];if((w.attr("class")||"").indexOf("mceItemMedia")!==-1){r.imgToObject(w,t)}}})});n.onInit.add(function(){if(n.theme&&n.theme.onResolveName){n.theme.onResolveName.add(function(i,s){if(s.name==="img"&&n.dom.hasClass(s.node,"mceItemMedia")){s.name="media"}})}if(n&&n.plugins.contextmenu){n.plugins.contextmenu.onContextMenu.add(function(s,t,i){if(i.nodeName==="IMG"&&i.className.indexOf("mceItemMedia")!==-1){t.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});n.addCommand("mceMedia",function(){var s,i;i=n.selection.getNode();if(o(i)){s=g.parse(n.dom.getAttrib(i,"data-mce-json"));tinymce.each(d,function(t){var u=n.dom.getAttrib(i,t);if(u){s[t]=u}});s.type=r.getType(i.className).name.toLowerCase()}if(!s){s={type:"flash",video:{sources:[]},params:{}}}n.windowManager.open({file:j+"/media.htm",width:430+parseInt(n.getLang("media.delta_width",0)),height:500+parseInt(n.getLang("media.delta_height",0)),inline:1},{plugin_url:j,data:s})});n.addButton("media",{title:"media.desc",cmd:"mceMedia"});n.onNodeChange.add(function(s,i,t){i.setActive("media",o(t))})},convertUrl:function(k,n){var j=this,m=j.editor,l=m.settings,o=l.url_converter,i=l.url_converter_scope||j;if(!k){return k}if(n){return m.documentBaseURI.toAbsolute(k)}return o.call(i,k,"src","object")},getInfo:function(){return{longname:"Media",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media",version:tinymce.majorVersion+"."+tinymce.minorVersion}},dataToImg:function(m,k){var r=this,o=r.editor,p=o.documentBaseURI,j,q,n,l;m.params.src=r.convertUrl(m.params.src,k);q=m.video.attrs;if(q){q.src=r.convertUrl(q.src,k)}if(q){q.poster=r.convertUrl(q.poster,k)}j=c(m.video.sources);if(j){for(l=0;l<j.length;l++){j[l].src=r.convertUrl(j[l].src,k)}}n=r.editor.dom.create("img",{id:m.id,style:m.style,align:m.align,src:r.editor.theme.url+"/img/trans.gif","class":"mceItemMedia mceItem"+r.getType(m.type).name,"data-mce-json":g.serialize(m,"'")});n.width=m.width||"320";n.height=m.height||"240";return n},dataToHtml:function(i,j){return this.editor.serializer.serialize(this.dataToImg(i,j),{force_absolute:j})},htmlToData:function(k){var j,i,l;l={type:"flash",video:{sources:[]},params:{}};j=this.editor.parser.parse(k);i=j.getAll("img")[0];if(i){l=g.parse(i.attr("data-mce-json"));l.type=this.getType(i.attr("class")).name.toLowerCase();tinymce.each(d,function(m){var n=i.attr(m);if(n){l[m]=n}})}return l},getType:function(m){var k,j,l;j=tinymce.explode(m," ");for(k=0;k<j.length;k++){l=this.lookup[j[k]];if(l){return l}}},imgToObject:function(x,n){var t=this,o=t.editor,A,E,j,s,F,w,D,u,k,C,r,p,y,B,m,v,l,z;function q(i,G){var K,J,L,I,H;H=o.getParam("flash_video_player_url",t.convertUrl(t.url+"/moxieplayer.swf"));if(H){K=o.documentBaseURI;D.params.src=H;if(o.getParam("flash_video_player_absvideourl",true)){i=K.toAbsolute(i||"",true);G=K.toAbsolute(G||"",true)}L="";J=o.getParam("flash_video_player_flashvars",{url:"$url",poster:"$poster"});tinymce.each(J,function(N,M){N=N.replace(/\$url/,i||"");N=N.replace(/\$poster/,G||"");if(N.length>0){L+=(L?"&":"")+M+"="+escape(N)}});if(L.length){D.params.flashvars=L}I=o.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(I,function(N,M){D.params[M]=""+N})}}D=g.parse(x.attr("data-mce-json"));p=this.getType(x.attr("class"));z=x.attr("data-mce-style");if(!z){z=x.attr("style");if(z){z=o.dom.serializeStyle(o.dom.parseStyle(z,"img"))}}if(p.name==="Iframe"){v=new b("iframe",1);tinymce.each(d,function(i){var G=x.attr(i);if(i=="class"&&G){G=G.replace(/mceItem.+ ?/g,"")}if(G&&G.length>0){v.attr(i,G)}});for(F in D.params){v.attr(F,D.params[F])}v.attr({style:z,src:D.params.src});x.replace(v);return}if(this.editor.settings.media_use_script){v=new b("script",1).attr("type","text/javascript");w=new b("#text",3);w.value="write"+p.name+"("+g.serialize(tinymce.extend(D.params,{width:x.attr("width"),height:x.attr("height")}))+");";v.append(w);x.replace(v);return}if(p.name==="Video"&&D.video.sources[0]){A=new b("video",1).attr(tinymce.extend({id:x.attr("id"),width:x.attr("width"),height:x.attr("height"),style:z},D.video.attrs));if(D.video.attrs){l=D.video.attrs.poster}k=D.video.sources=c(D.video.sources);for(y=0;y<k.length;y++){if(/\.mp4$/.test(k[y].src)){m=k[y].src}}if(!k[0].type){A.attr("src",k[0].src);k.splice(0,1)}for(y=0;y<k.length;y++){u=new b("source",1).attr(k[y]);u.shortEnded=true;A.append(u)}if(m){q(m,l);p=t.getType("flash")}else{D.params.src=""}}if(D.params.src){if(/\.flv$/i.test(D.params.src)){q(D.params.src,"")}if(n&&n.force_absolute){D.params.src=o.documentBaseURI.toAbsolute(D.params.src)}E=new b("object",1).attr({id:x.attr("id"),width:x.attr("width"),height:x.attr("height"),style:z});tinymce.each(d,function(i){if(D[i]&&i!="type"){E.attr(i,D[i])}});for(F in D.params){r=new b("param",1);r.shortEnded=true;w=D.params[F];if(F==="src"&&p.name==="WindowsMedia"){F="url"}r.attr({name:F,value:w});E.append(r)}if(this.editor.getParam("media_strict",true)){E.attr({data:D.params.src,type:p.mimes[0]})}else{E.attr({classid:"clsid:"+p.clsids[0],codebase:p.codebase});j=new b("embed",1);j.shortEnded=true;j.attr({id:x.attr("id"),width:x.attr("width"),height:x.attr("height"),style:z,type:p.mimes[0]});for(F in D.params){j.attr(F,D.params[F])}tinymce.each(d,function(i){if(D[i]&&i!="type"){j.attr(i,D[i])}});E.append(j)}if(D.object_html){w=new b("#text",3);w.raw=true;w.value=D.object_html;E.append(w)}if(A){A.append(E)}}if(A){if(D.video_html){w=new b("#text",3);w.raw=true;w.value=D.video_html;A.append(w)}}if(A||E){x.replace(A||E)}else{x.remove()}},objectToImg:function(y){var F,j,A,p,G,H,u,w,t,B,z,q,o,D,x,k,E,n,C=this.lookup,l,v,s=this.editor.settings.url_converter,m=this.editor.settings.url_converter_scope;function r(i){return new tinymce.html.Serializer({inner:true,validate:false}).serialize(i)}if(!y.parent){return}if(y.name==="script"){if(y.firstChild){l=a.exec(y.firstChild.value)}if(!l){return}n=l[1];E={video:{},params:g.parse(l[2])};w=E.params.width;t=E.params.height}E=E||{video:{},params:{}};G=new b("img",1);G.attr({src:this.editor.theme.url+"/img/trans.gif"});H=y.name;if(H==="video"){A=y;F=y.getAll("object")[0];j=y.getAll("embed")[0];w=A.attr("width");t=A.attr("height");u=A.attr("id");E.video={attrs:{},sources:[]};v=E.video.attrs;for(H in A.attributes.map){v[H]=A.attributes.map[H]}x=y.attr("src");if(x){E.video.sources.push({src:s.call(m,x,"src","video")})}k=A.getAll("source");for(z=0;z<k.length;z++){x=k[z].remove();E.video.sources.push({src:s.call(m,x.attr("src"),"src","source"),type:x.attr("type"),media:x.attr("media")})}if(v.poster){v.poster=s.call(m,v.poster,"poster","video")}}if(y.name==="object"){F=y;j=y.getAll("embed")[0]}if(y.name==="embed"){j=y}if(y.name==="iframe"){p=y;n="Iframe"}if(F){w=w||F.attr("width");t=t||F.attr("height");B=B||F.attr("style");u=u||F.attr("id");D=F.getAll("param");for(z=0;z<D.length;z++){o=D[z];H=o.remove().attr("name");if(!h[H]){E.params[H]=o.attr("value")}}E.params.src=E.params.src||F.attr("data")}if(j){w=w||j.attr("width");t=t||j.attr("height");B=B||j.attr("style");u=u||j.attr("id");for(H in j.attributes.map){if(!h[H]&&!E.params[H]){E.params[H]=j.attributes.map[H]}}}if(p){w=p.attr("width");t=p.attr("height");B=B||p.attr("style");u=p.attr("id");tinymce.each(d,function(i){G.attr(i,p.attr(i))});for(H in p.attributes.map){if(!h[H]&&!E.params[H]){E.params[H]=p.attributes.map[H]}}}if(E.params.movie){E.params.src=E.params.src||E.params.movie;delete E.params.movie}if(E.params.src){E.params.src=s.call(m,E.params.src,"src","object")}if(A){n=C.video.name}if(F&&!n){n=(C[(F.attr("clsid")||"").toLowerCase()]||C[(F.attr("type")||"").toLowerCase()]||{}).name}if(j&&!n){n=(C[(j.attr("type")||"").toLowerCase()]||{}).name}y.replace(G);if(j){j.remove()}if(F){q=r(F.remove());if(q){E.object_html=q}}if(A){q=r(A.remove());if(q){E.video_html=q}}G.attr({id:u,"class":"mceItemMedia mceItem"+(n||"Flash"),style:B,width:w||"320",height:t||"240","data-mce-json":g.serialize(E,"'")})}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
|