484. File Comparison Report

Produced on Mon May 12 13:06:10 2008 UTC. This report uses XHTML and CSS2, and is best viewed with a reasonably standards compliant browser such as the latest version of Firefox or Internet Explorer. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

484.1 Files compared

# Location File Last Modified
1 Mon May 12 13:06:10 2008 UTC
2 Dolphin-v.6.1.0\plugins\tiny_mce\plugins\media\js media.js Thu Mar 27 13:53:24 2008 UTC

484.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 0 0
Changed 0 0
Inserted 1 621
Removed 0 0

484.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

484.4 Active regular expressions

No regular expressions were active.

484.5 Comparison detail

    1   tinyMCEPop up.require LangPack() ;
    2  
    3   var oldWid th, oldHei ght, ed, u rl;
    4  
    5   if (url =  tinyMCEPop up.getPara m("media_e xternal_li st_url"))
    6       docume nt.write(' <script la nguage="ja vascript"  type="text /javascrip t" src="'  + tinyMCEP opup.edito r.document BaseURI.to Absolute(u rl) + '">< /script>') ;
    7  
    8   function i nit() {
    9       var pl  = "", f,  val;
    10       var ty pe = "flas h", fe, i;
    11  
    12       ed = t inyMCEPopu p.editor;
    13  
    14       tinyMC EPopup.res izeToInner Size();
    15       f = do cument.for ms[0]
    16  
    17       fe = e d.selectio n.getNode( );
    18       if (/m ceItem(Fla sh|ShockWa ve|Windows Media|Quic kTime|Real Media)/.te st(ed.dom. getAttrib( fe, 'class '))) {
    19           pl  = fe.titl e;
    20  
    21           sw itch (ed.d om.getAttr ib(fe, 'cl ass')) {
    22                case 'mc eItemFlash ':
    23                    type  = 'flash' ;
    24                    brea k;
    25  
    26                case 'mc eItemFlash Video':
    27                    type  = 'flv';
    28                    brea k;
    29  
    30                case 'mc eItemShock Wave':
    31                    type  = 'shockw ave';
    32                    brea k;
    33  
    34                case 'mc eItemWindo wsMedia':
    35                    type  = 'wmp';
    36                    brea k;
    37  
    38                case 'mc eItemQuick Time':
    39                    type  = 'qt';
    40                    brea k;
    41  
    42                case 'mc eItemRealM edia':
    43                    type  = 'rmp';
    44                    brea k;
    45           }
    46  
    47           do cument.for ms[0].inse rt.value =  ed.getLan g('update' , 'Insert' , true); 
    48       }
    49  
    50       docume nt.getElem entById('f ilebrowser container' ).innerHTM L = getBro wserHTML(' filebrowse r','src',' media','me dia');
    51       docume nt.getElem entById('q tsrcfilebr owserconta iner').inn erHTML = g etBrowserH TML('qtsrc filebrowse r','qt_qts rc','media ','media') ;
    52       docume nt.getElem entById('b gcolor_pic kcontainer ').innerHT ML = getCo lorPickerH TML('bgcol or_pick',' bgcolor');
    53  
    54       var ht ml = getMe diaListHTM L('mediali st','src', 'media','m edia');
    55       if (ht ml == "")
    56           do cument.get ElementByI d("linklis trow").sty le.display  = 'none';
    57       else
    58           do cument.get ElementByI d("linklis tcontainer ").innerHT ML = html;
    59  
    60       // Res ize some e lements
    61       if (is Visible('f ilebrowser '))
    62           do cument.get ElementByI d('src').s tyle.width  = '230px' ;
    63  
    64       // Set up form
    65       if (pl  != "") {
    66           pl  = tinyMCE Popup.edit or.plugins .media._pa rse(pl);
    67  
    68           sw itch (type ) {
    69                case "fl ash":
    70                    setB ool(pl, 'f lash', 'pl ay');
    71                    setB ool(pl, 'f lash', 'lo op');
    72                    setB ool(pl, 'f lash', 'me nu');
    73                    setB ool(pl, 'f lash', 'sw liveconnec t');
    74                    setS tr(pl, 'fl ash', 'qua lity');
    75                    setS tr(pl, 'fl ash', 'sca le');
    76                    setS tr(pl, 'fl ash', 'sal ign');
    77                    setS tr(pl, 'fl ash', 'wmo de');
    78                    setS tr(pl, 'fl ash', 'bas e');
    79                    setS tr(pl, 'fl ash', 'fla shvars');
    80                break;
    81  
    82                case "qt ":
    83                    setB ool(pl, 'q t', 'loop' );
    84                    setB ool(pl, 'q t', 'autop lay');
    85                    setB ool(pl, 'q t', 'cache ');
    86                    setB ool(pl, 'q t', 'contr oller');
    87                    setB ool(pl, 'q t', 'corre ction');
    88                    setB ool(pl, 'q t', 'enabl ejavascrip t');
    89                    setB ool(pl, 'q t', 'kiosk mode');
    90                    setB ool(pl, 'q t', 'autoh ref');
    91                    setB ool(pl, 'q t', 'playe veryframe' );
    92                    setB ool(pl, 'q t', 'tarse tcache');
    93                    setS tr(pl, 'qt ', 'scale' );
    94                    setS tr(pl, 'qt ', 'startt ime');
    95                    setS tr(pl, 'qt ', 'endtim e');
    96                    setS tr(pl, 'qt ', 'tarset ');
    97                    setS tr(pl, 'qt ', 'qtsrcc hokespeed' );
    98                    setS tr(pl, 'qt ', 'volume ');
    99                    setS tr(pl, 'qt ', 'qtsrc' );
    100                break;
    101  
    102                case "sh ockwave":
    103                    setB ool(pl, 's hockwave',  'sound');
    104                    setB ool(pl, 's hockwave',  'progress ');
    105                    setB ool(pl, 's hockwave',  'autostar t');
    106                    setB ool(pl, 's hockwave',  'swliveco nnect');
    107                    setS tr(pl, 'sh ockwave',  'swvolume' );
    108                    setS tr(pl, 'sh ockwave',  'swstretch style');
    109                    setS tr(pl, 'sh ockwave',  'swstretch halign');
    110                    setS tr(pl, 'sh ockwave',  'swstretch valign');
    111                break;
    112  
    113                case "wm p":
    114                    setB ool(pl, 'w mp', 'auto start');
    115                    setB ool(pl, 'w mp', 'enab led');
    116                    setB ool(pl, 'w mp', 'enab lecontextm enu');
    117                    setB ool(pl, 'w mp', 'full screen');
    118                    setB ool(pl, 'w mp', 'invo keurls');
    119                    setB ool(pl, 'w mp', 'mute ');
    120                    setB ool(pl, 'w mp', 'stre tchtofit') ;
    121                    setB ool(pl, 'w mp', 'wind owlessvide o');
    122                    setS tr(pl, 'wm p', 'balan ce');
    123                    setS tr(pl, 'wm p', 'baseu rl');
    124                    setS tr(pl, 'wm p', 'capti oningid');
    125                    setS tr(pl, 'wm p', 'curre ntmarker') ;
    126                    setS tr(pl, 'wm p', 'curre ntposition ');
    127                    setS tr(pl, 'wm p', 'defau ltframe');
    128                    setS tr(pl, 'wm p', 'playc ount');
    129                    setS tr(pl, 'wm p', 'rate' );
    130                    setS tr(pl, 'wm p', 'uimod e');
    131                    setS tr(pl, 'wm p', 'volum e');
    132                break;
    133  
    134                case "rm p":
    135                    setB ool(pl, 'r mp', 'auto start');
    136                    setB ool(pl, 'r mp', 'loop ');
    137                    setB ool(pl, 'r mp', 'auto gotourl');
    138                    setB ool(pl, 'r mp', 'cent er');
    139                    setB ool(pl, 'r mp', 'imag estatus');
    140                    setB ool(pl, 'r mp', 'main tainaspect ');
    141                    setB ool(pl, 'r mp', 'noja va');
    142                    setB ool(pl, 'r mp', 'pref etch');
    143                    setB ool(pl, 'r mp', 'shuf fle');
    144                    setS tr(pl, 'rm p', 'conso le');
    145                    setS tr(pl, 'rm p', 'contr ols');
    146                    setS tr(pl, 'rm p', 'numlo op');
    147                    setS tr(pl, 'rm p', 'scrip tcallbacks ');
    148                break;
    149           }
    150  
    151           se tStr(pl, n ull, 'src' );
    152           se tStr(pl, n ull, 'id') ;
    153           se tStr(pl, n ull, 'name ');
    154           se tStr(pl, n ull, 'vspa ce');
    155           se tStr(pl, n ull, 'hspa ce');
    156           se tStr(pl, n ull, 'bgco lor');
    157           se tStr(pl, n ull, 'alig n');
    158           se tStr(pl, n ull, 'widt h');
    159           se tStr(pl, n ull, 'heig ht');
    160  
    161           if  ((val = e d.dom.getA ttrib(fe,  "width"))  != "")
    162                pl.width  = f.width .value = v al;
    163  
    164           if  ((val = e d.dom.getA ttrib(fe,  "height"))  != "")
    165                pl.heigh t = f.heig ht.value =  val;
    166  
    167           ol dWidth = p l.width ?  parseInt(p l.width) :  0;
    168           ol dHeight =  pl.height  ? parseInt (pl.height ) : 0;
    169       } else
    170           ol dWidth = o ldHeight =  0;
    171  
    172       select ByValue(f,  'media_ty pe', type) ;
    173       change dType(type );
    174       update Color('bgc olor_pick' , 'bgcolor ');
    175  
    176       TinyMC E_Editable Selects.in it();
    177       genera tePreview( );
    178   }
    179  
    180   function i nsertMedia () {
    181       var fe , f = docu ment.forms [0], h;
    182  
    183       tinyMC EPopup.res toreSelect ion();
    184  
    185       if (!A utoValidat or.validat e(f)) {
    186           al ert(ed.get Lang('inva lid_data') );
    187           re turn false ;
    188       }
    189  
    190       f.widt h.value =  f.width.va lue == ""  ? 100 : f. width.valu e;
    191       f.heig ht.value =  f.height. value == " " ? 100 :  f.height.v alue;
    192  
    193       fe = e d.selectio n.getNode( );
    194       if (fe  != null & & /mceItem (Flash|Sho ckWave|Win dowsMedia| QuickTime| RealMedia) /.test(ed. dom.getAtt rib(fe, 'c lass'))) {
    195           sw itch (f.me dia_type.o ptions[f.m edia_type. selectedIn dex].value ) {
    196                case "fl ash":
    197                    fe.c lassName =  "mceItemF lash";
    198                    brea k;
    199  
    200                case "fl v":
    201                    fe.c lassName =  "mceItemF lashVideo" ;
    202                    brea k;
    203  
    204                case "sh ockwave":
    205                    fe.c lassName =  "mceItemS hockWave";
    206                    brea k;
    207  
    208                case "qt ":
    209                    fe.c lassName =  "mceItemQ uickTime";
    210                    brea k;
    211  
    212                case "wm p":
    213                    fe.c lassName =  "mceItemW indowsMedi a";
    214                    brea k;
    215  
    216                case "rm p":
    217                    fe.c lassName =  "mceItemR ealMedia";
    218                    brea k;
    219           }
    220  
    221           if  (fe.width  != f.widt h.value ||  fe.height  != f.heig ht.height)
    222                ed.execC ommand('mc eRepaint') ;
    223  
    224           fe .title = s erializePa rameters() ;
    225           fe .width = f .width.val ue;
    226           fe .height =  f.height.v alue;
    227           fe .style.wid th = f.wid th.value +  (f.width. value.inde xOf('%') = = -1 ? 'px ' : '');
    228           fe .style.hei ght = f.he ight.value  + (f.heig ht.value.i ndexOf('%' ) == -1 ?  'px' : '') ;
    229           fe .align = f .align.opt ions[f.ali gn.selecte dIndex].va lue;
    230       } else  {
    231           h  = '<img sr c="' + tin yMCEPopup. getWindowA rg("plugin _url") + ' /img/trans .gif"' ;
    232  
    233           sw itch (f.me dia_type.o ptions[f.m edia_type. selectedIn dex].value ) {
    234                case "fl ash":
    235                    h +=  ' class=" mceItemFla sh"';
    236                    brea k;
    237  
    238                case "fl v":
    239                    h +=  ' class=" mceItemFla shVideo"';
    240                    brea k;
    241  
    242                case "sh ockwave":
    243                    h +=  ' class=" mceItemSho ckWave"';
    244                    brea k;
    245  
    246                case "qt ":
    247                    h +=  ' class=" mceItemQui ckTime"';
    248                    brea k;
    249  
    250                case "wm p":
    251                    h +=  ' class=" mceItemWin dowsMedia" ';
    252                    brea k;
    253  
    254                case "rm p":
    255                    h +=  ' class=" mceItemRea lMedia"';
    256                    brea k;
    257           }
    258  
    259           h  += ' title ="' + seri alizeParam eters() +  '"';
    260           h  += ' width ="' + f.wi dth.value  + '"';
    261           h  += ' heigh t="' + f.h eight.valu e + '"';
    262           h  += ' align ="' + f.al ign.option s[f.align. selectedIn dex].value  + '"';
    263  
    264           h  += ' />';
    265  
    266           ed .execComma nd('mceIns ertContent ', false,  h);
    267       }
    268  
    269       tinyMC EPopup.clo se();
    270   }
    271  
    272   function u pdatePrevi ew() {
    273       var f  = document .forms[0],  type;
    274  
    275       f.widt h.value =  f.width.va lue || '32 0';
    276       f.heig ht.value =  f.height. value || ' 240';
    277  
    278       type =  getType(f .src.value );
    279       select ByValue(f,  'media_ty pe', type) ;
    280       change dType(type );
    281       genera tePreview( );
    282   }
    283  
    284   function g etMediaLis tHTML() {
    285       if (ty peof(tinyM CEMediaLis t) != "und efined" &&  tinyMCEMe diaList.le ngth > 0)  {
    286           va r html = " ";
    287  
    288           ht ml += '<se lect id="l inklist" n ame="linkl ist" style ="width: 2 50px" onch ange="this .form.src. value=this .options[t his.select edIndex].v alue;updat ePreview() ;">';
    289           ht ml += '<op tion value ="">---</o ption>';
    290  
    291           fo r (var i=0 ; i<tinyMC EMediaList .length; i ++)
    292                html +=  '<option v alue="' +  tinyMCEMed iaList[i][ 1] + '">'  + tinyMCEM ediaList[i ][0] + '</ option>';
    293  
    294           ht ml += '</s elect>';
    295  
    296           re turn html;
    297       }
    298  
    299       return  "";
    300   }
    301  
    302   function g etType(v)  {
    303       var fo , i, c, el , x, f = d ocument.fo rms[0];
    304  
    305       fo = e d.getParam ("media_ty pes", "fla sh=swf;flv =flv;shock wave=dcr;q t=mov,qt,m pg,mp3,mp4 ,mpeg;shoc kwave=dcr; wmp=avi,wm v,wm,asf,a sx,wmx,wvx ;rmp=rm,ra ,ram").spl it(';');
    306  
    307       // You Tube
    308       if (v. match(/wat ch\?v=(.+) (.*)/)) {
    309           f. width.valu e = '425';
    310           f. height.val ue = '350' ;
    311           f. src.value  = 'http:// www.youtub e.com/v/'  + v.match( /v=(.*)(.* )/)[0].spl it('=')[1] ;
    312           re turn 'flas h';
    313       }
    314  
    315       // Goo gle video
    316       if (v. indexOf('h ttp://vide o.google.c om/videopl ay?docid=' ) == 0) {
    317           f. width.valu e = '425';
    318           f. height.val ue = '326' ;
    319           f. src.value  = 'http:// video.goog le.com/goo gleplayer. swf?docId= ' + v.subs tring('htt p://video. google.com /videoplay ?docid='.l ength) + ' &hl=en';
    320           re turn 'flas h';
    321       }
    322  
    323       for (i =0; i<fo.l ength; i++ ) {
    324           c  = fo[i].sp lit('=');
    325  
    326           el  = c[1].sp lit(',');
    327           fo r (x=0; x< el.length;  x++)
    328           if  (v.indexO f('.' + el [x]) != -1 )
    329                return c [0];
    330       }
    331  
    332       return  null;
    333   }
    334  
    335   function s witchType( v) {
    336       var t  = getType( v), d = do cument, f  = d.forms[ 0];
    337  
    338       if (!t )
    339           re turn;
    340  
    341       select ByValue(d. forms[0],  'media_typ e', t);
    342       change dType(t);
    343  
    344       // Upd ate qtsrc  also
    345       if (t  == 'qt' &&  f.src.val ue.toLower Case().ind exOf('rtsp ://') != - 1) {
    346           al ert(ed.get Lang("medi a_qt_strea m_warn"));
    347  
    348           if  (f.qt_qts rc.value = = '')
    349                f.qt_qts rc.value =  f.src.val ue;
    350       }
    351   }
    352  
    353   function c hangedType (t) {
    354       var d  = document ;
    355  
    356       d.getE lementById ('flash_op tions').st yle.displa y = 'none' ;
    357       d.getE lementById ('flv_opti ons').styl e.display  = 'none';
    358       d.getE lementById ('qt_optio ns').style .display =  'none';
    359       d.getE lementById ('shockwav e_options' ).style.di splay = 'n one';
    360       d.getE lementById ('wmp_opti ons').styl e.display  = 'none';
    361       d.getE lementById ('rmp_opti ons').styl e.display  = 'none';
    362       d.getE lementById (t + '_opt ions').sty le.display  = 'block' ;
    363   }
    364  
    365   function s erializePa rameters()  {
    366       var d  = document , f = d.fo rms[0], s  = '';
    367  
    368       switch  (f.media_ type.optio ns[f.media _type.sele ctedIndex] .value) {
    369           ca se "flash" :
    370                s += get Bool('flas h', 'play' , true);
    371                s += get Bool('flas h', 'loop' , true);
    372                s += get Bool('flas h', 'menu' , true);
    373                s += get Bool('flas h', 'swliv econnect',  false);
    374                s += get Str('flash ', 'qualit y');
    375                s += get Str('flash ', 'scale' );
    376                s += get Str('flash ', 'salign ');
    377                s += get Str('flash ', 'wmode' );
    378                s += get Str('flash ', 'base') ;
    379                s += get Str('flash ', 'flashv ars');
    380           br eak;
    381  
    382           ca se "qt":
    383                s += get Bool('qt',  'loop', f alse);
    384                s += get Bool('qt',  'autoplay ', true);
    385                s += get Bool('qt',  'cache',  false);
    386                s += get Bool('qt',  'controll er', true) ;
    387                s += get Bool('qt',  'correcti on', false , 'none',  'full');
    388                s += get Bool('qt',  'enableja vascript',  false);
    389                s += get Bool('qt',  'kioskmod e', false) ;
    390                s += get Bool('qt',  'autohref ', false);
    391                s += get Bool('qt',  'playever yframe', f alse);
    392                s += get Bool('qt',  'targetca che', fals e);
    393                s += get Str('qt',  'scale');
    394                s += get Str('qt',  'starttime ');
    395                s += get Str('qt',  'endtime') ;
    396                s += get Str('qt',  'target');
    397                s += get Str('qt',  'qtsrcchok espeed');
    398                s += get Str('qt',  'volume');
    399                s += get Str('qt',  'qtsrc');
    400           br eak;
    401  
    402           ca se "shockw ave":
    403                s += get Bool('shoc kwave', 's ound');
    404                s += get Bool('shoc kwave', 'p rogress');
    405                s += get Bool('shoc kwave', 'a utostart') ;
    406                s += get Bool('shoc kwave', 's wliveconne ct');
    407                s += get Str('shock wave', 'sw volume');
    408                s += get Str('shock wave', 'sw stretchsty le');
    409                s += get Str('shock wave', 'sw stretchhal ign');
    410                s += get Str('shock wave', 'sw stretchval ign');
    411           br eak;
    412  
    413           ca se "wmp":
    414                s += get Bool('wmp' , 'autosta rt', true) ;
    415                s += get Bool('wmp' , 'enabled ', false);
    416                s += get Bool('wmp' , 'enablec ontextmenu ', true);
    417                s += get Bool('wmp' , 'fullscr een', fals e);
    418                s += get Bool('wmp' , 'invokeu rls', true );
    419                s += get Bool('wmp' , 'mute',  false);
    420                s += get Bool('wmp' , 'stretch tofit', fa lse);
    421                s += get Bool('wmp' , 'windowl essvideo',  false);
    422                s += get Str('wmp',  'balance' );
    423                s += get Str('wmp',  'baseurl' );
    424                s += get Str('wmp',  'captioni ngid');
    425                s += get Str('wmp',  'currentm arker');
    426                s += get Str('wmp',  'currentp osition');
    427                s += get Str('wmp',  'defaultf rame');
    428                s += get Str('wmp',  'playcoun t');
    429                s += get Str('wmp',  'rate');
    430                s += get Str('wmp',  'uimode') ;
    431                s += get Str('wmp',  'volume') ;
    432           br eak;
    433  
    434           ca se "rmp":
    435                s += get Bool('rmp' , 'autosta rt', false );
    436                s += get Bool('rmp' , 'loop',  false);
    437                s += get Bool('rmp' , 'autogot ourl', tru e);
    438                s += get Bool('rmp' , 'center' , false);
    439                s += get Bool('rmp' , 'imagest atus', tru e);
    440                s += get Bool('rmp' , 'maintai naspect',  false);
    441                s += get Bool('rmp' , 'nojava' , false);
    442                s += get Bool('rmp' , 'prefetc h', false) ;
    443                s += get Bool('rmp' , 'shuffle ', false);
    444                s += get Str('rmp',  'console' );
    445                s += get Str('rmp',  'controls ');
    446                s += get Str('rmp',  'numloop' );
    447                s += get Str('rmp',  'scriptca llbacks');
    448           br eak;
    449       }
    450  
    451       s += g etStr(null , 'id');
    452       s += g etStr(null , 'name');
    453       s += g etStr(null , 'src');
    454       s += g etStr(null , 'align') ;
    455       s += g etStr(null , 'bgcolor ');
    456       s += g etInt(null , 'vspace' );
    457       s += g etInt(null , 'hspace' );
    458       s += g etStr(null , 'width') ;
    459       s += g etStr(null , 'height' );
    460  
    461       s = s. length > 0  ? s.subst ring(0, s. length - 1 ) : s;
    462  
    463       return  s;
    464   }
    465  
    466   function s etBool(pl,  p, n) {
    467       if (ty peof(pl[n] ) == "unde fined")
    468           re turn;
    469  
    470       docume nt.forms[0 ].elements [p + "_" +  n].checke d = pl[n];
    471   }
    472  
    473   function s etStr(pl,  p, n) {
    474       var f  = document .forms[0],  e = f.ele ments[(p ! = null ? p  + "_" : ' ') + n];
    475  
    476       if (ty peof(pl[n] ) == "unde fined")
    477           re turn;
    478  
    479       if (e. type == "t ext")
    480           e. value = pl [n];
    481       else
    482           se lectByValu e(f, (p !=  null ? p  + "_" : '' ) + n, pl[ n]);
    483   }
    484  
    485   function g etBool(p,  n, d, tv,  fv) {
    486       var v  = document .forms[0]. elements[p  + "_" + n ].checked;
    487  
    488       tv = t ypeof(tv)  == 'undefi ned' ? 'tr ue' : "'"  + jsEncode (tv) + "'" ;
    489       fv = t ypeof(fv)  == 'undefi ned' ? 'fa lse' : "'"  + jsEncod e(fv) + "' ";
    490  
    491       return  (v == d)  ? '' : n +  (v ? ':'  + tv + ','  : ':' + f v + ',');
    492   }
    493  
    494   function g etStr(p, n , d) {
    495       var e  = document .forms[0]. elements[( p != null  ? p + "_"  : "") + n] ;
    496       var v  = e.type = = "text" ?  e.value :  e.options [e.selecte dIndex].va lue;
    497  
    498       if (n  == 'src')
    499           v  = tinyMCEP opup.edito r.convertU RL(v, 'src ', null);
    500  
    501       return  ((n == d  || v == '' ) ? '' : n  + ":'" +  jsEncode(v ) + "',");
    502   }
    503  
    504   function g etInt(p, n , d) {
    505       var e  = document .forms[0]. elements[( p != null  ? p + "_"  : "") + n] ;
    506       var v  = e.type = = "text" ?  e.value :  e.options [e.selecte dIndex].va lue;
    507  
    508       return  ((n == d  || v == '' ) ? '' : n  + ":" + v .replace(/ [^0-9]+/g,  '') + "," );
    509   }
    510  
    511   function j sEncode(s)  {
    512       s = s. replace(ne w RegExp(' \\\\', 'g' ), '\\\\') ;
    513       s = s. replace(ne w RegExp(' "', 'g'),  '\\"');
    514       s = s. replace(ne w RegExp(" '", 'g'),  "\\'");
    515  
    516       return  s;
    517   }
    518  
    519   function g eneratePre view(c) {
    520       var f  = document .forms[0],  p = docum ent.getEle mentById(' prev'), h  = '', cls,  pl, n, ty pe, codeba se, wp, hp , nw, nh;
    521  
    522       p.inne rHTML = '< !-- x ---> ';
    523  
    524       nw = p arseInt(f. width.valu e);
    525       nh = p arseInt(f. height.val ue);
    526  
    527       if (f. width.valu e != "" &&  f.height. value != " ") {
    528           if  (f.constr ain.checke d) {
    529                if (c ==  'width' & & oldWidth  != 0) {
    530                    wp =  nw / oldW idth;
    531                    nh =  Math.roun d(wp * nh) ;
    532                    f.he ight.value  = nh;
    533                } else i f (c == 'h eight' &&  oldHeight  != 0) {
    534                    hp =  nh / oldH eight;
    535                    nw =  Math.roun d(hp * nw) ;
    536                    f.wi dth.value  = nw;
    537                }
    538           }
    539       }
    540  
    541       if (f. width.valu e != "")
    542           ol dWidth = n w;
    543  
    544       if (f. height.val ue != "")
    545           ol dHeight =  nh;
    546  
    547       // Aft er constra in
    548       pl = s erializePa rameters() ;
    549  
    550       switch  (f.media_ type.optio ns[f.media _type.sele ctedIndex] .value) {
    551           ca se "flash" :
    552                cls = 'c lsid:D27CD B6E-AE6D-1 1cf-96B8-4 4455354000 0';
    553                codebase  = 'http:/ /download. macromedia .com/pub/s hockwave/c abs/flash/ swflash.ca b#version= 6,0,40,0';
    554                type = ' applicatio n/x-shockw ave-flash' ;
    555                break;
    556  
    557           ca se "shockw ave":
    558                cls = 'c lsid:166B1 BCA-3F9C-1 1CF-8075-4 4455354000 0';
    559                codebase  = 'http:/ /download. macromedia .com/pub/s hockwave/c abs/direct or/sw.cab# version=8, 5,1,0';
    560                type = ' applicatio n/x-direct or';
    561                break;
    562  
    563           ca se "qt":
    564                cls = 'c lsid:02BF2 5D5-8C17-4 B23-BC80-D 3488ABDDC6 B';
    565                codebase  = 'http:/ /www.apple .com/qtact ivex/qtplu gin.cab#ve rsion=6,0, 2,0';
    566                type = ' video/quic ktime';
    567                break;
    568  
    569           ca se "wmp":
    570                cls = ed .getParam( 'media_wmp 6_compatib le') ? 'cl sid:05589F A1-C356-11 CE-BF01-00 AA0055595A ' : 'clsid :6BF52A52- 394A-11D3- B153-00C04 F79FAA6';
    571                codebase  = 'http:/ /activex.m icrosoft.c om/activex /controls/ mplayer/en /nsmp2inf. cab#Versio n=5,1,52,7 01';
    572                type = ' applicatio n/x-mplaye r2';
    573                break;
    574  
    575           ca se "rmp":
    576                cls = 'c lsid:CFCDA A03-8BE4-1 1cf-B84B-0 020AFBBCCF A';
    577                codebase  = 'http:/ /activex.m icrosoft.c om/activex /controls/ mplayer/en /nsmp2inf. cab#Versio n=5,1,52,7 01';
    578                type = ' audio/x-pn -realaudio -plugin';
    579                break;
    580       }
    581  
    582       if (pl  == '') {
    583           p. innerHTML  = '';
    584           re turn;
    585       }
    586  
    587       pl = t inyMCEPopu p.editor.p lugins.med ia._parse( pl);
    588  
    589       if (!p l.src) {
    590           p. innerHTML  = '';
    591           re turn;
    592       }
    593  
    594       pl.src  = tinyMCE Popup.edit or.documen tBaseURI.t oAbsolute( pl.src);
    595       pl.wid th = !pl.w idth ? 100  : pl.widt h;
    596       pl.hei ght = !pl. height ? 1 00 : pl.he ight;
    597       pl.id  = !pl.id ?  'obj' : p l.id;
    598       pl.nam e = !pl.na me ? 'eobj ' : pl.nam e;
    599       pl.ali gn = !pl.a lign ? ''  : pl.align ;
    600  
    601       h += ' <object cl assid="cls id:' + cls  + '" code base="' +  codebase +  '" width= "' + pl.wi dth + '" h eight="' +  pl.height  + '" id=" ' + pl.id  + '" name= "' + pl.na me + '" al ign="' + p l.align +  '">';
    602  
    603       for (n  in pl) {
    604           h  += '<param  name="' +  n + '" va lue="' + p l[n] + '"> ';
    605  
    606           //  Add extra  url param eter if it 's an abso lute URL
    607           if  (n == 'sr c' && pl[n ].indexOf( '://') !=  -1)
    608                h += '<p aram name= "url" valu e="' + pl[ n] + '" /> ';
    609       }
    610  
    611       h += ' <embed typ e="' + typ e + '" ';
    612  
    613       for (n  in pl)
    614           h  += n + '=" ' + pl[n]  + '" ';
    615  
    616       h += ' ></embed>< /object>';
    617  
    618       p.inne rHTML = "< !-- x ---> " + h;
    619   }
    620  
    621   tinyMCEPop up.onInit. add(init);