381. File Comparison Report

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

381.1 Files compared

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

381.2 Comparison summary

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

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

381.4 Active regular expressions

No regular expressions were active.

381.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( ed) {
    12           va r f = docu ment.forms [0], nl =  f.elements , ed = tin yMCEPopup. editor, do m = ed.dom , n = ed.s election.g etNode();
    13  
    14           ti nyMCEPopup .resizeToI nnerSize() ;
    15           th is.fillCla ssList('cl ass_list') ;
    16           th is.fillFil eList('src _list', 't inyMCEImag eList');
    17           th is.fillFil eList('ove r_list', ' tinyMCEIma geList');
    18           th is.fillFil eList('out _list', 't inyMCEImag eList');
    19  
    20           if  (n.nodeNa me == 'IMG ') {
    21                nl.src.v alue = dom .getAttrib (n, 'src') ;
    22                nl.width .value = d om.getAttr ib(n, 'wid th');
    23                nl.heigh t.value =  dom.getAtt rib(n, 'he ight');
    24                nl.alt.v alue = dom .getAttrib (n, 'alt') ;
    25                nl.title .value = d om.getAttr ib(n, 'tit le');
    26                nl.vspac e.value =  this.getAt trib(n, 'v space');
    27                nl.hspac e.value =  this.getAt trib(n, 'h space');
    28                nl.borde r.value =  this.getAt trib(n, 'b order');
    29                selectBy Value(f, ' align', th is.getAttr ib(n, 'ali gn'));
    30                selectBy Value(f, ' class_list ', dom.get Attrib(n,  'class'));
    31                nl.style .value = d om.getAttr ib(n, 'sty le');
    32                nl.id.va lue = dom. getAttrib( n, 'id');
    33                nl.dir.v alue = dom .getAttrib (n, 'dir') ;
    34                nl.lang. value = do m.getAttri b(n, 'lang ');
    35                nl.usema p.value =  dom.getAtt rib(n, 'us emap');
    36                nl.longd esc.value  = dom.getA ttrib(n, ' longdesc') ;
    37                nl.inser t.value =  ed.getLang ('update') ;
    38  
    39                if (/^\s *this.src\ s*=\s*\'([ ^\']+)\';? \s*$/.test (dom.getAt trib(n, 'o nmouseover ')))
    40                    nl.o nmouseover src.value  = dom.getA ttrib(n, ' onmouseove r').replac e(/^\s*thi s.src\s*=\ s*\'([^\'] +)\';?\s*$ /, '$1');
    41  
    42                if (/^\s *this.src\ s*=\s*\'([ ^\']+)\';? \s*$/.test (dom.getAt trib(n, 'o nmouseout' )))
    43                    nl.o nmouseouts rc.value =  dom.getAt trib(n, 'o nmouseout' ).replace( /^\s*this. src\s*=\s* \'([^\']+) \';?\s*$/,  '$1');
    44  
    45                if (ed.s ettings.in line_style s) {
    46                    // M ove attrib s to style s
    47                    if ( dom.getAtt rib(n, 'al ign'))
    48                         this.updat eStyle('al ign');
    49  
    50                    if ( dom.getAtt rib(n, 'hs pace'))
    51                         this.updat eStyle('hs pace');
    52  
    53                    if ( dom.getAtt rib(n, 'bo rder'))
    54                         this.updat eStyle('bo rder');
    55  
    56                    if ( dom.getAtt rib(n, 'vs pace'))
    57                         this.updat eStyle('vs pace');
    58                }
    59           }
    60  
    61           //  Setup bro wse button
    62           do cument.get ElementByI d('srcbrow sercontain er').inner HTML = get BrowserHTM L('srcbrow ser','src' ,'image',' theme_adva nced_image ');
    63           if  (isVisibl e('srcbrow ser'))
    64                document .getElemen tById('src ').style.w idth = '26 0px';
    65  
    66           //  Setup bro wse button
    67           do cument.get ElementByI d('onmouse oversrccon tainer').i nnerHTML =  getBrowse rHTML('ove rbrowser', 'onmouseov ersrc','im age','them e_advanced _image');
    68           if  (isVisibl e('overbro wser'))
    69                document .getElemen tById('onm ouseoversr c').style. width = '2 60px';
    70  
    71           //  Setup bro wse button
    72           do cument.get ElementByI d('onmouse outsrccont ainer').in nerHTML =  getBrowser HTML('outb rowser','o nmouseouts rc','image ','theme_a dvanced_im age');
    73           if  (isVisibl e('outbrow ser'))
    74                document .getElemen tById('onm ouseoutsrc ').style.w idth = '26 0px';
    75  
    76           //  If option  enabled d efault con train prop ortions to  checked
    77           if  (ed.getPa ram("advim age_constr ain_propor tions", tr ue))
    78                f.constr ain.checke d = true;
    79  
    80           //  Check swa p image if  valid dat a
    81           if  (nl.onmou seoversrc. value || n l.onmouseo utsrc.valu e)
    82                this.set SwapImage( true);
    83           el se
    84                this.set SwapImage( false);
    85  
    86           th is.changeA ppearance( );
    87           th is.showPre viewImage( nl.src.val ue, 1);
    88       },
    89  
    90       insert  : functio n(file, ti tle) {
    91           va r ed = tin yMCEPopup. editor, t  = this, f  = document .forms[0];
    92  
    93           if  (f.src.va lue === '' ) {
    94                if (ed.s election.g etNode().n odeName ==  'IMG') {
    95                    ed.d om.remove( ed.selecti on.getNode ());
    96                    ed.e xecCommand ('mceRepai nt');
    97                }
    98  
    99                tinyMCEP opup.close ();
    100                return;
    101           }
    102  
    103           if  (tinyMCEP opup.getPa ram("acces sibility_w arnings",  1)) {
    104                if (!f.a lt.value)  {
    105                    tiny MCEPopup.e ditor.wind owManager. confirm(ti nyMCEPopup .getLang(' advimage_d lg.missing _alt'), fu nction(s)  {
    106                         if (s)
    107                             t.inse rtAndClose ();
    108                    });
    109  
    110                    retu rn;
    111                }
    112           }
    113  
    114           t. insertAndC lose();
    115       },
    116  
    117       insert AndClose :  function( ) {
    118           va r ed = tin yMCEPopup. editor, f  = document .forms[0],  nl = f.el ements, v,  args = {} , el;
    119  
    120           ti nyMCEPopup .restoreSe lection();
    121  
    122           //  Fixes cra sh in Safa ri
    123           if  (tinymce. isWebKit)
    124                ed.getWi n().focus( );
    125  
    126           if  (!ed.sett ings.inlin e_styles)  {
    127                args = {
    128                    vspa ce : nl.vs pace.value ,
    129                    hspa ce : nl.hs pace.value ,
    130                    bord er : nl.bo rder.value ,
    131                    alig n : getSel ectValue(f , 'align')
    132                };
    133           }  else {
    134                // Remov e deprecat ed values
    135                args = {
    136                    vspa ce : '',
    137                    hspa ce : '',
    138                    bord er : '',
    139                    alig n : ''
    140                };
    141           }
    142  
    143           ti nymce.exte nd(args, {
    144                src : nl .src.value ,
    145                width :  nl.width.v alue,
    146                height :  nl.height .value,
    147                alt : nl .alt.value ,
    148                title :  nl.title.v alue,
    149                'class'  : getSelec tValue(f,  'class_lis t'),
    150                style :  nl.style.v alue,
    151                id : nl. id.value,
    152                dir : nl .dir.value ,
    153                lang : n l.lang.val ue,
    154                usemap :  nl.usemap .value,
    155                longdesc  : nl.long desc.value
    156           }) ;
    157  
    158           ar gs.onmouse over = arg s.onmouseo ut = '';
    159  
    160           if  (f.onmous emovecheck .checked)  {
    161                if (nl.o nmouseover src.value)
    162                    args .onmouseov er = "this .src='" +  nl.onmouse oversrc.va lue + "';" ;
    163  
    164                if (nl.o nmouseouts rc.value)
    165                    args .onmouseou t = "this. src='" + n l.onmouseo utsrc.valu e + "';";
    166           }
    167  
    168           el  = ed.sele ction.getN ode();
    169  
    170           if  (el && el .nodeName  == 'IMG')  {
    171                ed.dom.s etAttribs( el, args);
    172           }  else {
    173                ed.execC ommand('mc eInsertCon tent', fal se, '<img  id="__mce_ tmp" src=" javascript :;" />', { skip_undo  : 1});
    174                ed.dom.s etAttribs( '__mce_tmp ', args);
    175                ed.dom.s etAttrib(' __mce_tmp' , 'id', '' );
    176                ed.undoM anager.add ();
    177           }
    178  
    179           ti nyMCEPopup .close();
    180       },
    181  
    182       getAtt rib : func tion(e, at ) {
    183           va r ed = tin yMCEPopup. editor, do m = ed.dom , v, v2;
    184  
    185           if  (ed.setti ngs.inline _styles) {
    186                switch ( at) {
    187                    case  'align':
    188                         if (v = do m.getStyle (e, 'float '))
    189                             return  v;
    190  
    191                         if (v = do m.getStyle (e, 'verti cal-align' ))
    192                             return  v;
    193  
    194                         break;
    195  
    196                    case  'hspace':
    197                         v = dom.ge tStyle(e,  'margin-le ft')
    198                         v2 = dom.g etStyle(e,  'margin-r ight');
    199  
    200                         if (v && v  == v2)
    201                             return  parseInt( v.replace( /[^0-9]/g,  ''));
    202  
    203                         break;
    204  
    205                    case  'vspace':
    206                         v = dom.ge tStyle(e,  'margin-to p')
    207                         v2 = dom.g etStyle(e,  'margin-b ottom');
    208                         if (v && v  == v2)
    209                             return  parseInt( v.replace( /[^0-9]/g,  ''));
    210  
    211                         break;
    212  
    213                    case  'border':
    214                         v = 0;
    215  
    216                         tinymce.ea ch(['top',  'right',  'bottom',  'left'], f unction(sv ) {
    217                             sv = d om.getStyl e(e, 'bord er-' + sv  + '-width' );
    218  
    219                             // Fal se or not  the same a s prev
    220                             if (!s v || (sv ! = v && v ! == 0)) {
    221                                 v  = 0;
    222                                 re turn false ;
    223                             }
    224  
    225                             if (sv )
    226                                 v  = sv;
    227                         });
    228  
    229                         if (v)
    230                             return  parseInt( v.replace( /[^0-9]/g,  ''));
    231  
    232                         break;
    233                }
    234           }
    235  
    236           if  (v = dom. getAttrib( e, at))
    237                return v ;
    238  
    239           re turn '';
    240       },
    241  
    242       setSwa pImage : f unction(st ) {
    243           va r f = docu ment.forms [0];
    244  
    245           f. onmousemov echeck.che cked = st;
    246           se tBrowserDi sabled('ov erbrowser' , !st);
    247           se tBrowserDi sabled('ou tbrowser',  !st);
    248  
    249           if  (f.over_l ist)
    250                f.over_l ist.disabl ed = !st;
    251  
    252           if  (f.out_li st)
    253                f.out_li st.disable d = !st;
    254  
    255           f. onmouseove rsrc.disab led = !st;
    256           f. onmouseout src.disabl ed  = !st;
    257       },
    258  
    259       fillCl assList :  function(i d) {
    260           va r dom = ti nyMCEPopup .dom, lst  = dom.get( id), v, cl ;
    261  
    262           if  (v = tiny MCEPopup.g etParam('t heme_advan ced_styles ')) {
    263                cl = [];
    264  
    265                tinymce. each(v.spl it(';'), f unction(v)  {
    266                    var  p = v.spli t('=');
    267  
    268                    cl.p ush({'titl e' : p[0],  'class' :  p[1]});
    269                });
    270           }  else
    271                cl = tin yMCEPopup. editor.dom .getClasse s();
    272  
    273           if  (cl.lengt h > 0) {
    274                lst.opti ons[lst.op tions.leng th] = new  Option(tin yMCEPopup. getLang('n ot_set'),  '');
    275  
    276                tinymce. each(cl, f unction(o)  {
    277                    lst. options[ls t.options. length] =  new Option (o.title | | o['class '], o['cla ss']);
    278                });
    279           }  else
    280                dom.remo ve(dom.get Parent(id,  'tr'));
    281       },
    282  
    283       fillFi leList : f unction(id , l) {
    284           va r dom = ti nyMCEPopup .dom, lst  = dom.get( id), v, cl ;
    285  
    286           l  = window[l ];
    287  
    288           if  (l && l.l ength > 0)  {
    289                lst.opti ons[lst.op tions.leng th] = new  Option('',  '');
    290  
    291                tinymce. each(l, fu nction(o)  {
    292                    lst. options[ls t.options. length] =  new Option (o[0], o[1 ]);
    293                });
    294           }  else
    295                dom.remo ve(dom.get Parent(id,  'tr'));
    296       },
    297  
    298       resetI mageData :  function( ) {
    299           va r f = docu ment.forms [0];
    300  
    301           f. elements.w idth.value  = f.eleme nts.height .value = ' ';
    302       },
    303  
    304       update ImageData  : function (img, st)  {
    305           va r f = docu ment.forms [0];
    306  
    307           if  (!st) {
    308                f.elemen ts.width.v alue = img .width;
    309                f.elemen ts.height. value = im g.height;
    310           }
    311  
    312           th is.preload Img = img;
    313       },
    314  
    315       change Appearance  : functio n() {
    316           va r ed = tin yMCEPopup. editor, f  = document .forms[0],  img = doc ument.getE lementById ('alignSam pleImg');
    317  
    318           if  (img) {
    319                if (ed.g etParam('i nline_styl es')) {
    320                    ed.d om.setAttr ib(img, 's tyle', f.s tyle.value );
    321                } else {
    322                    img. align = f. align.valu e;
    323                    img. border = f .border.va lue;
    324                    img. hspace = f .hspace.va lue;
    325                    img. vspace = f .vspace.va lue;
    326                }
    327           }
    328       },
    329  
    330       change Height : f unction()  {
    331           va r f = docu ment.forms [0], tp, t  = this;
    332  
    333           if  (!f.const rain.check ed || !t.p reloadImg)  {
    334                return;
    335           }
    336  
    337           if  (f.width. value == " " || f.hei ght.value  == "")
    338                return;
    339  
    340           tp  = (parseI nt(f.width .value) /  parseInt(t .preloadIm g.width))  * t.preloa dImg.heigh t;
    341           f. height.val ue = tp.to Fixed(0);
    342       },
    343  
    344       change Width : fu nction() {
    345           va r f = docu ment.forms [0], tp, t  = this;
    346  
    347           if  (!f.const rain.check ed || !t.p reloadImg)  {
    348                return;
    349           }
    350  
    351           if  (f.width. value == " " || f.hei ght.value  == "")
    352                return;
    353  
    354           tp  = (parseI nt(f.heigh t.value) /  parseInt( t.preloadI mg.height) ) * t.prel oadImg.wid th;
    355           f. width.valu e = tp.toF ixed(0);
    356       },
    357  
    358       update Style : fu nction(ty)  {
    359           va r dom = ti nyMCEPopup .dom, st,  v, f = doc ument.form s[0], img  = dom.crea te('img',  {style : d om.get('st yle').valu e});
    360  
    361           if  (tinyMCEP opup.edito r.settings .inline_st yles) {
    362                // Handl e align
    363                if (ty = = 'align')  {
    364                    dom. setStyle(i mg, 'float ', '');
    365                    dom. setStyle(i mg, 'verti cal-align' , '');
    366  
    367                    v =  getSelectV alue(f, 'a lign');
    368                    if ( v) {
    369                         if (v == ' left' || v  == 'right ')
    370                             dom.se tStyle(img , 'float',  v);
    371                         else
    372                             img.st yle.vertic alAlign =  v;
    373                    }
    374                }
    375  
    376                // Handl e border
    377                if (ty = = 'border' ) {
    378                    dom. setStyle(i mg, 'borde r', '');
    379  
    380                    v =  f.border.v alue;
    381                    if ( v || v ==  '0') {
    382                         if (v == ' 0')
    383                             img.st yle.border  = '';
    384                         else
    385                             img.st yle.border  = v + 'px  solid bla ck';
    386                    }
    387                }
    388  
    389                // Handl e hspace
    390                if (ty = = 'hspace' ) {
    391                    dom. setStyle(i mg, 'margi nLeft', '' );
    392                    dom. setStyle(i mg, 'margi nRight', ' ');
    393  
    394                    v =  f.hspace.v alue;
    395                    if ( v) {
    396                         img.style. marginLeft  = v + 'px ';
    397                         img.style. marginRigh t = v + 'p x';
    398                    }
    399                }
    400  
    401                // Handl e vspace
    402                if (ty = = 'vspace' ) {
    403                    dom. setStyle(i mg, 'margi nTop', '') ;
    404                    dom. setStyle(i mg, 'margi nBottom',  '');
    405  
    406                    v =  f.vspace.v alue;
    407                    if ( v) {
    408                         img.style. marginTop  = v + 'px' ;
    409                         img.style. marginBott om = v + ' px';
    410                    }
    411                }
    412  
    413                // Merge
    414                dom.get( 'style').v alue = dom .serialize Style(dom. parseStyle (img.style .cssText)) ;
    415           }
    416       },
    417  
    418       change MouseMove  : function () {
    419       },
    420  
    421       showPr eviewImage  : functio n(u, st) {
    422           if  (!u) {
    423                tinyMCEP opup.dom.s etHTML('pr ev', '');
    424                return;
    425           }
    426  
    427           if  (!st && t inyMCEPopu p.getParam ("advimage _update_di mensions_o nchange",  true))
    428                this.res etImageDat a();
    429  
    430           u  = tinyMCEP opup.edito r.document BaseURI.to Absolute(u );
    431  
    432           if  (!st)
    433                tinyMCEP opup.dom.s etHTML('pr ev', '<img  id="previ ewImg" src ="' + u +  '" border= "0" onload ="ImageDia log.update ImageData( this);" on error="Ima geDialog.r esetImageD ata();" /> ');
    434           el se
    435                tinyMCEP opup.dom.s etHTML('pr ev', '<img  id="previ ewImg" src ="' + u +  '" border= "0" onload ="ImageDia log.update ImageData( this, 1);"  />');
    436       }
    437   };
    438  
    439   ImageDialo g.preInit( );
    440   tinyMCEPop up.onInit. add(ImageD ialog.init , ImageDia log);