627. File Comparison Report

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

627.1 Files compared

# Location File Last Modified
1 Mon May 12 13:06:29 2008 UTC
2 Dolphin-v.6.1.0\plugins\tiny_mce\themes\advanced\js image.js Thu Mar 27 13:53:28 2008 UTC

627.2 Comparison summary

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

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

627.4 Active regular expressions

No regular expressions were active.

627.5 Comparison detail

    1   var ImageD ialog = {
    2       preIni t : functi on() {
    3           va r url;
    4  
    5           ti nyMCEPopup .requireLa ngPack();
    6  
    7           if  (url = ti nyMCEPopup .getParam( "external_ image_list _url"))
    8                document .write('<s cript lang uage="java script" ty pe="text/j avascript"  src="' +  tinyMCEPop up.editor. documentBa seURI.toAb solute(url ) + '"></s cript>');
    9       },
    10  
    11       init :  function( ) {
    12           va r f = docu ment.forms [0], ed =  tinyMCEPop up.editor;
    13  
    14           //  Setup bro wse button
    15           do cument.get ElementByI d('srcbrow sercontain er').inner HTML = get BrowserHTM L('srcbrow ser','src' ,'image',' theme_adva nced_image ');
    16           if  (isVisibl e('srcbrow ser'))
    17                document .getElemen tById('src ').style.w idth = '18 0px';
    18  
    19           e  = ed.selec tion.getNo de();
    20  
    21           th is.fillFil eList('ima ge_list',  'tinyMCEIm ageList');
    22  
    23           if  (e.nodeNa me == 'IMG ') {
    24                f.src.va lue = ed.d om.getAttr ib(e, 'src ');
    25                f.alt.va lue = ed.d om.getAttr ib(e, 'alt ');
    26                f.border .value = t his.getAtt rib(e, 'bo rder');
    27                f.vspace .value = t his.getAtt rib(e, 'vs pace');
    28                f.hspace .value = t his.getAtt rib(e, 'hs pace');
    29                f.width. value = ed .dom.getAt trib(e, 'w idth');
    30                f.height .value = e d.dom.getA ttrib(e, ' height');
    31                f.insert .value = e d.getLang( 'update');
    32                this.sty leVal = ed .dom.getAt trib(e, 's tyle');
    33                selectBy Value(f, ' image_list ', f.src.v alue);
    34                selectBy Value(f, ' align', th is.getAttr ib(e, 'ali gn'));
    35                this.upd ateStyle() ;
    36           }
    37       },
    38  
    39       fillFi leList : f unction(id , l) {
    40           va r dom = ti nyMCEPopup .dom, lst  = dom.get( id), v, cl ;
    41  
    42           l  = window[l ];
    43  
    44           if  (l && l.l ength > 0)  {
    45                lst.opti ons[lst.op tions.leng th] = new  Option('',  '');
    46  
    47                tinymce. each(l, fu nction(o)  {
    48                    lst. options[ls t.options. length] =  new Option (o[0], o[1 ]);
    49                });
    50           }  else
    51                dom.remo ve(dom.get Parent(id,  'tr'));
    52       },
    53  
    54       update  : functio n() {
    55           va r f = docu ment.forms [0], nl =  f.elements , ed = tin yMCEPopup. editor, ar gs = {}, e l;
    56  
    57           ti nyMCEPopup .restoreSe lection();
    58  
    59           if  (f.src.va lue === '' ) {
    60                if (ed.s election.g etNode().n odeName ==  'IMG') {
    61                    ed.d om.remove( ed.selecti on.getNode ());
    62                    ed.e xecCommand ('mceRepai nt');
    63                }
    64  
    65                tinyMCEP opup.close ();
    66                return;
    67           }
    68  
    69           if  (!ed.sett ings.inlin e_styles)  {
    70                args = t inymce.ext end(args,  {
    71                    vspa ce : nl.vs pace.value ,
    72                    hspa ce : nl.hs pace.value ,
    73                    bord er : nl.bo rder.value ,
    74                    alig n : getSel ectValue(f , 'align')
    75                });
    76           }  else
    77                args.sty le = this. styleVal;
    78  
    79           ti nymce.exte nd(args, {
    80                src : f. src.value,
    81                alt : f. alt.value,
    82                width :  f.width.va lue,
    83                height :  f.height. value
    84           }) ;
    85  
    86           el  = ed.sele ction.getN ode();
    87  
    88           if  (el && el .nodeName  == 'IMG')  {
    89                ed.dom.s etAttribs( el, args);
    90           }  else {
    91                ed.execC ommand('mc eInsertCon tent', fal se, '<img  id="__mce_ tmp" src=" javascript :;" />', { skip_undo  : 1});
    92                ed.dom.s etAttribs( '__mce_tmp ', args);
    93                ed.dom.s etAttrib(' __mce_tmp' , 'id', '' );
    94                ed.undoM anager.add ();
    95           }
    96  
    97           ti nyMCEPopup .close();
    98       },
    99  
    100       update Style : fu nction() {
    101           va r dom = ti nyMCEPopup .dom, st,  v, f = doc ument.form s[0];
    102  
    103           if  (tinyMCEP opup.edito r.settings .inline_st yles) {
    104                st = tin yMCEPopup. dom.parseS tyle(this. styleVal);
    105  
    106                // Handl e align
    107                v = getS electValue (f, 'align ');
    108                if (v) {
    109                    if ( v == 'left ' || v ==  'right') {
    110                         st['float' ] = v;
    111                         delete st[ 'vertical- align'];
    112                    } el se {
    113                         st['vertic al-align']  = v;
    114                         delete st[ 'float'];
    115                    }
    116                } else {
    117                    dele te st['flo at'];
    118                    dele te st['ver tical-alig n'];
    119                }
    120  
    121                // Handl e border
    122                v = f.bo rder.value ;
    123                if (v ||  v == '0')  {
    124                    if ( v == '0')
    125                         st['border '] = '0';
    126                    else
    127                         st['border '] = v + ' px solid b lack';
    128                } else
    129                    dele te st['bor der'];
    130  
    131                // Handl e hspace
    132                v = f.hs pace.value ;
    133                if (v) {
    134                    dele te st['mar gin'];
    135                    st[' margin-lef t'] = v +  'px';
    136                    st[' margin-rig ht'] = v +  'px';
    137                } else {
    138                    dele te st['mar gin-left'] ;
    139                    dele te st['mar gin-right' ];
    140                }
    141  
    142                // Handl e vspace
    143                v = f.vs pace.value ;
    144                if (v) {
    145                    dele te st['mar gin'];
    146                    st[' margin-top '] = v + ' px';
    147                    st[' margin-bot tom'] = v  + 'px';
    148                } else {
    149                    dele te st['mar gin-top'];
    150                    dele te st['mar gin-bottom '];
    151                }
    152  
    153                // Merge
    154                st = tin yMCEPopup. dom.parseS tyle(dom.s erializeSt yle(st));
    155                this.sty leVal = do m.serializ eStyle(st) ;
    156           }
    157       },
    158  
    159       getAtt rib : func tion(e, at ) {
    160           va r ed = tin yMCEPopup. editor, do m = ed.dom , v, v2;
    161  
    162           if  (ed.setti ngs.inline _styles) {
    163                switch ( at) {
    164                    case  'align':
    165                         if (v = do m.getStyle (e, 'float '))
    166                             return  v;
    167  
    168                         if (v = do m.getStyle (e, 'verti cal-align' ))
    169                             return  v;
    170  
    171                         break;
    172  
    173                    case  'hspace':
    174                         v = dom.ge tStyle(e,  'margin-le ft')
    175                         v2 = dom.g etStyle(e,  'margin-r ight');
    176                         if (v && v  == v2)
    177                             return  parseInt( v.replace( /[^0-9]/g,  ''));
    178  
    179                         break;
    180  
    181                    case  'vspace':
    182                         v = dom.ge tStyle(e,  'margin-to p')
    183                         v2 = dom.g etStyle(e,  'margin-b ottom');
    184                         if (v && v  == v2)
    185                             return  parseInt( v.replace( /[^0-9]/g,  ''));
    186  
    187                         break;
    188  
    189                    case  'border':
    190                         v = 0;
    191  
    192                         tinymce.ea ch(['top',  'right',  'bottom',  'left'], f unction(sv ) {
    193                             sv = d om.getStyl e(e, 'bord er-' + sv  + '-width' );
    194  
    195                             // Fal se or not  the same a s prev
    196                             if (!s v || (sv ! = v && v ! == 0)) {
    197                                 v  = 0;
    198                                 re turn false ;
    199                             }
    200  
    201                             if (sv )
    202                                 v  = sv;
    203                         });
    204  
    205                         if (v)
    206                             return  parseInt( v.replace( /[^0-9]/g,  ''));
    207  
    208                         break;
    209                }
    210           }
    211  
    212           if  (v = dom. getAttrib( e, at))
    213                return v ;
    214  
    215           re turn '';
    216       },
    217  
    218       resetI mageData :  function( ) {
    219           va r f = docu ment.forms [0];
    220  
    221           f. width.valu e = f.heig ht.value =  "";    
    222       },
    223  
    224       update ImageData  : function () {
    225           va r f = docu ment.forms [0], t = I mageDialog ;
    226  
    227           if  (f.width. value == " ")
    228                f.width. value = t. preloadImg .width;
    229  
    230           if  (f.height .value ==  "")
    231                f.height .value = t .preloadIm g.height;
    232       },
    233  
    234       getIma geData : f unction()  {
    235           va r f = docu ment.forms [0];
    236  
    237           th is.preload Img = new  Image();
    238           th is.preload Img.onload  = this.up dateImageD ata;
    239           th is.preload Img.onerro r = this.r esetImageD ata;
    240           th is.preload Img.src =  tinyMCEPop up.editor. documentBa seURI.toAb solute(f.s rc.value);
    241       }
    242   };
    243  
    244   ImageDialo g.preInit( );
    245   tinyMCEPop up.onInit. add(ImageD ialog.init , ImageDia log);