544. File Comparison Report

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

544.1 Files compared

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

544.2 Comparison summary

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

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

544.4 Active regular expressions

No regular expressions were active.

544.5 Comparison detail

    1   tinyMCEPop up.require LangPack() ;
    2  
    3   var defaul tFonts = " " + 
    4       "Arial , Helvetic a, sans-se rif=Arial,  Helvetica , sans-ser if;" + 
    5       "Times  New Roman , Times, s erif=Times  New Roman , Times, s erif;" + 
    6       "Couri er New, Co urier, mon o=Courier  New, Couri er, mono;"  + 
    7       "Times  New Roman , Times, s erif=Times  New Roman , Times, s erif;" + 
    8       "Georg ia, Times  New Roman,  Times, se rif=Georgi a, Times N ew Roman,  Times, ser if;" + 
    9       "Verda na, Arial,  Helvetica , sans-ser if=Verdana , Arial, H elvetica,  sans-serif ;" + 
    10       "Genev a, Arial,  Helvetica,  sans-seri f=Geneva,  Arial, Hel vetica, sa ns-serif";
    11  
    12   var defaul tSizes = " 9;10;12;14 ;16;18;24; xx-small;x -small;sma ll;medium; large;x-la rge;xx-lar ge;smaller ;larger";
    13   var defaul tMeasureme nt = "+pix els=px;poi nts=pt;em; in;cm;mm;p icas;ems;e xs;%";
    14   var defaul tSpacingMe asurement  = "pixels= px;points= pt;in;cm;m m;picas;+e ms;exs;%";
    15   var defaul tIndentMea surement =  "pixels=p x;+points= pt;in;cm;m m;picas;em s;exs;%";
    16   var defaul tWeight =  "normal;bo ld;bolder; lighter;10 0;200;300; 400;500;60 0;700;800; 900";
    17   var defaul tTextStyle  = "normal ;italic;ob lique";
    18   var defaul tVariant =  "normal;s mall-caps" ;
    19   var defaul tLineHeigh t = "norma l";
    20   var defaul tAttachmen t = "fixed ;scroll";
    21   var defaul tRepeat =  "no-repeat ;repeat;re peat-x;rep eat-y";
    22   var defaul tPosH = "l eft;center ;right";
    23   var defaul tPosV = "t op;center; bottom";
    24   var defaul tVAlign =  "baseline; sub;super; top;text-t op;middle; bottom;tex t-bottom";
    25   var defaul tDisplay =  "inline;b lock;list- item;run-i n;compact; marker;tab le;inline- table;tabl e-row-grou p;table-he ader-group ;table-foo ter-group; table-row; table-colu mn-group;t able-colum n;table-ce ll;table-c aption;non e";
    26   var defaul tBorderSty le = "none ;solid;das hed;dotted ;double;gr oove;ridge ;inset;out set";
    27   var defaul tBorderWid th = "thin ;medium;th ick";
    28   var defaul tListType  = "disc;ci rcle;squar e;decimal; lower-roma n;upper-ro man;lower- alpha;uppe r-alpha;no ne";
    29  
    30   function i nit() {
    31       var ce  = documen t.getEleme ntById('co ntainer'),  h;
    32  
    33       ce.sty le.cssText  = tinyMCE Popup.getW indowArg(' style_text ');
    34  
    35       h = ge tBrowserHT ML('backgr ound_image _browser', 'backgroun d_image',' image','ad vimage');
    36       docume nt.getElem entById("b ackground_ image_brow ser").inne rHTML = h;
    37  
    38       docume nt.getElem entById('t ext_color_ pickcontai ner').inne rHTML = ge tColorPick erHTML('te xt_color_p ick','text _color');
    39       docume nt.getElem entById('b ackground_ color_pick container' ).innerHTM L = getCol orPickerHT ML('backgr ound_color _pick','ba ckground_c olor');
    40       docume nt.getElem entById('b order_colo r_top_pick container' ).innerHTM L = getCol orPickerHT ML('border _color_top _pick','bo rder_color _top');
    41       docume nt.getElem entById('b order_colo r_right_pi ckcontaine r').innerH TML = getC olorPicker HTML('bord er_color_r ight_pick' ,'border_c olor_right ');
    42       docume nt.getElem entById('b order_colo r_bottom_p ickcontain er').inner HTML = get ColorPicke rHTML('bor der_color_ bottom_pic k','border _color_bot tom');
    43       docume nt.getElem entById('b order_colo r_left_pic kcontainer ').innerHT ML = getCo lorPickerH TML('borde r_color_le ft_pick',' border_col or_left');
    44  
    45       fillSe lect(0, 't ext_font',  'style_fo nt', defau ltFonts, ' ;', true);
    46       fillSe lect(0, 't ext_size',  'style_fo nt_size',  defaultSiz es, ';', t rue);
    47       fillSe lect(0, 't ext_size_m easurement ', 'style_ font_size_ measuremen t', defaul tMeasureme nt, ';', t rue);
    48       fillSe lect(0, 't ext_case',  'style_te xt_case',  "capitaliz e;uppercas e;lowercas e", ';', t rue);
    49       fillSe lect(0, 't ext_weight ', 'style_ font_weigh t', defaul tWeight, ' ;', true);
    50       fillSe lect(0, 't ext_style' , 'style_f ont_style' , defaultT extStyle,  ';', true) ;
    51       fillSe lect(0, 't ext_varian t', 'style _font_vari ant', defa ultVariant , ';', tru e);
    52       fillSe lect(0, 't ext_linehe ight', 'st yle_font_l ine_height ', default LineHeight , ';', tru e);
    53       fillSe lect(0, 't ext_linehe ight_measu rement', ' style_font _line_heig ht_measure ment', def aultMeasur ement, ';' , true);
    54  
    55       fillSe lect(0, 'b ackground_ attachment ', 'style_ background _attachmen t', defaul tAttachmen t, ';', tr ue);
    56       fillSe lect(0, 'b ackground_ repeat', ' style_back ground_rep eat', defa ultRepeat,  ';', true );
    57  
    58       fillSe lect(0, 'b ackground_ hpos_measu rement', ' style_back ground_hpo s_measurem ent', defa ultMeasure ment, ';',  true);
    59       fillSe lect(0, 'b ackground_ vpos_measu rement', ' style_back ground_vpo s_measurem ent', defa ultMeasure ment, ';',  true);
    60  
    61       fillSe lect(0, 'b ackground_ hpos', 'st yle_backgr ound_hpos' , defaultP osH, ';',  true);
    62       fillSe lect(0, 'b ackground_ vpos', 'st yle_backgr ound_vpos' , defaultP osV, ';',  true);
    63  
    64       fillSe lect(0, 'b lock_words pacing', ' style_word spacing',  'normal',  ';', true) ;
    65       fillSe lect(0, 'b lock_words pacing_mea surement',  'style_wo rdspacing_ measuremen t', defaul tSpacingMe asurement,  ';', true );
    66       fillSe lect(0, 'b lock_lette rspacing',  'style_le tterspacin g', 'norma l', ';', t rue);
    67       fillSe lect(0, 'b lock_lette rspacing_m easurement ', 'style_ letterspac ing_measur ement', de faultSpaci ngMeasurem ent, ';',  true);
    68       fillSe lect(0, 'b lock_verti cal_alignm ent', 'sty le_vertica l_alignmen t', defaul tVAlign, ' ;', true);
    69       fillSe lect(0, 'b lock_text_ align', 's tyle_text_ align', "l eft;right; center;jus tify", ';' , true);
    70       fillSe lect(0, 'b lock_white space', 's tyle_white space', "n ormal;pre; nowrap", ' ;', true);
    71       fillSe lect(0, 'b lock_displ ay', 'styl e_display' , defaultD isplay, '; ', true);
    72       fillSe lect(0, 'b lock_text_ indent_mea surement',  'style_te xt_indent_ measuremen t', defaul tIndentMea surement,  ';', true) ;
    73  
    74       fillSe lect(0, 'b ox_width_m easurement ', 'style_ box_width_ measuremen t', defaul tMeasureme nt, ';', t rue);
    75       fillSe lect(0, 'b ox_height_ measuremen t', 'style _box_heigh t_measurem ent', defa ultMeasure ment, ';',  true);
    76       fillSe lect(0, 'b ox_float',  'style_fl oat', 'lef t;right;no ne', ';',  true);
    77       fillSe lect(0, 'b ox_clear',  'style_cl ear', 'lef t;right;bo th;none',  ';', true) ;
    78       fillSe lect(0, 'b ox_padding _left_meas urement',  'style_pad ding_left_ measuremen t', defaul tMeasureme nt, ';', t rue);
    79       fillSe lect(0, 'b ox_padding _top_measu rement', ' style_padd ing_top_me asurement' , defaultM easurement , ';', tru e);
    80       fillSe lect(0, 'b ox_padding _bottom_me asurement' , 'style_p adding_bot tom_measur ement', de faultMeasu rement, '; ', true);
    81       fillSe lect(0, 'b ox_padding _right_mea surement',  'style_pa dding_righ t_measurem ent', defa ultMeasure ment, ';',  true);
    82       fillSe lect(0, 'b ox_margin_ left_measu rement', ' style_marg in_left_me asurement' , defaultM easurement , ';', tru e);
    83       fillSe lect(0, 'b ox_margin_ top_measur ement', 's tyle_margi n_top_meas urement',  defaultMea surement,  ';', true) ;
    84       fillSe lect(0, 'b ox_margin_ bottom_mea surement',  'style_ma rgin_botto m_measurem ent', defa ultMeasure ment, ';',  true);
    85       fillSe lect(0, 'b ox_margin_ right_meas urement',  'style_mar gin_right_ measuremen t', defaul tMeasureme nt, ';', t rue);
    86  
    87       fillSe lect(0, 'b order_styl e_top', 's tyle_borde r_style_to p', defaul tBorderSty le, ';', t rue);
    88       fillSe lect(0, 'b order_styl e_right',  'style_bor der_style_ right', de faultBorde rStyle, '; ', true);
    89       fillSe lect(0, 'b order_styl e_bottom',  'style_bo rder_style _bottom',  defaultBor derStyle,  ';', true) ;
    90       fillSe lect(0, 'b order_styl e_left', ' style_bord er_style_l eft', defa ultBorderS tyle, ';',  true);
    91  
    92       fillSe lect(0, 'b order_widt h_top', 's tyle_borde r_width_to p', defaul tBorderWid th, ';', t rue);
    93       fillSe lect(0, 'b order_widt h_right',  'style_bor der_width_ right', de faultBorde rWidth, '; ', true);
    94       fillSe lect(0, 'b order_widt h_bottom',  'style_bo rder_width _bottom',  defaultBor derWidth,  ';', true) ;
    95       fillSe lect(0, 'b order_widt h_left', ' style_bord er_width_l eft', defa ultBorderW idth, ';',  true);
    96  
    97       fillSe lect(0, 'b order_widt h_top_meas urement',  'style_bor der_width_ top_measur ement', de faultMeasu rement, '; ', true);
    98       fillSe lect(0, 'b order_widt h_right_me asurement' , 'style_b order_widt h_right_me asurement' , defaultM easurement , ';', tru e);
    99       fillSe lect(0, 'b order_widt h_bottom_m easurement ', 'style_ border_wid th_bottom_ measuremen t', defaul tMeasureme nt, ';', t rue);
    100       fillSe lect(0, 'b order_widt h_left_mea surement',  'style_bo rder_width _left_meas urement',  defaultMea surement,  ';', true) ;
    101  
    102       fillSe lect(0, 'l ist_type',  'style_li st_type',  defaultLis tType, ';' , true);
    103       fillSe lect(0, 'l ist_positi on', 'styl e_list_pos ition', "i nside;outs ide", ';',  true);
    104  
    105       fillSe lect(0, 'p ositioning _type', 's tyle_posit ioning_typ e', "absol ute;relati ve;static" , ';', tru e);
    106       fillSe lect(0, 'p ositioning _visibilit y', 'style _positioni ng_visibil ity', "inh erit;visib le;hidden" , ';', tru e);
    107  
    108       fillSe lect(0, 'p ositioning _width_mea surement',  'style_po sitioning_ width_meas urement',  defaultMea surement,  ';', true) ;
    109       fillSe lect(0, 'p ositioning _height_me asurement' , 'style_p ositioning _height_me asurement' , defaultM easurement , ';', tru e);
    110       fillSe lect(0, 'p ositioning _overflow' , 'style_p ositioning _overflow' , "visible ;hidden;sc roll;auto" , ';', tru e);
    111  
    112       fillSe lect(0, 'p ositioning _placement _top_measu rement', ' style_posi tioning_pl acement_to p_measurem ent', defa ultMeasure ment, ';',  true);
    113       fillSe lect(0, 'p ositioning _placement _right_mea surement',  'style_po sitioning_ placement_ right_meas urement',  defaultMea surement,  ';', true) ;
    114       fillSe lect(0, 'p ositioning _placement _bottom_me asurement' , 'style_p ositioning _placement _bottom_me asurement' , defaultM easurement , ';', tru e);
    115       fillSe lect(0, 'p ositioning _placement _left_meas urement',  'style_pos itioning_p lacement_l eft_measur ement', de faultMeasu rement, '; ', true);
    116  
    117       fillSe lect(0, 'p ositioning _clip_top_ measuremen t', 'style _positioni ng_clip_to p_measurem ent', defa ultMeasure ment, ';',  true);
    118       fillSe lect(0, 'p ositioning _clip_righ t_measurem ent', 'sty le_positio ning_clip_ right_meas urement',  defaultMea surement,  ';', true) ;
    119       fillSe lect(0, 'p ositioning _clip_bott om_measure ment', 'st yle_positi oning_clip _bottom_me asurement' , defaultM easurement , ';', tru e);
    120       fillSe lect(0, 'p ositioning _clip_left _measureme nt', 'styl e_position ing_clip_l eft_measur ement', de faultMeasu rement, '; ', true);
    121  
    122       TinyMC E_Editable Selects.in it();
    123       setupF ormData();
    124       showDi sabledCont rols();
    125   }
    126  
    127   function s etupFormDa ta() {
    128       var ce  = documen t.getEleme ntById('co ntainer'),  f = docum ent.forms[ 0], s, b,  i;
    129  
    130       // Set up text fi elds
    131  
    132       select ByValue(f,  'text_fon t', ce.sty le.fontFam ily, true,  true);
    133       select ByValue(f,  'text_siz e', getNum (ce.style. fontSize),  true, tru e);
    134       select ByValue(f,  'text_siz e_measurem ent', getM easurement (ce.style. fontSize)) ;
    135       select ByValue(f,  'text_wei ght', ce.s tyle.fontW eight, tru e, true);
    136       select ByValue(f,  'text_sty le', ce.st yle.fontSt yle, true,  true);
    137       select ByValue(f,  'text_lin eheight',  getNum(ce. style.line Height), t rue, true) ;
    138       select ByValue(f,  'text_lin eheight_me asurement' , getMeasu rement(ce. style.line Height));
    139       select ByValue(f,  'text_cas e', ce.sty le.textTra nsform, tr ue, true);
    140       select ByValue(f,  'text_var iant', ce. style.font Variant, t rue, true) ;
    141       f.text _color.val ue = tinyM CEPopup.ed itor.dom.t oHex(ce.st yle.color) ;
    142       update Color('tex t_color_pi ck', 'text _color');
    143       f.text _underline .checked =  inStr(ce. style.text Decoration , 'underli ne');
    144       f.text _overline. checked =  inStr(ce.s tyle.textD ecoration,  'overline ');
    145       f.text _linethrou gh.checked  = inStr(c e.style.te xtDecorati on, 'line- through');
    146       f.text _blink.che cked = inS tr(ce.styl e.textDeco ration, 'b link');
    147  
    148       // Set up backgro und fields
    149  
    150       f.back ground_col or.value =  tinyMCEPo pup.editor .dom.toHex (ce.style. background Color);
    151       update Color('bac kground_co lor_pick',  'backgrou nd_color') ;
    152       f.back ground_ima ge.value =  ce.style. background Image.repl ace(new Re gExp("url\ \('?([^']* )'?\\)", ' gi'), "$1" );
    153       select ByValue(f,  'backgrou nd_repeat' , ce.style .backgroun dRepeat, t rue, true) ;
    154       select ByValue(f,  'backgrou nd_attachm ent', ce.s tyle.backg roundAttac hment, tru e, true);
    155       select ByValue(f,  'backgrou nd_hpos',  getNum(get Val(ce.sty le.backgro undPositio n, 0)), tr ue, true);
    156       select ByValue(f,  'backgrou nd_hpos_me asurement' , getMeasu rement(get Val(ce.sty le.backgro undPositio n, 0)));
    157       select ByValue(f,  'backgrou nd_vpos',  getNum(get Val(ce.sty le.backgro undPositio n, 1)), tr ue, true);
    158       select ByValue(f,  'backgrou nd_vpos_me asurement' , getMeasu rement(get Val(ce.sty le.backgro undPositio n, 1)));
    159  
    160       // Set up block f ields
    161  
    162       select ByValue(f,  'block_wo rdspacing' , getNum(c e.style.wo rdSpacing) , true, tr ue);
    163       select ByValue(f,  'block_wo rdspacing_ measuremen t', getMea surement(c e.style.wo rdSpacing) );
    164       select ByValue(f,  'block_le tterspacin g', getNum (ce.style. letterSpac ing), true , true);
    165       select ByValue(f,  'block_le tterspacin g_measurem ent', getM easurement (ce.style. letterSpac ing));
    166       select ByValue(f,  'block_ve rtical_ali gnment', c e.style.ve rticalAlig n, true, t rue);
    167       select ByValue(f,  'block_te xt_align',  ce.style. textAlign,  true, tru e);
    168       f.bloc k_text_ind ent.value  = getNum(c e.style.te xtIndent);
    169       select ByValue(f,  'block_te xt_indent_ measuremen t', getMea surement(c e.style.te xtIndent)) ;
    170       select ByValue(f,  'block_wh itespace',  ce.style. whiteSpace , true, tr ue);
    171       select ByValue(f,  'block_di splay', ce .style.dis play, true , true);
    172  
    173       // Set up box fie lds
    174  
    175       f.box_ width.valu e = getNum (ce.style. width);
    176       select ByValue(f,  'box_widt h_measurem ent', getM easurement (ce.style. width));
    177  
    178       f.box_ height.val ue = getNu m(ce.style .height);
    179       select ByValue(f,  'box_heig ht_measure ment', get Measuremen t(ce.style .height));
    180  
    181       if (ti nymce.isGe cko)
    182           se lectByValu e(f, 'box_ float', ce .style.css Float, tru e, true);
    183       else
    184           se lectByValu e(f, 'box_ float', ce .style.sty leFloat, t rue, true) ;
    185  
    186       select ByValue(f,  'box_clea r', ce.sty le.clear,  true, true );
    187  
    188       setupB ox(f, ce,  'box_paddi ng', 'padd ing', '');
    189       setupB ox(f, ce,  'box_margi n', 'margi n', '');
    190  
    191       // Set up border  fields
    192  
    193       setupB ox(f, ce,  'border_st yle', 'bor der', 'Sty le');
    194       setupB ox(f, ce,  'border_wi dth', 'bor der', 'Wid th');
    195       setupB ox(f, ce,  'border_co lor', 'bor der', 'Col or');
    196  
    197       update Color('bor der_color_ top_pick',  'border_c olor_top') ;
    198       update Color('bor der_color_ right_pick ', 'border _color_rig ht');
    199       update Color('bor der_color_ bottom_pic k', 'borde r_color_bo ttom');
    200       update Color('bor der_color_ left_pick' , 'border_ color_left ');
    201  
    202       f.elem ents.borde r_color_to p.value =  tinyMCEPop up.editor. dom.toHex( f.elements .border_co lor_top.va lue);
    203       f.elem ents.borde r_color_ri ght.value  = tinyMCEP opup.edito r.dom.toHe x(f.elemen ts.border_ color_righ t.value);
    204       f.elem ents.borde r_color_bo ttom.value  = tinyMCE Popup.edit or.dom.toH ex(f.eleme nts.border _color_bot tom.value) ;
    205       f.elem ents.borde r_color_le ft.value =  tinyMCEPo pup.editor .dom.toHex (f.element s.border_c olor_left. value);
    206  
    207       // Set up list fi elds
    208  
    209       select ByValue(f,  'list_typ e', ce.sty le.listSty leType, tr ue, true);
    210       select ByValue(f,  'list_pos ition', ce .style.lis tStylePosi tion, true , true);
    211       f.list _bullet_im age.value  = ce.style .listStyle Image.repl ace(new Re gExp("url\ \('?([^']* )'?\\)", ' gi'), "$1" );
    212  
    213       // Set up box fie lds
    214  
    215       select ByValue(f,  'position ing_type',  ce.style. position,  true, true );
    216       select ByValue(f,  'position ing_visibi lity', ce. style.visi bility, tr ue, true);
    217       select ByValue(f,  'position ing_overfl ow', ce.st yle.overfl ow, true,  true);
    218       f.posi tioning_zi ndex.value  = ce.styl e.zIndex ?  ce.style. zIndex : " ";
    219  
    220       f.posi tioning_wi dth.value  = getNum(c e.style.wi dth);
    221       select ByValue(f,  'position ing_width_ measuremen t', getMea surement(c e.style.wi dth));
    222  
    223       f.posi tioning_he ight.value  = getNum( ce.style.h eight);
    224       select ByValue(f,  'position ing_height _measureme nt', getMe asurement( ce.style.h eight));
    225  
    226       setupB ox(f, ce,  'positioni ng_placeme nt', '', ' ', new Arr ay('top',  'right', ' bottom', ' left'));
    227  
    228       s = ce .style.cli p.replace( new RegExp ("rect\\(' ?([^']*)'? \\)", 'gi' ), "$1");
    229       s = s. replace(/, /g, ' ');
    230  
    231       if (!h asEqualVal ues(new Ar ray(getVal (s, 0), ge tVal(s, 1) , getVal(s , 2), getV al(s, 3))) ) {
    232           f. positionin g_clip_top .value = g etNum(getV al(s, 0));
    233           se lectByValu e(f, 'posi tioning_cl ip_top_mea surement',  getMeasur ement(getV al(s, 0))) ;
    234           f. positionin g_clip_rig ht.value =  getNum(ge tVal(s, 1) );
    235           se lectByValu e(f, 'posi tioning_cl ip_right_m easurement ', getMeas urement(ge tVal(s, 1) ));
    236           f. positionin g_clip_bot tom.value  = getNum(g etVal(s, 2 ));
    237           se lectByValu e(f, 'posi tioning_cl ip_bottom_ measuremen t', getMea surement(g etVal(s, 2 )));
    238           f. positionin g_clip_lef t.value =  getNum(get Val(s, 3)) ;
    239           se lectByValu e(f, 'posi tioning_cl ip_left_me asurement' , getMeasu rement(get Val(s, 3)) );
    240       } else  {
    241           f. positionin g_clip_top .value = g etNum(getV al(s, 0));
    242           se lectByValu e(f, 'posi tioning_cl ip_top_mea surement',  getMeasur ement(getV al(s, 0))) ;
    243           f. positionin g_clip_rig ht.value =  f.positio ning_clip_ bottom.val ue = f.pos itioning_c lip_left.v alue;
    244       }
    245  
    246   //  setupB ox(f, ce,  '', 'borde r', 'Color ');
    247   }
    248  
    249   function g etMeasurem ent(s) {
    250       return  s.replace (/^([0-9]+ )(.*)$/, " $2");
    251   }
    252  
    253   function g etNum(s) {
    254       if (ne w RegExp(' ^[0-9]+[a- z%]+$', 'g i').test(s ))
    255           re turn s.rep lace(/[^0- 9]/g, '');
    256  
    257       return  s;
    258   }
    259  
    260   function i nStr(s, n)  {
    261       return  new RegEx p(n, 'gi') .test(s);
    262   }
    263  
    264   function g etVal(s, i ) {
    265       var a  = s.split( ' ');
    266  
    267       if (a. length > 1 )
    268           re turn a[i];
    269  
    270       return  "";
    271   }
    272  
    273   function s etValue(f,  n, v) {
    274       if (f. elements[n ].type ==  "text")
    275           f. elements[n ].value =  v;
    276       else
    277           se lectByValu e(f, n, v,  true, tru e);
    278   }
    279  
    280   function s etupBox(f,  ce, fp, p r, sf, b)  {
    281       if (ty peof(b) ==  "undefine d")
    282           b  = new Arra y('Top', ' Right', 'B ottom', 'L eft');
    283  
    284       if (is Same(ce, p r, sf, b))  {
    285           f. elements[f p + "_same "].checked  = true;
    286  
    287           se tValue(f,  fp + "_top ", getNum( ce.style[p r + b[0] +  sf]));
    288           f. elements[f p + "_top" ].disabled  = false;
    289  
    290           f. elements[f p + "_righ t"].value  = "";
    291           f. elements[f p + "_righ t"].disabl ed = true;
    292           f. elements[f p + "_bott om"].value  = "";
    293           f. elements[f p + "_bott om"].disab led = true ;
    294           f. elements[f p + "_left "].value =  "";
    295           f. elements[f p + "_left "].disable d = true;
    296  
    297           if  (f.elemen ts[fp + "_ top_measur ement"]) {
    298                selectBy Value(f, f p + '_top_ measuremen t', getMea surement(c e.style[pr  + b[0] +  sf]));
    299                f.elemen ts[fp + "_ left_measu rement"].d isabled =  true;
    300                f.elemen ts[fp + "_ bottom_mea surement"] .disabled  = true;
    301                f.elemen ts[fp + "_ right_meas urement"]. disabled =  true;
    302           }
    303       } else  {
    304           f. elements[f p + "_same "].checked  = false;
    305  
    306           se tValue(f,  fp + "_top ", getNum( ce.style[p r + b[0] +  sf]));
    307           f. elements[f p + "_top" ].disabled  = false;
    308  
    309           se tValue(f,  fp + "_rig ht", getNu m(ce.style [pr + b[1]  + sf]));
    310           f. elements[f p + "_righ t"].disabl ed = false ;
    311  
    312           se tValue(f,  fp + "_bot tom", getN um(ce.styl e[pr + b[2 ] + sf]));
    313           f. elements[f p + "_bott om"].disab led = fals e;
    314  
    315           se tValue(f,  fp + "_lef t", getNum (ce.style[ pr + b[3]  + sf]));
    316           f. elements[f p + "_left "].disable d = false;
    317  
    318           if  (f.elemen ts[fp + "_ top_measur ement"]) {
    319                selectBy Value(f, f p + '_top_ measuremen t', getMea surement(c e.style[pr  + b[0] +  sf]));
    320                selectBy Value(f, f p + '_righ t_measurem ent', getM easurement (ce.style[ pr + b[1]  + sf]));
    321                selectBy Value(f, f p + '_bott om_measure ment', get Measuremen t(ce.style [pr + b[2]  + sf]));
    322                selectBy Value(f, f p + '_left _measureme nt', getMe asurement( ce.style[p r + b[3] +  sf]));
    323                f.elemen ts[fp + "_ left_measu rement"].d isabled =  false;
    324                f.elemen ts[fp + "_ bottom_mea surement"] .disabled  = false;
    325                f.elemen ts[fp + "_ right_meas urement"]. disabled =  false;
    326           }
    327       }
    328   }
    329  
    330   function i sSame(e, p r, sf, b)  {
    331       var a  = new Arra y(), i, x;
    332  
    333       if (ty peof(b) ==  "undefine d")
    334           b  = new Arra y('Top', ' Right', 'B ottom', 'L eft');
    335  
    336       if (ty peof(sf) = = "undefin ed" || sf  == null)
    337           sf  = "";
    338  
    339       a[0] =  e.style[p r + b[0] +  sf];
    340       a[1] =  e.style[p r + b[1] +  sf];
    341       a[2] =  e.style[p r + b[2] +  sf];
    342       a[3] =  e.style[p r + b[3] +  sf];
    343  
    344       for (i =0; i<a.le ngth; i++)  {
    345           if  (a[i] ==  null)
    346                return f alse;
    347  
    348           fo r (x=0; x< a.length;  x++) {
    349                if (a[x]  != a[i])
    350                    retu rn false;
    351           }
    352       }
    353  
    354       return  true;
    355   };
    356  
    357   function h asEqualVal ues(a) {
    358       var i,  x;
    359  
    360       for (i =0; i<a.le ngth; i++)  {
    361           if  (a[i] ==  null)
    362                return f alse;
    363  
    364           fo r (x=0; x< a.length;  x++) {
    365                if (a[x]  != a[i])
    366                    retu rn false;
    367           }
    368       }
    369  
    370       return  true;
    371   }
    372  
    373   function a pplyAction () {
    374       var ce  = documen t.getEleme ntById('co ntainer'),  ed = tiny MCEPopup.e ditor;
    375  
    376       genera teCSS();
    377  
    378       tinyMC EPopup.res toreSelect ion();
    379       ed.dom .setAttrib (ed.select ion.getNod e(), 'styl e', tinyMC EPopup.edi tor.dom.se rializeSty le(tinyMCE Popup.edit or.dom.par seStyle(ce .style.css Text)));
    380   }
    381  
    382   function u pdateActio n() {
    383       applyA ction();
    384       tinyMC EPopup.clo se();
    385   }
    386  
    387   function g enerateCSS () {
    388       var ce  = documen t.getEleme ntById('co ntainer'),  f = docum ent.forms[ 0], num =  new RegExp ('[0-9]+',  'g'), s,  t;
    389  
    390       ce.sty le.cssText  = "";
    391  
    392       // Bui ld text st yles
    393       ce.sty le.fontFam ily = f.te xt_font.va lue;
    394       ce.sty le.fontSiz e = f.text _size.valu e + (isNum (f.text_si ze.value)  ? (f.text_ size_measu rement.val ue || 'px' ) : "");
    395       ce.sty le.fontSty le = f.tex t_style.va lue;
    396       ce.sty le.lineHei ght = f.te xt_linehei ght.value  + (isNum(f .text_line height.val ue) ? f.te xt_linehei ght_measur ement.valu e : "");
    397       ce.sty le.textTra nsform = f .text_case .value;
    398       ce.sty le.fontWei ght = f.te xt_weight. value;
    399       ce.sty le.fontVar iant = f.t ext_varian t.value;
    400       ce.sty le.color =  f.text_co lor.value;
    401  
    402       s = "" ;
    403       s += f .text_unde rline.chec ked ? " un derline" :  "";
    404       s += f .text_over line.check ed ? " ove rline" : " ";
    405       s += f .text_line through.ch ecked ? "  line-throu gh" : "";
    406       s += f .text_blin k.checked  ? " blink"  : "";
    407       s = s. length > 0  ? s.subst ring(1) :  s;
    408  
    409       if (f. text_none. checked)
    410           s  = "none";
    411  
    412       ce.sty le.textDec oration =  s;
    413  
    414       // Bui ld backgro und styles
    415  
    416       ce.sty le.backgro undColor =  f.backgro und_color. value;
    417       ce.sty le.backgro undImage =  f.backgro und_image. value != " " ? "url("  + f.backg round_imag e.value +  ")" : "";
    418       ce.sty le.backgro undRepeat  = f.backgr ound_repea t.value;
    419       ce.sty le.backgro undAttachm ent = f.ba ckground_a ttachment. value;
    420  
    421       if (f. background _hpos.valu e != "") {
    422           s  = "";
    423           s  += f.backg round_hpos .value + ( isNum(f.ba ckground_h pos.value)  ? f.backg round_hpos _measureme nt.value :  "") + " " ;
    424           s  += f.backg round_vpos .value + ( isNum(f.ba ckground_v pos.value)  ? f.backg round_vpos _measureme nt.value :  "");
    425           ce .style.bac kgroundPos ition = s;
    426       }
    427  
    428       // Bui ld block s tyles
    429  
    430       ce.sty le.wordSpa cing = f.b lock_words pacing.val ue + (isNu m(f.block_ wordspacin g.value) ?  f.block_w ordspacing _measureme nt.value :  "");
    431       ce.sty le.letterS pacing = f .block_let terspacing .value + ( isNum(f.bl ock_letter spacing.va lue) ? f.b lock_lette rspacing_m easurement .value : " ");
    432       ce.sty le.vertica lAlign = f .block_ver tical_alig nment.valu e;
    433       ce.sty le.textAli gn = f.blo ck_text_al ign.value;
    434       ce.sty le.textInd ent = f.bl ock_text_i ndent.valu e + (isNum (f.block_t ext_indent .value) ?  f.block_te xt_indent_ measuremen t.value :  "");
    435       ce.sty le.whiteSp ace = f.bl ock_whites pace.value ;
    436       ce.sty le.display  = f.block _display.v alue;
    437  
    438       // Bui ld box sty les
    439  
    440       ce.sty le.width =  f.box_wid th.value +  (isNum(f. box_width. value) ? f .box_width _measureme nt.value :  "");
    441       ce.sty le.height  = f.box_he ight.value  + (isNum( f.box_heig ht.value)  ? f.box_he ight_measu rement.val ue : "");
    442       ce.sty le.styleFl oat = f.bo x_float.va lue;
    443  
    444       if (ti nymce.isGe cko)
    445           ce .style.css Float = f. box_float. value;
    446  
    447       ce.sty le.clear =  f.box_cle ar.value;
    448  
    449       if (!f .box_paddi ng_same.ch ecked) {
    450           ce .style.pad dingTop =  f.box_padd ing_top.va lue + (isN um(f.box_p adding_top .value) ?  f.box_padd ing_top_me asurement. value : "" );
    451           ce .style.pad dingRight  = f.box_pa dding_righ t.value +  (isNum(f.b ox_padding _right.val ue) ? f.bo x_padding_ right_meas urement.va lue : "");
    452           ce .style.pad dingBottom  = f.box_p adding_bot tom.value  + (isNum(f .box_paddi ng_bottom. value) ? f .box_paddi ng_bottom_ measuremen t.value :  "");
    453           ce .style.pad dingLeft =  f.box_pad ding_left. value + (i sNum(f.box _padding_l eft.value)  ? f.box_p adding_lef t_measurem ent.value  : "");
    454       } else
    455           ce .style.pad ding = f.b ox_padding _top.value  + (isNum( f.box_padd ing_top.va lue) ? f.b ox_padding _top_measu rement.val ue : "");        
    456  
    457       if (!f .box_margi n_same.che cked) {
    458           ce .style.mar ginTop = f .box_margi n_top.valu e + (isNum (f.box_mar gin_top.va lue) ? f.b ox_margin_ top_measur ement.valu e : "");
    459           ce .style.mar ginRight =  f.box_mar gin_right. value + (i sNum(f.box _margin_ri ght.value)  ? f.box_m argin_righ t_measurem ent.value  : "");
    460           ce .style.mar ginBottom  = f.box_ma rgin_botto m.value +  (isNum(f.b ox_margin_ bottom.val ue) ? f.bo x_margin_b ottom_meas urement.va lue : "");
    461           ce .style.mar ginLeft =  f.box_marg in_left.va lue + (isN um(f.box_m argin_left .value) ?  f.box_marg in_left_me asurement. value : "" );
    462       } else
    463           ce .style.mar gin = f.bo x_margin_t op.value +  (isNum(f. box_margin _top.value ) ? f.box_ margin_top _measureme nt.value :  "");        
    464  
    465       // Bui ld border  styles
    466  
    467       if (!f .border_st yle_same.c hecked) {
    468           ce .style.bor derTopStyl e = f.bord er_style_t op.value;
    469           ce .style.bor derRightSt yle = f.bo rder_style _right.val ue;
    470           ce .style.bor derBottomS tyle = f.b order_styl e_bottom.v alue;
    471           ce .style.bor derLeftSty le = f.bor der_style_ left.value ;
    472       } else
    473           ce .style.bor derStyle =  f.border_ style_top. value;
    474  
    475       if (!f .border_wi dth_same.c hecked) {
    476           ce .style.bor derTopWidt h = f.bord er_width_t op.value +  (isNum(f. border_wid th_top.val ue) ? f.bo rder_width _top_measu rement.val ue : "");
    477           ce .style.bor derRightWi dth = f.bo rder_width _right.val ue + (isNu m(f.border _width_rig ht.value)  ? f.border _width_rig ht_measure ment.value  : "");
    478           ce .style.bor derBottomW idth = f.b order_widt h_bottom.v alue + (is Num(f.bord er_width_b ottom.valu e) ? f.bor der_width_ bottom_mea surement.v alue : "") ;
    479           ce .style.bor derLeftWid th = f.bor der_width_ left.value  + (isNum( f.border_w idth_left. value) ? f .border_wi dth_left_m easurement .value : " ");
    480       } else
    481           ce .style.bor derWidth =  f.border_ width_top. value;
    482  
    483       if (!f .border_co lor_same.c hecked) {
    484           ce .style.bor derTopColo r = f.bord er_color_t op.value;
    485           ce .style.bor derRightCo lor = f.bo rder_color _right.val ue;
    486           ce .style.bor derBottomC olor = f.b order_colo r_bottom.v alue;
    487           ce .style.bor derLeftCol or = f.bor der_color_ left.value ;
    488       } else
    489           ce .style.bor derColor =  f.border_ color_top. value;
    490  
    491       // Bui ld list st yles
    492  
    493       ce.sty le.listSty leType = f .list_type .value;
    494       ce.sty le.listSty lePosition  = f.list_ position.v alue;
    495       ce.sty le.listSty leImage =  f.list_bul let_image. value != " " ? "url("  + f.list_ bullet_ima ge.value +  ")" : "";
    496  
    497       // Bui ld positio ning style s
    498  
    499       ce.sty le.positio n = f.posi tioning_ty pe.value;
    500       ce.sty le.visibil ity = f.po sitioning_ visibility .value;
    501  
    502       if (ce .style.wid th == "")
    503           ce .style.wid th = f.pos itioning_w idth.value  + (isNum( f.position ing_width. value) ? f .positioni ng_width_m easurement .value : " ");
    504  
    505       if (ce .style.hei ght == "")
    506           ce .style.hei ght = f.po sitioning_ height.val ue + (isNu m(f.positi oning_heig ht.value)  ? f.positi oning_heig ht_measure ment.value  : "");
    507  
    508       ce.sty le.zIndex  = f.positi oning_zind ex.value;
    509       ce.sty le.overflo w = f.posi tioning_ov erflow.val ue;
    510  
    511       if (!f .positioni ng_placeme nt_same.ch ecked) {
    512           ce .style.top  = f.posit ioning_pla cement_top .value + ( isNum(f.po sitioning_ placement_ top.value)  ? f.posit ioning_pla cement_top _measureme nt.value :  "");
    513           ce .style.rig ht = f.pos itioning_p lacement_r ight.value  + (isNum( f.position ing_placem ent_right. value) ? f .positioni ng_placeme nt_right_m easurement .value : " ");
    514           ce .style.bot tom = f.po sitioning_ placement_ bottom.val ue + (isNu m(f.positi oning_plac ement_bott om.value)  ? f.positi oning_plac ement_bott om_measure ment.value  : "");
    515           ce .style.lef t = f.posi tioning_pl acement_le ft.value +  (isNum(f. positionin g_placemen t_left.val ue) ? f.po sitioning_ placement_ left_measu rement.val ue : "");
    516       } else  {
    517           s  = f.positi oning_plac ement_top. value + (i sNum(f.pos itioning_p lacement_t op.value)  ? f.positi oning_plac ement_top_ measuremen t.value :  "");
    518           ce .style.top  = s;
    519           ce .style.rig ht = s;
    520           ce .style.bot tom = s;
    521           ce .style.lef t = s;
    522       }
    523  
    524       if (!f .positioni ng_clip_sa me.checked ) {
    525           s  = "rect(";
    526           s  += (isNum( f.position ing_clip_t op.value)  ? f.positi oning_clip _top.value  + f.posit ioning_cli p_top_meas urement.va lue : "aut o") + " ";
    527           s  += (isNum( f.position ing_clip_r ight.value ) ? f.posi tioning_cl ip_right.v alue + f.p ositioning _clip_righ t_measurem ent.value  : "auto")  + " ";
    528           s  += (isNum( f.position ing_clip_b ottom.valu e) ? f.pos itioning_c lip_bottom .value + f .positioni ng_clip_bo ttom_measu rement.val ue : "auto ") + " ";
    529           s  += (isNum( f.position ing_clip_l eft.value)  ? f.posit ioning_cli p_left.val ue + f.pos itioning_c lip_left_m easurement .value : " auto");
    530           s  += ")";
    531  
    532           if  (s != "re ct(auto au to auto au to)")
    533                ce.style .clip = s;
    534       } else  {
    535           s  = "rect(";
    536           t  = isNum(f. positionin g_clip_top .value) ?  f.position ing_clip_t op.value +  f.positio ning_clip_ top_measur ement.valu e : "auto" ;
    537           s  += t + " " ;
    538           s  += t + " " ;
    539           s  += t + " " ;
    540           s  += t + ")" ;
    541  
    542           if  (s != "re ct(auto au to auto au to)")
    543                ce.style .clip = s;
    544       }
    545  
    546       ce.sty le.cssText  = ce.styl e.cssText;
    547   }
    548  
    549   function i sNum(s) {
    550       return  new RegEx p('[0-9]+' , 'g').tes t(s);
    551   }
    552  
    553   function s howDisable dControls( ) {
    554       var f  = document .forms, i,  a;
    555  
    556       for (i =0; i<f.le ngth; i++)  {
    557           fo r (a=0; a< f[i].eleme nts.length ; a++) {
    558                if (f[i] .elements[ a].disable d)
    559                    tiny MCEPopup.e ditor.dom. addClass(f [i].elemen ts[a], "di sabled");
    560                else
    561                    tiny MCEPopup.e ditor.dom. removeClas s(f[i].ele ments[a],  "disabled" );
    562           }
    563       }
    564   }
    565  
    566   function f illSelect( f, s, para m, dval, s ep, em) {
    567       var i,  ar, p, se ;
    568  
    569       f = do cument.for ms[f];
    570       sep =  typeof(sep ) == "unde fined" ? " ;" : sep;
    571  
    572       if (em )
    573           ad dSelectVal ue(f, s, " ", "");
    574  
    575       ar = t inyMCEPopu p.getParam (param, dv al).split( sep);
    576       for (i =0; i<ar.l ength; i++ ) {
    577           se  = false;
    578  
    579           if  (ar[i].ch arAt(0) ==  '+') {
    580                ar[i] =  ar[i].subs tring(1);
    581                se = tru e;
    582           }
    583  
    584           p  = ar[i].sp lit('=');
    585  
    586           if  (p.length  > 1) {
    587                addSelec tValue(f,  s, p[0], p [1]);
    588  
    589                if (se)
    590                    sele ctByValue( f, s, p[1] );
    591           }  else {
    592                addSelec tValue(f,  s, p[0], p [0]);
    593  
    594                if (se)
    595                    sele ctByValue( f, s, p[0] );
    596           }
    597       }
    598   }
    599  
    600   function t oggleSame( ce, pre) {
    601       var el  = documen t.forms[0] .elements,  i;
    602  
    603       if (ce .checked)  {
    604           el [pre + "_t op"].disab led = fals e;
    605           el [pre + "_r ight"].dis abled = tr ue;
    606           el [pre + "_b ottom"].di sabled = t rue;
    607           el [pre + "_l eft"].disa bled = tru e;
    608  
    609           if  (el[pre +  "_top_mea surement"] ) {
    610                el[pre +  "_top_mea surement"] .disabled  = false;
    611                el[pre +  "_right_m easurement "].disable d = true;
    612                el[pre +  "_bottom_ measuremen t"].disabl ed = true;
    613                el[pre +  "_left_me asurement" ].disabled  = true;
    614           }
    615       } else  {
    616           el [pre + "_t op"].disab led = fals e;
    617           el [pre + "_r ight"].dis abled = fa lse;
    618           el [pre + "_b ottom"].di sabled = f alse;
    619           el [pre + "_l eft"].disa bled = fal se;
    620  
    621           if  (el[pre +  "_top_mea surement"] ) {
    622                el[pre +  "_top_mea surement"] .disabled  = false;
    623                el[pre +  "_right_m easurement "].disable d = false;
    624                el[pre +  "_bottom_ measuremen t"].disabl ed = false ;
    625                el[pre +  "_left_me asurement" ].disabled  = false;
    626           }
    627       }
    628  
    629       showDi sabledCont rols();
    630   }
    631  
    632   function s ynch(fr, t o) {
    633       var f  = document .forms[0];
    634  
    635       f.elem ents[to].v alue = f.e lements[fr ].value;
    636  
    637       if (f. elements[f r + "_meas urement"])
    638           se lectByValu e(f, to +  "_measurem ent", f.el ements[fr  + "_measur ement"].va lue);
    639   }
    640  
    641   tinyMCEPop up.onInit. add(init);