Changeset 12941

Show
Ignore:
Timestamp:
03/06/08 17:06:44 (10 months ago)
Author:
peller
Message:

Add formatBlock to test, make it WYSIWYG. Refs #5980 Add custom fonts via djConfig. Refs #6035

Location:
dijit/trunk
Files:
1 removed
4 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/tests/form/test_SimpleTextarea.html

    r12572 r12941  
    5252                                This is just some text in the center region. 
    5353                        </textarea> 
     54                        <textarea name="textAreaN3" dojoType="dijit.form.SimpleTextarea" region="right" splitter="true" style="width: 200px;"> 
     55                                This is just some text in the left region. 
     56                        </textarea> 
     57                        <textarea name="textAreaN3" dojoType="dijit.form.SimpleTextarea" region="bottom" splitter="true" style="height: 100px;"> 
     58                                This is just some text in the left region. 
     59                        </textarea> 
    5460                </div> 
    5561</body> 
  • dijit/trunk/tests/layout/test_AccordionContainer.html

    r12703 r12941  
    2424                dojo.require("dijit.layout.AccordionContainer"); 
    2525                dojo.require("dijit.layout.ContentPane"); 
    26                 // dojo.require("dijit.layout.SplitContainer"); 
     26                dojo.require("dijit.layout.BorderContainer"); 
    2727                dojo.require("dijit.form.ComboBox"); 
    2828                dojo.require("dijit.form.Button"); 
     
    149149                <div dojoType="dijit.layout.AccordionPane" id="lazyLoadPane" title="Pane 2 (lazy load)" href="tab1.html"></div> 
    150150 
    151 <!-- Support for nested complex widgets de-supported, for now 
    152                 <div dojoType="dijit.layout.AccordionLayoutPane" title="Pane 3 (split pane)"> 
    153                         <div dojoType="dijit.layout.SplitContainer"> 
    154                                 <p dojoType="dijit.layout.ContentPane"> 
    155                                 Sed arcu magna, molestie at, fringilla in, sodales eu, elit. 
     151                <div dojoType="dijit.layout.AccordionPane" title="Pane 3 (split pane)"> 
     152                        <div dojoType="dijit.layout.BorderContainer" style="height:100%; width:100%"> 
     153                                <div dojoType="dijit.layout.ContentPane" region="left" style="width:50%" splitter="true"> 
     154                                1Sed arcu magna, molestie at, fringilla in, sodales eu, elit. 
    156155                                Curabitur mattis lorem et est. Quisque et tortor. Integer bibendum 
    157156                                vulputate odio. Nam nec ipsum. Vestibulum mollis eros feugiat 
     
    166165                                sollicitudin sed, consequat nec, facilisis sit amet, orci. Aenean 
    167166                                ut eros sit amet ante pharetra interdum. 
    168                                 </p> 
    169                                 <p dojoType="dijit.layout.ContentPane"> 
    170                                 Sed arcu magna, molestie at, fringilla in, sodales eu, elit. 
     167                                </div> 
     168                                <div dojoType="dijit.layout.ContentPane" region="center"> 
     169                                2Sed arcu magna, molestie at, fringilla in, sodales eu, elit. 
    171170                                Curabitur mattis lorem et est. Quisque et tortor. Integer bibendum 
    172171                                vulputate odio. Nam nec ipsum. Vestibulum mollis eros feugiat 
     
    181180                                sollicitudin sed, consequat nec, facilisis sit amet, orci. Aenean 
    182181                                ut eros sit amet ante pharetra interdum. 
    183                                 </p> 
     182                                </div> 
    184183                        </div> 
    185184                </div> 
    186 --> 
    187185        </div> 
    188186 
  • dijit/trunk/tests/test_Editor.html

    r12747 r12941  
    1111 
    1212        <script type="text/javascript" src="../../dojo/dojo.js" 
    13                 djConfig="parseOnLoad: true, isDebug: true"></script> 
     13                djConfig="parseOnLoad: true, isDebug: true, fontName: 'Arial'"></script> 
    1414        <script type="text/javascript" src="_testCommon.js"></script> 
    1515 
     
    9898                <h3><label for="blah">blah entry</label></h3> 
    9999                <textarea dojoType="dijit.Editor" 
    100                         plugins="['bold','italic','|','createLink','foreColor','hiliteColor','fontName','fontSize','insertImage']" 
     100                        plugins="['bold','italic','|','createLink','foreColor','hiliteColor','fontName','fontSize','formatBlock','insertImage']" 
    101101                        styleSheets="../../dojo/resources/dojo.css" id="blah"> 
    102102                        This instance includes optional toolbar buttons which pull in additional ui (dijit) code. 
  • dijit/trunk/_editor/plugins/FontChoice.js

    r12940 r12941  
    3434                        var cmd = this.command; 
    3535                        var names = { 
    36                                 fontName: ["serif", "sans-serif", "monospace", "cursive", "fantasy"], 
    37                                 fontSize: [1,2,3,4,5,6,7], 
     36                                fontName: ["serif", "sans-serif", "monospace", "cursive", "fantasy"], // CSS font-family generics 
     37                                fontSize: [1,2,3,4,5,6,7], // sizes according to the old HTML FONT SIZE 
    3838                                formatBlock: ["p", "h1", "h2", "h3", "pre"] }[cmd]; 
     39                        var additions = dojo.config[cmd]; 
     40                        if(additions){ 
     41                                names = names.concat(additions); 
     42                        } 
    3943                        var strings = dojo.i18n.getLocalization("dijit._editor", "FontChoice"); 
    4044                        var items = dojo.map(names, function(value){ 
    41                                 var name = strings[value]; 
     45                                var name = strings[value] || value; 
    4246                                var label = name; 
    4347                                switch(cmd){ 
    4448                                case "fontName": 
    45                                         label = "<div style='font-family: "+value+"'>"+name+"</div>"; 
     49                                        label = "<div style='font-family: "+value+"'>" + name + "</div>"; 
    4650                                        break; 
    4751                                case "fontSize": 
    4852                                        // we're stuck using the deprecated FONT tag to correspond with the size measurements used by the editor 
    4953                                        label = "<font size="+value+"'>"+name+"</font>"; 
     54                                        break; 
     55                                case "formatBlock": 
     56                                        label = "<" + value + ">" + name + "</" + value + ">"; 
    5057                                } 
    5158                                return { label: label, name: name, value: value }; 
     
    8491                        if(this.button){ 
    8592                                var value = _e.queryCommandValue(_c); 
     93//console.log("cmd="+this.command+" value="+value); 
    8694                                this.updating = true; 
    8795                                this.button.setValue(value);