667. File Comparison Report

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

667.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\plugins\tiny_mce\utils form_utils.js Thu Sep 20 08:58:52 2007 UTC
2 Dolphin-v.6.1.0\plugins\tiny_mce\utils form_utils.js Thu Mar 27 13:53:24 2008 UTC

667.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 19 336
Changed 16 67
Inserted 1 1
Removed 1 5

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

667.4 Active regular expressions

No regular expressions were active.

667.5 Comparison detail

1   /**   1   /**
2     *   $Id:   form_utils .js   1 6 2   200 7 -0 1 -0 3   1 6 : 1
6: 5 2
Z   spocke   $
  2     *   $Id:   form_utils .js  
6 73   200 8 -0 3 -0
6  
1 3:2 6:
2 0 Z   spocke   $
3    *   3    *
4    * Various  form util itiy funct ions.   4    * Various  form util itiy funct ions.
5    *   5    *
6    * @author  Moxiecode   6    * @author  Moxiecode
7     *   @copyright   Copyright   ©   2004-200 7 ,   Moxiecode   Systems   AB,   All   rights   reserved.   7     *   @copyright   Copyright   ©   2004-200 8 ,   Moxiecode   Systems   AB,   All   rights   reserved.
8    */   8    */
9     9  
10   var   themeBaseU RL   =   tinyMCE
.baseUR L   +   ' / themes/'   +   tinyMCE
.getParam( "theme")
;
  10   var   themeBaseU RL   =   tinyMCE Popup.edit or .baseUR I.toAbsolu te( '
themes/'   +   tinyMCE Popup .getParam( "theme") ) ;
11     11  
12   function g etColorPic kerHTML(id , target_f orm_elemen t) {   12   function g etColorPic kerHTML(id , target_f orm_elemen t) {
13       var h  = "";   13       var h  = "";
14     14  
15        h   +=   '<a   id="'   +   id   +   '_link"   href="java script: void(0) ;"   on
k eydown ="
pickColor( event,\''   +   target_for m_element   +'\');"   onmousedow n=" pickColor( event,\''   +   target_for m_element   +'\'); return   false;"
>';
  15        h   +=   '<a   id="'   +   id   +   '_link"   href="java script:
;"   on clic k
=" tinyMCEPop up. pickColor( event,\''   +   target_for m_element   +'\');"   onmousedow n="
return   false;"   class="pic kcolor" >';
16       h += ' <img id="'  + id + '"  src="' +  themeBaseU RL + '/ima ges/color. gif"';   16        h   +=   ' < s pan   id =" '   +   id   +   '"   t i t
l e ="'   +   tinyMCE Popup .getLang('
browse')   +   '" >< / span ></a>';
17       h += '  onmouseov er="this.c lassName=\ 'mceButton Over\'"';    
18       h += '  onmouseou t="this.cl assName=\' mceButtonN ormal\'"';    
19       h += '  onmousedo wn="this.c lassName=\ 'mceButton Down\'"';    
20       h += '  width="20 " height=" 16" border ="0" title ="' + tiny MCE.getLan g('lang_br owse') + ' "';    
21        h   +=   '   clas s
=" mceBu t
t onNormal"   a l t ="'   +   tinyMCE
.getLang(' lang_ browse')   +   '"  
/
></a>';
   
22     17  
23       return  h;   18       return  h;
24   }   19   }
25     20  
26   function p ickColor(e , target_f orm_elemen t) {    
27       if ((e .keyCode = = 32 || e. keyCode ==  13) || e. type == "m ousedown")    
28           ti nyMCEPopup .pickColor (e, target _form_elem ent);    
29   }    
30      
31   function u pdateColor (img_id, f orm_elemen t_id) {   21   function u pdateColor (img_id, f orm_elemen t_id) {
32       docume nt.getElem entById(im g_id).styl e.backgrou ndColor =  document.f orms[0].el ements[for m_element_ id].value;   22       docume nt.getElem entById(im g_id).styl e.backgrou ndColor =  document.f orms[0].el ements[for m_element_ id].value;
33   }   23   }
34     24  
35   function s etBrowserD isabled(id , state) {   25   function s etBrowserD isabled(id , state) {
36       var im g = docume nt.getElem entById(id );   26       var im g = docume nt.getElem entById(id );
37       var ln k = docume nt.getElem entById(id  + "_link" );   27       var ln k = docume nt.getElem entById(id  + "_link" );
38     28  
39       if (ln k) {   29       if (ln k) {
40           if  (state) {   30           if  (state) {
41                lnk.setA ttribute(" realhref",  lnk.getAt tribute("h ref"));   31                lnk.setA ttribute(" realhref",  lnk.getAt tribute("h ref"));
42                lnk.remo veAttribut e("href");   32                lnk.remo veAttribut e("href");
43                 tinyMCE
. switch Class(img,   ' mceButtonD isabled' ,   true );
  33                 tinyMCE Popup . dom.add Class(img,   ' d isabled'
);
44           }  else {   34           }  else {
    35                if (lnk. getAttribu te("realhr ef"))
45                lnk.setA ttribute(" href", lnk .getAttrib ute("realh ref"));   36                    lnk. setAttribu te("href",  lnk.getAt tribute("r ealhref")) ;
46                 tinyMCE
. switch Class(img,   ' mceButtonN ormal',   f a
l s e
);
  37  
    38                 tinyMCE Popup . dom.remove Class(img,   ' dis a b l
e d' );
47           }   39           }
48       }   40       }
49   }   41   }
50     42  
51   function g etBrowserH TML(id, ta rget_form_ element, t ype, prefi x) {   43   function g etBrowserH TML(id, ta rget_form_ element, t ype, prefi x) {
52        var   option   =   prefix   +   "_"   +   type   +   "_browser_ callback"
;
  44        var   option   =   prefix   +   "_"   +   type   +   "_browser_ callback" ,   cb,   html ;
53       var cb  = tinyMCE .getParam( option, ti nyMCE.getP aram("file _browser_c allback")) ;    
54       if (cb  == null)    
55           re turn "";    
56     45  
57       var ht ml = "";   46       cb = t inyMCEPopu p.getParam (option, t inyMCEPopu p.getParam ("file_bro wser_callb ack"));
58     47  
59        html   +=   '<a   id="'   +   id   +   '_link"   href="java script:ope nBrow
er(\''   +   id   +   '\',\''   +   target_for m_element   +   '\',   \''   +   type   +   '\',\''   +   option   +   '\');"   onmousedow n="return   false;"
>';
  48       if (!c b)
60       html + = '<img id ="' + id +  '" src="'  + themeBa seURL + '/ images/bro wse.gif"';   49           re turn "";
61       html + = ' onmous eover="thi s.classNam e=\'mceBut tonOver\'; "';   50  
62       html + = ' onmous eout="this .className =\'mceButt onNormal\' ;"';   51       html =  "";
63       html + = ' onmous edown="thi s.classNam e=\'mceBut tonDown\'; "';   52        html   +=   '<a   id="'   +   id   +   '_link"   href="java script:ope nBrow s er(\''   +   id   +   '\',\''   +   target_for m_element   +   '\',   \''   +   type   +   '\',\''   +   option   +   '\');"   onmousedow n="return   false;"   class="bro wse" >';
64       html + = ' width= "20" heigh t="18" bor der="0" ti tle="' + t inyMCE.get Lang('lang _browse')  + '"';   53        html   +=   ' < s pan   id =" '   +   id   +   '"   t i t
l e ="'   +   tinyMCE Popup .getLang('
browse')   +   '" >< / span ></a>';
65        html   +=   '   clas s
=" mceBu t
t onNormal"   a l t ="'   +   tinyMCE
.getLang(' lang_ browse')   +   '"  
/
></a>';
   
66     54  
67       return  html;   55       return  html;
68   }   56   }
69     57  
70   function   openBrow
er(img_id,   target_for m_element,   type,   option)   {
  58   function   openBrow s er(img_id,   target_for m_element,   type,   option)   {
71       var im g = docume nt.getElem entById(im g_id);   59       var im g = docume nt.getElem entById(im g_id);
72     60  
73       if (im g.classNam e != "mceB uttonDisab led")   61       if (im g.classNam e != "mceB uttonDisab led")
74           ti nyMCEPopup .openBrows er(target_ form_eleme nt, type,  option);   62           ti nyMCEPopup .openBrows er(target_ form_eleme nt, type,  option);
75   }   63   }
76     64  
77   function s electByVal ue(form_ob j, field_n ame, value , add_cust om, ignore _case) {   65   function s electByVal ue(form_ob j, field_n ame, value , add_cust om, ignore _case) {
78       if (!f orm_obj ||  !form_obj .elements[ field_name ])   66       if (!f orm_obj ||  !form_obj .elements[ field_name ])
79           re turn;   67           re turn;
80     68  
81       var se l = form_o bj.element s[field_na me];   69       var se l = form_o bj.element s[field_na me];
82     70  
83       var fo und = fals e;   71       var fo und = fals e;
84       for (v ar i=0; i< sel.option s.length;  i++) {   72       for (v ar i=0; i< sel.option s.length;  i++) {
85           va r option =  sel.optio ns[i];   73           va r option =  sel.optio ns[i];
86     74  
87           if  (option.v alue == va lue || (ig nore_case  && option. value.toLo werCase()  == value.t oLowerCase ())) {   75           if  (option.v alue == va lue || (ig nore_case  && option. value.toLo werCase()  == value.t oLowerCase ())) {
88                option.s elected =  true;   76                option.s elected =  true;
89                found =  true;   77                found =  true;
90           }  else   78           }  else
91                option.s elected =  false;   79                option.s elected =  false;
92       }   80       }
93     81  
94       if (!f ound && ad d_custom & & value !=  '') {   82       if (!f ound && ad d_custom & & value !=  '') {
95           va r option =  new Optio n(value, v alue);   83           va r option =  new Optio n(value, v alue);
96           op tion.selec ted = true ;   84           op tion.selec ted = true ;
97           se l.options[ sel.option s.length]  = option;   85           se l.options[ sel.option s.length]  = option;
98           se l.selected Index = se l.options. length - 1 ;   86           se l.selected Index = se l.options. length - 1 ;
99       }   87       }
100     88  
101       return  found;   89       return  found;
102   }   90   }
103     91  
104   function g etSelectVa lue(form_o bj, field_ name) {   92   function g etSelectVa lue(form_o bj, field_ name) {
105       var el m = form_o bj.element s[field_na me];   93       var el m = form_o bj.element s[field_na me];
106     94  
107       if (el m == null  || elm.opt ions == nu ll)   95       if (el m == null  || elm.opt ions == nu ll)
108           re turn "";   96           re turn "";
109     97  
110       return  elm.optio ns[elm.sel ectedIndex ].value;   98       return  elm.optio ns[elm.sel ectedIndex ].value;
111   }   99   }
112     100  
113   function a ddSelectVa lue(form_o bj, field_ name, name , value) {   101   function a ddSelectVa lue(form_o bj, field_ name, name , value) {
114       var s  = form_obj .elements[ field_name ];   102       var s  = form_obj .elements[ field_name ];
115       var o  = new Opti on(name, v alue);   103       var o  = new Opti on(name, v alue);
116       s.opti ons[s.opti ons.length ] = o;   104       s.opti ons[s.opti ons.length ] = o;
117   }   105   }
118     106  
119   function a ddClassesT oList(list _id, speci fic_option ) {   107   function a ddClassesT oList(list _id, speci fic_option ) {
120       // Set up class d roplist   108       // Set up class d roplist
121       var st yleSelectE lm = docum ent.getEle mentById(l ist_id);   109       var st yleSelectE lm = docum ent.getEle mentById(l ist_id);
122        var   styles   =   tinyMCE
.getParam( 'theme_adv anced_styl es',   false);
  110        var   styles   =   tinyMCE Popup .getParam( 'theme_adv anced_styl es',   false);
123        styles   =   tinyMCE
.getParam( specific_o ption,   styles);
  111        styles   =   tinyMCE Popup .getParam( specific_o ption,   styles);
124     112  
125       if (st yles) {   113       if (st yles) {
126           va r stylesAr  = styles. split(';') ;   114           va r stylesAr  = styles. split(';') ;
127     115  
128           fo r (var i=0 ; i<styles Ar.length;  i++) {   116           fo r (var i=0 ; i<styles Ar.length;  i++) {
129                if (styl esAr != "" ) {   117                if (styl esAr != "" ) {
130                    var  key, value ;   118                    var  key, value ;
131     119  
132                    key  = stylesAr [i].split( '=')[0];   120                    key  = stylesAr [i].split( '=')[0];
133                    valu e = styles Ar[i].spli t('=')[1];   121                    valu e = styles Ar[i].spli t('=')[1];
134     122  
135                    styl eSelectElm .options[s tyleSelect Elm.length ] = new Op tion(key,  value);   123                    styl eSelectElm .options[s tyleSelect Elm.length ] = new Op tion(key,  value);
136                }   124                }
137           }   125           }
138       } else  {   126       } else  {
139           //  Use auto  impored cl asses   127           ti nymce.each (tinyMCEPo pup.editor .dom.getCl asses(), f unction(o)  {
140           va r csses =  tinyMCE.ge tCSSClasse s(tinyMCE. getWindowA rg('editor _id'));   128                 styleSelec tElm.optio ns[styleSe lectElm.le ngth]   =   new   Option( o.title   ||   o[' c la ss ' ],   o[' c la ss ' ]);
141           fo r (var i=0 ; i<csses. length; i+ +)   129           }) ;
142                 styleSelec tElm.optio ns[styleSe lectElm.le ngth]   =   new   Option(
c
ss es[i ],  
c
ss es[i ]);
   
143       }   130       }
144   }   131   }
145     132  
146   function i sVisible(e lement_id)  {   133   function i sVisible(e lement_id)  {
147       var el m = docume nt.getElem entById(el ement_id);   134       var el m = docume nt.getElem entById(el ement_id);
148     135  
149       return  elm && el m.style.di splay != " none";   136       return  elm && el m.style.di splay != " none";
150   }   137   }
151     138  
152   function c onvertRGBT oHex(col)  {   139   function c onvertRGBT oHex(col)  {
153       var re  = new Reg Exp("rgb\\ s*\\(\\s*( [0-9]+).*, \\s*([0-9] +).*,\\s*( [0-9]+).*\ \)", "gi") ;   140       var re  = new Reg Exp("rgb\\ s*\\(\\s*( [0-9]+).*, \\s*([0-9] +).*,\\s*( [0-9]+).*\ \)", "gi") ;
154     141  
155       var rg b = col.re place(re,  "$1,$2,$3" ).split(', ');   142       var rg b = col.re place(re,  "$1,$2,$3" ).split(', ');
156       if (rg b.length = = 3) {   143       if (rg b.length = = 3) {
157           r  = parseInt (rgb[0]).t oString(16 );   144           r  = parseInt (rgb[0]).t oString(16 );
158           g  = parseInt (rgb[1]).t oString(16 );   145           g  = parseInt (rgb[1]).t oString(16 );
159           b  = parseInt (rgb[2]).t oString(16 );   146           b  = parseInt (rgb[2]).t oString(16 );
160     147  
161           r  = r.length  == 1 ? '0 ' + r : r;   148           r  = r.length  == 1 ? '0 ' + r : r;
162           g  = g.length  == 1 ? '0 ' + g : g;   149           g  = g.length  == 1 ? '0 ' + g : g;
163           b  = b.length  == 1 ? '0 ' + b : b;   150           b  = b.length  == 1 ? '0 ' + b : b;
164     151  
165           re turn "#" +  r + g + b ;   152           re turn "#" +  r + g + b ;
166       }   153       }
167     154  
168       return  col;   155       return  col;
169   }   156   }
170     157  
171   function c onvertHexT oRGB(col)  {   158   function c onvertHexT oRGB(col)  {
172       if (co l.indexOf( '#') != -1 ) {   159       if (co l.indexOf( '#') != -1 ) {
173           co l = col.re place(new  RegExp('[^ 0-9A-F]',  'gi'), '') ;   160           co l = col.re place(new  RegExp('[^ 0-9A-F]',  'gi'), '') ;
174     161  
175           r  = parseInt (col.subst ring(0, 2) , 16);   162           r  = parseInt (col.subst ring(0, 2) , 16);
176           g  = parseInt (col.subst ring(2, 4) , 16);   163           g  = parseInt (col.subst ring(2, 4) , 16);
177           b  = parseInt (col.subst ring(4, 6) , 16);   164           b  = parseInt (col.subst ring(4, 6) , 16);
178     165  
179           re turn "rgb( " + r + ", " + g + ", " + b + ") ";   166           re turn "rgb( " + r + ", " + g + ", " + b + ") ";
180       }   167       }
181     168  
182       return  col;   169       return  col;
183   }   170   }
184     171  
185   function t rimSize(si ze) {   172   function t rimSize(si ze) {
186        return   size.repla ce( new   RegExp ( ' [ ^ 0-9 % ] ',   'g i ' )
,   '
');
  173        return   size.repla ce( / (
[
0-9 \. ] +)px|(%| i n|cm|mm|em |ex|pt|pc ) / ,   ' $1$2 ');
187   }   174   }
188     175  
189   function g etCSSSize( size) {   176   function g etCSSSize( size) {
190       size =  trimSize( size);   177       size =  trimSize( size);
191     178  
192       if (si ze == "")   179       if (si ze == "")
193           re turn "";   180           re turn "";
194     181  
195       return  size.inde xOf('%') ! = -1 ? siz e : size +  "px";   182       // Add  px
    183       if (/^ [0-9]+$/.t est(size))
    184           si ze += 'px' ;
    185  
    186       return  size;
196   }   187   }
197     188  
198   function g etStyle(el m, attrib,  style) {   189   function g etStyle(el m, attrib,  style) {
199        var   val   =   tinyMCE
.getAttrib (elm,   attrib);
  190        var   val   =   tinyMCE Popup.dom .getAttrib (elm,   attrib);
200     191  
201       if (va l != '')   192       if (va l != '')
202           re turn '' +  val;   193           re turn '' +  val;
203     194  
204       if (ty peof(style ) == 'unde fined')   195       if (ty peof(style ) == 'unde fined')
205           st yle = attr ib;   196           st yle = attr ib;
206     197  
207       val =  eval('elm. style.' +  style);   198       return  tinyMCEPo pup.dom.ge tStyle(elm , style);
208      
209       return  val == nu ll ? '' :  '' + val;    
210   }   199   }