455. File Comparison Report

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

455.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\plugins\tiny_mce\plugins\fullpage editor_plugin_src.js Thu Sep 20 08:59:10 2007 UTC
2 Dolphin-v.6.1.0\plugins\tiny_mce\plugins\fullpage editor_plugin_src.js Thu Mar 27 13:53:26 2008 UTC

455.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 27 74
Changed 23 270
Inserted 1 1
Removed 3 12

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

455.4 Active regular expressions

No regular expressions were active.

455.5 Comparison detail

1   /**   1   /**
2     *   $Id:   editor_plu gin_src.js   2 32   2 00 7 -0 3 - 05   1 7 :00:
2 7 Z   spocke   $
  2     *   $Id:   editor_plu gin_src.js   59 3   2
00 8 -0 2 -
1 3   13 :00: 1 2
Z   spocke   $
3    *   3    *
4    * @author  Moxiecode   4    * @author  Moxiecode
5     *   @copyright   Copyright   ©   2004-200 7 ,   Moxiecode   Systems   AB,   All   rights   reserved.   5     *   @copyright   Copyright   ©   2004-200 8 ,   Moxiecode   Systems   AB,   All   rights   reserved.
6    */   6    */
7     7  
8   /* Import  plugin spe cific lang uage pack  */   8   (function( ) {
9   tinyMCE.im portPlugin LanguagePa ck('fullpa ge');   9       tinymc e.create(' tinymce.pl ugins.Full PagePlugin ', {
    10           in it : funct ion(ed, ur l) {
    11                var t =  this;
    12  
    13                t.editor  = ed;
    14  
    15                // Regis ter comman ds
    16                ed.addCo mmand('mce FullPagePr operties',  function( ) {
    17                    ed.w indowManag er.open({
    18                         file : url  + '/fullp age.htm',
    19                         width : 43 0 + parseI nt(ed.getL ang('fullp age.delta_ width', 0) ),
    20                         height : 4 95 + parse Int(ed.get Lang('full page.delta _height',  0)),
    21                         inline : 1
    22                    }, {
    23                         plugin_url  : url,
    24                         head_html  : t.head
    25                    });
    26                });
    27  
    28                // Regis ter button s
    29                ed.addBu tton('full page', {ti tle : 'ful lpage.desc ', cmd : ' mceFullPag ePropertie s'});
    30  
    31                ed.onBef oreSetCont ent.add(t. _setConten t, t);
    32                ed.onSet Content.ad d(t._setBo dyAttribs,  t);
    33                ed.onGet Content.ad d(t._getCo ntent, t);
    34           },
10     35  
11   var TinyMC E_FullPage Plugin = {    
12       getInf o : functi on() {   36           ge tInfo : fu nction() {
13           re turn {   37                return {
14                longname  : 'Fullpa ge',   38                    long name : 'Fu llpage',
15                author :  'Moxiecod e Systems  AB',   39                    auth or : 'Moxi ecode Syst ems AB',
16                authorur l : 'http: //tinymce. moxiecode. com',   40                    auth orurl : 'h ttp://tiny mce.moxiec ode.com',
17                infourl  : 'http:// wiki.moxie code.com/i ndex.php/T inyMCE:Plu gins/fullp age',   41                    info url : 'htt p://wiki.m oxiecode.c om/index.p hp/TinyMCE :Plugins/f ullpage',
18                 version   :   tiny MCE .majorVers ion   +   "."   +   tiny MCE .minorVers ion   42                     version   :   tiny mce .majorVers ion   +   "."   +   tiny mce .minorVers ion
19           };   43                };
20       },   44           },
21     45  
22       getCon trolHTML :  function( cn) {   46           //  Private p lugin inte rnal metho ds
23           sw itch (cn)  {    
24                case "fu llpage":    
25                    retu rn tinyMCE .getButton HTML(cn, ' lang_fullp age_desc',  '{$plugin url}/image s/fullpage .gif', 'mc eFullPageP roperties' );    
26           }    
27      
28           re turn "";    
29       },    
30      
31       execCo mmand : fu nction(edi tor_id, el ement, com mand, user _interface , value) {    
32           //  Handle co mmands    
33           sw itch (comm and) {    
34                case "mc eFullPageP roperties" :    
35                    var  template =  new Array ();    
36      
37                    temp late['file ']   = '.. /../plugin s/fullpage /fullpage. htm';    
38                    temp late['widt h']  = 430 ;    
39                    temp late['heig ht'] = 485  + (tinyMC E.isOpera  ? 5 : 0);    
40      
41                    temp late['widt h'] += tin yMCE.getLa ng('lang_f ullpage_de lta_width' , 0);    
42                    temp late['heig ht'] += ti nyMCE.getL ang('lang_ fullpage_d elta_heigh t', 0);    
43      
44                    tiny MCE.openWi ndow(templ ate, {edit or_id : ed itor_id, i nline : "y es"});    
45                return t rue;    
46      
47                case "mc eFullPageU pdate":    
48                    Tiny MCE_FullPa gePlugin._ addToHead( tinyMCE.ge tInstanceB yId(editor _id));    
49                    retu rn true;    
50          }    
51      
52          //  Pass to ne xt handler  in chain    
53          ret urn false;    
54       },    
55      
56       cleanu p : functi on(type, c ontent, in st) {    
57           sw itch (type ) {    
58                case "in sert_to_ed itor":    
59                    var  tmp = cont ent.toLowe rCase();    
60                    var  pos = tmp. indexOf('< body'), po s2;    
61      
62                    // S plit page  in header  and body c hunks    
63                    if ( pos != -1)  {    
64                         pos = tmp. indexOf('> ', pos);    
65                         pos2 = tmp .lastIndex Of('</body >');    
66                         inst.fullp ageTopCont ent = cont ent.substr ing(0, pos  + 1);    
67                         content =  content.su bstring(po s + 1, pos 2);    
68                         // tinyMCE .debug(ins t.fullpage TopContent , content) ;    
69                    } el se {    
70                         if (!inst. fullpageTo pContent)  {    
71                             var do cType = ti nyMCE.getP aram("full page_defau lt_doctype ", '<!DOCT YPE html P UBLIC "-/' +'/W3C//DT D XHTML 1. 0 Transiti onal/'+'/E N" "http:/ '+'/www.w3 .org/TR/xh tml1/DTD/x html1-tran sitional.d td">');    
72                             var en c = tinyMC E.getParam ("fullpage _default_e ncoding",  'utf-8');    
73                             var ti tle = tiny MCE.getPar am("fullpa ge_default _title", ' Untitled d ocument');    
74                             var la ng = tinyM CE.getPara m("fullpag e_default_ langcode",  'en');    
75                             var pi  = tinyMCE .getParam( "fullpage_ default_xm l_pi", tru e);    
76                             var ff  = tinyMCE .getParam( "fullpage_ default_fo nt_family" , "");    
77                             var fz  = tinyMCE .getParam( "fullpage_ default_fo nt_size",  "");    
78                             var ds  = tinyMCE .getParam( "fullpage_ default_st yle", "");    
79                             var dt c = tinyMC E.getParam ("fullpage _default_t ext_color" , "");    
80      
81                             // Xml  encode it    
82                             title  = title.re place(/&/g , '&amp;') ;    
83                             title  = title.re place(/\"/ g, '&quot; ');    
84                             title  = title.re place(/</g , '&lt;');    
85                             title  = title.re place(/>/g , '&gt;');    
86      
87                             tmp =  '';    
88      
89                             // Mak e default  chunk    
90                             if (pi )    
91                                 tm p += '<?xm l version= "1.0" enco ding="' +  enc + '"?> \n';    
92      
93                             tmp +=  docType +  '\n';    
94                             tmp +=  '<html xm lns="http: /'+'/www.w 3.org/1999 /xhtml" la ng="' + la ng + '" xm l:lang="'  + lang + ' ">\n';    
95                             tmp +=  '<head>\n ';    
96                             tmp +=  '\t<title >' + title  + '</titl e>\n';    
97                             tmp +=  '\t<meta  http-equiv ="Content- Type" cont ent="text/ html; char set=' + en c + '" />\ n';    
98                             tmp +=  '</head>\ n';    
99                             tmp +=  '<body';    
100      
101                             if (ff  != '' ||  fz != '')  {    
102                                 tm p += ' sty le="';    
103      
104                                 if  (ds != '' )    
105                                      tmp += d s + ";";    
106      
107                                 if  (ff != '' )    
108                                      tmp += ' font-famil y: ' + ff  + ";";    
109      
110                                 if  (fz != '' )    
111                                      tmp += ' font-size:  ' + fz +  ";";    
112     47  
113                                 tm p += '"';   48           _s etBodyAttr ibs : func tion(ed, o ) {
114                             }   49                var bdat tr, i, len , kv, k, v , t, attr  = this.hea d.match(/b ody(.*?)>/ i);
115     50  
116                             if (dt c != '')   51                if (attr  && attr[1 ]) {
117                                 tm p += ' tex t="' + dtc  + '"';   52                    bdat tr = attr[ 1].match(/ \s*(\w+\s* =\s*".*?"| \w+\s*=\s* '.*?'|\w+\ s*=\s*\w+| \w+)\s*/g) ;
118     53  
119                             tmp +=  '>\n';   54                    for( i = 0, len  = bdattr. length; i  < len; i++ ) {
    55                         kv = bdatt r[i].split ('=');
    56                         k = kv[0]. replace(/\ s/,'');
    57                         v = kv[1];
120     58  
121                             inst.f ullpageTop Content =  tmp;   59                         if (v) {
122                         }   60                             v = v. replace(/^ \s+/,'').r eplace(/\s +$/,'');
123                     }   61                             t = v. match(/^[" '](.*)["'] $/);
124     62  
125                    this ._addToHea d(inst);   63                             if (t)
    64                                 v  = t[1];
    65                         } else
    66                             v = k;
126     67  
127                    brea k;   68                         ed.dom.set Attrib(ed. getBody(),  'style',  v);
128      
129                case "ge t_from_edi tor":    
130                    if ( inst.fullp ageTopCont ent && !ti nyMCE.getP aram("full page_hide_ in_source_ view", fal se)) {    
131                         content =  content.re place(/(\s )?mce\_[a- z_]+\=[^\s >]+(\s|\>) /i, ''); / / Remove i nternal st uff    
132                         content =  inst.fullp ageTopCont ent + cont ent + "\n< /body>\n</ html>";    
133                    }   69                    }
134      
135                    brea k;    
136      
137                case "su bmit_conte nt":    
138                    if ( inst.fullp ageTopCont ent && tin yMCE.getPa ram("fullp age_hide_i n_source_v iew", fals e))    
139                         content =  inst.fullp ageTopCont ent + cont ent + "\n< /body>\n</ html>";    
140      
141                    brea k;    
142           }   70                }
143      
144           //  Pass thro ugh to nex t handler  in chain    
145           re turn conte nt;    
146       },   71           },
147     72  
148       // Pri vate plugi n internal  methods   73            _ cre a t e Seri a lizer   :   function(
)   {
149     74                return n ew tinymce .dom.Seria lizer({
150        _
a ddToH e
a d   :   function( inst )   {
  75                    dom  : this.edi tor.dom,
151           va r doc = in st.getDoc( );   76                    appl y_source_f ormatting  : true
152           va r head = d oc.getElem entsByTagN ame("head" )[0];   77                 });
153           va r body = d oc.body;   78           },
154           va r h = inst .fullpageT opContent;    
155           va r e = doc. createElem ent("body" );    
156           va r nl, i, l e, tmp;    
157  
   
158           //  Remove st uff we don 't want    
159           h  = h.replac e(/(\r|\n) /gi, '');    
160           h  = h.replac e(/<\?[^\> ]*\>/gi, ' ');    
161           h  = h.replac e(/<\/?(!D OCTYPE|hea d|html)[^\ >]*\>/gi,  '');    
162           h  = h.replac e(/<script (.*?)<\/sc ript>/gi,  '');    
163           h  = h.replac e(/<title( .*?)<\/tit le>/gi, '' );    
164           h  = h.replac e(/<(meta| base)[^>]* >/gi, '');    
165     79  
166           //  Make link  and style  elements  into pre   80           _s etContent  : function (ed, o) {
167           h  = h.replac e(/<link([ ^>]*)\/>/g i, '<pre m ce_type="l ink" $1></ pre>');   81                var t =  this, sp,  ep, c = o. content;
168           // h = h.repl ace(/<styl e([^>]*)>( .*?)<\/sty le>/gi, '< pre mce_ty pe="style"  $1>$2</pr e>');    
169     82  
170           //  Make body  a div   83                // Parse  out head,  body and  footer
171            h   =   h .replace(/ < body /gi,   '< div   mce_type=" body " ');   84                 c   =   c .replace(/ < (\/?)BODY /gi,   '< $1 body
');
172           h  += '</div> ';   85                sp = c.i ndexOf('<b ody');
173     86  
174           //  Now crapy  MSIE can  parse it   87                if (sp ! = -1) {
175           e. innerHTML  = h;   88                    sp =  c.indexOf ('>', sp);
    89                    t.he ad = c.sub string(0,  sp + 1);
176     90  
177           //  Reset all  body attr ibutes   91                    ep =  c.indexOf ('</body',  sp);
178           bo dy.vLink =  body.aLin k = body.l ink = body .text = '' ;   92                    if ( ep == -1)
179           bo dy.style.c ssText = ' ';   93                         ep = c.ind exOf('</bo dy', ep);
180     94  
181           //  Delete al l old link s   95                    o.co ntent = c. substring( sp + 1, ep );
182           nl  = head.ge tElementsB yTagName(' link');   96                    t.fo ot = c.sub string(ep) ;
183           fo r (i=0; i< nl.length;  i++) {    
184                if (tiny MCE.getAtt rib(nl[i],  'mce_head ') == "tru e")    
185                    nl[i ].parentNo de.removeC hild(nl[i] );    
186           }    
187     97  
188           //  Add link  elements   98                    func tion low(s ) {
189           nl  = e.getEl ementsByTa gName('pre ');   99                         return s.r eplace(/<\ /?[A-Z]+/g , function (a) {
190           fo r (i=0; i< nl.length;  i++) {   100                             return  a.toLower Case();
191                tmp = ti nyMCE.getA ttrib(nl[i ], 'media' );   101                         })
192                if (tiny MCE.getAtt rib(nl[i],  'mce_type ') == "lin k" && (tmp  == "" ||  tmp == "sc reen" || t mp == "all ") && tiny MCE.getAtt rib(nl[i],  'rel') ==  "styleshe et") {   102                    };
193                    le =  doc.creat eElement(" link");    
194  
   
195                    le.r el = "styl esheet";    
196                    le.h ref = tiny MCE.getAtt rib(nl[i],  'href');    
197                    le.s etAttribut e("mce_hea d", "true" );    
198     103  
199                    head .appendChi ld(le);   104                    t.he ad = low(t .head);
200                }
  105                    t.fo ot = low(t .foot);
    106                }  else {
    107                    t.he ad = '<!DO CTYPE html  PUBLIC "- //W3C//DTD  XHTML 1.0  Transitio nal//EN" " http://www .w3.org/TR /xhtml1/DT D/xhtml1-t ransitiona l.dtd">';
    108                    t.he ad += '\n< html>\n<he ad>\n<titl e>Untitled  document< /title>\n< /head>\n<b ody>\n';
    109                    t.fo ot = '\n</ body>\n</h tml>';
201           }   110                }
    111           },
202     112  
203           //  Add body  attributes   113           _g etContent  : function (ed, o) {
204           nl  = e.getEl ementsByTa gName('div ');   114                var t =  this;
205           if  (nl.lengt h > 0) {    
206                body.sty le.cssText  = tinyMCE .getAttrib (nl[0], 's tyle');    
207      
208                if ((tmp  = tinyMCE .getAttrib (nl[0], 'l eftmargin' )) != '' & & body.sty le.marginL eft == '')    
209                    body .style.mar ginLeft =  tmp + "px" ;    
210      
211                if ((tmp  = tinyMCE .getAttrib (nl[0], 'r ightmargin ')) != ''  && body.st yle.margin Right == ' ')    
212                    body .style.mar ginRight =  tmp + "px ";    
213      
214                if ((tmp  = tinyMCE .getAttrib (nl[0], 't opmargin') ) != '' &&  body.styl e.marginTo p == '')    
215                    body .style.mar ginTop = t mp + "px";    
216      
217                if ((tmp  = tinyMCE .getAttrib (nl[0], 'b ottommargi n')) != ''  && body.s tyle.margi nBottom ==  '')    
218                    body .style.mar ginBottom  = tmp + "p x";    
219      
220                body.dir  = tinyMCE .getAttrib (nl[0], 'd ir');    
221                body.vLi nk = tinyM CE.getAttr ib(nl[0],  'vlink');    
222                body.aLi nk = tinyM CE.getAttr ib(nl[0],  'alink');    
223                body.lin k = tinyMC E.getAttri b(nl[0], ' link');    
224                body.tex t = tinyMC E.getAttri b(nl[0], ' text');    
225      
226                if ((tmp  = tinyMCE .getAttrib (nl[0], 'b ackground' )) != '')    
227                    body .style.bac kgroundIma ge = "url( '" + tmp +  "')";    
228     115  
229                if ((tmp  = tinyMCE .getAttrib (nl[0], 'b gcolor'))  != '')   116                o.conten t = tinymc e.trim(t.h ead) + '\n ' + tinymc e.trim(o.c ontent) +  '\n' + tin ymce.trim( t.foot);
230                    body .style.bac kgroundCol or = tmp;    
231           }    
232       }   117           }
233   }
;
  118        } ) ;
234     119  
235   tiny MCE . add Plugin
( " fullpage " ,   T iny MCE_ FullPagePl ugin);
  120       // Reg ister plug in
    121        tiny mce .
Plugin Manager.ad d ( ' fullpage ' ,   t iny mce.plugin s. FullPagePl ugin);
    122   })();