diff options
author | thomascube <thomas@roundcube.net> | 2011-04-20 19:11:10 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2011-04-20 19:11:10 +0000 |
commit | a9251be2f09fb5f18a85d201c67668c70980efe3 (patch) | |
tree | 59d8e5e6de86e4bcde237f2b5793eccb98a7ca87 /program/js/tiny_mce/plugins/media | |
parent | 164b45964edc699db9e049dddd91e9de07635fcd (diff) |
Update to TinyMCE 3.4.2 to fix errors in IE9v0.5.2@4679
Diffstat (limited to 'program/js/tiny_mce/plugins/media')
-rw-r--r-- | program/js/tiny_mce/plugins/media/css/media.css | 9 | ||||
-rw-r--r-- | program/js/tiny_mce/plugins/media/editor_plugin.js | 2 | ||||
-rw-r--r-- | program/js/tiny_mce/plugins/media/editor_plugin_src.js | 948 | ||||
-rw-r--r-- | program/js/tiny_mce/plugins/media/js/media.js | 930 | ||||
-rw-r--r-- | program/js/tiny_mce/plugins/media/langs/en_dlg.js | 10 | ||||
-rw-r--r-- | program/js/tiny_mce/plugins/media/media.htm | 571 |
6 files changed, 1276 insertions, 1194 deletions
diff --git a/program/js/tiny_mce/plugins/media/css/media.css b/program/js/tiny_mce/plugins/media/css/media.css index 2d087944d..0c45c7ff6 100644 --- a/program/js/tiny_mce/plugins/media/css/media.css +++ b/program/js/tiny_mce/plugins/media/css/media.css @@ -1,12 +1,12 @@ -#id, #name, #hspace, #vspace, #class_name, #align { width: 100px }
+#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 { width: 240px }
+#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: 230px; overflow: auto }
-.panel_wrapper div.current { height: 390px; overflow: auto }
+#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: #DDDDDD }
#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 }
@@ -14,3 +14,4 @@ #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}
diff --git a/program/js/tiny_mce/plugins/media/editor_plugin.js b/program/js/tiny_mce/plugins/media/editor_plugin.js index 4bbe367e3..66219078c 100644 --- a/program/js/tiny_mce/plugins/media/editor_plugin.js +++ b/program/js/tiny_mce/plugins/media/editor_plugin.js @@ -1 +1 @@ -(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.MediaPlugin",{init:function(b,c){var e=this;e.editor=b;e.url=c;function f(g){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(g.className)}b.onPreInit.add(function(){b.serializer.addRules("param[name|value|_mce_value]")});b.addCommand("mceMedia",function(){b.windowManager.open({file:c+"/media.htm",width:430+parseInt(b.getLang("media.delta_width",0)),height:470+parseInt(b.getLang("media.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("media",{title:"media.desc",cmd:"mceMedia"});b.onNodeChange.add(function(h,g,i){g.setActive("media",i.nodeName=="IMG"&&f(i))});b.onInit.add(function(){var g={mceItemFlash:"flash",mceItemShockWave:"shockwave",mceItemWindowsMedia:"windowsmedia",mceItemQuickTime:"quicktime",mceItemRealMedia:"realmedia"};b.selection.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.selection.onBeforeSetContent.add(e._objectsToSpans,e);if(b.settings.content_css!==false){b.dom.loadCSS(c+"/css/content.css")}if(b.theme&&b.theme.onResolveName){b.theme.onResolveName.add(function(h,i){if(i.name=="img"){a(g,function(l,j){if(b.dom.hasClass(i.node,j)){i.name=l;i.title=b.dom.getAttrib(i.node,"title");return false}})}})}if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(i,h,j){if(j.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(j.className)){h.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});b.onBeforeSetContent.add(e._objectsToSpans,e);b.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.onPreProcess.add(function(g,i){var h=g.dom;if(i.set){e._spansToImgs(i.node);a(h.select("IMG",i.node),function(k){var j;if(f(k)){j=e._parse(k.title);h.setAttrib(k,"width",h.getAttrib(k,"width",j.width||100));h.setAttrib(k,"height",h.getAttrib(k,"height",j.height||100))}})}if(i.get){a(h.select("IMG",i.node),function(m){var l,j,k;if(g.getParam("media_use_script")){if(f(m)){m.className=m.className.replace(/mceItem/g,"mceTemp")}return}switch(m.className){case"mceItemFlash":l="d27cdb6e-ae6d-11cf-96b8-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="application/x-shockwave-flash";break;case"mceItemShockWave":l="166b1bca-3f9c-11cf-8075-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0";k="application/x-director";break;case"mceItemWindowsMedia":l=g.getParam("media_wmp6_compatible")?"05589fa1-c356-11ce-bf01-00aa0055595a":"6bf52a52-394a-11d3-b153-00c04f79faa6";j="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";k="application/x-mplayer2";break;case"mceItemQuickTime":l="02bf25d5-8c17-4b23-bc80-d3488abddc6b";j="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0";k="video/quicktime";break;case"mceItemRealMedia":l="cfcdaa03-8be4-11cf-b84b-0020afbbccfa";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="audio/x-pn-realaudio-plugin";break}if(l){h.replace(e._buildObj({classid:l,codebase:j,type:k},m),m)}})}});b.onPostProcess.add(function(g,h){h.content=h.content.replace(/_mce_value=/g,"value=")});function d(g,h){h=new RegExp(h+'="([^"]+)"',"g").exec(g);return h?b.dom.decode(h[1]):""}b.onPostProcess.add(function(g,h){if(g.getParam("media_use_script")){h.content=h.content.replace(/<img[^>]+>/g,function(j){var i=d(j,"class");if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(i)){at=e._parse(d(j,"title"));at.width=d(j,"width");at.height=d(j,"height");j='<script type="text/javascript">write'+i.substring(7)+"({"+e._serialize(at)+"});<\/script>"}return j})}})},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}},_objectsToSpans:function(b,e){var c=this,d=e.content;d=d.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(g,f,i){var h=c._parse(i);return'<img class="mceItem'+f+'" title="'+b.dom.encode(i)+'" src="'+c.url+'/img/trans.gif" width="'+h.width+'" height="'+h.height+'" />'});d=d.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');d=d.replace(/<embed([^>]*)\/?>/gi,'<span class="mceItemEmbed" $1></span>');d=d.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');d=d.replace(/<\/(object)([^>]*)>/gi,"</span>");d=d.replace(/<\/embed>/gi,"");d=d.replace(/<param([^>]*)>/gi,function(g,f){return"<span "+f.replace(/value=/gi,"_mce_value=")+' class="mceItemParam"></span>'});d=d.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');e.content=d},_buildObj:function(g,h){var d,c=this.editor,f=c.dom,e=this._parse(h.title),b;b=c.getParam("media_strict",true)&&g.type=="application/x-shockwave-flash";e.width=g.width=f.getAttrib(h,"width")||100;e.height=g.height=f.getAttrib(h,"height")||100;if(e.src){e.src=c.convertURL(e.src,"src",h)}if(b){d=f.create("span",{id:e.id,_mce_name:"object",type:"application/x-shockwave-flash",data:e.src,style:f.getAttrib(h,"style"),width:g.width,height:g.height})}else{d=f.create("span",{id:e.id,_mce_name:"object",classid:"clsid:"+g.classid,style:f.getAttrib(h,"style"),codebase:g.codebase,width:g.width,height:g.height})}a(e,function(j,i){if(!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(i)){if(g.type=="application/x-mplayer2"&&i=="src"&&!e.url){i="url"}if(j){f.add(d,"span",{_mce_name:"param",name:i,_mce_value:j})}}});if(!b){f.add(d,"span",tinymce.extend({_mce_name:"embed",type:g.type,style:f.getAttrib(h,"style")},e))}return d},_spansToImgs:function(e){var d=this,f=d.editor.dom,b,c;a(f.select("span",e),function(g){if(f.getAttrib(g,"class")=="mceItemObject"){c=f.getAttrib(g,"classid").toLowerCase().replace(/\s+/g,"");switch(c){case"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000":f.replace(d._createImg("mceItemFlash",g),g);break;case"clsid:166b1bca-3f9c-11cf-8075-444553540000":f.replace(d._createImg("mceItemShockWave",g),g);break;case"clsid:6bf52a52-394a-11d3-b153-00c04f79faa6":case"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95":case"clsid:05589fa1-c356-11ce-bf01-00aa0055595a":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}return}if(f.getAttrib(g,"class")=="mceItemEmbed"){switch(f.getAttrib(g,"type")){case"application/x-shockwave-flash":f.replace(d._createImg("mceItemFlash",g),g);break;case"application/x-director":f.replace(d._createImg("mceItemShockWave",g),g);break;case"application/x-mplayer2":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"video/quicktime":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"audio/x-pn-realaudio-plugin":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}}})},_createImg:function(c,h){var b,g=this.editor.dom,f={},e="",d;d=["id","name","width","height","bgcolor","align","flashvars","src","wmode","allowfullscreen","quality","data"];b=g.create("img",{src:this.url+"/img/trans.gif",width:g.getAttrib(h,"width")||100,height:g.getAttrib(h,"height")||100,style:g.getAttrib(h,"style"),"class":c});a(d,function(i){var j=g.getAttrib(h,i);if(j){f[i]=j}});a(g.select("span",h),function(i){if(g.hasClass(i,"mceItemParam")){f[g.getAttrib(i,"name")]=g.getAttrib(i,"_mce_value")}});if(f.movie){f.src=f.movie;delete f.movie}if(!f.src){f.src=f.data;delete f.data}h=g.select(".mceItemEmbed",h)[0];if(h){a(d,function(i){var j=g.getAttrib(h,i);if(j&&!f[i]){f[i]=j}})}delete f.width;delete f.height;b.title=this._serialize(f);return b},_parse:function(b){return tinymce.util.JSON.parse("{"+b+"}")},_serialize:function(b){return tinymce.util.JSON.serialize(b).replace(/[{}]/g,"")}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
\ No newline at end of file +(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)})();
\ No newline at end of file diff --git a/program/js/tiny_mce/plugins/media/editor_plugin_src.js b/program/js/tiny_mce/plugins/media/editor_plugin_src.js index fc84e5b6c..e640bd366 100644 --- a/program/js/tiny_mce/plugins/media/editor_plugin_src.js +++ b/program/js/tiny_mce/plugins/media/editor_plugin_src.js @@ -9,187 +9,205 @@ */
(function() {
- var each = tinymce.each;
+ var rootAttributes = tinymce.explode('id,name,width,height,style,align,class,hspace,vspace,bgcolor,type'), excludedAttrs = tinymce.makeMap(rootAttributes.join(',')), Node = tinymce.html.Node,
+ mediaTypes, scriptRegExp, JSON = tinymce.util.JSON, mimeTypes;
+
+ // Media types supported by this plugin
+ mediaTypes = [
+ // Type, clsid:s, mime types, codebase
+ ["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 toArray(obj) {
+ var undef, out, i;
+
+ if (obj && !obj.splice) {
+ out = [];
+
+ for (i = 0; true; i++) {
+ if (obj[i])
+ out[i] = obj[i];
+ else
+ break;
+ }
+
+ return out;
+ }
+
+ return obj;
+ };
tinymce.create('tinymce.plugins.MediaPlugin', {
init : function(ed, url) {
- var t = this;
-
- t.editor = ed;
- t.url = url;
+ var self = this, lookup = {}, i, y, item, name;
- function isMediaElm(n) {
- return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);
+ function isMediaImg(node) {
+ return node && node.nodeName === 'IMG' && ed.dom.hasClass(node, 'mceItemMedia');
};
- ed.onPreInit.add(function() {
- // Force in _value parameter this extra parameter is required for older Opera versions
- ed.serializer.addRules('param[name|value|_mce_value]');
- });
+ self.editor = ed;
+ self.url = url;
- // Register commands
- ed.addCommand('mceMedia', function() {
- ed.windowManager.open({
- file : url + '/media.htm',
- width : 430 + parseInt(ed.getLang('media.delta_width', 0)),
- height : 470 + parseInt(ed.getLang('media.delta_height', 0)),
- inline : 1
- }, {
- plugin_url : url
- });
- });
+ // Parse media types into a lookup table
+ scriptRegExp = '';
+ for (i = 0; i < mediaTypes.length; i++) {
+ name = mediaTypes[i][0];
- // Register buttons
- ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'});
+ item = {
+ name : name,
+ clsids : tinymce.explode(mediaTypes[i][1] || ''),
+ mimes : tinymce.explode(mediaTypes[i][2] || ''),
+ codebase : mediaTypes[i][3]
+ };
+
+ for (y = 0; y < item.clsids.length; y++)
+ lookup['clsid:' + item.clsids[y]] = item;
+
+ for (y = 0; y < item.mimes.length; y++)
+ lookup[item.mimes[y]] = item;
+
+ lookup['mceItem' + name] = item;
+ lookup[name.toLowerCase()] = item;
- ed.onNodeChange.add(function(ed, cm, n) {
- cm.setActive('media', n.nodeName == 'IMG' && isMediaElm(n));
+ scriptRegExp += (scriptRegExp ? '|' : '') + name;
+ }
+
+ // Handle the media_types setting
+ tinymce.each(ed.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(item) {
+ var i, extensions, type;
+
+ item = item.split(/=/);
+ extensions = tinymce.explode(item[1].toLowerCase());
+ for (i = 0; i < extensions.length; i++) {
+ type = lookup[item[0].toLowerCase()];
+
+ if (type)
+ lookup[extensions[i]] = type;
+ }
});
- ed.onInit.add(function() {
- var lo = {
- mceItemFlash : 'flash',
- mceItemShockWave : 'shockwave',
- mceItemWindowsMedia : 'windowsmedia',
- mceItemQuickTime : 'quicktime',
- mceItemRealMedia : 'realmedia'
- };
+ scriptRegExp = new RegExp('write(' + scriptRegExp + ')\\(([^)]+)\\)');
+ self.lookup = lookup;
- ed.selection.onSetContent.add(function() {
- t._spansToImgs(ed.getBody());
+ ed.onPreInit.add(function() {
+ // Allow video elements
+ ed.schema.addValidElements('object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]');
+
+ // Convert video elements to image placeholder
+ ed.parser.addNodeFilter('object,embed,video,audio,script,iframe', function(nodes) {
+ var i = nodes.length;
+
+ while (i--)
+ self.objectToImg(nodes[i]);
});
- ed.selection.onBeforeSetContent.add(t._objectsToSpans, t);
+ // Convert image placeholders to video elements
+ ed.serializer.addNodeFilter('img', function(nodes, name, args) {
+ var i = nodes.length, node;
- if (ed.settings.content_css !== false)
- ed.dom.loadCSS(url + "/css/content.css");
+ while (i--) {
+ node = nodes[i];
+ if ((node.attr('class') || '').indexOf('mceItemMedia') !== -1)
+ self.imgToObject(node, args);
+ }
+ });
+ });
+ ed.onInit.add(function() {
+ // Display "media" instead of "img" in element path
if (ed.theme && ed.theme.onResolveName) {
- ed.theme.onResolveName.add(function(th, o) {
- if (o.name == 'img') {
- each(lo, function(v, k) {
- if (ed.dom.hasClass(o.node, k)) {
- o.name = v;
- o.title = ed.dom.getAttrib(o.node, 'title');
- return false;
- }
- });
- }
+ ed.theme.onResolveName.add(function(theme, path_object) {
+ if (path_object.name === 'img' && ed.dom.hasClass(path_object.node, 'mceItemMedia'))
+ path_object.name = 'media';
});
}
+ // Add contect menu if it's loaded
if (ed && ed.plugins.contextmenu) {
- ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
- if (e.nodeName == 'IMG' && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)) {
- m.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});
- }
+ ed.plugins.contextmenu.onContextMenu.add(function(plugin, menu, element) {
+ if (element.nodeName === 'IMG' && element.className.indexOf('mceItemMedia') !== -1)
+ menu.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});
});
}
});
- ed.onBeforeSetContent.add(t._objectsToSpans, t);
-
- ed.onSetContent.add(function() {
- t._spansToImgs(ed.getBody());
- });
-
- ed.onPreProcess.add(function(ed, o) {
- var dom = ed.dom;
+ // Register commands
+ ed.addCommand('mceMedia', function() {
+ var data, img;
- if (o.set) {
- t._spansToImgs(o.node);
+ img = ed.selection.getNode();
+ if (isMediaImg(img)) {
+ data = JSON.parse(ed.dom.getAttrib(img, 'data-mce-json'));
- each(dom.select('IMG', o.node), function(n) {
- var p;
+ // Add some extra properties to the data object
+ tinymce.each(rootAttributes, function(name) {
+ var value = ed.dom.getAttrib(img, name);
- if (isMediaElm(n)) {
- p = t._parse(n.title);
- dom.setAttrib(n, 'width', dom.getAttrib(n, 'width', p.width || 100));
- dom.setAttrib(n, 'height', dom.getAttrib(n, 'height', p.height || 100));
- }
+ if (value)
+ data[name] = value;
});
+
+ data.type = self.getType(img.className).name.toLowerCase();
}
- if (o.get) {
- each(dom.select('IMG', o.node), function(n) {
- var ci, cb, mt;
-
- if (ed.getParam('media_use_script')) {
- if (isMediaElm(n))
- n.className = n.className.replace(/mceItem/g, 'mceTemp');
-
- return;
- }
-
- switch (n.className) {
- case 'mceItemFlash':
- ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000';
- cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
- mt = 'application/x-shockwave-flash';
- break;
-
- case 'mceItemShockWave':
- ci = '166b1bca-3f9c-11cf-8075-444553540000';
- cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';
- mt = 'application/x-director';
- break;
-
- case 'mceItemWindowsMedia':
- ci = ed.getParam('media_wmp6_compatible') ? '05589fa1-c356-11ce-bf01-00aa0055595a' : '6bf52a52-394a-11d3-b153-00c04f79faa6';
- cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
- mt = 'application/x-mplayer2';
- break;
-
- case 'mceItemQuickTime':
- ci = '02bf25d5-8c17-4b23-bc80-d3488abddc6b';
- cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';
- mt = 'video/quicktime';
- break;
-
- case 'mceItemRealMedia':
- ci = 'cfcdaa03-8be4-11cf-b84b-0020afbbccfa';
- cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
- mt = 'audio/x-pn-realaudio-plugin';
- break;
- }
-
- if (ci) {
- dom.replace(t._buildObj({
- classid : ci,
- codebase : cb,
- type : mt
- }, n), n);
- }
- });
+ if (!data) {
+ data = {
+ type : 'flash',
+ video: {sources:[]},
+ params: {}
+ };
}
- });
- ed.onPostProcess.add(function(ed, o) {
- o.content = o.content.replace(/_mce_value=/g, 'value=');
+ ed.windowManager.open({
+ file : url + '/media.htm',
+ width : 430 + parseInt(ed.getLang('media.delta_width', 0)),
+ height : 500 + parseInt(ed.getLang('media.delta_height', 0)),
+ inline : 1
+ }, {
+ plugin_url : url,
+ data : data
+ });
});
- function getAttr(s, n) {
- n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);
+ // Register buttons
+ ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'});
- return n ? ed.dom.decode(n[1]) : '';
- };
+ // Update media selection status
+ ed.onNodeChange.add(function(ed, cm, node) {
+ cm.setActive('media', isMediaImg(node));
+ });
+ },
- ed.onPostProcess.add(function(ed, o) {
- if (ed.getParam('media_use_script')) {
- o.content = o.content.replace(/<img[^>]+>/g, function(im) {
- var cl = getAttr(im, 'class');
+ convertUrl : function(url, force_absolute) {
+ var self = this, editor = self.editor, settings = editor.settings,
+ urlConverter = settings.url_converter,
+ urlConverterScope = settings.url_converter_scope || self;
- if (/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)) {
- at = t._parse(getAttr(im, 'title'));
- at.width = getAttr(im, 'width');
- at.height = getAttr(im, 'height');
- im = '<script type="text/javascript">write' + cl.substring(7) + '({' + t._serialize(at) + '});</script>';
- }
+ if (!url)
+ return url;
- return im;
- });
- }
- });
+ if (force_absolute)
+ return editor.documentBaseURI.toAbsolute(url);
+
+ return urlConverter.call(urlConverterScope, url, 'src', 'object');
},
getInfo : function() {
@@ -202,210 +220,548 @@ };
},
- // Private methods
- _objectsToSpans : function(ed, o) {
- var t = this, h = o.content;
+ /**
+ * Converts the JSON data object to an img node.
+ */
+ dataToImg : function(data, force_absolute) {
+ var self = this, editor = self.editor, baseUri = editor.documentBaseURI, sources, attrs, img, i;
+
+ data.params.src = self.convertUrl(data.params.src, force_absolute);
- h = h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) {
- var o = t._parse(c);
+ attrs = data.video.attrs;
+ if (attrs)
+ attrs.src = self.convertUrl(attrs.src, force_absolute);
- return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + t.url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />'
+ if (attrs)
+ attrs.poster = self.convertUrl(attrs.poster, force_absolute);
+
+ sources = toArray(data.video.sources);
+ if (sources) {
+ for (i = 0; i < sources.length; i++)
+ sources[i].src = self.convertUrl(sources[i].src, force_absolute);
+ }
+
+ img = self.editor.dom.create('img', {
+ id : data.id,
+ style : data.style,
+ align : data.align,
+ src : self.editor.theme.url + '/img/trans.gif',
+ 'class' : 'mceItemMedia mceItem' + self.getType(data.type).name,
+ 'data-mce-json' : JSON.serialize(data, "'")
});
- h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>');
- h = h.replace(/<embed([^>]*)\/?>/gi, '<span class="mceItemEmbed" $1></span>');
- h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>');
- h = h.replace(/<\/(object)([^>]*)>/gi, '</span>');
- h = h.replace(/<\/embed>/gi, '');
- h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_mce_value=') + ' class="mceItemParam"></span>'});
- h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>');
+ img.width = data.width || "320";
+ img.height = data.height || "240";
- o.content = h;
+ return img;
},
- _buildObj : function(o, n) {
- var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title), stc;
-
- stc = ed.getParam('media_strict', true) && o.type == 'application/x-shockwave-flash';
-
- p.width = o.width = dom.getAttrib(n, 'width') || 100;
- p.height = o.height = dom.getAttrib(n, 'height') || 100;
-
- if (p.src)
- p.src = ed.convertURL(p.src, 'src', n);
-
- if (stc) {
- ob = dom.create('span', {
- id : p.id,
- _mce_name : 'object',
- type : 'application/x-shockwave-flash',
- data : p.src,
- style : dom.getAttrib(n, 'style'),
- width : o.width,
- height : o.height
- });
- } else {
- ob = dom.create('span', {
- id : p.id,
- _mce_name : 'object',
- classid : "clsid:" + o.classid,
- style : dom.getAttrib(n, 'style'),
- codebase : o.codebase,
- width : o.width,
- height : o.height
+ /**
+ * Converts the JSON data object to a HTML string.
+ */
+ dataToHtml : function(data, force_absolute) {
+ return this.editor.serializer.serialize(this.dataToImg(data, force_absolute), {force_absolute : force_absolute});
+ },
+
+ /**
+ * Converts the JSON data object to a HTML string.
+ */
+ htmlToData : function(html) {
+ var fragment, img, data;
+
+ data = {
+ type : 'flash',
+ video: {sources:[]},
+ params: {}
+ };
+
+ fragment = this.editor.parser.parse(html);
+ img = fragment.getAll('img')[0];
+
+ if (img) {
+ data = JSON.parse(img.attr('data-mce-json'));
+ data.type = this.getType(img.attr('class')).name.toLowerCase();
+
+ // Add some extra properties to the data object
+ tinymce.each(rootAttributes, function(name) {
+ var value = img.attr(name);
+
+ if (value)
+ data[name] = value;
});
}
- each (p, function(v, k) {
- if (!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(k)) {
- // Use url instead of src in IE for Windows media
- if (o.type == 'application/x-mplayer2' && k == 'src' && !p.url)
- k = 'url';
+ return data;
+ },
+
+ /**
+ * Get type item by extension, class, clsid or mime type.
+ *
+ * @method getType
+ * @param {String} value Value to get type item by.
+ * @return {Object} Type item object or undefined.
+ */
+ getType : function(value) {
+ var i, values, typeItem;
+
+ // Find type by checking the classes
+ values = tinymce.explode(value, ' ');
+ for (i = 0; i < values.length; i++) {
+ typeItem = this.lookup[values[i]];
+
+ if (typeItem)
+ return typeItem;
+ }
+ },
+
+ /**
+ * Converts a tinymce.html.Node image element to video/object/embed.
+ */
+ imgToObject : function(node, args) {
+ var self = this, editor = self.editor, video, object, embed, iframe, name, value, data,
+ source, sources, params, param, typeItem, i, item, mp4Source, replacement,
+ posterSrc, style;
+
+ // Adds the flash player
+ function addPlayer(video_src, poster_src) {
+ var baseUri, flashVars, flashVarsOutput, params, flashPlayer;
+
+ flashPlayer = editor.getParam('flash_video_player_url', self.convertUrl(self.url + '/moxieplayer.swf'));
+ if (flashPlayer) {
+ baseUri = editor.documentBaseURI;
+ data.params.src = flashPlayer;
+
+ // Convert the movie url to absolute urls
+ if (editor.getParam('flash_video_player_absvideourl', true)) {
+ video_src = baseUri.toAbsolute(video_src || '', true);
+ poster_src = baseUri.toAbsolute(poster_src || '', true);
+ }
+
+ // Generate flash vars
+ flashVarsOutput = '';
+ flashVars = editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'});
+ tinymce.each(flashVars, function(value, name) {
+ // Replace $url and $poster variables in flashvars value
+ value = value.replace(/\$url/, video_src || '');
+ value = value.replace(/\$poster/, poster_src || '');
+
+ if (value.length > 0)
+ flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value);
+ });
+
+ if (flashVarsOutput.length)
+ data.params.flashvars = flashVarsOutput;
- if (v)
- dom.add(ob, 'span', {_mce_name : 'param', name : k, '_mce_value' : v});
+ params = editor.getParam('flash_video_player_params', {
+ allowfullscreen: true,
+ allowscriptaccess: true
+ });
+
+ tinymce.each(params, function(value, name) {
+ data.params[name] = "" + value;
+ });
}
- });
+ };
- if (!stc)
- dom.add(ob, 'span', tinymce.extend({_mce_name : 'embed', type : o.type, style : dom.getAttrib(n, 'style')}, p));
+ data = JSON.parse(node.attr('data-mce-json'));
+ typeItem = this.getType(node.attr('class'));
- return ob;
- },
+ style = node.attr('data-mce-style')
+ if (!style) {
+ style = node.attr('style');
- _spansToImgs : function(p) {
- var t = this, dom = t.editor.dom, im, ci;
+ if (style)
+ style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img'));
+ }
- each(dom.select('span', p), function(n) {
- // Convert object into image
- if (dom.getAttrib(n, 'class') == 'mceItemObject') {
- ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, '');
+ // Handle iframe
+ if (typeItem.name === 'Iframe') {
+ replacement = new Node('iframe', 1);
- switch (ci) {
- case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':
- dom.replace(t._createImg('mceItemFlash', n), n);
- break;
+ tinymce.each(rootAttributes, function(name) {
+ var value = node.attr(name);
- case 'clsid:166b1bca-3f9c-11cf-8075-444553540000':
- dom.replace(t._createImg('mceItemShockWave', n), n);
- break;
+ if (name == 'class' && value)
+ value = value.replace(/mceItem.+ ?/g, '');
- case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':
- case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':
- case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':
- dom.replace(t._createImg('mceItemWindowsMedia', n), n);
- break;
+ if (value && value.length > 0)
+ replacement.attr(name, value);
+ });
- case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':
- dom.replace(t._createImg('mceItemQuickTime', n), n);
- break;
+ for (name in data.params)
+ replacement.attr(name, data.params[name]);
- case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':
- dom.replace(t._createImg('mceItemRealMedia', n), n);
- break;
+ replacement.attr({
+ style: style,
+ src: data.params.src
+ });
- default:
- dom.replace(t._createImg('mceItemFlash', n), n);
- }
-
- return;
+ node.replace(replacement);
+
+ return;
+ }
+
+ // Handle scripts
+ if (this.editor.settings.media_use_script) {
+ replacement = new Node('script', 1).attr('type', 'text/javascript');
+
+ value = new Node('#text', 3);
+ value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, {
+ width: node.attr('width'),
+ height: node.attr('height')
+ })) + ');';
+
+ replacement.append(value);
+ node.replace(replacement);
+
+ return;
+ }
+
+ // Add HTML5 video element
+ if (typeItem.name === 'Video' && data.video.sources[0]) {
+ // Create new object element
+ video = new Node('video', 1).attr(tinymce.extend({
+ id : node.attr('id'),
+ width: node.attr('width'),
+ height: node.attr('height'),
+ style : style
+ }, data.video.attrs));
+
+ // Get poster source and use that for flash fallback
+ if (data.video.attrs)
+ posterSrc = data.video.attrs.poster;
+
+ sources = data.video.sources = toArray(data.video.sources);
+ for (i = 0; i < sources.length; i++) {
+ if (/\.mp4$/.test(sources[i].src))
+ mp4Source = sources[i].src;
}
- // Convert embed into image
- if (dom.getAttrib(n, 'class') == 'mceItemEmbed') {
- switch (dom.getAttrib(n, 'type')) {
- case 'application/x-shockwave-flash':
- dom.replace(t._createImg('mceItemFlash', n), n);
- break;
+ if (!sources[0].type) {
+ video.attr('src', sources[0].src);
+ sources.splice(0, 1);
+ }
- case 'application/x-director':
- dom.replace(t._createImg('mceItemShockWave', n), n);
- break;
+ for (i = 0; i < sources.length; i++) {
+ source = new Node('source', 1).attr(sources[i]);
+ source.shortEnded = true;
+ video.append(source);
+ }
- case 'application/x-mplayer2':
- dom.replace(t._createImg('mceItemWindowsMedia', n), n);
- break;
+ // Create flash fallback for video if we have a mp4 source
+ if (mp4Source) {
+ addPlayer(mp4Source, posterSrc);
+ typeItem = self.getType('flash');
+ } else
+ data.params.src = '';
+ }
- case 'video/quicktime':
- dom.replace(t._createImg('mceItemQuickTime', n), n);
- break;
+ // Do we have a params src then we can generate object
+ if (data.params.src) {
+ // Is flv movie add player for it
+ if (/\.flv$/i.test(data.params.src))
+ addPlayer(data.params.src, '');
+
+ if (args && args.force_absolute)
+ data.params.src = editor.documentBaseURI.toAbsolute(data.params.src);
+
+ // Create new object element
+ object = new Node('object', 1).attr({
+ id : node.attr('id'),
+ width: node.attr('width'),
+ height: node.attr('height'),
+ style : style
+ });
- case 'audio/x-pn-realaudio-plugin':
- dom.replace(t._createImg('mceItemRealMedia', n), n);
- break;
+ tinymce.each(rootAttributes, function(name) {
+ if (data[name] && name != 'type')
+ object.attr(name, data[name]);
+ });
- default:
- dom.replace(t._createImg('mceItemFlash', n), n);
- }
- }
- });
+ // Add params
+ for (name in data.params) {
+ param = new Node('param', 1);
+ param.shortEnded = true;
+ value = data.params[name];
+
+ // Windows media needs to use url instead of src for the media URL
+ if (name === 'src' && typeItem.name === 'WindowsMedia')
+ name = 'url';
+
+ param.attr({name: name, value: value});
+ object.append(param);
+ }
+
+ // Setup add type and classid if strict is disabled
+ if (this.editor.getParam('media_strict', true)) {
+ object.attr({
+ data: data.params.src,
+ type: typeItem.mimes[0]
+ });
+ } else {
+ object.attr({
+ classid: "clsid:" + typeItem.clsids[0],
+ codebase: typeItem.codebase
+ });
+
+ embed = new Node('embed', 1);
+ embed.shortEnded = true;
+ embed.attr({
+ id: node.attr('id'),
+ width: node.attr('width'),
+ height: node.attr('height'),
+ style : style,
+ type: typeItem.mimes[0]
+ });
+
+ for (name in data.params)
+ embed.attr(name, data.params[name]);
+
+ tinymce.each(rootAttributes, function(name) {
+ if (data[name] && name != 'type')
+ embed.attr(name, data[name]);
+ });
+
+ object.append(embed);
+ }
+
+ // Insert raw HTML
+ if (data.object_html) {
+ value = new Node('#text', 3);
+ value.raw = true;
+ value.value = data.object_html;
+ object.append(value);
+ }
+
+ // Append object to video element if it exists
+ if (video)
+ video.append(object);
+ }
+
+ if (video) {
+ // Insert raw HTML
+ if (data.video_html) {
+ value = new Node('#text', 3);
+ value.raw = true;
+ value.value = data.video_html;
+ video.append(value);
+ }
+ }
+
+ if (video || object)
+ node.replace(video || object);
+ else
+ node.remove();
},
- _createImg : function(cl, n) {
- var im, dom = this.editor.dom, pa = {}, ti = '', args;
+ /**
+ * Converts a tinymce.html.Node video/object/embed to an img element.
+ *
+ * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this:
+ * <img class="mceItemMedia mceItemFlash" width="100" height="100" data-mce-json="{..}" />
+ *
+ * The JSON structure will be like this:
+ * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}}
+ */
+ objectToImg : function(node) {
+ var object, embed, video, iframe, img, name, id, width, height, style, i, html,
+ param, params, source, sources, data, type, lookup = this.lookup,
+ matches, attrs, urlConverter = this.editor.settings.url_converter,
+ urlConverterScope = this.editor.settings.url_converter_scope;
+
+ function getInnerHTML(node) {
+ return new tinymce.html.Serializer({
+ inner: true,
+ validate: false
+ }).serialize(node);
+ };
- args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality', 'data'];
+ // If node isn't in document
+ if (!node.parent)
+ return;
- // Create image
- im = dom.create('img', {
- src : this.url + '/img/trans.gif',
- width : dom.getAttrib(n, 'width') || 100,
- height : dom.getAttrib(n, 'height') || 100,
- style : dom.getAttrib(n, 'style'),
- 'class' : cl
- });
+ // Handle media scripts
+ if (node.name === 'script') {
+ if (node.firstChild)
+ matches = scriptRegExp.exec(node.firstChild.value);
- // Setup base parameters
- each(args, function(na) {
- var v = dom.getAttrib(n, na);
+ if (!matches)
+ return;
- if (v)
- pa[na] = v;
- });
+ type = matches[1];
+ data = {video : {}, params : JSON.parse(matches[2])};
+ width = data.params.width;
+ height = data.params.height;
+ }
+
+ // Setup data objects
+ data = data || {
+ video : {},
+ params : {}
+ };
- // Add optional parameters
- each(dom.select('span', n), function(n) {
- if (dom.hasClass(n, 'mceItemParam'))
- pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_mce_value');
+ // Setup new image object
+ img = new Node('img', 1);
+ img.attr({
+ src : this.editor.theme.url + '/img/trans.gif'
});
- // Use src not movie
- if (pa.movie) {
- pa.src = pa.movie;
- delete pa.movie;
+ // Video element
+ name = node.name;
+ if (name === 'video') {
+ video = node;
+ object = node.getAll('object')[0];
+ embed = node.getAll('embed')[0];
+ width = video.attr('width');
+ height = video.attr('height');
+ id = video.attr('id');
+ data.video = {attrs : {}, sources : []};
+
+ // Get all video attributes
+ attrs = data.video.attrs;
+ for (name in video.attributes.map)
+ attrs[name] = video.attributes.map[name];
+
+ source = node.attr('src');
+ if (source)
+ data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', 'video')});
+
+ // Get all sources
+ sources = video.getAll("source");
+ for (i = 0; i < sources.length; i++) {
+ source = sources[i].remove();
+
+ data.video.sources.push({
+ src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'),
+ type: source.attr('type'),
+ media: source.attr('media')
+ });
+ }
+
+ // Convert the poster URL
+ if (attrs.poster)
+ attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', 'video');
+ }
+
+ // Object element
+ if (node.name === 'object') {
+ object = node;
+ embed = node.getAll('embed')[0];
+ }
+
+ // Embed element
+ if (node.name === 'embed')
+ embed = node;
+
+ // Iframe element
+ if (node.name === 'iframe') {
+ iframe = node;
+ type = 'Iframe';
+ }
+
+ if (object) {
+ // Get width/height
+ width = width || object.attr('width');
+ height = height || object.attr('height');
+ style = style || object.attr('style');
+ id = id || object.attr('id');
+
+ // Get all object params
+ params = object.getAll("param");
+ for (i = 0; i < params.length; i++) {
+ param = params[i];
+ name = param.remove().attr('name');
+
+ if (!excludedAttrs[name])
+ data.params[name] = param.attr('value');
+ }
+
+ data.params.src = data.params.src || object.attr('data');
}
- // No src try data
- if (!pa.src) {
- pa.src = pa.data;
- delete pa.data;
+ if (embed) {
+ // Get width/height
+ width = width || embed.attr('width');
+ height = height || embed.attr('height');
+ style = style || embed.attr('style');
+ id = id || embed.attr('id');
+
+ // Get all embed attributes
+ for (name in embed.attributes.map) {
+ if (!excludedAttrs[name] && !data.params[name])
+ data.params[name] = embed.attributes.map[name];
+ }
}
- // Merge with embed args
- n = dom.select('.mceItemEmbed', n)[0];
- if (n) {
- each(args, function(na) {
- var v = dom.getAttrib(n, na);
+ if (iframe) {
+ // Get width/height
+ width = iframe.attr('width');
+ height = iframe.attr('height');
+ style = style || iframe.attr('style');
+ id = iframe.attr('id');
- if (v && !pa[na])
- pa[na] = v;
+ tinymce.each(rootAttributes, function(name) {
+ img.attr(name, iframe.attr(name));
});
+
+ // Get all iframe attributes
+ for (name in iframe.attributes.map) {
+ if (!excludedAttrs[name] && !data.params[name])
+ data.params[name] = iframe.attributes.map[name];
+ }
}
- delete pa.width;
- delete pa.height;
+ // Use src not movie
+ if (data.params.movie) {
+ data.params.src = data.params.src || data.params.movie;
+ delete data.params.movie;
+ }
- im.title = this._serialize(pa);
+ // Convert the URL to relative/absolute depending on configuration
+ if (data.params.src)
+ data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object');
- return im;
- },
+ if (video)
+ type = lookup.video.name;
- _parse : function(s) {
- return tinymce.util.JSON.parse('{' + s + '}');
- },
+ if (object && !type)
+ type = (lookup[(object.attr('clsid') || '').toLowerCase()] || lookup[(object.attr('type') || '').toLowerCase()] || {}).name;
- _serialize : function(o) {
- return tinymce.util.JSON.serialize(o).replace(/[{}]/g, '');
+ if (embed && !type)
+ type = (lookup[(embed.attr('type') || '').toLowerCase()] || {}).name;
+
+ // Replace the video/object/embed element with a placeholder image containing the data
+ node.replace(img);
+
+ // Remove embed
+ if (embed)
+ embed.remove();
+
+ // Serialize the inner HTML of the object element
+ if (object) {
+ html = getInnerHTML(object.remove());
+
+ if (html)
+ data.object_html = html;
+ }
+
+ // Serialize the inner HTML of the video element
+ if (video) {
+ html = getInnerHTML(video.remove());
+
+ if (html)
+ data.video_html = html;
+ }
+
+ // Set width/height of placeholder
+ img.attr({
+ id : id,
+ 'class' : 'mceItemMedia mceItem' + (type || 'Flash'),
+ style : style,
+ width : width || "320",
+ height : height || "240",
+ "data-mce-json" : JSON.serialize(data, "'")
+ });
}
});
diff --git a/program/js/tiny_mce/plugins/media/js/media.js b/program/js/tiny_mce/plugins/media/js/media.js index 86cfa9856..30ad65617 100644 --- a/program/js/tiny_mce/plugins/media/js/media.js +++ b/program/js/tiny_mce/plugins/media/js/media.js @@ -1,630 +1,354 @@ -tinyMCEPopup.requireLangPack();
+(function() {
+ var url;
-var oldWidth, oldHeight, ed, url;
+ if (url = tinyMCEPopup.getParam("media_external_list_url"))
+ document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
-if (url = tinyMCEPopup.getParam("media_external_list_url"))
- document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
-
-function init() {
- var pl = "", f, val;
- var type = "flash", fe, i;
-
- ed = tinyMCEPopup.editor;
-
- tinyMCEPopup.resizeToInnerSize();
- f = document.forms[0]
-
- fe = ed.selection.getNode();
- if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) {
- pl = fe.title;
-
- switch (ed.dom.getAttrib(fe, 'class')) {
- case 'mceItemFlash':
- type = 'flash';
- break;
-
- case 'mceItemFlashVideo':
- type = 'flv';
- break;
-
- case 'mceItemShockWave':
- type = 'shockwave';
- break;
-
- case 'mceItemWindowsMedia':
- type = 'wmp';
- break;
-
- case 'mceItemQuickTime':
- type = 'qt';
- break;
-
- case 'mceItemRealMedia':
- type = 'rmp';
- break;
- }
-
- document.forms[0].insert.value = ed.getLang('update', 'Insert', true);
+ function get(id) {
+ return document.getElementById(id);
}
- document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');
- document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media');
- document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
-
- var html = getMediaListHTML('medialist','src','media','media');
- if (html == "")
- document.getElementById("linklistrow").style.display = 'none';
- else
- document.getElementById("linklistcontainer").innerHTML = html;
-
- // Resize some elements
- if (isVisible('filebrowser'))
- document.getElementById('src').style.width = '230px';
-
- // Setup form
- if (pl != "") {
- pl = tinyMCEPopup.editor.plugins.media._parse(pl);
-
- switch (type) {
- case "flash":
- setBool(pl, 'flash', 'play');
- setBool(pl, 'flash', 'loop');
- setBool(pl, 'flash', 'menu');
- setBool(pl, 'flash', 'swliveconnect');
- setStr(pl, 'flash', 'quality');
- setStr(pl, 'flash', 'scale');
- setStr(pl, 'flash', 'salign');
- setStr(pl, 'flash', 'wmode');
- setStr(pl, 'flash', 'base');
- setStr(pl, 'flash', 'flashvars');
- break;
-
- case "qt":
- setBool(pl, 'qt', 'loop');
- setBool(pl, 'qt', 'autoplay');
- setBool(pl, 'qt', 'cache');
- setBool(pl, 'qt', 'controller');
- setBool(pl, 'qt', 'correction');
- setBool(pl, 'qt', 'enablejavascript');
- setBool(pl, 'qt', 'kioskmode');
- setBool(pl, 'qt', 'autohref');
- setBool(pl, 'qt', 'playeveryframe');
- setBool(pl, 'qt', 'tarsetcache');
- setStr(pl, 'qt', 'scale');
- setStr(pl, 'qt', 'starttime');
- setStr(pl, 'qt', 'endtime');
- setStr(pl, 'qt', 'tarset');
- setStr(pl, 'qt', 'qtsrcchokespeed');
- setStr(pl, 'qt', 'volume');
- setStr(pl, 'qt', 'qtsrc');
- break;
-
- case "shockwave":
- setBool(pl, 'shockwave', 'sound');
- setBool(pl, 'shockwave', 'progress');
- setBool(pl, 'shockwave', 'autostart');
- setBool(pl, 'shockwave', 'swliveconnect');
- setStr(pl, 'shockwave', 'swvolume');
- setStr(pl, 'shockwave', 'swstretchstyle');
- setStr(pl, 'shockwave', 'swstretchhalign');
- setStr(pl, 'shockwave', 'swstretchvalign');
- break;
-
- case "wmp":
- setBool(pl, 'wmp', 'autostart');
- setBool(pl, 'wmp', 'enabled');
- setBool(pl, 'wmp', 'enablecontextmenu');
- setBool(pl, 'wmp', 'fullscreen');
- setBool(pl, 'wmp', 'invokeurls');
- setBool(pl, 'wmp', 'mute');
- setBool(pl, 'wmp', 'stretchtofit');
- setBool(pl, 'wmp', 'windowlessvideo');
- setStr(pl, 'wmp', 'balance');
- setStr(pl, 'wmp', 'baseurl');
- setStr(pl, 'wmp', 'captioningid');
- setStr(pl, 'wmp', 'currentmarker');
- setStr(pl, 'wmp', 'currentposition');
- setStr(pl, 'wmp', 'defaultframe');
- setStr(pl, 'wmp', 'playcount');
- setStr(pl, 'wmp', 'rate');
- setStr(pl, 'wmp', 'uimode');
- setStr(pl, 'wmp', 'volume');
- break;
-
- case "rmp":
- setBool(pl, 'rmp', 'autostart');
- setBool(pl, 'rmp', 'loop');
- setBool(pl, 'rmp', 'autogotourl');
- setBool(pl, 'rmp', 'center');
- setBool(pl, 'rmp', 'imagestatus');
- setBool(pl, 'rmp', 'maintainaspect');
- setBool(pl, 'rmp', 'nojava');
- setBool(pl, 'rmp', 'prefetch');
- setBool(pl, 'rmp', 'shuffle');
- setStr(pl, 'rmp', 'console');
- setStr(pl, 'rmp', 'controls');
- setStr(pl, 'rmp', 'numloop');
- setStr(pl, 'rmp', 'scriptcallbacks');
- break;
- }
-
- setStr(pl, null, 'src');
- setStr(pl, null, 'id');
- setStr(pl, null, 'name');
- setStr(pl, null, 'vspace');
- setStr(pl, null, 'hspace');
- setStr(pl, null, 'bgcolor');
- setStr(pl, null, 'align');
- setStr(pl, null, 'width');
- setStr(pl, null, 'height');
-
- if ((val = ed.dom.getAttrib(fe, "width")) != "")
- pl.width = f.width.value = val;
-
- if ((val = ed.dom.getAttrib(fe, "height")) != "")
- pl.height = f.height.value = val;
-
- oldWidth = pl.width ? parseInt(pl.width) : 0;
- oldHeight = pl.height ? parseInt(pl.height) : 0;
- } else
- oldWidth = oldHeight = 0;
-
- selectByValue(f, 'media_type', type);
- changedType(type);
- updateColor('bgcolor_pick', 'bgcolor');
+ function getVal(id) {
+ var elm = get(id);
- TinyMCE_EditableSelects.init();
- generatePreview();
-}
+ if (elm.nodeName == "SELECT")
+ return elm.options[elm.selectedIndex].value;
-function insertMedia() {
- var fe, f = document.forms[0], h;
+ if (elm.type == "checkbox")
+ return elm.checked;
- tinyMCEPopup.restoreSelection();
-
- if (!AutoValidator.validate(f)) {
- tinyMCEPopup.alert(ed.getLang('invalid_data'));
- return false;
+ return elm.value;
}
- f.width.value = f.width.value == "" ? 100 : f.width.value;
- f.height.value = f.height.value == "" ? 100 : f.height.value;
-
- fe = ed.selection.getNode();
- if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) {
- switch (f.media_type.options[f.media_type.selectedIndex].value) {
- case "flash":
- fe.className = "mceItemFlash";
- break;
-
- case "flv":
- fe.className = "mceItemFlashVideo";
- break;
-
- case "shockwave":
- fe.className = "mceItemShockWave";
- break;
-
- case "qt":
- fe.className = "mceItemQuickTime";
- break;
-
- case "wmp":
- fe.className = "mceItemWindowsMedia";
- break;
-
- case "rmp":
- fe.className = "mceItemRealMedia";
- break;
- }
-
- if (fe.width != f.width.value || fe.height != f.height.value)
- ed.execCommand('mceRepaint');
-
- fe.title = serializeParameters();
- fe.width = f.width.value;
- fe.height = f.height.value;
- fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : '');
- fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : '');
- fe.align = f.align.options[f.align.selectedIndex].value;
- } else {
- h = '<img src="' + tinyMCEPopup.getWindowArg("plugin_url") + '/img/trans.gif"' ;
-
- switch (f.media_type.options[f.media_type.selectedIndex].value) {
- case "flash":
- h += ' class="mceItemFlash"';
- break;
-
- case "flv":
- h += ' class="mceItemFlashVideo"';
- break;
-
- case "shockwave":
- h += ' class="mceItemShockWave"';
- break;
-
- case "qt":
- h += ' class="mceItemQuickTime"';
- break;
-
- case "wmp":
- h += ' class="mceItemWindowsMedia"';
- break;
-
- case "rmp":
- h += ' class="mceItemRealMedia"';
- break;
+ function setVal(id, value) {
+ if (typeof(value) != 'undefined') {
+ var elm = get(id);
+
+ if (elm.nodeName == "SELECT")
+ selectByValue(document.forms[0], id, value);
+ else if (elm.type == "checkbox") {
+ if (typeof(value) == 'string')
+ elm.checked = value.toLowerCase() === 'true' ? true : false;
+ else
+ elm.checked = !!value;
+ } else
+ elm.value = value;
}
-
- h += ' title="' + serializeParameters() + '"';
- h += ' width="' + f.width.value + '"';
- h += ' height="' + f.height.value + '"';
- h += ' align="' + f.align.options[f.align.selectedIndex].value + '"';
-
- h += ' />';
-
- ed.execCommand('mceInsertContent', false, h);
}
- tinyMCEPopup.close();
-}
-
-function updatePreview() {
- var f = document.forms[0], type;
-
- f.width.value = f.width.value || '320';
- f.height.value = f.height.value || '240';
-
- type = getType(f.src.value);
- selectByValue(f, 'media_type', type);
- changedType(type);
- generatePreview();
-}
-
-function getMediaListHTML() {
- if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {
- var html = "";
-
- html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;updatePreview();">';
- html += '<option value="">---</option>';
-
- for (var i=0; i<tinyMCEMediaList.length; i++)
- html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';
-
- html += '</select>';
-
- return html;
- }
-
- return "";
-}
-
-function getType(v) {
- var fo, i, c, el, x, f = document.forms[0];
-
- fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';');
-
- // YouTube
- if (v.match(/watch\?v=(.+)(.*)/)) {
- f.width.value = '425';
- f.height.value = '350';
- f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1];
- return 'flash';
- }
-
- // Google video
- if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) {
- f.width.value = '425';
- f.height.value = '326';
- f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en';
- return 'flash';
- }
-
- for (i=0; i<fo.length; i++) {
- c = fo[i].split('=');
-
- el = c[1].split(',');
- for (x=0; x<el.length; x++)
- if (v.indexOf('.' + el[x]) != -1)
- return c[0];
- }
-
- return null;
-}
-
-function switchType(v) {
- var t = getType(v), d = document, f = d.forms[0];
-
- if (!t)
- return;
-
- selectByValue(d.forms[0], 'media_type', t);
- changedType(t);
-
- // Update qtsrc also
- if (t == 'qt' && f.src.value.toLowerCase().indexOf('rtsp://') != -1) {
- alert(ed.getLang("media_qt_stream_warn"));
-
- if (f.qt_qtsrc.value == '')
- f.qt_qtsrc.value = f.src.value;
- }
-}
-
-function changedType(t) {
- var d = document;
-
- d.getElementById('flash_options').style.display = 'none';
- d.getElementById('flv_options').style.display = 'none';
- d.getElementById('qt_options').style.display = 'none';
- d.getElementById('shockwave_options').style.display = 'none';
- d.getElementById('wmp_options').style.display = 'none';
- d.getElementById('rmp_options').style.display = 'none';
-
- if (t)
- d.getElementById(t + '_options').style.display = 'block';
-}
-
-function serializeParameters() {
- var d = document, f = d.forms[0], s = '';
-
- switch (f.media_type.options[f.media_type.selectedIndex].value) {
- case "flash":
- s += getBool('flash', 'play', true);
- s += getBool('flash', 'loop', true);
- s += getBool('flash', 'menu', true);
- s += getBool('flash', 'swliveconnect', false);
- s += getStr('flash', 'quality');
- s += getStr('flash', 'scale');
- s += getStr('flash', 'salign');
- s += getStr('flash', 'wmode');
- s += getStr('flash', 'base');
- s += getStr('flash', 'flashvars');
- break;
-
- case "qt":
- s += getBool('qt', 'loop', false);
- s += getBool('qt', 'autoplay', true);
- s += getBool('qt', 'cache', false);
- s += getBool('qt', 'controller', true);
- s += getBool('qt', 'correction', false, 'none', 'full');
- s += getBool('qt', 'enablejavascript', false);
- s += getBool('qt', 'kioskmode', false);
- s += getBool('qt', 'autohref', false);
- s += getBool('qt', 'playeveryframe', false);
- s += getBool('qt', 'targetcache', false);
- s += getStr('qt', 'scale');
- s += getStr('qt', 'starttime');
- s += getStr('qt', 'endtime');
- s += getStr('qt', 'target');
- s += getStr('qt', 'qtsrcchokespeed');
- s += getStr('qt', 'volume');
- s += getStr('qt', 'qtsrc');
- break;
-
- case "shockwave":
- s += getBool('shockwave', 'sound');
- s += getBool('shockwave', 'progress');
- s += getBool('shockwave', 'autostart');
- s += getBool('shockwave', 'swliveconnect');
- s += getStr('shockwave', 'swvolume');
- s += getStr('shockwave', 'swstretchstyle');
- s += getStr('shockwave', 'swstretchhalign');
- s += getStr('shockwave', 'swstretchvalign');
- break;
-
- case "wmp":
- s += getBool('wmp', 'autostart', true);
- s += getBool('wmp', 'enabled', false);
- s += getBool('wmp', 'enablecontextmenu', true);
- s += getBool('wmp', 'fullscreen', false);
- s += getBool('wmp', 'invokeurls', true);
- s += getBool('wmp', 'mute', false);
- s += getBool('wmp', 'stretchtofit', false);
- s += getBool('wmp', 'windowlessvideo', false);
- s += getStr('wmp', 'balance');
- s += getStr('wmp', 'baseurl');
- s += getStr('wmp', 'captioningid');
- s += getStr('wmp', 'currentmarker');
- s += getStr('wmp', 'currentposition');
- s += getStr('wmp', 'defaultframe');
- s += getStr('wmp', 'playcount');
- s += getStr('wmp', 'rate');
- s += getStr('wmp', 'uimode');
- s += getStr('wmp', 'volume');
- break;
-
- case "rmp":
- s += getBool('rmp', 'autostart', false);
- s += getBool('rmp', 'loop', false);
- s += getBool('rmp', 'autogotourl', true);
- s += getBool('rmp', 'center', false);
- s += getBool('rmp', 'imagestatus', true);
- s += getBool('rmp', 'maintainaspect', false);
- s += getBool('rmp', 'nojava', false);
- s += getBool('rmp', 'prefetch', false);
- s += getBool('rmp', 'shuffle', false);
- s += getStr('rmp', 'console');
- s += getStr('rmp', 'controls');
- s += getStr('rmp', 'numloop');
- s += getStr('rmp', 'scriptcallbacks');
- break;
- }
-
- s += getStr(null, 'id');
- s += getStr(null, 'name');
- s += getStr(null, 'src');
- s += getStr(null, 'align');
- s += getStr(null, 'bgcolor');
- s += getInt(null, 'vspace');
- s += getInt(null, 'hspace');
- s += getStr(null, 'width');
- s += getStr(null, 'height');
-
- s = s.length > 0 ? s.substring(0, s.length - 1) : s;
-
- return s;
-}
-
-function setBool(pl, p, n) {
- if (typeof(pl[n]) == "undefined")
- return;
-
- document.forms[0].elements[p + "_" + n].checked = pl[n] != 'false';
-}
-
-function setStr(pl, p, n) {
- var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n];
-
- if (typeof(pl[n]) == "undefined")
- return;
-
- if (e.type == "text")
- e.value = pl[n];
- else
- selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]);
-}
-
-function getBool(p, n, d, tv, fv) {
- var v = document.forms[0].elements[p + "_" + n].checked;
-
- tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'";
- fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'";
-
- return (v == d) ? '' : n + (v ? ':' + tv + ',' : ":\'" + fv + "\',");
-}
-
-function getStr(p, n, d) {
- var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];
- var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;
-
- if (n == 'src')
- v = tinyMCEPopup.editor.convertURL(v, 'src', null);
-
- return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',");
-}
-
-function getInt(p, n, d) {
- var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];
- var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;
-
- return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ",");
-}
-
-function jsEncode(s) {
- s = s.replace(new RegExp('\\\\', 'g'), '\\\\');
- s = s.replace(new RegExp('"', 'g'), '\\"');
- s = s.replace(new RegExp("'", 'g'), "\\'");
+ window.Media = {
+ init : function() {
+ var html, editor;
+
+ this.editor = editor = tinyMCEPopup.editor;
+
+ // Setup file browsers and color pickers
+ get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');
+ get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media');
+ get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
+ get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('filebrowser_altsource1','video_altsource1','media','media');
+ get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('filebrowser_altsource2','video_altsource2','media','media');
+ get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image');
+
+ html = this.getMediaListHTML('medialist', 'src', 'media', 'media');
+ if (html == "")
+ get("linklistrow").style.display = 'none';
+ else
+ get("linklistcontainer").innerHTML = html;
+
+ if (isVisible('filebrowser'))
+ get('src').style.width = '230px';
+
+ if (isVisible('filebrowser_altsource1'))
+ get('video_altsource1').style.width = '220px';
+
+ if (isVisible('filebrowser_altsource2'))
+ get('video_altsource2').style.width = '220px';
+
+ if (isVisible('filebrowser_poster'))
+ get('video_poster').style.width = '220px';
+
+ this.data = tinyMCEPopup.getWindowArg('data');
+ this.dataToForm();
+ this.preview();
+ },
+
+ insert : function() {
+ var editor = tinyMCEPopup.editor;
+
+ this.formToData();
+ editor.execCommand('mceRepaint');
+ tinyMCEPopup.restoreSelection();
+ editor.selection.setNode(editor.plugins.media.dataToImg(this.data));
+ tinyMCEPopup.close();
+ },
+
+ preview : function() {
+ get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true);
+ },
+
+ moveStates : function(to_form, field) {
+ var data = this.data, editor = this.editor, data = this.data,
+ mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src;
+
+ defaultStates = {
+ // QuickTime
+ quicktime_autoplay : true,
+ quicktime_controller : true,
+
+ // Flash
+ flash_play : true,
+ flash_loop : true,
+ flash_menu : true,
+
+ // WindowsMedia
+ windowsmedia_autostart : true,
+ windowsmedia_enablecontextmenu : true,
+ windowsmedia_invokeurls : true,
+
+ // RealMedia
+ realmedia_autogotourl : true,
+ realmedia_imagestatus : true
+ };
+
+ function parseQueryParams(str) {
+ var out = {};
+
+ if (str) {
+ tinymce.each(str.split('&'), function(item) {
+ var parts = item.split('=');
+
+ out[unescape(parts[0])] = unescape(parts[1]);
+ });
+ }
+
+ return out;
+ };
+
+ function setOptions(type, names) {
+ var i, name, formItemName, value, list;
+
+ if (type == data.type || type == 'global') {
+ names = tinymce.explode(names);
+ for (i = 0; i < names.length; i++) {
+ name = names[i];
+ formItemName = type == 'global' ? name : type + '_' + name;
+
+ if (type == 'global')
+ list = data;
+ else if (type == 'video') {
+ list = data.video.attrs;
+
+ if (!list && !to_form)
+ data.video.attrs = list = {};
+ } else
+ list = data.params;
+
+ if (list) {
+ if (to_form) {
+ setVal(formItemName, list[name]);
+ } else {
+ delete list[name];
+
+ value = getVal(formItemName);
+ if (type == 'video' && value === true)
+ value = name;
+
+ if (defaultStates[formItemName]) {
+ if (value !== defaultStates[formItemName]) {
+ value = "" + value;
+ list[name] = value;
+ }
+ } else if (value) {
+ value = "" + value;
+ list[name] = value;
+ }
+ }
+ }
+ }
+ }
+ }
- return s;
-}
+ if (!to_form) {
+ data.type = get('media_type').options[get('media_type').selectedIndex].value;
+ data.width = getVal('width');
+ data.height = getVal('height');
-function generatePreview(c) {
- var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh;
+ // Switch type based on extension
+ src = getVal('src');
+ if (field == 'src') {
+ ext = src.replace(/^.*\.([^.]+)$/, '$1');
+ if (typeInfo = mediaPlugin.getType(ext))
+ data.type = typeInfo.name.toLowerCase();
- p.innerHTML = '<!-- x --->';
+ setVal('media_type', data.type);
+ }
- nw = parseInt(f.width.value);
- nh = parseInt(f.height.value);
+ if (data.type == "video") {
+ if (!data.video.sources)
+ data.video.sources = [];
- if (f.width.value != "" && f.height.value != "") {
- if (f.constrain.checked) {
- if (c == 'width' && oldWidth != 0) {
- wp = nw / oldWidth;
- nh = Math.round(wp * nh);
- f.height.value = nh;
- } else if (c == 'height' && oldHeight != 0) {
- hp = nh / oldHeight;
- nw = Math.round(hp * nw);
- f.width.value = nw;
+ data.video.sources[0] = {src: getVal('src')};
+ }
}
- }
- }
- if (f.width.value != "")
- oldWidth = nw;
-
- if (f.height.value != "")
- oldHeight = nh;
-
- // After constrain
- pl = serializeParameters();
-
- switch (f.media_type.options[f.media_type.selectedIndex].value) {
- case "flash":
- cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
- codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
- type = 'application/x-shockwave-flash';
- break;
-
- case "shockwave":
- cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000';
- codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';
- type = 'application/x-director';
- break;
-
- case "qt":
- cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';
- codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';
- type = 'video/quicktime';
- break;
-
- case "wmp":
- cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6';
- codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
- type = 'application/x-mplayer2';
- break;
-
- case "rmp":
- cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';
- codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
- type = 'audio/x-pn-realaudio-plugin';
- break;
- }
-
- if (pl == '') {
- p.innerHTML = '';
- return;
- }
+ // Hide all fieldsets and show the one active
+ get('video_options').style.display = 'none';
+ get('flash_options').style.display = 'none';
+ get('quicktime_options').style.display = 'none';
+ get('shockwave_options').style.display = 'none';
+ get('windowsmedia_options').style.display = 'none';
+ get('realmedia_options').style.display = 'none';
+
+ if (get(data.type + '_options'))
+ get(data.type + '_options').style.display = 'block';
+
+ setVal('media_type', data.type);
+
+ setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars');
+ setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc');
+ setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign');
+ setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume');
+ setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks');
+ setOptions('video', 'poster,autoplay,loop,preload,controls');
+ setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height');
+
+ if (to_form) {
+ if (data.type == 'video') {
+ if (data.video.sources[0])
+ setVal('src', data.video.sources[0].src);
+
+ src = data.video.sources[1];
+ if (src)
+ setVal('video_altsource1', src.src);
+
+ src = data.video.sources[2];
+ if (src)
+ setVal('video_altsource2', src.src);
+ } else {
+ // Check flash vars
+ if (data.type == 'flash') {
+ tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) {
+ if (value == '$url')
+ data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src;
+ });
+ }
+
+ setVal('src', data.params.src);
+ }
+ } else {
+ src = getVal("src");
+
+ // YouTube
+ if (src.match(/youtube.com(.+)v=([^&]+)/)) {
+ data.width = 425;
+ data.height = 350;
+ data.params.frameborder = '0';
+ data.type = 'iframe';
+ src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
+ setVal('src', src);
+ setVal('media_type', data.type);
+ }
+
+ // Google video
+ if (src.match(/video.google.com(.+)docid=([^&]+)/)) {
+ data.width = 425;
+ data.height = 326;
+ data.type = 'flash';
+ src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en';
+ setVal('src', src);
+ setVal('media_type', data.type);
+ }
+
+ if (data.type == 'video') {
+ if (!data.video.sources)
+ data.video.sources = [];
+
+ data.video.sources[0] = {src : src};
+
+ src = getVal("video_altsource1");
+ if (src)
+ data.video.sources[1] = {src : src};
+
+ src = getVal("video_altsource2");
+ if (src)
+ data.video.sources[2] = {src : src};
+ } else
+ data.params.src = src;
+
+ // Set default size
+ setVal('width', data.width || 320);
+ setVal('height', data.height || 240);
+ }
+ },
+
+ dataToForm : function() {
+ this.moveStates(true);
+ },
+
+ formToData : function(field) {
+ if (field == "width" || field == "height")
+ this.changeSize(field);
+
+ if (field == 'source') {
+ this.moveStates(false, field);
+ setVal('source', this.editor.plugins.media.dataToHtml(this.data));
+ this.panel = 'source';
+ } else {
+ if (this.panel == 'source') {
+ this.data = this.editor.plugins.media.htmlToData(getVal('source'));
+ this.dataToForm();
+ this.panel = '';
+ }
+
+ this.moveStates(false, field);
+ this.preview();
+ }
+ },
+
+ beforeResize : function() {
+ this.width = parseInt(getVal('width') || "320", 10);
+ this.height = parseInt(getVal('height') || "240", 10);
+ },
+
+ changeSize : function(type) {
+ var width, height, scale, size;
+
+ if (get('constrain').checked) {
+ width = parseInt(getVal('width') || "320", 10);
+ height = parseInt(getVal('height') || "240", 10);
+
+ if (type == 'width') {
+ this.height = Math.round((width / this.width) * height);
+ setVal('height', this.height);
+ } else {
+ this.width = Math.round((height / this.height) * width);
+ setVal('width', this.width);
+ }
+ }
+ },
- pl = tinyMCEPopup.editor.plugins.media._parse(pl);
+ getMediaListHTML : function() {
+ if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {
+ var html = "";
- if (!pl.src) {
- p.innerHTML = '';
- return;
- }
+ html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;Media.formToData(\'src\');">';
+ html += '<option value="">---</option>';
- pl.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(pl.src);
- pl.width = !pl.width ? 100 : pl.width;
- pl.height = !pl.height ? 100 : pl.height;
- pl.id = !pl.id ? 'obj' : pl.id;
- pl.name = !pl.name ? 'eobj' : pl.name;
- pl.align = !pl.align ? '' : pl.align;
+ for (var i=0; i<tinyMCEMediaList.length; i++)
+ html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';
- // Avoid annoying warning about insecure items
- if (!tinymce.isIE || document.location.protocol != 'https:') {
- h += '<object classid="' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">';
+ html += '</select>';
- for (n in pl) {
- h += '<param name="' + n + '" value="' + pl[n] + '">';
+ return html;
+ }
- // Add extra url parameter if it's an absolute URL
- if (n == 'src' && pl[n].indexOf('://') != -1)
- h += '<param name="url" value="' + pl[n] + '" />';
+ return "";
}
- }
-
- h += '<embed type="' + type + '" ';
-
- for (n in pl)
- h += n + '="' + pl[n] + '" ';
-
- h += '></embed>';
-
- // Avoid annoying warning about insecure items
- if (!tinymce.isIE || document.location.protocol != 'https:')
- h += '</object>';
-
- p.innerHTML = "<!-- x --->" + h;
-}
+ };
-tinyMCEPopup.onInit.add(init);
+ tinyMCEPopup.requireLangPack();
+ tinyMCEPopup.onInit.add(function() {
+ Media.init();
+ });
+})();
\ No newline at end of file diff --git a/program/js/tiny_mce/plugins/media/langs/en_dlg.js b/program/js/tiny_mce/plugins/media/langs/en_dlg.js index 6d0a996f7..29d26a0d4 100644 --- a/program/js/tiny_mce/plugins/media/langs/en_dlg.js +++ b/program/js/tiny_mce/plugins/media/langs/en_dlg.js @@ -91,7 +91,6 @@ align_bottom_right:"Bottom right", flv_options:"Flash video options",
flv_scalemode:"Scale mode",
flv_buffer:"Buffer",
-flv_startimage:"Start image",
flv_starttime:"Start time",
flv_defaultvolume:"Default volumne",
flv_hiddengui:"Hidden GUI",
@@ -99,5 +98,12 @@ flv_autostart:"Auto start", flv_loop:"Loop",
flv_showscalemodes:"Show scale modes",
flv_smoothvideo:"Smooth video",
-flv_jscallback:"JS Callback"
+flv_jscallback:"JS Callback",
+html5_video_options:"HTML5 Video Options",
+altsource1:"Alternative source 1",
+altsource2:"Alternative source 2",
+preload:"Preload",
+poster:"Poster",
+
+source:"Source"
});
\ No newline at end of file diff --git a/program/js/tiny_mce/plugins/media/media.htm b/program/js/tiny_mce/plugins/media/media.htm index 73a903f7c..807a537dc 100644 --- a/program/js/tiny_mce/plugins/media/media.htm +++ b/program/js/tiny_mce/plugins/media/media.htm @@ -10,12 +10,13 @@ <script type="text/javascript" src="../../utils/editable_selects.js"></script>
<link href="css/media.css" rel="stylesheet" type="text/css" />
</head>
-<body style="display: none">
- <form onsubmit="insertMedia();return false;" action="#">
- <div class="tabs">
+<body style="display: none" role="application">
+<form onsubmit="Media.insert();return false;" action="#">
+ <div class="tabs" role="presentation">
<ul>
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');generatePreview();" onmousedown="return false;">{#media_dlg.general}</a></span></li>
- <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#media_dlg.advanced}</a></span></li>
+ <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');Media.formToData();" onmousedown="return false;">{#media_dlg.general}</a></span></li>
+ <li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');Media.formToData();" onmousedown="return false;">{#media_dlg.advanced}</a></span></li>
+ <li id="source_tab" aria-controls="source_panel"><span><a href="javascript:mcTabs.displayTab('source_tab','source_panel');Media.formToData('source');" onmousedown="return false;">{#media_dlg.source}</a></span></li>
</ul>
</div>
@@ -24,28 +25,29 @@ <fieldset>
<legend>{#media_dlg.general}</legend>
- <table border="0" cellpadding="4" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="4" cellspacing="0">
<tr>
<td><label for="media_type">{#media_dlg.type}</label></td>
<td>
- <select id="media_type" name="media_type" onchange="changedType(this.value);generatePreview();">
+ <select id="media_type" name="media_type" onchange="Media.formToData('type');">
+ <option value="video">HTML5 Video</option>
<option value="flash">Flash</option>
- <!-- <option value="flv">Flash video (FLV)</option> -->
- <option value="qt">Quicktime</option>
+ <option value="quicktime">QuickTime</option>
<option value="shockwave">Shockwave</option>
- <option value="wmp">Windows Media</option>
- <option value="rmp">Real Media</option>
+ <option value="windowsmedia">Windows Media</option>
+ <option value="realmedia">Real Media</option>
+ <option value="iframe">Iframe</option>
</select>
</td>
</tr>
<tr>
<td><label for="src">{#media_dlg.file}</label></td>
- <td>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input id="src" name="src" type="text" value="" class="mceFocus" onchange="switchType(this.value);generatePreview();" /></td>
+ <td>
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input id="src" name="src" type="text" value="" class="mceFocus" onchange="Media.formToData();" /></td>
<td id="filebrowsercontainer"> </td>
- </tr>
+ </tr>
</table>
</td>
</tr>
@@ -56,10 +58,10 @@ <tr>
<td><label for="width">{#media_dlg.size}</label></td>
<td>
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="text" id="width" name="width" value="" class="size" onchange="generatePreview('width');" /> x <input type="text" id="height" name="height" value="" class="size" onchange="generatePreview('height');" /></td>
- <td> <input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
+ <td><input type="text" id="width" name="width" value="" class="size" onchange="Media.formToData('width');" onfocus="Media.beforeResize();" /> x <input type="text" id="height" name="height" value="" class="size" onfocus="Media.beforeResize();" onchange="Media.formToData('height');" /></td>
+ <td> <input id="constrain" type="checkbox" name="constrain" class="checkbox" checked="checked" /></td>
<td><label id="constrainlabel" for="constrain">{#media_dlg.constrain_proportions}</label></td>
</tr>
</table>
@@ -78,18 +80,18 @@ <fieldset>
<legend>{#media_dlg.advanced}</legend>
- <table border="0" cellpadding="4" cellspacing="0" width="100%">
+ <table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td><label for="id">{#media_dlg.id}</label></td>
- <td><input type="text" id="id" name="id" onchange="generatePreview();" /></td>
+ <td><input type="text" id="id" name="id" onchange="Media.formToData();" /></td>
<td><label for="name">{#media_dlg.name}</label></td>
- <td><input type="text" id="name" name="name" onchange="generatePreview();" /></td>
+ <td><input type="text" id="name" name="name" onchange="Media.formToData();" /></td>
</tr>
<tr>
<td><label for="align">{#media_dlg.align}</label></td>
<td>
- <select id="align" name="align" onchange="generatePreview();">
+ <select id="align" name="align" onchange="Media.formToData();">
<option value="">{#not_set}</option>
<option value="top">{#media_dlg.align_top}</option>
<option value="right">{#media_dlg.align_right}</option>
@@ -100,9 +102,9 @@ <td><label for="bgcolor">{#media_dlg.bgcolor}</label></td>
<td>
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');generatePreview();" /></td>
+ <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');Media.formToData();" /></td>
<td id="bgcolor_pickcontainer"> </td>
</tr>
</table>
@@ -111,9 +113,91 @@ <tr>
<td><label for="vspace">{#media_dlg.vspace}</label></td>
- <td><input type="text" id="vspace" name="vspace" class="number" onchange="generatePreview();" /></td>
+ <td><input type="text" id="vspace" name="vspace" class="number" onchange="Media.formToData();" /></td>
<td><label for="hspace">{#media_dlg.hspace}</label></td>
- <td><input type="text" id="hspace" name="hspace" class="number" onchange="generatePreview();" /></td>
+ <td><input type="text" id="hspace" name="hspace" class="number" onchange="Media.formToData();" /></td>
+ </tr>
+ </table>
+ </fieldset>
+
+ <fieldset id="video_options">
+ <legend>{#media_dlg.html5_video_options}</legend>
+
+ <table role="presentation">
+ <tr>
+ <td><label for="video_altsource1">{#media_dlg.altsource1}</label></td>
+ <td>
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="video_altsource1" name="video_altsource1" onchange="Media.formToData();" style="width: 240px" /></td>
+ <td id="video_altsource1_filebrowser"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label for="video_altsource2">{#media_dlg.altsource2}</label></td>
+ <td>
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="video_altsource2" name="video_altsource2" onchange="Media.formToData();" style="width: 240px" /></td>
+ <td id="video_altsource2_filebrowser"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label for="video_poster">{#media_dlg.poster}</label></td>
+ <td>
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="video_poster" name="video_poster" onchange="Media.formToData();" style="width: 240px" /></td>
+ <td id="video_poster_filebrowser"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+
+ <table role="presentation" border="0" cellpadding="4" cellspacing="0">
+ <tr>
+ <td>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="video_autoplay" name="video_autoplay" onchange="Media.formToData();" /></td>
+ <td><label for="video_autoplay">{#media_dlg.play}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="video_loop" name="video_loop" onchange="Media.formToData();" /></td>
+ <td><label for="video_loop">{#media_dlg.loop}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="video_preload" name="video_preload" onchange="Media.formToData();" /></td>
+ <td><label for="video_preload">{#media_dlg.preload}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="video_controls" name="video_controls" onchange="Media.formToData();" /></td>
+ <td><label for="video_controls">{#media_dlg.controls}</label></td>
+ </tr>
+ </table>
+ </td>
</tr>
</table>
</fieldset>
@@ -121,11 +205,11 @@ <fieldset id="flash_options">
<legend>{#media_dlg.flash_options}</legend>
- <table border="0" cellpadding="4" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="4" cellspacing="0">
<tr>
<td><label for="flash_quality">{#media_dlg.quality}</label></td>
<td>
- <select id="flash_quality" name="flash_quality" onchange="generatePreview();">
+ <select id="flash_quality" name="flash_quality" onchange="Media.formToData();">
<option value="">{#not_set}</option>
<option value="high">high</option>
<option value="low">low</option>
@@ -137,7 +221,7 @@ <td><label for="flash_scale">{#media_dlg.scale}</label></td>
<td>
- <select id="flash_scale" name="flash_scale" onchange="generatePreview();">
+ <select id="flash_scale" name="flash_scale" onchange="Media.formToData();">
<option value="">{#not_set}</option>
<option value="showall">showall</option>
<option value="noborder">noborder</option>
@@ -150,7 +234,7 @@ <tr>
<td><label for="flash_wmode">{#media_dlg.wmode}</label></td>
<td>
- <select id="flash_wmode" name="flash_wmode" onchange="generatePreview();">
+ <select id="flash_wmode" name="flash_wmode" onchange="Media.formToData();">
<option value="">{#not_set}</option>
<option value="window">window</option>
<option value="opaque">opaque</option>
@@ -160,7 +244,7 @@ <td><label for="flash_salign">{#media_dlg.salign}</label></td>
<td>
- <select id="flash_salign" name="flash_salign" onchange="generatePreview();">
+ <select id="flash_salign" name="flash_salign" onchange="Media.formToData();">
<option value="">{#not_set}</option>
<option value="l">{#media_dlg.align_left}</option>
<option value="t">{#media_dlg.align_top}</option>
@@ -176,18 +260,18 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="generatePreview();" /></td>
+ <td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="Media.formToData();" /></td>
<td><label for="flash_play">{#media_dlg.play}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="generatePreview();" /></td>
+ <td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="Media.formToData();" /></td>
<td><label for="flash_loop">{#media_dlg.loop}</label></td>
</tr>
</table>
@@ -196,18 +280,18 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="generatePreview();" /></td>
+ <td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="Media.formToData();" /></td>
<td><label for="flash_menu">{#media_dlg.menu}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="generatePreview();" /></td>
+ <td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="Media.formToData();" /></td>
<td><label for="flash_swliveconnect">{#media_dlg.liveconnect}</label></td>
</tr>
</table>
@@ -215,134 +299,38 @@ </tr>
</table>
- <table>
+ <table role="presentation">
<tr>
<td><label for="flash_base">{#media_dlg.base}</label></td>
- <td><input type="text" id="flash_base" name="flash_base" onchange="generatePreview();" /></td>
+ <td><input type="text" id="flash_base" name="flash_base" onchange="Media.formToData();" /></td>
</tr>
<tr>
<td><label for="flash_flashvars">{#media_dlg.flashvars}</label></td>
- <td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="generatePreview();" /></td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset id="flv_options">
- <legend>{#media_dlg.flv_options}</legend>
-
- <table border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td><label for="flv_scalemode">{#media_dlg.flv_scalemode}</label></td>
- <td>
- <select id="flv_scalemode" name="flv_scalemode" onchange="generatePreview();">
- <option value="">{#not_set}</option>
- <option value="none">none</option>
- <option value="double">double</option>
- <option value="full">full</option>
- </select>
- </td>
-
- <td><label for="flv_buffer">{#media_dlg.flv_buffer}</label></td>
- <td><input type="text" id="flv_buffer" name="flv_buffer" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="flv_startimage">{#media_dlg.flv_startimage}</label></td>
- <td><input type="text" id="flv_startimage" name="flv_startimage" onchange="generatePreview();" /></td>
-
- <td><label for="flv_starttime">{#media_dlg.flv_starttime}</label></td>
- <td><input type="text" id="flv_starttime" name="flv_starttime" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="flv_defaultvolume">{#media_dlg.flv_defaultvolume}</label></td>
- <td><input type="text" id="flv_defaultvolume" name="flv_defaultvolume" onchange="generatePreview();" /></td>
-
-
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flv_hiddengui" name="flv_hiddengui" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="flv_hiddengui">{#media_dlg.flv_hiddengui}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flv_autostart" name="flv_autostart" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="flv_autostart">{#media_dlg.flv_autostart}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flv_loop" name="flv_loop" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="flv_loop">{#media_dlg.flv_loop}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flv_showscalemodes" name="flv_showscalemodes" onchange="generatePreview();" /></td>
- <td><label for="flv_showscalemodes">{#media_dlg.flv_showscalemodes}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flv_smoothvideo" name="flash_flv_flv_smoothvideosmoothvideo" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="flv_smoothvideo">{#media_dlg.flv_smoothvideo}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flv_jscallback" name="flv_jscallback" onchange="generatePreview();" /></td>
- <td><label for="flv_jscallback">{#media_dlg.flv_jscallback}</label></td>
- </tr>
- </table>
- </td>
+ <td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="Media.formToData();" /></td>
</tr>
</table>
</fieldset>
- <fieldset id="qt_options">
+ <fieldset id="quicktime_options">
<legend>{#media_dlg.qt_options}</legend>
- <table border="0" cellpadding="4" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="4" cellspacing="0">
<tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="qt_loop" name="qt_loop" onchange="generatePreview();" /></td>
- <td><label for="qt_loop">{#media_dlg.loop}</label></td>
+ <td><input type="checkbox" class="checkbox" id="quicktime_loop" name="quicktime_loop" onchange="Media.formToData();" /></td>
+ <td><label for="quicktime_loop">{#media_dlg.loop}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="qt_autoplay" name="qt_autoplay" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="qt_autoplay">{#media_dlg.play}</label></td>
+ <td><input type="checkbox" class="checkbox" id="quicktime_autoplay" name="quicktime_autoplay" checked="checked" onchange="Media.formToData();" /></td>
+ <td><label for="quicktime_autoplay">{#media_dlg.play}</label></td>
</tr>
</table>
</td>
@@ -350,19 +338,19 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="qt_cache" name="qt_cache" onchange="generatePreview();" /></td>
- <td><label for="qt_cache">{#media_dlg.cache}</label></td>
+ <td><input type="checkbox" class="checkbox" id="quicktime_cache" name="quicktime_cache" onchange="Media.formToData();" /></td>
+ <td><label for="quicktime_cache">{#media_dlg.cache}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="qt_controller" name="qt_controller" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="qt_controller">{#media_dlg.controller}</label></td>
+ <td><input type="checkbox" class="checkbox" id="quicktime_controller" name="quicktime_controller" checked="checked" onchange="Media.formToData();" /></td>
+ <td><label for="quicktime_controller">{#media_dlg.controller}</label></td>
</tr>
</table>
</td>
@@ -370,19 +358,19 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="qt_correction" name="qt_correction" onchange="generatePreview();" /></td>
- <td><label for="qt_correction">{#media_dlg.correction}</label></td>
+ <td><input type="checkbox" class="checkbox" id="quicktime_correction" name="quicktime_correction" onchange="Media.formToData();" /></td>
+ <td><label for="quicktime_correction">{#media_dlg.correction}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="qt_enablejavascript" name="qt_enablejavascript" onchange="generatePreview();" /></td>
- <td><label for="qt_enablejavascript">{#media_dlg.enablejavascript}</label></td>
+ <td><input type="checkbox" class="checkbox" id="quicktime_enablejavascript" name="quicktime_enablejavascript" onchange="Media.formToData();" /></td>
+ <td><label for="quicktime_enablejavascript">{#media_dlg.enablejavascript}</label></td>
</tr>
</table>
</td>
@@ -390,19 +378,19 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="qt_kioskmode" name="qt_kioskmode" onchange="generatePreview();" /></td>
- <td><label for="qt_kioskmode">{#media_dlg.kioskmode}</label></td>
+ <td><input type="checkbox" class="checkbox" id="quicktime_kioskmode" name="quicktime_kioskmode" onchange="Media.formToData();" /></td>
+ <td><label for="quicktime_kioskmode">{#media_dlg.kioskmode}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="qt_autohref" name="qt_autohref" onchange="generatePreview();" /></td>
- <td><label for="qt_autohref">{#media_dlg.autohref}</label></td>
+ <td><input type="checkbox" class="checkbox" id="quicktime_autohref" name="quicktime_autohref" onchange="Media.formToData();" /></td>
+ <td><label for="quicktime_autohref">{#media_dlg.autohref}</label></td>
</tr>
</table>
</td>
@@ -410,27 +398,27 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="qt_playeveryframe" name="qt_playeveryframe" onchange="generatePreview();" /></td>
- <td><label for="qt_playeveryframe">{#media_dlg.playeveryframe}</label></td>
+ <td><input type="checkbox" class="checkbox" id="quicktime_playeveryframe" name="quicktime_playeveryframe" onchange="Media.formToData();" /></td>
+ <td><label for="quicktime_playeveryframe">{#media_dlg.playeveryframe}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="qt_targetcache" name="qt_targetcache" onchange="generatePreview();" /></td>
- <td><label for="qt_targetcache">{#media_dlg.targetcache}</label></td>
+ <td><input type="checkbox" class="checkbox" id="quicktime_targetcache" name="quicktime_targetcache" onchange="Media.formToData();" /></td>
+ <td><label for="quicktime_targetcache">{#media_dlg.targetcache}</label></td>
</tr>
</table>
</td>
</tr>
<tr>
- <td><label for="qt_scale">{#media_dlg.scale}</label></td>
- <td><select id="qt_scale" name="qt_scale" class="mceEditableSelect" onchange="generatePreview();">
+ <td><label for="quicktime_scale">{#media_dlg.scale}</label></td>
+ <td><select id="quicktime_scale" name="quicktime_scale" class="mceEditableSelect" onchange="Media.formToData();">
<option value="">{#not_set}</option>
<option value="tofit">tofit</option>
<option value="aspect">aspect</option>
@@ -441,62 +429,62 @@ </tr>
<tr>
- <td><label for="qt_starttime">{#media_dlg.starttime}</label></td>
- <td><input type="text" id="qt_starttime" name="qt_starttime" onchange="generatePreview();" /></td>
+ <td><label for="quicktime_starttime">{#media_dlg.starttime}</label></td>
+ <td><input type="text" id="quicktime_starttime" name="quicktime_starttime" onchange="Media.formToData();" /></td>
- <td><label for="qt_endtime">{#media_dlg.endtime}</label></td>
- <td><input type="text" id="qt_endtime" name="qt_endtime" onchange="generatePreview();" /></td>
+ <td><label for="quicktime_endtime">{#media_dlg.endtime}</label></td>
+ <td><input type="text" id="quicktime_endtime" name="quicktime_endtime" onchange="Media.formToData();" /></td>
</tr>
<tr>
- <td><label for="qt_target">{#media_dlg.target}</label></td>
- <td><input type="text" id="qt_target" name="qt_target" onchange="generatePreview();" /></td>
+ <td><label for="quicktime_target">{#media_dlg.target}</label></td>
+ <td><input type="text" id="quicktime_target" name="quicktime_target" onchange="Media.formToData();" /></td>
- <td><label for="qt_href">{#media_dlg.href}</label></td>
- <td><input type="text" id="qt_href" name="qt_href" onchange="generatePreview();" /></td>
+ <td><label for="quicktime_href">{#media_dlg.href}</label></td>
+ <td><input type="text" id="quicktime_href" name="quicktime_href" onchange="Media.formToData();" /></td>
</tr>
<tr>
- <td><label for="qt_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td>
- <td><input type="text" id="qt_qtsrcchokespeed" name="qt_qtsrcchokespeed" onchange="generatePreview();" /></td>
+ <td><label for="quicktime_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td>
+ <td><input type="text" id="quicktime_qtsrcchokespeed" name="quicktime_qtsrcchokespeed" onchange="Media.formToData();" /></td>
- <td><label for="qt_volume">{#media_dlg.volume}</label></td>
- <td><input type="text" id="qt_volume" name="qt_volume" onchange="generatePreview();" /></td>
+ <td><label for="quicktime_volume">{#media_dlg.volume}</label></td>
+ <td><input type="text" id="quicktime_volume" name="quicktime_volume" onchange="Media.formToData();" /></td>
</tr>
<tr>
- <td><label for="qt_qtsrc">{#media_dlg.qtsrc}</label></td>
+ <td><label for="quicktime_qtsrc">{#media_dlg.qtsrc}</label></td>
<td colspan="4">
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="qt_qtsrc" name="qt_qtsrc" onchange="generatePreview();" /></td>
- <td id="qtsrcfilebrowsercontainer"> </td>
- </tr>
- </table>
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="quicktime_qtsrc" name="quicktime_qtsrc" onchange="Media.formToData();" /></td>
+ <td id="qtsrcfilebrowsercontainer"> </td>
+ </tr>
+ </table>
</td>
</tr>
</table>
</fieldset>
- <fieldset id="wmp_options">
+ <fieldset id="windowsmedia_options">
<legend>{#media_dlg.wmp_options}</legend>
- <table border="0" cellpadding="4" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="4" cellspacing="0">
<tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="wmp_autostart" name="wmp_autostart" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="wmp_autostart">{#media_dlg.autostart}</label></td>
+ <td><input type="checkbox" class="checkbox" id="windowsmedia_autostart" name="windowsmedia_autostart" checked="checked" onchange="Media.formToData();" /></td>
+ <td><label for="windowsmedia_autostart">{#media_dlg.autostart}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="wmp_enabled" name="wmp_enabled" onchange="generatePreview();" /></td>
- <td><label for="wmp_enabled">{#media_dlg.enabled}</label></td>
+ <td><input type="checkbox" class="checkbox" id="windowsmedia_enabled" name="windowsmedia_enabled" onchange="Media.formToData();" /></td>
+ <td><label for="windowsmedia_enabled">{#media_dlg.enabled}</label></td>
</tr>
</table>
</td>
@@ -504,19 +492,19 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="wmp_enablecontextmenu" name="wmp_enablecontextmenu" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="wmp_enablecontextmenu">{#media_dlg.menu}</label></td>
+ <td><input type="checkbox" class="checkbox" id="windowsmedia_enablecontextmenu" name="windowsmedia_enablecontextmenu" checked="checked" onchange="Media.formToData();" /></td>
+ <td><label for="windowsmedia_enablecontextmenu">{#media_dlg.menu}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="wmp_fullscreen" name="wmp_fullscreen" onchange="generatePreview();" /></td>
- <td><label for="wmp_fullscreen">{#media_dlg.fullscreen}</label></td>
+ <td><input type="checkbox" class="checkbox" id="windowsmedia_fullscreen" name="windowsmedia_fullscreen" onchange="Media.formToData();" /></td>
+ <td><label for="windowsmedia_fullscreen">{#media_dlg.fullscreen}</label></td>
</tr>
</table>
</td>
@@ -524,19 +512,19 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="wmp_invokeurls" name="wmp_invokeurls" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="wmp_invokeurls">{#media_dlg.invokeurls}</label></td>
+ <td><input type="checkbox" class="checkbox" id="windowsmedia_invokeurls" name="windowsmedia_invokeurls" checked="checked" onchange="Media.formToData();" /></td>
+ <td><label for="windowsmedia_invokeurls">{#media_dlg.invokeurls}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="wmp_mute" name="wmp_mute" onchange="generatePreview();" /></td>
- <td><label for="wmp_mute">{#media_dlg.mute}</label></td>
+ <td><input type="checkbox" class="checkbox" id="windowsmedia_mute" name="windowsmedia_mute" onchange="Media.formToData();" /></td>
+ <td><label for="windowsmedia_mute">{#media_dlg.mute}</label></td>
</tr>
</table>
</td>
@@ -544,86 +532,86 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="wmp_stretchtofit" name="wmp_stretchtofit" onchange="generatePreview();" /></td>
- <td><label for="wmp_stretchtofit">{#media_dlg.stretchtofit}</label></td>
+ <td><input type="checkbox" class="checkbox" id="windowsmedia_stretchtofit" name="windowsmedia_stretchtofit" onchange="Media.formToData();" /></td>
+ <td><label for="windowsmedia_stretchtofit">{#media_dlg.stretchtofit}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="wmp_windowlessvideo" name="wmp_windowlessvideo" onchange="generatePreview();" /></td>
- <td><label for="wmp_windowlessvideo">{#media_dlg.windowlessvideo}</label></td>
+ <td><input type="checkbox" class="checkbox" id="windowsmedia_windowlessvideo" name="windowsmedia_windowlessvideo" onchange="Media.formToData();" /></td>
+ <td><label for="windowsmedia_windowlessvideo">{#media_dlg.windowlessvideo}</label></td>
</tr>
</table>
</td>
</tr>
<tr>
- <td><label for="wmp_balance">{#media_dlg.balance}</label></td>
- <td><input type="text" id="wmp_balance" name="wmp_balance" onchange="generatePreview();" /></td>
+ <td><label for="windowsmedia_balance">{#media_dlg.balance}</label></td>
+ <td><input type="text" id="windowsmedia_balance" name="windowsmedia_balance" onchange="Media.formToData();" /></td>
- <td><label for="wmp_baseurl">{#media_dlg.baseurl}</label></td>
- <td><input type="text" id="wmp_baseurl" name="wmp_baseurl" onchange="generatePreview();" /></td>
+ <td><label for="windowsmedia_baseurl">{#media_dlg.baseurl}</label></td>
+ <td><input type="text" id="windowsmedia_baseurl" name="windowsmedia_baseurl" onchange="Media.formToData();" /></td>
</tr>
<tr>
- <td><label for="wmp_captioningid">{#media_dlg.captioningid}</label></td>
- <td><input type="text" id="wmp_captioningid" name="wmp_captioningid" onchange="generatePreview();" /></td>
+ <td><label for="windowsmedia_captioningid">{#media_dlg.captioningid}</label></td>
+ <td><input type="text" id="windowsmedia_captioningid" name="windowsmedia_captioningid" onchange="Media.formToData();" /></td>
- <td><label for="wmp_currentmarker">{#media_dlg.currentmarker}</label></td>
- <td><input type="text" id="wmp_currentmarker" name="wmp_currentmarker" onchange="generatePreview();" /></td>
+ <td><label for="windowsmedia_currentmarker">{#media_dlg.currentmarker}</label></td>
+ <td><input type="text" id="windowsmedia_currentmarker" name="windowsmedia_currentmarker" onchange="Media.formToData();" /></td>
</tr>
<tr>
- <td><label for="wmp_currentposition">{#media_dlg.currentposition}</label></td>
- <td><input type="text" id="wmp_currentposition" name="wmp_currentposition" onchange="generatePreview();" /></td>
+ <td><label for="windowsmedia_currentposition">{#media_dlg.currentposition}</label></td>
+ <td><input type="text" id="windowsmedia_currentposition" name="windowsmedia_currentposition" onchange="Media.formToData();" /></td>
- <td><label for="wmp_defaultframe">{#media_dlg.defaultframe}</label></td>
- <td><input type="text" id="wmp_defaultframe" name="wmp_defaultframe" onchange="generatePreview();" /></td>
+ <td><label for="windowsmedia_defaultframe">{#media_dlg.defaultframe}</label></td>
+ <td><input type="text" id="windowsmedia_defaultframe" name="windowsmedia_defaultframe" onchange="Media.formToData();" /></td>
</tr>
<tr>
- <td><label for="wmp_playcount">{#media_dlg.playcount}</label></td>
- <td><input type="text" id="wmp_playcount" name="wmp_playcount" onchange="generatePreview();" /></td>
+ <td><label for="windowsmedia_playcount">{#media_dlg.playcount}</label></td>
+ <td><input type="text" id="windowsmedia_playcount" name="windowsmedia_playcount" onchange="Media.formToData();" /></td>
- <td><label for="wmp_rate">{#media_dlg.rate}</label></td>
- <td><input type="text" id="wmp_rate" name="wmp_rate" onchange="generatePreview();" /></td>
+ <td><label for="windowsmedia_rate">{#media_dlg.rate}</label></td>
+ <td><input type="text" id="windowsmedia_rate" name="windowsmedia_rate" onchange="Media.formToData();" /></td>
</tr>
<tr>
- <td><label for="wmp_uimode">{#media_dlg.uimode}</label></td>
- <td><input type="text" id="wmp_uimode" name="wmp_uimode" onchange="generatePreview();" /></td>
+ <td><label for="windowsmedia_uimode">{#media_dlg.uimode}</label></td>
+ <td><input type="text" id="windowsmedia_uimode" name="windowsmedia_uimode" onchange="Media.formToData();" /></td>
- <td><label for="wmp_volume">{#media_dlg.volume}</label></td>
- <td><input type="text" id="wmp_volume" name="wmp_volume" onchange="generatePreview();" /></td>
+ <td><label for="windowsmedia_volume">{#media_dlg.volume}</label></td>
+ <td><input type="text" id="windowsmedia_volume" name="windowsmedia_volume" onchange="Media.formToData();" /></td>
</tr>
</table>
</fieldset>
- <fieldset id="rmp_options">
+ <fieldset id="realmedia_options">
<legend>{#media_dlg.rmp_options}</legend>
- <table border="0" cellpadding="4" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="4" cellspacing="0">
<tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="rmp_autostart" name="rmp_autostart" onchange="generatePreview();" /></td>
- <td><label for="rmp_autostart">{#media_dlg.autostart}</label></td>
+ <td><input type="checkbox" class="checkbox" id="realmedia_autostart" name="realmedia_autostart" onchange="Media.formToData();" /></td>
+ <td><label for="realmedia_autostart">{#media_dlg.autostart}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="rmp_loop" name="rmp_loop" onchange="generatePreview();" /></td>
- <td><label for="rmp_loop">{#media_dlg.loop}</label></td>
+ <td><input type="checkbox" class="checkbox" id="realmedia_loop" name="realmedia_loop" onchange="Media.formToData();" /></td>
+ <td><label for="realmedia_loop">{#media_dlg.loop}</label></td>
</tr>
</table>
</td>
@@ -631,19 +619,19 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="rmp_autogotourl" name="rmp_autogotourl" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="rmp_autogotourl">{#media_dlg.autogotourl}</label></td>
+ <td><input type="checkbox" class="checkbox" id="realmedia_autogotourl" name="realmedia_autogotourl" checked="checked" onchange="Media.formToData();" /></td>
+ <td><label for="realmedia_autogotourl">{#media_dlg.autogotourl}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="rmp_center" name="rmp_center" onchange="generatePreview();" /></td>
- <td><label for="rmp_center">{#media_dlg.center}</label></td>
+ <td><input type="checkbox" class="checkbox" id="realmedia_center" name="realmedia_center" onchange="Media.formToData();" /></td>
+ <td><label for="realmedia_center">{#media_dlg.center}</label></td>
</tr>
</table>
</td>
@@ -651,19 +639,19 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="rmp_imagestatus" name="rmp_imagestatus" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="rmp_imagestatus">{#media_dlg.imagestatus}</label></td>
+ <td><input type="checkbox" class="checkbox" id="realmedia_imagestatus" name="realmedia_imagestatus" checked="checked" onchange="Media.formToData();" /></td>
+ <td><label for="realmedia_imagestatus">{#media_dlg.imagestatus}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="rmp_maintainaspect" name="rmp_maintainaspect" onchange="generatePreview();" /></td>
- <td><label for="rmp_maintainaspect">{#media_dlg.maintainaspect}</label></td>
+ <td><input type="checkbox" class="checkbox" id="realmedia_maintainaspect" name="realmedia_maintainaspect" onchange="Media.formToData();" /></td>
+ <td><label for="realmedia_maintainaspect">{#media_dlg.maintainaspect}</label></td>
</tr>
</table>
</td>
@@ -671,19 +659,19 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="rmp_nojava" name="rmp_nojava" onchange="generatePreview();" /></td>
- <td><label for="rmp_nojava">{#media_dlg.nojava}</label></td>
+ <td><input type="checkbox" class="checkbox" id="realmedia_nojava" name="realmedia_nojava" onchange="Media.formToData();" /></td>
+ <td><label for="realmedia_nojava">{#media_dlg.nojava}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="rmp_prefetch" name="rmp_prefetch" onchange="generatePreview();" /></td>
- <td><label for="rmp_prefetch">{#media_dlg.prefetch}</label></td>
+ <td><input type="checkbox" class="checkbox" id="realmedia_prefetch" name="realmedia_prefetch" onchange="Media.formToData();" /></td>
+ <td><label for="realmedia_prefetch">{#media_dlg.prefetch}</label></td>
</tr>
</table>
</td>
@@ -691,10 +679,10 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="rmp_shuffle" name="rmp_shuffle" onchange="generatePreview();" /></td>
- <td><label for="rmp_shuffle">{#media_dlg.shuffle}</label></td>
+ <td><input type="checkbox" class="checkbox" id="realmedia_shuffle" name="realmedia_shuffle" onchange="Media.formToData();" /></td>
+ <td><label for="realmedia_shuffle">{#media_dlg.shuffle}</label></td>
</tr>
</table>
</td>
@@ -705,19 +693,19 @@ </tr>
<tr>
- <td><label for="rmp_console">{#media_dlg.console}</label></td>
- <td><input type="text" id="rmp_console" name="rmp_console" onchange="generatePreview();" /></td>
+ <td><label for="realmedia_console">{#media_dlg.console}</label></td>
+ <td><input type="text" id="realmedia_console" name="realmedia_console" onchange="Media.formToData();" /></td>
- <td><label for="rmp_controls">{#media_dlg.controls}</label></td>
- <td><input type="text" id="rmp_controls" name="rmp_controls" onchange="generatePreview();" /></td>
+ <td><label for="realmedia_controls">{#media_dlg.controls}</label></td>
+ <td><input type="text" id="realmedia_controls" name="realmedia_controls" onchange="Media.formToData();" /></td>
</tr>
<tr>
- <td><label for="rmp_numloop">{#media_dlg.numloop}</label></td>
- <td><input type="text" id="rmp_numloop" name="rmp_numloop" onchange="generatePreview();" /></td>
+ <td><label for="realmedia_numloop">{#media_dlg.numloop}</label></td>
+ <td><input type="text" id="realmedia_numloop" name="realmedia_numloop" onchange="Media.formToData();" /></td>
- <td><label for="rmp_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td>
- <td><input type="text" id="rmp_scriptcallbacks" name="rmp_scriptcallbacks" onchange="generatePreview();" /></td>
+ <td><label for="realmedia_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td>
+ <td><input type="text" id="realmedia_scriptcallbacks" name="realmedia_scriptcallbacks" onchange="Media.formToData();" /></td>
</tr>
</table>
</fieldset>
@@ -725,11 +713,11 @@ <fieldset id="shockwave_options">
<legend>{#media_dlg.shockwave_options}</legend>
- <table border="0" cellpadding="4" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="4" cellspacing="0">
<tr>
<td><label for="shockwave_swstretchstyle">{#media_dlg.swstretchstyle}</label></td>
<td>
- <select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="generatePreview();">
+ <select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="Media.formToData();">
<option value="none">{#not_set}</option>
<option value="meet">Meet</option>
<option value="fill">Fill</option>
@@ -738,13 +726,13 @@ </td>
<td><label for="shockwave_swvolume">{#media_dlg.volume}</label></td>
- <td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="generatePreview();" /></td>
+ <td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="Media.formToData();" /></td>
</tr>
<tr>
<td><label for="shockwave_swstretchhalign">{#media_dlg.swstretchhalign}</label></td>
<td>
- <select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="generatePreview();">
+ <select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="Media.formToData();">
<option value="none">{#not_set}</option>
<option value="left">{#media_dlg.align_left}</option>
<option value="center">{#media_dlg.align_center}</option>
@@ -754,7 +742,7 @@ <td><label for="shockwave_swstretchvalign">{#media_dlg.swstretchvalign}</label></td>
<td>
- <select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="generatePreview();">
+ <select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="Media.formToData();">
<option value="none">{#not_set}</option>
<option value="meet">Meet</option>
<option value="fill">Fill</option>
@@ -765,18 +753,18 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="generatePreview();" checked="checked" /></td>
+ <td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="Media.formToData();" checked="checked" /></td>
<td><label for="shockwave_autostart">{#media_dlg.autostart}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="generatePreview();" checked="checked" /></td>
+ <td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="Media.formToData();" checked="checked" /></td>
<td><label for="shockwave_sound">{#media_dlg.sound}</label></td>
</tr>
</table>
@@ -786,18 +774,18 @@ <tr>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="generatePreview();" /></td>
+ <td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="Media.formToData();" /></td>
<td><label for="shockwave_swliveconnect">{#media_dlg.liveconnect}</label></td>
</tr>
</table>
</td>
<td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="generatePreview();" checked="checked" /></td>
+ <td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="Media.formToData();" checked="checked" /></td>
<td><label for="shockwave_progress">{#media_dlg.progress}</label></td>
</tr>
</table>
@@ -806,6 +794,13 @@ </table>
</fieldset>
</div>
+
+ <div id="source_panel" class="panel">
+ <fieldset>
+ <legend>{#media_dlg.source}</legend>
+ <textarea id="source" style="width: 100%; height: 390px"></textarea>
+ </fieldset>
+ </div>
</div>
<div class="mceActionPanel">
|