390. File Comparison Report

Produced on Mon May 12 13:05:59 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.

390.1 Files compared

# Location File Last Modified
1 Mon May 12 13:05:59 2008 UTC
2 Dolphin-v.6.1.0\plugins\tiny_mce\plugins\advlink\js advlink.js Thu Mar 27 13:53:26 2008 UTC

390.2 Comparison summary

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

390.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

390.4 Active regular expressions

No regular expressions were active.

390.5 Comparison detail

    1   /* Functio ns for the  advlink p lugin popu p */
    2  
    3   tinyMCEPop up.require LangPack() ;
    4  
    5   var templa tes = {
    6       "windo w.open" :  "window.op en('${url} ','${targe t}','${opt ions}')"
    7   };
    8  
    9   function p reinit() {
    10       var ur l;
    11  
    12       if (ur l = tinyMC EPopup.get Param("ext ernal_link _list_url" ))
    13           do cument.wri te('<scrip t language ="javascri pt" type=" text/javas cript" src ="' + tiny MCEPopup.e ditor.docu mentBaseUR I.toAbsolu te(url) +  '"></scrip t>');
    14   }
    15  
    16   function c hangeClass () {
    17       var fo rmObj = do cument.for ms[0];
    18       formOb j.classes. value = ge tSelectVal ue(formObj , 'classli st');
    19   }
    20  
    21   function i nit() {
    22       tinyMC EPopup.res izeToInner Size();
    23  
    24       var fo rmObj = do cument.for ms[0];
    25       var in st = tinyM CEPopup.ed itor;
    26       var el m = inst.s election.g etNode();
    27       var ac tion = "in sert";
    28       var ht ml;
    29  
    30       docume nt.getElem entById('h refbrowser container' ).innerHTM L = getBro wserHTML(' hrefbrowse r','href', 'file','ad vlink');
    31       docume nt.getElem entById('p opupurlbro wsercontai ner').inne rHTML = ge tBrowserHT ML('popupu rlbrowser' ,'popupurl ','file',' advlink');
    32       docume nt.getElem entById('l inklisthre fcontainer ').innerHT ML = getLi nkListHTML ('linklist href','hre f');
    33       docume nt.getElem entById('a nchorlistc ontainer') .innerHTML  = getAnch orListHTML ('anchorli st','href' );
    34       docume nt.getElem entById('t argetlistc ontainer') .innerHTML  = getTarg etListHTML ('targetli st','targe t');
    35  
    36       // Lin k list
    37       html =  getLinkLi stHTML('li nklisthref ','href');
    38       if (ht ml == "")
    39           do cument.get ElementByI d("linklis threfrow") .style.dis play = 'no ne';
    40       else
    41           do cument.get ElementByI d("linklis threfconta iner").inn erHTML = h tml;
    42  
    43       // Res ize some e lements
    44       if (is Visible('h refbrowser '))
    45           do cument.get ElementByI d('href'). style.widt h = '260px ';
    46  
    47       if (is Visible('p opupurlbro wser'))
    48           do cument.get ElementByI d('popupur l').style. width = '1 80px';
    49  
    50       elm =  inst.dom.g etParent(e lm, "A");
    51       if (el m != null  && elm.nod eName == " A")
    52           ac tion = "up date";
    53  
    54       formOb j.insert.v alue = tin yMCEPopup. getLang(ac tion, 'Ins ert', true ); 
    55  
    56       setPop upControls Disabled(t rue);
    57  
    58       if (ac tion == "u pdate") {
    59           va r href = i nst.dom.ge tAttrib(el m, 'href') ;
    60           va r onclick  = inst.dom .getAttrib (elm, 'onc lick');
    61  
    62           //  Setup for m data
    63           se tFormValue ('href', h ref);
    64           se tFormValue ('title',  inst.dom.g etAttrib(e lm, 'title '));
    65           se tFormValue ('id', ins t.dom.getA ttrib(elm,  'id'));
    66           se tFormValue ('style',  inst.dom.g etAttrib(e lm, "style "));
    67           se tFormValue ('rel', in st.dom.get Attrib(elm , 'rel'));
    68           se tFormValue ('rev', in st.dom.get Attrib(elm , 'rev'));
    69           se tFormValue ('charset' , inst.dom .getAttrib (elm, 'cha rset'));
    70           se tFormValue ('hreflang ', inst.do m.getAttri b(elm, 'hr eflang'));
    71           se tFormValue ('dir', in st.dom.get Attrib(elm , 'dir'));
    72           se tFormValue ('lang', i nst.dom.ge tAttrib(el m, 'lang') );
    73           se tFormValue ('tabindex ', inst.do m.getAttri b(elm, 'ta bindex', t ypeof(elm. tabindex)  != "undefi ned" ? elm .tabindex  : ""));
    74           se tFormValue ('accesske y', inst.d om.getAttr ib(elm, 'a ccesskey',  typeof(el m.accesske y) != "und efined" ?  elm.access key : "")) ;
    75           se tFormValue ('type', i nst.dom.ge tAttrib(el m, 'type') );
    76           se tFormValue ('onfocus' , inst.dom .getAttrib (elm, 'onf ocus'));
    77           se tFormValue ('onblur',  inst.dom. getAttrib( elm, 'onbl ur'));
    78           se tFormValue ('onclick' , onclick) ;
    79           se tFormValue ('ondblcli ck', inst. dom.getAtt rib(elm, ' ondblclick '));
    80           se tFormValue ('onmoused own', inst .dom.getAt trib(elm,  'onmousedo wn'));
    81           se tFormValue ('onmouseu p', inst.d om.getAttr ib(elm, 'o nmouseup') );
    82           se tFormValue ('onmouseo ver', inst .dom.getAt trib(elm,  'onmouseov er'));
    83           se tFormValue ('onmousem ove', inst .dom.getAt trib(elm,  'onmousemo ve'));
    84           se tFormValue ('onmouseo ut', inst. dom.getAtt rib(elm, ' onmouseout '));
    85           se tFormValue ('onkeypre ss', inst. dom.getAtt rib(elm, ' onkeypress '));
    86           se tFormValue ('onkeydow n', inst.d om.getAttr ib(elm, 'o nkeydown') );
    87           se tFormValue ('onkeyup' , inst.dom .getAttrib (elm, 'onk eyup'));
    88           se tFormValue ('target',  inst.dom. getAttrib( elm, 'targ et'));
    89           se tFormValue ('classes' , inst.dom .getAttrib (elm, 'cla ss'));
    90  
    91           //  Parse onc lick data
    92           if  (onclick  != null &&  onclick.i ndexOf('wi ndow.open' ) != -1)
    93                parseWin dowOpen(on click);
    94           el se
    95                parseFun ction(oncl ick);
    96  
    97           //  Select by  the value s
    98           se lectByValu e(formObj,  'dir', in st.dom.get Attrib(elm , 'dir'));
    99           se lectByValu e(formObj,  'rel', in st.dom.get Attrib(elm , 'rel'));
    100           se lectByValu e(formObj,  'rev', in st.dom.get Attrib(elm , 'rev'));
    101           se lectByValu e(formObj,  'linklist href', hre f);
    102  
    103           if  (href.cha rAt(0) ==  '#')
    104                selectBy Value(form Obj, 'anch orlist', h ref);
    105  
    106           ad dClassesTo List('clas slist', 'a dvlink_sty les');
    107  
    108           se lectByValu e(formObj,  'classlis t', inst.d om.getAttr ib(elm, 'c lass'), tr ue);
    109           se lectByValu e(formObj,  'targetli st', inst. dom.getAtt rib(elm, ' target'),  true);
    110       } else
    111           ad dClassesTo List('clas slist', 'a dvlink_sty les');
    112   }
    113  
    114   function c heckPrefix (n) {
    115       if (n. value && V alidator.i sEmail(n)  && !/^\s*m ailto:/i.t est(n.valu e) && conf irm(tinyMC EPopup.get Lang('advl ink_dlg.is _email')))
    116           n. value = 'm ailto:' +  n.value;
    117  
    118       if (/^ \s*www./i. test(n.val ue) && con firm(tinyM CEPopup.ge tLang('adv link_dlg.i s_external ')))
    119           n. value = 'h ttp://' +  n.value;
    120   }
    121  
    122   function s etFormValu e(name, va lue) {
    123       docume nt.forms[0 ].elements [name].val ue = value ;
    124   }
    125  
    126   function p arseWindow Open(oncli ck) {
    127       var fo rmObj = do cument.for ms[0];
    128  
    129       // Pre process ce nter code
    130       if (on click.inde xOf('retur n false;')  != -1) {
    131           fo rmObj.popu preturn.ch ecked = tr ue;
    132           on click = on click.repl ace('retur n false;',  '');
    133       } else
    134           fo rmObj.popu preturn.ch ecked = fa lse;
    135  
    136       var on ClickData  = parseLin k(onclick) ;
    137  
    138       if (on ClickData  != null) {
    139           fo rmObj.ispo pup.checke d = true;
    140           se tPopupCont rolsDisabl ed(false);
    141  
    142           va r onClickW indowOptio ns = parse Options(on ClickData[ 'options'] );
    143           va r url = on ClickData[ 'url'];
    144  
    145           fo rmObj.popu pname.valu e = onClic kData['tar get'];
    146           fo rmObj.popu purl.value  = url;
    147           fo rmObj.popu pwidth.val ue = getOp tion(onCli ckWindowOp tions, 'wi dth');
    148           fo rmObj.popu pheight.va lue = getO ption(onCl ickWindowO ptions, 'h eight');
    149  
    150           fo rmObj.popu pleft.valu e = getOpt ion(onClic kWindowOpt ions, 'lef t');
    151           fo rmObj.popu ptop.value  = getOpti on(onClick WindowOpti ons, 'top' );
    152  
    153           if  (formObj. popupleft. value.inde xOf('scree n') != -1)
    154                formObj. popupleft. value = "c ";
    155  
    156           if  (formObj. popuptop.v alue.index Of('screen ') != -1)
    157                formObj. popuptop.v alue = "c" ;
    158  
    159           fo rmObj.popu plocation. checked =  getOption( onClickWin dowOptions , 'locatio n') == "ye s";
    160           fo rmObj.popu pscrollbar s.checked  = getOptio n(onClickW indowOptio ns, 'scrol lbars') ==  "yes";
    161           fo rmObj.popu pmenubar.c hecked = g etOption(o nClickWind owOptions,  'menubar' ) == "yes" ;
    162           fo rmObj.popu presizable .checked =  getOption (onClickWi ndowOption s, 'resiza ble') == " yes";
    163           fo rmObj.popu ptoolbar.c hecked = g etOption(o nClickWind owOptions,  'toolbar' ) == "yes" ;
    164           fo rmObj.popu pstatus.ch ecked = ge tOption(on ClickWindo wOptions,  'status')  == "yes";
    165           fo rmObj.popu pdependent .checked =  getOption (onClickWi ndowOption s, 'depend ent') == " yes";
    166  
    167           bu ildOnClick ();
    168       }
    169   }
    170  
    171   function p arseFuncti on(onclick ) {
    172       var fo rmObj = do cument.for ms[0];
    173       var on ClickData  = parseLin k(onclick) ;
    174  
    175       // TOD O: Add stu ff here
    176   }
    177  
    178   function g etOption(o pts, name)  {
    179       return  typeof(op ts[name])  == "undefi ned" ? ""  : opts[nam e];
    180   }
    181  
    182   function s etPopupCon trolsDisab led(state)  {
    183       var fo rmObj = do cument.for ms[0];
    184  
    185       formOb j.popupnam e.disabled  = state;
    186       formOb j.popupurl .disabled  = state;
    187       formOb j.popupwid th.disable d = state;
    188       formOb j.popuphei ght.disabl ed = state ;
    189       formOb j.popuplef t.disabled  = state;
    190       formOb j.popuptop .disabled  = state;
    191       formOb j.popuploc ation.disa bled = sta te;
    192       formOb j.popupscr ollbars.di sabled = s tate;
    193       formOb j.popupmen ubar.disab led = stat e;
    194       formOb j.popupres izable.dis abled = st ate;
    195       formOb j.popuptoo lbar.disab led = stat e;
    196       formOb j.popupsta tus.disabl ed = state ;
    197       formOb j.popupret urn.disabl ed = state ;
    198       formOb j.popupdep endent.dis abled = st ate;
    199  
    200       setBro wserDisabl ed('popupu rlbrowser' , state);
    201   }
    202  
    203   function p arseLink(l ink) {
    204       link =  link.repl ace(new Re gExp('&#39 ;', 'g'),  "'");
    205  
    206       var fn Name = lin k.replace( new RegExp ("\\s*([A- Za-z0-9\.] *)\\s*\\(. *", "gi"),  "$1");
    207  
    208       // Is  function n ame a temp late funct ion
    209       var te mplate = t emplates[f nName];
    210       if (te mplate) {
    211           //  Build reg exp
    212           va r variable Names = te mplate.mat ch(new Reg Exp("'?\\$ \\{[A-Za-z 0-9\.]*\\} '?", "gi") );
    213           va r regExp =  "\\s*[A-Z a-z0-9\.]* \\s*\\(";
    214           va r replaceS tr = "";
    215           fo r (var i=0 ; i<variab leNames.le ngth; i++)  {
    216                // Is st ring value
    217                if (vari ableNames[ i].indexOf ("'${") !=  -1)
    218                    regE xp += "'(. *)'";
    219                else //  Number val ue
    220                    regE xp += "([0 -9]*)";
    221  
    222                replaceS tr += "$"  + (i+1);
    223  
    224                // Clean up variabl e name
    225                variable Names[i] =  variableN ames[i].re place(new  RegExp("[^ A-Za-z0-9] ", "gi"),  "");
    226  
    227                if (i !=  variableN ames.lengt h-1) {
    228                    regE xp += "\\s *,\\s*";
    229                    repl aceStr +=  "<delim>";
    230                } else
    231                    regE xp += ".*" ;
    232           }
    233  
    234           re gExp += "\ \);?";
    235  
    236           //  Build var iable arra y
    237           va r variable s = new Ar ray();
    238           va riables["_ function"]  = fnName;
    239           va r variable Values = l ink.replac e(new RegE xp(regExp,  "gi"), re placeStr). split('<de lim>');
    240           fo r (var i=0 ; i<variab leNames.le ngth; i++)
    241                variable s[variable Names[i]]  = variable Values[i];
    242  
    243           re turn varia bles;
    244       }
    245  
    246       return  null;
    247   }
    248  
    249   function p arseOption s(opts) {
    250       if (op ts == null  || opts = = "")
    251           re turn new A rray();
    252  
    253       // Cle anup the o ptions
    254       opts =  opts.toLo werCase();
    255       opts =  opts.repl ace(/;/g,  ",");
    256       opts =  opts.repl ace(/[^0-9 a-z=,]/g,  "");
    257  
    258       var op tionChunks  = opts.sp lit(',');
    259       var op tions = ne w Array();
    260  
    261       for (v ar i=0; i< optionChun ks.length;  i++) {
    262           va r parts =  optionChun ks[i].spli t('=');
    263  
    264           if  (parts.le ngth == 2)
    265                options[ parts[0]]  = parts[1] ;
    266       }
    267  
    268       return  options;
    269   }
    270  
    271   function b uildOnClic k() {
    272       var fo rmObj = do cument.for ms[0];
    273  
    274       if (!f ormObj.isp opup.check ed) {
    275           fo rmObj.oncl ick.value  = "";
    276           re turn;
    277       }
    278  
    279       var on click = "w indow.open ('";
    280       var ur l = formOb j.popupurl .value;
    281  
    282       onclic k += url +  "','";
    283       onclic k += formO bj.popupna me.value +  "','";
    284  
    285       if (fo rmObj.popu plocation. checked)
    286           on click += " location=y es,";
    287  
    288       if (fo rmObj.popu pscrollbar s.checked)
    289           on click += " scrollbars =yes,";
    290  
    291       if (fo rmObj.popu pmenubar.c hecked)
    292           on click += " menubar=ye s,";
    293  
    294       if (fo rmObj.popu presizable .checked)
    295           on click += " resizable= yes,";
    296  
    297       if (fo rmObj.popu ptoolbar.c hecked)
    298           on click += " toolbar=ye s,";
    299  
    300       if (fo rmObj.popu pstatus.ch ecked)
    301           on click += " status=yes ,";
    302  
    303       if (fo rmObj.popu pdependent .checked)
    304           on click += " dependent= yes,";
    305  
    306       if (fo rmObj.popu pwidth.val ue != "")
    307           on click += " width=" +  formObj.po pupwidth.v alue + "," ;
    308  
    309       if (fo rmObj.popu pheight.va lue != "")
    310           on click += " height=" +  formObj.p opupheight .value + " ,";
    311  
    312       if (fo rmObj.popu pleft.valu e != "") {
    313           if  (formObj. popupleft. value != " c")
    314                onclick  += "left="  + formObj .popupleft .value + " ,";
    315           el se
    316                onclick  += "left=' +(screen.a vailWidth/ 2-" + (for mObj.popup width.valu e/2) + ")+ ',";
    317       }
    318  
    319       if (fo rmObj.popu ptop.value  != "") {
    320           if  (formObj. popuptop.v alue != "c ")
    321                onclick  += "top="  + formObj. popuptop.v alue + "," ;
    322           el se
    323                onclick  += "top='+ (screen.av ailHeight/ 2-" + (for mObj.popup height.val ue/2) + ") +',";
    324       }
    325  
    326       if (on click.char At(onclick .length-1)  == ',')
    327           on click = on click.subs tring(0, o nclick.len gth-1);
    328  
    329       onclic k += "');" ;
    330  
    331       if (fo rmObj.popu preturn.ch ecked)
    332           on click += " return fal se;";
    333  
    334       // tin yMCE.debug (onclick);
    335  
    336       formOb j.onclick. value = on click;
    337  
    338       if (fo rmObj.href .value ==  "")
    339           fo rmObj.href .value = u rl;
    340   }
    341  
    342   function s etAttrib(e lm, attrib , value) {
    343       var fo rmObj = do cument.for ms[0];
    344       var va lueElm = f ormObj.ele ments[attr ib.toLower Case()];
    345       var do m = tinyMC EPopup.edi tor.dom;
    346  
    347       if (ty peof(value ) == "unde fined" ||  value == n ull) {
    348           va lue = "";
    349  
    350           if  (valueElm )
    351                value =  valueElm.v alue;
    352       }
    353  
    354       // Cle an up the  style
    355       if (at trib == 's tyle')
    356           va lue = dom. serializeS tyle(dom.p arseStyle( value));
    357  
    358       dom.se tAttrib(el m, attrib,  value);
    359   }
    360  
    361   function g etAnchorLi stHTML(id,  target) {
    362       var in st = tinyM CEPopup.ed itor;
    363       var no des = inst .dom.selec t('a.mceIt emAnchor,i mg.mceItem Anchor'),  name, i;
    364       var ht ml = "";
    365  
    366       html + = '<select  id="' + i d + '" nam e="' + id  + '" class ="mceAncho rList" o2n focus="tin yMCE.addSe lectAccess ibility(ev ent, this,  window);"  onchange= "this.form .' + targe t + '.valu e=';
    367       html + = 'this.op tions[this .selectedI ndex].valu e;">';
    368       html + = '<option  value=""> ---</optio n>';
    369  
    370       for (i =0; i<node s.length;  i++) {
    371           if  ((name =  inst.dom.g etAttrib(n odes[i], " name")) !=  "")
    372                html +=  '<option v alue="#' +  name + '" >' + name  + '</optio n>';
    373       }
    374  
    375       html + = '</selec t>';
    376  
    377       return  html;
    378   }
    379  
    380   function i nsertActio n() {
    381       var in st = tinyM CEPopup.ed itor;
    382       var el m, element Array, i;
    383  
    384       elm =  inst.selec tion.getNo de();
    385       checkP refix(docu ment.forms [0].href);
    386  
    387       elm =  inst.dom.g etParent(e lm, "A");
    388  
    389       // Rem ove elemen t if there  is no hre f
    390       if (!d ocument.fo rms[0].hre f.value) {
    391           ti nyMCEPopup .execComma nd("mceBeg inUndoLeve l");
    392           i  = inst.sel ection.get Bookmark() ;
    393           in st.dom.rem ove(elm, 1 );
    394           in st.selecti on.moveToB ookmark(i) ;
    395           ti nyMCEPopup .execComma nd("mceEnd UndoLevel" );
    396           ti nyMCEPopup .close();
    397           re turn;
    398       }
    399  
    400       tinyMC EPopup.exe cCommand(" mceBeginUn doLevel");
    401  
    402       // Cre ate new an chor eleme nts
    403       if (el m == null)  {
    404           ti nyMCEPopup .execComma nd("Create Link", fal se, "#mce_ temp_url#" , {skip_un do : 1});
    405  
    406           el ementArray  = tinymce .grep(inst .dom.selec t("a"), fu nction(n)  {return in st.dom.get Attrib(n,  'href') ==  '#mce_tem p_url#';}) ;
    407           fo r (i=0; i< elementArr ay.length;  i++) {
    408                elm = el ementArray [i];
    409  
    410                // Move  cursor to  end
    411                try {
    412                    tiny MCEPopup.e ditor.sele ction.coll apse(false );
    413                } catch  (ex) {
    414                    // I gnore
    415                }
    416  
    417                // Move  cursor beh ind the ne w anchor
    418                // Don't  remember  why this w as needed  so it's no w removed
    419                /*
    420                if (tiny MCE.isGeck o) {
    421                    var  sp = inst. getDoc().c reateTextN ode(" ");
    422  
    423                    if ( elm.nextSi bling)
    424                         elm.parent Node.inser tBefore(sp , elm.next Sibling);
    425                    else
    426                         elm.parent Node.appen dChild(sp) ;
    427  
    428                    // S et range a fter link
    429                    var  rng = inst .getDoc(). createRang e();
    430                    rng. setStartAf ter(elm);
    431                    rng. setEndAfte r(elm);
    432  
    433                    // U pdate sele ction
    434                    var  sel = inst .getSel();
    435                    sel. removeAllR anges();
    436                    sel. addRange(r ng);
    437                }
    438                */
    439  
    440                setAllAt tribs(elm) ;
    441           }
    442       } else
    443           se tAllAttrib s(elm);
    444  
    445       tinyMC EPopup.exe cCommand(" mceEndUndo Level");
    446       tinyMC EPopup.clo se();
    447   }
    448  
    449   function s etAllAttri bs(elm) {
    450       var fo rmObj = do cument.for ms[0];
    451       var hr ef = formO bj.href.va lue;
    452       var ta rget = get SelectValu e(formObj,  'targetli st');
    453  
    454       setAtt rib(elm, ' href', hre f);
    455       setAtt rib(elm, ' mce_href',  href);
    456       setAtt rib(elm, ' title');
    457       setAtt rib(elm, ' target', t arget == ' _self' ? ' ' : target );
    458       setAtt rib(elm, ' id');
    459       setAtt rib(elm, ' style');
    460       setAtt rib(elm, ' class', ge tSelectVal ue(formObj , 'classli st'));
    461       setAtt rib(elm, ' rel');
    462       setAtt rib(elm, ' rev');
    463       setAtt rib(elm, ' charset');
    464       setAtt rib(elm, ' hreflang') ;
    465       setAtt rib(elm, ' dir');
    466       setAtt rib(elm, ' lang');
    467       setAtt rib(elm, ' tabindex') ;
    468       setAtt rib(elm, ' accesskey' );
    469       setAtt rib(elm, ' type');
    470       setAtt rib(elm, ' onfocus');
    471       setAtt rib(elm, ' onblur');
    472       setAtt rib(elm, ' onclick');
    473       setAtt rib(elm, ' ondblclick ');
    474       setAtt rib(elm, ' onmousedow n');
    475       setAtt rib(elm, ' onmouseup' );
    476       setAtt rib(elm, ' onmouseove r');
    477       setAtt rib(elm, ' onmousemov e');
    478       setAtt rib(elm, ' onmouseout ');
    479       setAtt rib(elm, ' onkeypress ');
    480       setAtt rib(elm, ' onkeydown' );
    481       setAtt rib(elm, ' onkeyup');
    482  
    483       // Ref resh in ol d MSIE
    484       if (ti nyMCE.isMS IE5)
    485           el m.outerHTM L = elm.ou terHTML;
    486   }
    487  
    488   function g etSelectVa lue(form_o bj, field_ name) {
    489       var el m = form_o bj.element s[field_na me];
    490  
    491       if (el m == null  || elm.opt ions == nu ll)
    492           re turn "";
    493  
    494       return  elm.optio ns[elm.sel ectedIndex ].value;
    495   }
    496  
    497   function g etLinkList HTML(elm_i d, target_ form_eleme nt, onchan ge_func) {
    498       if (ty peof(tinyM CELinkList ) == "unde fined" ||  tinyMCELin kList.leng th == 0)
    499           re turn "";
    500  
    501       var ht ml = "";
    502  
    503       html + = '<select  id="' + e lm_id + '"  name="' +  elm_id +  '"';
    504       html + = ' class= "mceLinkLi st" onfoc2 us="tinyMC E.addSelec tAccessibi lity(event , this, wi ndow);" on change="th is.form.'  + target_f orm_elemen t + '.valu e=';
    505       html + = 'this.op tions[this .selectedI ndex].valu e;';
    506  
    507       if (ty peof(oncha nge_func)  != "undefi ned")
    508           ht ml += onch ange_func  + '(\'' +  target_for m_element  + '\',this .options[t his.select edIndex].t ext,this.o ptions[thi s.selected Index].val ue);';
    509  
    510       html + = '"><opti on value=" ">---</opt ion>';
    511  
    512       for (v ar i=0; i< tinyMCELin kList.leng th; i++)
    513           ht ml += '<op tion value ="' + tiny MCELinkLis t[i][1] +  '">' + tin yMCELinkLi st[i][0] +  '</option >';
    514  
    515       html + = '</selec t>';
    516  
    517       return  html;
    518  
    519       // tin yMCE.debug ('-- image  list star t --', htm l, '-- ima ge list en d --');
    520   }
    521  
    522   function g etTargetLi stHTML(elm _id, targe t_form_ele ment) {
    523       var ta rgets = ti nyMCEPopup .getParam( 'theme_adv anced_link _targets',  '').split (';');
    524       var ht ml = '';
    525  
    526       html + = '<select  id="' + e lm_id + '"  name="' +  elm_id +  '" onf2ocu s="tinyMCE .addSelect Accessibil ity(event,  this, win dow);" onc hange="thi s.form.' +  target_fo rm_element  + '.value =';
    527       html + = 'this.op tions[this .selectedI ndex].valu e;">';
    528       html + = '<option  value="_s elf">' + t inyMCEPopu p.getLang( 'advlink_d lg.target_ same') + ' </option>' ;
    529       html + = '<option  value="_b lank">' +  tinyMCEPop up.getLang ('advlink_ dlg.target _blank') +  ' (_blank )</option> ';
    530       html + = '<option  value="_p arent">' +  tinyMCEPo pup.getLan g('advlink _dlg.targe t_parent')  + ' (_par ent)</opti on>';
    531       html + = '<option  value="_t op">' + ti nyMCEPopup .getLang(' advlink_dl g.target_t op') + ' ( _top)</opt ion>';
    532  
    533       for (v ar i=0; i< targets.le ngth; i++)  {
    534           va r key, val ue;
    535  
    536           if  (targets[ i] == "")
    537                continue ;
    538  
    539           ke y = target s[i].split ('=')[0];
    540           va lue = targ ets[i].spl it('=')[1] ;
    541  
    542           ht ml += '<op tion value ="' + key  + '">' + v alue + ' ( ' + key +  ')</option >';
    543       }
    544  
    545       html + = '</selec t>';
    546  
    547       return  html;
    548   }
    549  
    550   // While l oading
    551   preinit();
    552   tinyMCEPop up.onInit. add(init);