587. File Comparison Report

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

587.1 Files compared

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

587.2 Comparison summary

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

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

587.4 Active regular expressions

No regular expressions were active.

587.5 Comparison detail

    1    /**
    2    * $Id: ed itor_plugi n_src.js 4 2 2006-08- 08 14:32:2 4Z spocke  $
    3    *
    4    * @author  Moxiecode  - based o n work by  Andrew Tet law
    5    * @copyri ght Copyri ght © 2004 -2008, Mox iecode Sys tems AB, A ll rights  reserved.
    6    */
    7  
    8   tinyMCEPop up.require LangPack() ;
    9  
    10   function i nitCommonA ttributes( elm) {
    11       var fo rmObj = do cument.for ms[0], dom  = tinyMCE Popup.edit or.dom;
    12  
    13       // Set up form da ta for com mon elemen t attribut es
    14       setFor mValue('ti tle', dom. getAttrib( elm, 'titl e'));
    15       setFor mValue('id ', dom.get Attrib(elm , 'id'));
    16       select ByValue(fo rmObj, 'cl ass', dom. getAttrib( elm, 'clas s'), true) ;
    17       setFor mValue('st yle', dom. getAttrib( elm, 'styl e'));
    18       select ByValue(fo rmObj, 'di r', dom.ge tAttrib(el m, 'dir')) ;
    19       setFor mValue('la ng', dom.g etAttrib(e lm, 'lang' ));
    20       setFor mValue('on focus', do m.getAttri b(elm, 'on focus'));
    21       setFor mValue('on blur', dom .getAttrib (elm, 'onb lur'));
    22       setFor mValue('on click', do m.getAttri b(elm, 'on click'));
    23       setFor mValue('on dblclick',  dom.getAt trib(elm,  'ondblclic k'));
    24       setFor mValue('on mousedown' , dom.getA ttrib(elm,  'onmoused own'));
    25       setFor mValue('on mouseup',  dom.getAtt rib(elm, ' onmouseup' ));
    26       setFor mValue('on mouseover' , dom.getA ttrib(elm,  'onmouseo ver'));
    27       setFor mValue('on mousemove' , dom.getA ttrib(elm,  'onmousem ove'));
    28       setFor mValue('on mouseout',  dom.getAt trib(elm,  'onmouseou t'));
    29       setFor mValue('on keypress',  dom.getAt trib(elm,  'onkeypres s'));
    30       setFor mValue('on keydown',  dom.getAtt rib(elm, ' onkeydown' ));
    31       setFor mValue('on keyup', do m.getAttri b(elm, 'on keyup'));
    32   }
    33  
    34   function s etFormValu e(name, va lue) {
    35       if(doc ument.form s[0].eleme nts[name])  document. forms[0].e lements[na me].value  = value;
    36   }
    37  
    38   function i nsertDateT ime(id) {
    39       docume nt.getElem entById(id ).value =  getDateTim e(new Date (), "%Y-%m -%dT%H:%M: %S");
    40   }
    41  
    42   function g etDateTime (d, fmt) {
    43       fmt =  fmt.replac e("%D", "% m/%d/%y");
    44       fmt =  fmt.replac e("%r", "% I:%M:%S %p ");
    45       fmt =  fmt.replac e("%Y", ""  + d.getFu llYear());
    46       fmt =  fmt.replac e("%y", ""  + d.getYe ar());
    47       fmt =  fmt.replac e("%m", ad dZeros(d.g etMonth()+ 1, 2));
    48       fmt =  fmt.replac e("%d", ad dZeros(d.g etDate(),  2));
    49       fmt =  fmt.replac e("%H", ""  + addZero s(d.getHou rs(), 2));
    50       fmt =  fmt.replac e("%M", ""  + addZero s(d.getMin utes(), 2) );
    51       fmt =  fmt.replac e("%S", ""  + addZero s(d.getSec onds(), 2) );
    52       fmt =  fmt.replac e("%I", ""  + ((d.get Hours() +  11) % 12 +  1));
    53       fmt =  fmt.replac e("%p", ""  + (d.getH ours() < 1 2 ? "AM" :  "PM"));
    54       fmt =  fmt.replac e("%%", "% ");
    55  
    56       return  fmt;
    57   }
    58  
    59   function a ddZeros(va lue, len)  {
    60       var i;
    61  
    62       value  = "" + val ue;
    63  
    64       if (va lue.length  < len) {
    65           fo r (i=0; i< (len-value .length);  i++)
    66                value =  "0" + valu e;
    67       }
    68  
    69       return  value;
    70   }
    71  
    72   function s electByVal ue(form_ob j, field_n ame, value , add_cust om, ignore _case) {
    73       if (!f orm_obj ||  !form_obj .elements[ field_name ])
    74           re turn;
    75  
    76       var se l = form_o bj.element s[field_na me];
    77  
    78       var fo und = fals e;
    79       for (v ar i=0; i< sel.option s.length;  i++) {
    80           va r option =  sel.optio ns[i];
    81  
    82           if  (option.v alue == va lue || (ig nore_case  && option. value.toLo werCase()  == value.t oLowerCase ())) {
    83                option.s elected =  true;
    84                found =  true;
    85           }  else
    86                option.s elected =  false;
    87       }
    88  
    89       if (!f ound && ad d_custom & & value !=  '') {
    90           va r option =  new Optio n('Value:  ' + value,  value);
    91           op tion.selec ted = true ;
    92           se l.options[ sel.option s.length]  = option;
    93       }
    94  
    95       return  found;
    96   }
    97  
    98   function s etAttrib(e lm, attrib , value) {
    99       var fo rmObj = do cument.for ms[0];
    100       var va lueElm = f ormObj.ele ments[attr ib.toLower Case()];
    101       tinyMC EPopup.edi tor.dom.se tAttrib(el m, attrib,  value ||  valueElm.v alue);
    102   }
    103  
    104   function s etAllCommo nAttribs(e lm) {
    105       setAtt rib(elm, ' title');
    106       setAtt rib(elm, ' id');
    107       setAtt rib(elm, ' class');
    108       setAtt rib(elm, ' style');
    109       setAtt rib(elm, ' dir');
    110       setAtt rib(elm, ' lang');
    111       /*setA ttrib(elm,  'onfocus' );
    112       setAtt rib(elm, ' onblur');
    113       setAtt rib(elm, ' onclick');
    114       setAtt rib(elm, ' ondblclick ');
    115       setAtt rib(elm, ' onmousedow n');
    116       setAtt rib(elm, ' onmouseup' );
    117       setAtt rib(elm, ' onmouseove r');
    118       setAtt rib(elm, ' onmousemov e');
    119       setAtt rib(elm, ' onmouseout ');
    120       setAtt rib(elm, ' onkeypress ');
    121       setAtt rib(elm, ' onkeydown' );
    122       setAtt rib(elm, ' onkeyup'); */
    123   }
    124  
    125   SXE = {
    126       curren tAction :  "insert",
    127       inst :  tinyMCEPo pup.editor ,
    128       update Element :  null
    129   }
    130  
    131   SXE.focusE lement = S XE.inst.se lection.ge tNode();
    132  
    133   SXE.initEl ementDialo g = functi on(element _name) {
    134       addCla ssesToList ('class',  'xhtmlxtra s_styles') ;
    135       TinyMC E_Editable Selects.in it();
    136  
    137       elemen t_name = e lement_nam e.toLowerC ase();
    138       var el m = SXE.in st.dom.get Parent(SXE .focusElem ent, eleme nt_name.to UpperCase( ));
    139       if (el m != null  && elm.nod eName == e lement_nam e.toUpperC ase()) {
    140           SX E.currentA ction = "u pdate";
    141       }
    142  
    143       if (SX E.currentA ction == " update") {
    144           in itCommonAt tributes(e lm);
    145           SX E.updateEl ement = el m;
    146       }
    147  
    148       docume nt.forms[0 ].insert.v alue = tin yMCEPopup. getLang(SX E.currentA ction, 'In sert', tru e); 
    149   }
    150  
    151   SXE.insert Element =  function(e lement_nam e) {
    152       var el m = SXE.in st.dom.get Parent(SXE .focusElem ent, eleme nt_name.to UpperCase( )), h, tag Name;
    153  
    154       tinyMC EPopup.exe cCommand(' mceBeginUn doLevel');
    155       if (el m == null)  {
    156           va r s = SXE. inst.selec tion.getCo ntent();
    157           if (s.length  > 0) {
    158                tagName  = element_ name;
    159  
    160                if (tiny mce.isIE & & element_ name.index Of('html:' ) == 0)
    161                    elem ent_name =  element_n ame.substr ing(5).toL owerCase() ;
    162  
    163                h = '<'  + tagName  + ' id="#s xe_temp_'  + element_ name + '#" >' + s + ' </' + tagN ame + '>';
    164  
    165                tinyMCEP opup.execC ommand('mc eInsertCon tent', fal se, h);
    166  
    167                var elem entArray =  tinymce.g rep(SXE.in st.dom.sel ect(elemen t_name), f unction(n)  {return n .id == '#s xe_temp_'  + element_ name + '#' ;});
    168                for (var  i=0; i<el ementArray .length; i ++) {
    169                    var  elm = elem entArray[i ];
    170  
    171                    elm. id = '';
    172                    elm. setAttribu te('id', ' ');
    173                    elm. removeAttr ibute('id' );
    174  
    175                    setA llCommonAt tribs(elm) ;
    176                }
    177           }
    178       } else  {
    179           se tAllCommon Attribs(el m);
    180       }
    181       SXE.in st.nodeCha nged();
    182       tinyMC EPopup.exe cCommand(' mceEndUndo Level');
    183   }
    184  
    185   SXE.remove Element =  function(e lement_nam e){
    186       elemen t_name = e lement_nam e.toLowerC ase();
    187       elm =  SXE.inst.d om.getPare nt(SXE.foc usElement,  element_n ame.toUppe rCase());
    188       if(elm  && elm.no deName ==  element_na me.toUpper Case()){
    189           ti nyMCEPopup .execComma nd('mceBeg inUndoLeve l');
    190           ti nyMCE.exec Command('m ceRemoveNo de', false , elm);
    191           SX E.inst.nod eChanged() ;
    192           ti nyMCEPopup .execComma nd('mceEnd UndoLevel' );
    193       }
    194   }
    195  
    196   SXE.showRe moveButton  = functio n() {
    197           do cument.get ElementByI d("remove" ).style.di splay = 'b lock';
    198   }
    199  
    200   SXE.contai nsClass =  function(e lm,cl) {
    201       return  (elm.clas sName.inde xOf(cl) >  -1) ? true  : false;
    202   }
    203  
    204   SXE.remove Class = fu nction(elm ,cl) {
    205       if(elm .className  == null | | elm.clas sName == " " || !SXE. containsCl ass(elm,cl )) {
    206           re turn true;
    207       }
    208       var cl assNames =  elm.class Name.split (" ");
    209       var ne wClassName s = "";
    210       for (v ar x = 0,  cnl = clas sNames.len gth; x < c nl; x++) {
    211           if  (classNam es[x] != c l) {
    212                newClass Names += ( classNames [x] + " ") ;
    213           }
    214       }
    215       elm.cl assName =  newClassNa mes.substr ing(0,newC lassNames. length-1);  //removes  extra spa ce at the  end
    216   }
    217  
    218   SXE.addCla ss = funct ion(elm,cl ) {
    219       if(!SX E.contains Class(elm, cl)) elm.c lassName ?  elm.class Name += "  " + cl : e lm.classNa me = cl;
    220       return  true;
    221   }