Ticket #3058: 3058.2.patch

File 3058.2.patch, 26.9 kB (added by peller, 16 months ago)

combine style and class attributes; remove special cases from _Templated to do this. still needs more testing

  • Users/peller/workspace/trunk/dijit/changes.txt

     
    2525 
    2626createWidget() call removed since multiple renderers are no longer supported (see next section). 
    2727 
    28 At least for the dijit widgets, all widgets are guaranteed to work programatically, which in 
     28At least for the dijit widgets, all widgets are guaranteed to work programmatically, which in 
    2929effect means that all widgets must have templates, unless the default <div> works. 
    3030 
    3131Renderers 
     
    5858lists within dojoAttachPoint, dojoAttachEvent, waiRole, and waiState are now comma-separated 
    5959(not separated by semi-colons) 
    6060 
     61Standard HTML attributes like 'id', 'name', 'lang', etc. are carried over programmatically 
     62by the _Widget constructor and do not need to be declared in the template (see _Widget.genericMap) 
     63 
    6164Parent/Child relationships 
    6265-------------------------- 
    6366By default widgets exist as islands, not knowing about their parent widget or children widgets. 
  • Users/peller/workspace/trunk/dijit/_Templated.js

     
    4040                // method over-ride 
    4141                buildRendering: function(){ 
    4242                        // summary: 
    43                         //              Construct the UI for this widget from a template. 
    44                         // description: 
     43                        //              Construct the UI for this widget from a template, setting this.domNode. 
     44 
    4545                        // Lookup cached version of template, and download to cache if it 
    4646                        // isn't there already.  Returns either a DomNode or a string, depending on 
    4747                        // whether or not the template contains ${foo} replacement parameters. 
    48  
    4948                        var cached = dijit._Templated.getCachedTemplate(this.templatePath, this.templateString); 
    5049 
    5150                        var node; 
     
    7473                        // recurse through the node, looking for, and attaching to, our 
    7574                        // attachment points which should be defined on the template node. 
    7675                        this._attachTemplateNodes(node); 
    77                         if(this.srcNodeRef){ 
    78                                 dojo.style(node, "cssText", this.srcNodeRef.style.cssText); 
    79                                 if(this.srcNodeRef.className){ 
    80                                         node.className += " " + this.srcNodeRef.className; 
    81                                 } 
     76 
     77                        var source = this.srcNodeRef; 
     78                        if(source && source.parentNode){ 
     79                                source.parentNode.replaceChild(node, source); 
    8280                        } 
    8381 
    8482                        this.domNode = node; 
    85                         if(this.srcNodeRef && this.srcNodeRef.parentNode){ 
    86                                 this.srcNodeRef.parentNode.replaceChild(this.domNode, this.srcNodeRef); 
    87                         } 
    8883                        if(this.widgetsInTemplate){ 
    89                                 var childWidgets = dojo.parser.parse(this.domNode); 
     84                                var childWidgets = dojo.parser.parse(node); 
    9085                                this._attachTemplateNodes(childWidgets, function(n,p){ 
    9186                                        return n[p]; 
    9287                                }); 
    9388                        } 
    9489 
    95                         this._fillContent(this.srcNodeRef); 
     90                        this._fillContent(source); 
    9691                }, 
    9792 
    9893                _fillContent: function(/*DomNode*/ source){ 
  • Users/peller/workspace/trunk/dijit/_Widget.js

     
    4141                dojo.mixin(this,params); 
    4242        } 
    4343        this.postMixInProperties(); 
    44          
     44 
    4545        // generate an id for the widget if one wasn't specified 
    4646        // (be sure to do this before buildRendering() because that function might 
    4747        // expect the id to be there. 
    4848        if(!this.id){ 
    49                 this.id=dijit.getUniqueId(this.declaredClass.replace(/\./g,"_")); 
     49                this.id = dijit.getUniqueId(this.declaredClass.replace(/\./g,"_")); 
    5050        } 
    5151        dijit.registry.add(this); 
    5252 
    5353        this.buildRendering(); 
     54        for(var attr in this.genericMap){ 
     55                if(this.domNode){ 
     56                        var node = this[this.genericMap[attr] || "domNode"]; 
     57                        var value = this[attr]; 
     58                        if(value !== "" || (params && params[attr])){ 
     59                                var domValue = node.getAttribute(attr); 
     60                                if(domValue){ 
     61                                        var delim = {style: ";", class: " "}[attr]; 
     62                                        if(delim){ 
     63                                                // combine values 
     64                                                value += delim + domValue; 
     65                                                domValue = null; 
     66                                        } 
     67                                } 
     68                                if(domValue === null){ 
     69                                        node.setAttribute(attr, value); 
     70                                } 
     71                        } 
     72                } 
     73        } 
    5474        if(this.domNode){ 
    5575                this.domNode.setAttribute("widgetId", this.id); 
    56                 if(this.srcNodeRef && this.srcNodeRef.dir){ 
    57                         this.domNode.dir = this.srcNodeRef.dir; 
    58                 } 
    5976        } 
    6077        this.postCreate(); 
    6178 
     
    8198        //  Bi-directional support, as defined by the HTML DIR attribute. Either left-to-right "ltr" or right-to-left "rtl". 
    8299        dir: "", 
    83100 
     101        // class: String 
     102        // HTML class attribute 
     103        "class": "", 
     104 
     105        // style: String 
     106        // HTML style attribute 
     107        style: "", 
     108 
     109        // title: String 
     110        // HTML title attribute 
     111        title: "", 
     112 
    84113        // srcNodeRef: DomNode 
    85114        //              pointer to original dom node 
    86115        srcNodeRef: null, 
     
    92121        //              property is the canonical "top level" node in widget UI. 
    93122        domNode: null, 
    94123 
     124        // genericMap Object: 
     125        //              A map of attributes -- typically standard HTML attributes -- to transfer 
     126        //              from the parsed node into the new dom, at the widget's domNode, by default. 
     127        //              Other node references can be specified as properties of 'this' 
     128        genericMap: {id:"", dir:"", lang:"", "class":"", style:"", title:""},  // TODO: add on* handlers? 
     129 
    95130        //////////// INITIALIZATION METHODS /////////////////////////////////////// 
    96131 
    97132        postMixInProperties: function(){ 
     
    276311                //              See HTML spec, DIR attribute for more information. 
    277312 
    278313                if(typeof this._ltr == "undefined"){ 
     314                        //FIXME: don't need to check this.dir anymore, since it's mixed into domNode? 
     315                        //FIXME: is it even worth having this method anymore? 
    279316                        this._ltr = (this.dir || dojo.getComputedStyle(this.domNode).direction) != "rtl"; 
    280317                } 
    281318                return this._ltr; //Boolean 
  • Users/peller/workspace/trunk/dijit/templates/Dialog.html

     
    11<div class="dijitDialog"> 
    2                 <div dojoAttachPoint="titleBar" class="dijitDialogTitleBar" tabindex="0" waiRole="dialog" title="${title}"> 
    3                 <span dojoAttachPoint="titleNode" class="dijitDialogTitle">${title}</span> 
    4                 <span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: hide"> 
    5                         <span dojoAttachPoint="closeText" class="closeText">x</span> 
    6                 </span> 
     2        <div dojoAttachPoint="titleBar" class="dijitDialogTitleBar" tabindex="0" waiRole="dialog"> 
     3        <span dojoAttachPoint="titleNode" class="dijitDialogTitle">${title}</span> 
     4        <span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: hide"> 
     5                <span dojoAttachPoint="closeText" class="closeText">x</span> 
     6        </span> 
    77        </div> 
    88                <div dojoAttachPoint="containerNode" class="dijitDialogPaneContent"></div> 
    99        <span dojoAttachPoint="tabEnd" dojoAttachEvent="onfocus:_cycleFocus" tabindex="0"></span> 
  • Users/peller/workspace/trunk/dijit/templates/Tooltip.html

     
    1 <div class="dijitTooltip dijitTooltipLeft" id="dojoTooltip"> 
     1<div class="dijitTooltip dijitTooltipLeft"> 
    22        <div class="dijitTooltipContainer dijitTooltipContents" dojoAttachPoint="containerNode" waiRole='alert'></div> 
    33        <div class="dijitTooltipConnector"></div> 
    44</div> 
  • Users/peller/workspace/trunk/dijit/form/_FormWidget.js

     
    174174                // summary: callback when value is changed 
    175175        }, 
    176176 
     177        postMixInProperties: function(){ 
     178                // These mixins assume that the focus node is an INPUT, as many but not all _FormWidgets are. 
     179                // Don't attempt to mixin the 'type' attribute here programatically -- it must be declared 
     180                // directly in the template as read by the parser in order to function 
     181                this.genericMap = dojo.mixin(dojo.clone(this.genericMap), {id:"focusNode", name:"focusNode", tabIndex:"focusNode", alt:"focusNode"});//TODO: check on alt. Should these be moved down to subclasses? 
     182        }, 
     183 
    177184        postCreate: function(){ 
    178185                this.setDisabled(this.disabled); 
    179186                this._setStateClass(); 
  • Users/peller/workspace/trunk/dijit/form/Textarea.js

     
    1616        // usage: 
    1717        //      <textarea dojoType="dijit.form.TextArea">...</textarea> 
    1818 
    19         templateString: (dojo.isIE || dojo.isSafari || dojo.isMozilla) ? '<fieldset id="${id}" class="dijitInlineBox dijitInputField dijitTextArea">' 
    20                                 + ((dojo.isIE || dojo.isSafari) ? '<div dojoAttachPoint="editNode" waiRole="textarea" tabIndex="${tabIndex}" style="text-decoration:none;_padding-bottom:16px;display:block;overflow:auto;" contentEditable="true"></div>' 
     19        templateString: (dojo.isIE || dojo.isSafari || dojo.isMozilla) ? '<fieldset class="dijitInlineBox dijitInputField dijitTextArea">' 
     20                                + ((dojo.isIE || dojo.isSafari) ? '<div dojoAttachPoint="editNode" waiRole="textarea" style="text-decoration:none;_padding-bottom:16px;display:block;overflow:auto;" contentEditable="true"></div>' 
    2121                                        : '<iframe dojoAttachPoint="iframe" dojoAttachEvent="onblur:_onIframeBlur" src="javascript:void(0)" style="border:0px;margin:0px;padding:0px;display:block;width:100%;height:100%;overflow-x:auto;overflow-y:hidden;"></iframe>') 
    22                                 + '<textarea name="${name}" value="${value}" dojoAttachPoint="formValueNode" style="display:none;"></textarea>' 
     22                                + '<textarea dojoAttachPoint="formValueNode" style="display:none;"></textarea>' 
    2323                                + '</fieldset>' 
    24                         : '<textarea id="${id}" name="${name}" value="${value}" dojoAttachPoint="formValueNode,editNode" class="dijitInputField dijitTextArea"></textarea>', 
     24                        : '<textarea dojoAttachPoint="formValueNode,editNode" class="dijitInputField dijitTextArea"></textarea>', 
    2525 
    2626        _nlsResources: null,    // Needed for screen readers on FF2 
    2727 
     28        postMixInProperties: function(){ 
     29                this.inherited('postMixInProperties', arguments); 
     30                this.genericMap = dojo.mixin(dojo.clone(this.genericMap), {id:"", name:"formValueNode", tabIndex:"editNode", value:"formValueNode"}); 
     31        }, 
     32 
    2833        focus: function(){ 
    2934                // summary: Received focus, needed for the InlineEditBox widget 
    3035                if(!this.disabled){ 
     
    8691                if(!this.value){ this.value = ""; } 
    8792        }, 
    8893 
    89         postCreate: function(){ 
     94//TODO: ok to change this form postCreate to buildRendering?  Need attachpoints defined earlier 
     95        buildRendering: function(){ 
     96                this.inherited('buildRendering', arguments); 
    9097                if(dojo.isIE || dojo.isSafari){ 
    9198                        this.domNode.style.overflowY = 'hidden'; 
    9299                        this.eventNode = this.focusNode = this.editNode; 
     
    102109                        // 
    103110                        // An additional problem is that the browser gives the document object a 
    104111                        // very cryptic accessible name, e.g. 
    105                         // wyciwyg://13/http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/form/test_InlineEditBox.html 
     112                        // wysiwyg://13/http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/form/test_InlineEditBox.html 
    106113                        // When focus is fired from the document object, the screen reader speaks 
    107                         // the accessible name.  The cyptic accessile name is confusing. 
     114                        // the accessible name.  The cryptic accessible name is confusing. 
    108115                        // 
    109116                        // A workaround for both of these problems is to give the iframe's 
    110117                        // document a title, the name of which is similar to a role name, i.e. 
     
    135142                if(this.editNode){ 
    136143                        this.connect(this.editNode, "change", this._changed); // needed for mouse paste events per #3479 
    137144                } 
    138                 this.inherited('postCreate', arguments); 
    139145        }, 
    140146 
    141147        // event handlers, you can over-ride these in your own subclasses 
  • Users/peller/workspace/trunk/dijit/form/Slider.js

     
    4949        _progressPixelSize: "width", 
    5050        _upsideDown: false, 
    5151 
    52          setDisabled: function(/*Boolean*/ disabled){ 
     52        setDisabled: function(/*Boolean*/ disabled){ 
    5353                if(this.showButtons){ 
    5454                        this.incrementButton.disabled = disabled; 
    5555                        this.decrementButton.disabled = disabled; 
     
    167167                dijit.form.HorizontalSlider.superclass.setValue.call(this, this.value, true); 
    168168        }, 
    169169 
     170        postMixInProperties: function(){ 
     171                this.inherited('postMixInProperties', arguments); 
     172                this.genericMap = dojo.mixin(dojo.clone(this.genericMap), {id:"", name:"valueNode"}); 
     173        }, 
     174 
    170175        postCreate: function(){ 
    171176                if(this.showButtons){ 
    172177                        this.incrementButton.domNode.style.display=""; 
  • Users/peller/workspace/trunk/dijit/form/templates/HorizontalSlider.html

     
    1 <table class="dijit dijitReset dijitSlider" cellspacing=0 cellpadding=0 border=0 rules=none id="${id}" 
     1<table class="dijit dijitReset dijitSlider" cellspacing="0" cellpadding="0" border="0" rules="none" 
    22        ><tr class="dijitReset" 
    3                 ><td class="dijitReset" colspan=2></td 
     3                ><td class="dijitReset" colspan="2"></td 
    44                ><td dojoAttachPoint="containerNode,topDecoration" class="dijitReset" style="text-align:center;width:100%;"></td 
    5                 ><td class="dijitReset" colspan=2></td 
     5                ><td class="dijitReset" colspan="2"></td 
    66        ></tr 
    77        ><tr class="dijitReset" 
    88                ><td class="dijitReset dijitSliderButtonContainer dijitHorizontalSliderButtonContainer" 
     
    1212                        ><div class="dijitSliderBar dijitSliderBumper dijitHorizontalSliderBumper dijitSliderLeftBumper dijitHorizontalSliderLeftBumper"></div 
    1313                ></td 
    1414                ><td class="dijitReset" 
    15                         ><input dojoAttachPoint="valueNode" name="${name}" type="hidden" 
     15                        ><input dojoAttachPoint="valueNode" type="hidden" 
    1616                        ><div style="position:relative;" dojoAttachPoint="sliderBarContainer" 
    1717                                ><div dojoAttachPoint="progressBar" class="dijitSliderBar dijitHorizontalSliderBar dijitSliderProgressBar dijitHorizontalSliderProgressBar" dojoAttachEvent="onclick:_onBarClick" 
    18                                         ><div tabIndex="${tabIndex}" dojoAttachPoint="sliderHandle,focusNode" class="dijitSliderMoveable dijitHorizontalSliderMoveable" dojoAttachEvent="onkeypress:_onKeyPress,onclick:_onHandleClick" waiRole="slider" valuemin="${minimum}" valuemax="${maximum}" 
     18                                        ><div dojoAttachPoint="sliderHandle,focusNode" class="dijitSliderMoveable dijitHorizontalSliderMoveable" dojoAttachEvent="onkeypress:_onKeyPress,onclick:_onHandleClick" waiRole="slider" valuemin="${minimum}" valuemax="${maximum}" 
    1919                                                ><div class="dijitSliderImageHandle dijitHorizontalSliderImageHandle"></div 
    2020                                        ></div 
    2121                                ></div 
     
    3030                ></td 
    3131        ></tr 
    3232        ><tr class="dijitReset" 
    33                 ><td class="dijitReset" colspan=2></td 
     33                ><td class="dijitReset" colspan="2"></td 
    3434                ><td dojoAttachPoint="containerNode,bottomDecoration" class="dijitReset" style="text-align:center;"></td 
    35                 ><td class="dijitReset" colspan=2></td 
     35                ><td class="dijitReset" colspan="2"></td 
    3636        ></tr 
    3737></table> 
  • Users/peller/workspace/trunk/dijit/form/templates/TimePicker.html

     
    1 <fieldset id="widget_${id}" baseClass="dijitTimePicker" class="dijitMenu" 
     1<fieldset baseClass="dijitTimePicker" class="dijitMenu" 
    22><div dojoAttachPoint="upArrow" class="dijitButtonNode">&#9650;</div 
    33><div dojoAttachPoint="timeMenu" dojoAttachEvent="onclick:_onOptionSelected,onmouseover,onmouseout" 
    44></div 
  • Users/peller/workspace/trunk/dijit/form/templates/VerticalSlider.html

     
    1 <table class="dijitReset dijitSlider" cellspacing=0 cellpadding=0 border=0 rules=none id="${id}" 
     1<table class="dijitReset dijitSlider" cellspacing="0" cellpadding="0" border="0" rules="none" 
    22><tbody class="dijitReset" 
    33        ><tr class="dijitReset" 
    44                ><td class="dijitReset"></td 
    55                ><td class="dijitReset dijitSliderButtonContainer dijitVerticalSliderButtonContainer" 
    6                         ><button dojoType="dijit.form.Button" tabIndex=-1 alt="+"  style="display:none" dojoAttachPoint="incrementButton" dojoAttachEvent="onClick: increment">+</button 
     6                        ><button dojoType="dijit.form.Button" tabIndex="-1" alt="+"  style="display:none" dojoAttachPoint="incrementButton" dojoAttachEvent="onClick: increment">+</button 
    77                ></td 
    88                ><td class="dijitReset"></td 
    99        ></tr 
     
    1717        ><tr class="dijitReset" 
    1818                ><td dojoAttachPoint="leftDecoration" class="dijitReset" style="text-align:center;height:100%;"></td 
    1919                ><td class="dijitReset" style="height:100%;" 
    20                         ><input dojoAttachPoint="valueNode" type="hidden" name="${name}" 
     20                        ><input dojoAttachPoint="valueNode" type="hidden" 
    2121                        ><center style="position:relative;height:100%;" dojoAttachPoint="sliderBarContainer" 
    2222                                ><div dojoAttachPoint="remainingBar" class="dijitSliderBar dijitVerticalSliderBar dijitSliderRemainingBar dijitVerticalSliderRemainingBar" dojoAttachEvent="onclick:_onBarClick"></div 
    2323                                ><div dojoAttachPoint="progressBar" class="dijitSliderBar dijitVerticalSliderBar dijitSliderProgressBar dijitVerticalSliderProgressBar" dojoAttachEvent="onclick:_onBarClick" 
    24                                         ><div tabIndex="${tabIndex}" dojoAttachPoint="sliderHandle,focusNode" class="dijitSliderMoveable" dojoAttachEvent="onkeypress:_onKeyPress,onclick:_onHandleClick" style="vertical-align:top;" waiRole="slider" valuemin="${minimum}" valuemax="${maximum}" 
     24                                        ><div dojoAttachPoint="sliderHandle,focusNode" class="dijitSliderMoveable" dojoAttachEvent="onkeypress:_onKeyPress,onclick:_onHandleClick" style="vertical-align:top;" waiRole="slider" valuemin="${minimum}" valuemax="${maximum}" 
    2525                                                ><div class="dijitSliderImageHandle dijitVerticalSliderImageHandle"></div 
    2626                                        ></div 
    2727                                ></div 
     
    3939        ><tr class="dijitReset" 
    4040                ><td class="dijitReset"></td 
    4141                ><td class="dijitReset dijitSliderButtonContainer dijitVerticalSliderButtonContainer" 
    42                         ><button dojoType="dijit.form.Button" tabIndex=-1 alt="-" style="display:none" dojoAttachPoint="decrementButton" dojoAttachEvent="onClick: decrement">-</button 
     42                        ><button dojoType="dijit.form.Button" tabIndex="-1" alt="-" style="display:none" dojoAttachPoint="decrementButton" dojoAttachEvent="onClick: decrement">-</button 
    4343                ></td 
    4444                ><td class="dijitReset"></td 
    4545        ></tr 
  • Users/peller/workspace/trunk/dijit/form/templates/InlineEditBox.html

     
    11<span> 
     2<!-- fixme: ok to put id, name, tabIndex on focusNode? --> 
    23        <span class='dijitInlineValue' tabIndex="0" dojoAttachPoint="editable,focusNode" style="" waiRole="button" 
    34                dojoAttachEvent="onkeypress:_onKeyPress,onclick:_onClick,onmouseout:_onMouseOut,onmouseover:_onMouseOver,onfocus:_onMouseOver,onblur:_onMouseOut"></span> 
    45        <fieldset style="display:none;" dojoAttachPoint="editNode" class="dijitInlineEditor"> 
  • Users/peller/workspace/trunk/dijit/form/templates/Textbox.html

     
    1 <input dojoAttachPoint='textbox,focusNode' dojoAttachEvent='onfocus,onkeyup,onkeypress:_onKeyPress' autocomplete="off" 
    2         id='${id}' name='${name}' class="dijitInputField" type='${type}' size='${size}' maxlength='${maxlength}' tabIndex='${tabIndex}'> 
     1<input dojoAttachPoint='textbox,focusNode' dojoAttachEvent='onfocus,onkeyup,onkeypress:_onKeyPress' 
     2        class="dijitInputField" type='${type}'> 
  • Users/peller/workspace/trunk/dijit/form/templates/Button.html

     
    22        dojoAttachEvent="onclick:_onButtonClick,onmouseover:_onMouse,onmouseout:_onMouse,onmousedown:_onMouse" 
    33        ><div class='dijitRight' 
    44        ><button class="dijitStretch dijitButtonNode dijitButtonContents" dojoAttachPoint="focusNode,titleNode" 
    5                 tabIndex="${tabIndex}" type="${type}" id="${id}" name="${name}" waiRole="button" waiState="labelledby-${id}_label" 
     5                type="${type}" waiRole="button" waiState="labelledby-${id}_label" 
    66                ><div class="dijitInline ${iconClass}"></div 
    77                ><span class="dijitButtonText" id="${id}_label" dojoAttachPoint="containerNode">${label}</span 
    88        ></button 
  • Users/peller/workspace/trunk/dijit/form/Textbox.js

     
    2828 
    2929                // size: String 
    3030                //              HTML INPUT tag size declaration. 
    31                 size: "20", 
     31                size: "", 
    3232 
    3333                // maxlength: String 
    3434                //              HTML INPUT tag maxlength declaration. 
    35                 maxlength: "999999", 
     35                maxlength: "", 
    3636 
    3737                templatePath: dojo.moduleUrl("dijit.form", "templates/Textbox.html"), 
    3838 
     
    4646 
    4747                setValue: function(value, /*Boolean, optional*/ priorityChange, /*String, optional*/ formattedValue){ 
    4848                        value = this.filter(value); 
    49                         if(typeof formattedValue == "undefined" ){ 
     49                        if(typeof formattedValue == "undefined"){ 
    5050                                formattedValue = (typeof value == "undefined" || value == null || value == NaN) ? null : this.format(value, this.constraints); 
    5151                        } 
    52                         if(formattedValue != null){ 
     52                        if(formattedValue){ 
    5353                                var _this = this; 
    5454                                // synchronous value set needed for InlineEditBox 
    5555                                this.textbox.value = formattedValue; 
     
    7171                        return value; 
    7272                }, 
    7373 
     74                postMixInProperties: function(){ 
     75                        this.inherited('postMixInProperties', arguments); 
     76                        this.genericMap = dojo.mixin(dojo.clone(this.genericMap), {size:"focusNode", maxlength:"focusNode"}); 
     77                }, 
     78 
    7479                postCreate: function(){ 
    7580                        // get the node for which the background color will be updated 
    7681                        if(typeof this.nodeWithBorder != "object"){ 
  • Users/peller/workspace/trunk/dijit/form/InlineEditBox.js

     
    157157                                var _this=this; 
    158158                                var isFirst = true; 
    159159                                dojo.forEach(value.split("\n"), function(line){ 
    160                                         if(isFirst){ isFirst = false; } 
    161                                         else { 
     160                                        if(isFirst){ 
     161                                                isFirst = false; 
     162                                        }else{ 
    162163                                                _this.editable.appendChild(document.createElement("BR")); // preserve line breaks 
    163164                                        } 
    164165                                        _this.editable.appendChild(document.createTextNode(line)); // use text nodes so that imbedded tags can be edited 
  • Users/peller/workspace/trunk/dijit/Dialog.js

     
    8383                templateString: null, 
    8484                templatePath: dojo.moduleUrl("dijit", "templates/Dialog.html"), 
    8585 
    86                 // title: String 
    87                 //              Title of the dialog 
    88                 title: "", 
     86                duration: 400, 
    8987 
    90                 duration: 400, 
    91                  
    9288                _lastFocusItem:null, 
    93                                  
     89 
     90                postMixInProperties: function(){ 
     91                        this.genericMap = dojo.mixin(dojo.clone(this.genericMap), {title: "titleBar"}); 
     92                }, 
     93 
    9494                postCreate: function(){ 
    9595                        dojo.body().appendChild(this.domNode); 
    9696                        dijit.Dialog.superclass.postCreate.apply(this, arguments); 
     
    188188                                var node = evt.target; 
    189189                                // see if we are shift-tabbing from titleBar 
    190190                                if(node == this.titleBar && evt.shiftKey && evt.keyCode == dojo.keys.TAB){ 
    191                                         if (this._lastFocusItem){ 
     191                                        if(this._lastFocusItem){ 
    192192                                                this._lastFocusItem.focus(); // send focus to last item in dialog if known 
    193193                                        } 
    194194                                        dojo.stopEvent(evt); 
    195195                                }else{ 
    196196                                        // see if the key is for the dialog 
    197                                         while (node){ 
     197                                        while(node){ 
    198198                                                if(node == this.domNode){ 
    199                                                         if (evt.keyCode == dojo.keys.ESCAPE){ 
     199                                                        if(evt.keyCode == dojo.keys.ESCAPE){ 
    200200                                                                this.hide();  
    201201                                                        }else{ 
    202202                                                                return; // just let it go 
     
    205205                                                node = node.parentNode; 
    206206                                        } 
    207207                                        // this key is for the disabled document window 
    208                                         if (evt.keyCode != dojo.keys.TAB){ // allow tabbing into the dialog for a11y 
     208                                        if(evt.keyCode != dojo.keys.TAB){ // allow tabbing into the dialog for a11y 
    209209                                                dojo.stopEvent(evt); 
    210210                                        // opera won't tab to a div 
    211211                                        }else if (!dojo.isOpera){ 
  • Users/peller/workspace/trunk/dijit/layout/StackContainer.js

     
    362362                        switch(evt.keyCode){                             
    363363                                case dojo.keys.LEFT_ARROW: 
    364364                                case dojo.keys.UP_ARROW: 
    365                                         forward=false; 
     365                                        forward = false; 
    366366                                        // fall through 
    367367                                case dojo.keys.RIGHT_ARROW: 
    368368                                case dojo.keys.DOWN_ARROW: 
     
    370370                                        dojo.stopEvent(evt); 
    371371                                        break; 
    372372                                case dojo.keys.DELETE: 
    373                                         if (this._currentChild.closable){ 
     373                                        if(this._currentChild.closable){ 
    374374                                                this.onCloseButtonClick(this._currentChild);