annotate WebContent/jscripts/tiny_mce/plugins/media/js/media.js @ 6:5bb7cc86069c

restlet.jar
author dwinter
date Wed, 14 Mar 2012 16:21:45 +0100
parents 0be9d53a6967
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
1 (function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
2 var url;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
3
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
4 if (url = tinyMCEPopup.getParam("media_external_list_url"))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
5 document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
6
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
7 function get(id) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
8 return document.getElementById(id);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
9 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
10
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
11 function clone(obj) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
12 var i, len, copy, attr;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
13
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
14 if (null == obj || "object" != typeof obj)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
15 return obj;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
16
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
17 // Handle Array
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
18 if ('length' in obj) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
19 copy = [];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
20
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
21 for (i = 0, len = obj.length; i < len; ++i) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
22 copy[i] = clone(obj[i]);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
23 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
24
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
25 return copy;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
26 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
27
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
28 // Handle Object
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
29 copy = {};
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
30 for (attr in obj) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
31 if (obj.hasOwnProperty(attr))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
32 copy[attr] = clone(obj[attr]);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
33 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
34
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
35 return copy;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
36 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
37
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
38 function getVal(id) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
39 var elm = get(id);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
40
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
41 if (elm.nodeName == "SELECT")
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
42 return elm.options[elm.selectedIndex].value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
43
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
44 if (elm.type == "checkbox")
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
45 return elm.checked;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
46
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
47 return elm.value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
48 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
49
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
50 function setVal(id, value, name) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
51 if (typeof(value) != 'undefined') {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
52 var elm = get(id);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
53
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
54 if (elm.nodeName == "SELECT")
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
55 selectByValue(document.forms[0], id, value);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
56 else if (elm.type == "checkbox") {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
57 if (typeof(value) == 'string') {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
58 value = value.toLowerCase();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
59 value = (!name && value === 'true') || (name && value === name.toLowerCase());
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
60 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
61 elm.checked = !!value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
62 } else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
63 elm.value = value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
64 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
65 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
66
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
67 window.Media = {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
68 init : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
69 var html, editor, self = this;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
70
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
71 self.editor = editor = tinyMCEPopup.editor;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
72
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
73 // Setup file browsers and color pickers
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
74 get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
75 get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
76 get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
77 get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
78 get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
79 get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
80 get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
81 get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
82
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
83 html = self.getMediaListHTML('medialist', 'src', 'media', 'media');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
84 if (html == "")
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
85 get("linklistrow").style.display = 'none';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
86 else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
87 get("linklistcontainer").innerHTML = html;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
88
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
89 if (isVisible('filebrowser'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
90 get('src').style.width = '230px';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
91
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
92 if (isVisible('video_filebrowser_altsource1'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
93 get('video_altsource1').style.width = '220px';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
94
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
95 if (isVisible('video_filebrowser_altsource2'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
96 get('video_altsource2').style.width = '220px';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
97
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
98 if (isVisible('audio_filebrowser_altsource1'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
99 get('audio_altsource1').style.width = '220px';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
100
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
101 if (isVisible('audio_filebrowser_altsource2'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
102 get('audio_altsource2').style.width = '220px';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
103
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
104 if (isVisible('filebrowser_poster'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
105 get('video_poster').style.width = '220px';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
106
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
107 editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
108
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
109 self.setDefaultDialogSettings(editor);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
110 self.data = clone(tinyMCEPopup.getWindowArg('data'));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
111 self.dataToForm();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
112 self.preview();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
113
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
114 updateColor('bgcolor_pick', 'bgcolor');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
115 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
116
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
117 insert : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
118 var editor = tinyMCEPopup.editor;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
119
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
120 this.formToData();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
121 editor.execCommand('mceRepaint');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
122 tinyMCEPopup.restoreSelection();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
123 editor.selection.setNode(editor.plugins.media.dataToImg(this.data));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
124 tinyMCEPopup.close();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
125 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
126
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
127 preview : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
128 get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
129 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
130
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
131 moveStates : function(to_form, field) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
132 var data = this.data, editor = this.editor,
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
133 mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
134
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
135 defaultStates = {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
136 // QuickTime
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
137 quicktime_autoplay : true,
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
138 quicktime_controller : true,
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
139
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
140 // Flash
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
141 flash_play : true,
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
142 flash_loop : true,
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
143 flash_menu : true,
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
144
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
145 // WindowsMedia
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
146 windowsmedia_autostart : true,
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
147 windowsmedia_enablecontextmenu : true,
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
148 windowsmedia_invokeurls : true,
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
149
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
150 // RealMedia
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
151 realmedia_autogotourl : true,
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
152 realmedia_imagestatus : true
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
153 };
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
154
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
155 function parseQueryParams(str) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
156 var out = {};
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
157
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
158 if (str) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
159 tinymce.each(str.split('&'), function(item) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
160 var parts = item.split('=');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
161
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
162 out[unescape(parts[0])] = unescape(parts[1]);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
163 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
164 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
165
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
166 return out;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
167 };
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
168
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
169 function setOptions(type, names) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
170 var i, name, formItemName, value, list;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
171
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
172 if (type == data.type || type == 'global') {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
173 names = tinymce.explode(names);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
174 for (i = 0; i < names.length; i++) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
175 name = names[i];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
176 formItemName = type == 'global' ? name : type + '_' + name;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
177
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
178 if (type == 'global')
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
179 list = data;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
180 else if (type == 'video' || type == 'audio') {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
181 list = data.video.attrs;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
182
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
183 if (!list && !to_form)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
184 data.video.attrs = list = {};
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
185 } else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
186 list = data.params;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
187
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
188 if (list) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
189 if (to_form) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
190 setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : '');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
191 } else {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
192 delete list[name];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
193
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
194 value = getVal(formItemName);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
195 if ((type == 'video' || type == 'audio') && value === true)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
196 value = name;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
197
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
198 if (defaultStates[formItemName]) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
199 if (value !== defaultStates[formItemName]) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
200 value = "" + value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
201 list[name] = value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
202 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
203 } else if (value) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
204 value = "" + value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
205 list[name] = value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
206 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
207 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
208 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
209 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
210 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
211 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
212
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
213 if (!to_form) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
214 data.type = get('media_type').options[get('media_type').selectedIndex].value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
215 data.width = getVal('width');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
216 data.height = getVal('height');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
217
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
218 // Switch type based on extension
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
219 src = getVal('src');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
220 if (field == 'src') {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
221 ext = src.replace(/^.*\.([^.]+)$/, '$1');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
222 if (typeInfo = mediaPlugin.getType(ext))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
223 data.type = typeInfo.name.toLowerCase();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
224
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
225 setVal('media_type', data.type);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
226 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
227
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
228 if (data.type == "video" || data.type == "audio") {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
229 if (!data.video.sources)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
230 data.video.sources = [];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
231
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
232 data.video.sources[0] = {src: getVal('src')};
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
233 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
234 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
235
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
236 // Hide all fieldsets and show the one active
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
237 get('video_options').style.display = 'none';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
238 get('audio_options').style.display = 'none';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
239 get('flash_options').style.display = 'none';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
240 get('quicktime_options').style.display = 'none';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
241 get('shockwave_options').style.display = 'none';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
242 get('windowsmedia_options').style.display = 'none';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
243 get('realmedia_options').style.display = 'none';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
244 get('embeddedaudio_options').style.display = 'none';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
245
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
246 if (get(data.type + '_options'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
247 get(data.type + '_options').style.display = 'block';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
248
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
249 setVal('media_type', data.type);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
250
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
251 setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
252 setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
253 setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
254 setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
255 setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
256 setOptions('video', 'poster,autoplay,loop,muted,preload,controls');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
257 setOptions('audio', 'autoplay,loop,preload,controls');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
258 setOptions('embeddedaudio', 'autoplay,loop,controls');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
259 setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
260
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
261 if (to_form) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
262 if (data.type == 'video') {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
263 if (data.video.sources[0])
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
264 setVal('src', data.video.sources[0].src);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
265
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
266 src = data.video.sources[1];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
267 if (src)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
268 setVal('video_altsource1', src.src);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
269
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
270 src = data.video.sources[2];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
271 if (src)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
272 setVal('video_altsource2', src.src);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
273 } else if (data.type == 'audio') {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
274 if (data.video.sources[0])
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
275 setVal('src', data.video.sources[0].src);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
276
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
277 src = data.video.sources[1];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
278 if (src)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
279 setVal('audio_altsource1', src.src);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
280
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
281 src = data.video.sources[2];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
282 if (src)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
283 setVal('audio_altsource2', src.src);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
284 } else {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
285 // Check flash vars
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
286 if (data.type == 'flash') {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
287 tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
288 if (value == '$url')
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
289 data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || '';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
290 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
291 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
292
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
293 setVal('src', data.params.src);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
294 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
295 } else {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
296 src = getVal("src");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
297
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
298 // YouTube *NEW*
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
299 if (src.match(/youtu.be\/[a-z1-9.-_]+/)) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
300 data.width = 425;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
301 data.height = 350;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
302 data.params.frameborder = '0';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
303 data.type = 'iframe';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
304 src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
305 setVal('src', src);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
306 setVal('media_type', data.type);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
307 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
308
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
309 // YouTube
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
310 if (src.match(/youtube.com(.+)v=([^&]+)/)) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
311 data.width = 425;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
312 data.height = 350;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
313 data.params.frameborder = '0';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
314 data.type = 'iframe';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
315 src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
316 setVal('src', src);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
317 setVal('media_type', data.type);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
318 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
319
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
320 // Google video
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
321 if (src.match(/video.google.com(.+)docid=([^&]+)/)) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
322 data.width = 425;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
323 data.height = 326;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
324 data.type = 'flash';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
325 src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
326 setVal('src', src);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
327 setVal('media_type', data.type);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
328 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
329
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
330 if (data.type == 'video') {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
331 if (!data.video.sources)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
332 data.video.sources = [];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
333
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
334 data.video.sources[0] = {src : src};
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
335
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
336 src = getVal("video_altsource1");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
337 if (src)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
338 data.video.sources[1] = {src : src};
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
339
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
340 src = getVal("video_altsource2");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
341 if (src)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
342 data.video.sources[2] = {src : src};
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
343 } else if (data.type == 'audio') {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
344 if (!data.video.sources)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
345 data.video.sources = [];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
346
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
347 data.video.sources[0] = {src : src};
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
348
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
349 src = getVal("audio_altsource1");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
350 if (src)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
351 data.video.sources[1] = {src : src};
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
352
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
353 src = getVal("audio_altsource2");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
354 if (src)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
355 data.video.sources[2] = {src : src};
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
356 } else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
357 data.params.src = src;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
358
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
359 // Set default size
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
360 setVal('width', data.width || (data.type == 'audio' ? 300 : 320));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
361 setVal('height', data.height || (data.type == 'audio' ? 32 : 240));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
362 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
363 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
364
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
365 dataToForm : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
366 this.moveStates(true);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
367 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
368
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
369 formToData : function(field) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
370 if (field == "width" || field == "height")
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
371 this.changeSize(field);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
372
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
373 if (field == 'source') {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
374 this.moveStates(false, field);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
375 setVal('source', this.editor.plugins.media.dataToHtml(this.data));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
376 this.panel = 'source';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
377 } else {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
378 if (this.panel == 'source') {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
379 this.data = clone(this.editor.plugins.media.htmlToData(getVal('source')));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
380 this.dataToForm();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
381 this.panel = '';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
382 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
383
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
384 this.moveStates(false, field);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
385 this.preview();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
386 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
387 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
388
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
389 beforeResize : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
390 this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
391 this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
392 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
393
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
394 changeSize : function(type) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
395 var width, height, scale, size;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
396
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
397 if (get('constrain').checked) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
398 width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
399 height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
400
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
401 if (type == 'width') {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
402 this.height = Math.round((width / this.width) * height);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
403 setVal('height', this.height);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
404 } else {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
405 this.width = Math.round((height / this.height) * width);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
406 setVal('width', this.width);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
407 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
408 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
409 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
410
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
411 getMediaListHTML : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
412 if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
413 var html = "";
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
414
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
415 html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;Media.formToData(\'src\');">';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
416 html += '<option value="">---</option>';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
417
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
418 for (var i=0; i<tinyMCEMediaList.length; i++)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
419 html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
420
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
421 html += '</select>';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
422
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
423 return html;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
424 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
425
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
426 return "";
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
427 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
428
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
429 getMediaTypeHTML : function(editor) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
430 function option(media_type){
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
431 return '<option value="'+media_type+'">'+tinyMCEPopup.editor.translate("media_dlg."+media_type)+'</option>'
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
432 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
433 var html = "";
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
434 html += '<select id="media_type" name="media_type" onchange="Media.formToData(\'type\');">';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
435 html += option("video");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
436 html += option("audio");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
437 html += option("flash");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
438 html += option("quicktime");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
439 html += option("shockwave");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
440 html += option("windowsmedia");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
441 html += option("realmedia");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
442 html += option("iframe");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
443
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
444 if (editor.getParam('media_embedded_audio', false)) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
445 html += option('embeddedaudio');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
446 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
447
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
448 html += '</select>';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
449 return html;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
450 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
451
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
452 setDefaultDialogSettings : function(editor) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
453 var defaultDialogSettings = editor.getParam("media_dialog_defaults", {});
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
454 tinymce.each(defaultDialogSettings, function(v, k) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
455 setVal(k, v);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
456 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
457 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
458 };
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
459
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
460 tinyMCEPopup.requireLangPack();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
461 tinyMCEPopup.onInit.add(function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
462 Media.init();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
463 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
464 })();