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