Changeset 10527
- Timestamp:
- 09/16/07 21:17:19 (8 months ago)
- Location:
- dijit/trunk
- Files:
-
- 22 modified
-
changes.txt (modified) (2 diffs)
-
Dialog.js (modified) (5 diffs)
-
form/Button.js (modified) (1 diff)
-
form/InlineEditBox.js (modified) (1 diff)
-
form/Slider.js (modified) (1 diff)
-
form/templates/Button.html (modified) (1 diff)
-
form/templates/CheckBox.html (modified) (1 diff)
-
form/templates/ComboBox.html (modified) (1 diff)
-
form/templates/ComboButton.html (modified) (2 diffs)
-
form/templates/DropDownButton.html (modified) (1 diff)
-
form/templates/HorizontalSlider.html (modified) (2 diffs)
-
form/templates/Spinner.html (modified) (1 diff)
-
form/templates/TextBox.html (modified) (1 diff)
-
form/templates/VerticalSlider.html (modified) (2 diffs)
-
form/Textarea.js (modified) (1 diff)
-
form/TextBox.js (modified) (1 diff)
-
form/_FormWidget.js (modified) (3 diffs)
-
layout/StackContainer.js (modified) (1 diff)
-
layout/templates/TooltipDialog.html (modified) (1 diff)
-
templates/Dialog.html (modified) (1 diff)
-
_Templated.js (modified) (3 diffs)
-
_Widget.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/changes.txt
r9679 r10527 26 26 createWidget() call removed since multiple renderers are no longer supported (see next section). 27 27 28 At least for the dijit widgets, all widgets are guaranteed to work program atically, which in28 At least for the dijit widgets, all widgets are guaranteed to work programmatically, which in 29 29 effect means that all widgets must have templates, unless the default <div> works. 30 30 … … 59 59 (not separated by semi-colons) 60 60 61 Standard HTML attributes like 'id', 'name', 'lang', etc. are carried over programmatically 62 by the _Widget constructor and do not need to be declared in the template (see _Widget.attributeMap) 63 61 64 Parent/Child relationships 62 65 -------------------------- -
dijit/trunk/Dialog.js
r10409 r10527 84 84 templatePath: dojo.moduleUrl("dijit", "templates/Dialog.html"), 85 85 86 // title: String87 // Title of the dialog88 title: "",89 90 86 // open: Boolean 91 87 // is True or False depending on state of dialog … … 95 91 96 92 _lastFocusItem:null, 93 94 attributeMap: dojo.mixin(dojo.clone(dijit._Widget.prototype.attributeMap), 95 {title: "titleBar"}), 97 96 98 97 postCreate: function(){ … … 193 192 // see if we are shift-tabbing from titleBar 194 193 if(node == this.titleBar && evt.shiftKey && evt.keyCode == dojo.keys.TAB){ 195 if (this._lastFocusItem){194 if(this._lastFocusItem){ 196 195 this._lastFocusItem.focus(); // send focus to last item in dialog if known 197 196 } … … 199 198 }else{ 200 199 // see if the key is for the dialog 201 while (node){200 while(node){ 202 201 if(node == this.domNode){ 203 if (evt.keyCode == dojo.keys.ESCAPE){204 this.hide(); 202 if(evt.keyCode == dojo.keys.ESCAPE){ 203 this.hide(); 205 204 }else{ 206 205 return; // just let it go … … 210 209 } 211 210 // this key is for the disabled document window 212 if (evt.keyCode != dojo.keys.TAB){ // allow tabbing into the dialog for a11y211 if(evt.keyCode != dojo.keys.TAB){ // allow tabbing into the dialog for a11y 213 212 dojo.stopEvent(evt); 214 213 // opera won't tab to a div -
dijit/trunk/form/Button.js
r10409 r10527 235 235 templatePath: dojo.moduleUrl("dijit.form", "templates/ComboButton.html"), 236 236 237 attributeMap: dojo.mixin(dojo.clone(dijit.form._FormWidget.prototype.attributeMap), 238 {id:"", name:""}), 239 237 240 // optionsTitle: String 238 241 // text that describes the options menu (accessibility) -
dijit/trunk/form/InlineEditBox.js
r10492 r10527 191 191 var isFirst = true; 192 192 dojo.forEach(value.split("\n"), function(line){ 193 if(isFirst){ isFirst = false; } 194 else { 193 if(isFirst){ 194 isFirst = false; 195 }else{ 195 196 _this.textNode.appendChild(document.createElement("BR")); // preserve line breaks 196 197 } -
dijit/trunk/form/Slider.js
r10445 r10527 41 41 42 42 widgetsInTemplate: true, 43 44 attributeMap: dojo.mixin(dojo.clone(dijit._Widget.prototype.attributeMap), 45 {id:"", name:"valueNode"}), 43 46 44 47 baseClass: "dijitSlider", -
dijit/trunk/form/templates/Button.html
r9820 r10527 3 3 ><div class='dijitRight' 4 4 ><button class="dijitStretch dijitButtonNode dijitButtonContents" dojoAttachPoint="focusNode,titleNode" 5 t abIndex="${tabIndex}" type="${type}" id="${id}" name="${name}" waiRole="button" waiState="labelledby-${id}_label"5 type="${type}" waiRole="button" waiState="labelledby-${id}_label" 6 6 ><div class="dijitInline ${iconClass}"></div 7 7 ><span class="dijitButtonText" id="${id}_label" dojoAttachPoint="containerNode">${label}</span -
dijit/trunk/form/templates/CheckBox.html
r10421 r10527 1 1 <span class="${baseClass}" baseClass="${baseClass}" 2 2 ><input 3 id="${id}" tabIndex="${tabIndex}" type="${_type}" name="${name}" value="${value}"3 type="${_type}" 4 4 class="dijitCheckBoxInput" 5 5 dojoAttachPoint="inputNode,focusNode" -
dijit/trunk/form/templates/ComboBox.html
r10421 r10527 3 3 ><tr 4 4 ><td class='dijitReset dijitStretch dijitInputField' dojoAttachPoint="nodeWithBorder" 5 ><input type="text" autocomplete="off" name="${name}"5 ><input type="text" autocomplete="off" 6 6 dojoAttachEvent="onkeypress, onkeyup, onfocus, onblur, compositionend" 7 dojoAttachPoint="textbox,focusNode" id='${id}' 8 tabIndex='${tabIndex}' size='${size}' maxlength='${maxlength}' 9 waiRole="combobox" 7 dojoAttachPoint="textbox,focusNode" waiRole="combobox" 10 8 /></td 11 9 ><td class='dijitReset dijitRight dijitButtonNode dijitDownArrowButton' -
dijit/trunk/form/templates/ComboButton.html
r10339 r10527 1 <table class='dijit dijitReset dijitInline dijitLeft dijitComboButton' baseClass='dijitComboButton'2 id="${id}" name="${name}"cellspacing='0' cellpadding='0'1 <table class='dijit dijitReset dijitInline dijitLeft dijitComboButton' baseClass='dijitComboButton' 2 cellspacing='0' cellpadding='0' 3 3 dojoAttachEvent="onmouseover:_onMouse,onmouseout:_onMouse,onmousedown:_onMouse"> 4 4 <tr> … … 15 15 baseClass="dijitComboButtonDownArrow" 16 16 title="${optionsTitle}" 17 tabIndex="${tabIndex}"18 17 waiRole="button" waiState="haspopup-true" 19 18 ><div waiRole="presentation">▼</div> -
dijit/trunk/form/templates/DropDownButton.html
r9833 r10527 2 2 dojoAttachEvent="onmouseover:_onMouse,onmouseout:_onMouse,onmousedown:_onMouse,onclick:_onArrowClick,onkeypress:_onKey" 3 3 ><div class='dijitRight'> 4 <button tabIndex="${tabIndex}" class="dijitStretch dijitButtonNode dijitButtonContents" type="${type}" id="${id}" name="${name}"4 <button class="dijitStretch dijitButtonNode dijitButtonContents" type="${type}" 5 5 dojoAttachPoint="focusNode,titleNode" waiRole="button" waiState="haspopup-true,labelledby-${id}_label" 6 6 ><div class="dijitInline ${iconClass}"></div -
dijit/trunk/form/templates/HorizontalSlider.html
r10445 r10527 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" 2 2 ><tr class="dijitReset" 3 3 ><td class="dijitReset" colspan="2"></td … … 13 13 ></td 14 14 ><td class="dijitReset" 15 ><input dojoAttachPoint="valueNode" name="${name}"type="hidden"15 ><input dojoAttachPoint="valueNode" type="hidden" 16 16 /><div style="position:relative;" dojoAttachPoint="sliderBarContainer" 17 17 ><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}" 19 19 ><div class="dijitSliderImageHandle dijitHorizontalSliderImageHandle"></div 20 20 ></div -
dijit/trunk/form/templates/Spinner.html
r10421 r10527 6 6 <td rowspan="2" class="dijitReset dijitStretch dijitInputField" dojoAttachPoint="nodeWithBorder"> 7 7 <input dojoAttachPoint="textbox,focusNode" type="${type}" dojoAttachEvent="onfocus,onkeyup" 8 name="${name}" size="${size}" maxlength="${maxlength}" 9 waiRole="spinbutton" autocomplete="off" tabIndex="${tabIndex}" id="${id}" 8 waiRole="spinbutton" autocomplete="off" 10 9 /></td> 11 10 <td class="dijitReset dijitRight dijitButtonNode dijitUpArrowButton" -
dijit/trunk/form/templates/TextBox.html
r10421 r10527 1 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}'/>2 class="dijitInputField" type='${type}' /> -
dijit/trunk/form/templates/VerticalSlider.html
r10445 r10527 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" 2 2 ><tbody class="dijitReset" 3 3 ><tr class="dijitReset" 4 4 ><td class="dijitReset"></td 5 5 ><td class="dijitReset dijitSliderButtonContainer dijitVerticalSliderButtonContainer" 6 ><div class="dijitVerticalSliderIncrementIcon" tabIndex= -1style="display:none" dojoAttachPoint="incrementButton" dojoAttachEvent="onclick: increment"><span class="dijitSliderButtonInner">+</a></span></div6 ><div class="dijitVerticalSliderIncrementIcon" tabIndex="-1" style="display:none" dojoAttachPoint="incrementButton" dojoAttachEvent="onclick: increment"><span class="dijitSliderButtonInner">+</a></span></div 7 7 ></td 8 8 ><td class="dijitReset"></td … … 18 18 ><td dojoAttachPoint="leftDecoration" class="dijitReset" style="text-align:center;height:100%;"></td 19 19 ><td class="dijitReset" style="height:100%;" 20 ><input dojoAttachPoint="valueNode" type="hidden" name="${name}"20 ><input dojoAttachPoint="valueNode" type="hidden" 21 21 /><center style="position:relative;height:100%;" dojoAttachPoint="sliderBarContainer" 22 22 ><div dojoAttachPoint="remainingBar" class="dijitSliderBar dijitVerticalSliderBar dijitSliderRemainingBar dijitVerticalSliderRemainingBar" dojoAttachEvent="onclick:_onBarClick"></div 23 23 ><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}" 25 25 ><div class="dijitSliderImageHandle dijitVerticalSliderImageHandle"></div 26 26 ></div -
dijit/trunk/form/Textarea.js
r10430 r10527 105 105 // An additional problem is that the browser gives the document object a 106 106 // very cryptic accessible name, e.g. 107 // wy ciwyg://13/http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/form/test_InlineEditBox.html107 // wysiwyg://13/http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/form/test_InlineEditBox.html 108 108 // When focus is fired from the document object, the screen reader speaks 109 109 // the accessible name. The cyptic accessile name is confusing. -
dijit/trunk/form/TextBox.js
r10373 r10527 29 29 // size: String 30 30 // HTML INPUT tag size declaration. 31 size: " 20",31 size: "", 32 32 33 33 // maxlength: String 34 34 // HTML INPUT tag maxlength declaration. 35 maxlength: " 999999",35 maxlength: "", 36 36 37 37 templatePath: dojo.moduleUrl("dijit.form", "templates/TextBox.html"), 38 39 attributeMap: dojo.mixin(dojo.clone(dijit.form._FormWidget.prototype.attributeMap), 40 {size:"focusNode", maxlength:"focusNode"}), 38 41 39 42 getTextValue: function(){ -
dijit/trunk/form/_FormWidget.js
r10409 r10527 57 57 // Fires onChange for each value change or only on demand 58 58 intermediateChanges: false, 59 60 // These mixins assume that the focus node is an INPUT, as many but not all _FormWidgets are. 61 // Don't attempt to mixin the 'type' attribute here programatically -- it must be declared 62 // directly in the template as read by the parser in order to function 63 attributeMap: dojo.mixin(dojo.clone(dijit._Widget.prototype.attributeMap), 64 {id:"focusNode", name:"focusNode", value:"focusNode", tabIndex:"focusNode", alt:"focusNode"}), 59 65 60 66 setDisabled: function(/*Boolean*/ disabled){ … … 147 153 148 154 // get original class (non state related) specified in template 149 var origClass = (this.st yleNode||this.domNode).className;155 var origClass = (this.stateNode||this.domNode).className; 150 156 151 157 // compute list of classname representing the states of the widget … … 177 183 } 178 184 179 (this.st yleNode || this.domNode).className = origClass + " " + classes.join(" ");185 (this.stateNode || this.domNode).className = origClass + " " + classes.join(" "); 180 186 }, 181 187 -
dijit/trunk/layout/StackContainer.js
r10519 r10527 381 381 break; 382 382 case dojo.keys.DELETE: 383 if (this._currentChild.closable){383 if(this._currentChild.closable){ 384 384 this.onCloseButtonClick(this._currentChild); 385 385 dojo.stopEvent(evt); -
dijit/trunk/layout/templates/TooltipDialog.html
r9732 r10527 1 <div id="${id}"class="dijitTooltipDialog" >1 <div class="dijitTooltipDialog" > 2 2 <div class="dijitTooltipContainer"> 3 <div class ="dijitTooltipContents dijitTooltipFocusNode" dojoAttachPoint="containerNode" tabindex="0" waiRole="dialog"></div>3 <div class ="dijitTooltipContents dijitTooltipFocusNode" dojoAttachPoint="containerNode" tabindex="0" waiRole="dialog"></div> 4 4 </div> 5 5 <span dojoAttachPoint="tabEnd" tabindex="0" dojoAttachEvent="focus:_cycleFocus"></span> -
dijit/trunk/templates/Dialog.html
r9703 r10527 1 1 <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> 7 7 </div> 8 8 <div dojoAttachPoint="containerNode" class="dijitDialogPaneContent"></div> -
dijit/trunk/_Templated.js
r10450 r10527 41 41 buildRendering: function(){ 42 42 // 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 45 45 // Lookup cached version of template, and download to cache if it 46 46 // isn't there already. Returns either a DomNode or a string, depending on 47 47 // whether or not the template contains ${foo} replacement parameters. 48 49 48 var cached = dijit._Templated.getCachedTemplate(this.templatePath, this.templateString); 50 49 … … 75 74 // attachment points which should be defined on the template node. 76 75 this._attachTemplateNodes(node); 77 if(this.srcNodeRef){ 78 dojo.style(this.styleNode || 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); 82 80 } 83 81 84 82 this.domNode = node; 85 if(this.srcNodeRef && this.srcNodeRef.parentNode){86 this.srcNodeRef.parentNode.replaceChild(this.domNode, this.srcNodeRef);87 }88 83 if(this.widgetsInTemplate){ 89 var childWidgets = dojo.parser.parse( this.domNode);84 var childWidgets = dojo.parser.parse(node); 90 85 this._attachTemplateNodes(childWidgets, function(n,p){ 91 86 return n[p]; … … 93 88 } 94 89 95 this._fillContent( this.srcNodeRef);90 this._fillContent(source); 96 91 }, 97 92 -
dijit/trunk/_Widget.js
r10486 r10527 20 20 dir: "", 21 21 22 // class: String 23 // HTML class attribute 24 "class": "", 25 26 // style: String 27 // HTML style attribute 28 style: "", 29 30 // title: String 31 // HTML title attribute 32 title: "", 33 22 34 // srcNodeRef: DomNode 23 35 // pointer to original dom node 24 36 srcNodeRef: null, 25 37 26 // domNode DomNode:38 // domNode: DomNode 27 39 // this is our visible representation of the widget! Other DOM 28 40 // Nodes may by assigned to other properties, usually through the … … 31 43 domNode: null, 32 44 45 // attributeMap: Object 46 // A map of attributes -- typically standard HTML attributes -- to transfer 47 // from the parsed node into the new dom, at the widget's domNode, by default. 48 // Other node references can be specified as properties of 'this' 49 attributeMap: {id:"", dir:"", lang:"", "class":"", style:"", title:""}, // TODO: add on* handlers? 50 33 51 //////////// INITIALIZATION METHODS /////////////////////////////////////// 34 52 … … 37 55 }, 38 56 39 create: function(params, srcNodeRef) {57 create: function(params, srcNodeRef){ 40 58 // summary: 41 59 // To understand the process by which widgets are instantiated, it … … 89 107 90 108 this.buildRendering(); 109 110 // Copy attributes listed in attributeMap into the newly created DOM for the widget 111 // The placement of these attributes is according to the property mapping in attributeMap 112 // Note special handling for 'style' and 'class' attributes which are lists and can 113 // have elements from both old and new structures, and some attributes like "type" 114 // cannot be processed this way as they are not mutable. 115 116 //KLUDGE: skip the widgets which aren't yet working. See #3058 117 if(!/dijit\.form\.(Slider|TextArea|ComboBox|FilteringSelect)/.test(this.declaredClass)) 118 119 for(var attr in this.attributeMap){ 120 if(this.domNode){ 121 var node = this[this.attributeMap[attr] || "domNode"]; 122 var value = this[attr]; 123 if(value !== "" || (params && params[attr])){ 124 var domValue = node.getAttribute(attr); 125 // Deal with IE quirks for 'class' and 'style' 126 switch(attr){ 127 case "class": 128 domValue = node.className; 129 break; 130 case "style": 131 if(domValue && dojo.isObject(domValue)){ 132 domValue = domValue.cssText; // required for IE, doesn't work in Opera 133 } 134 } 135 if(domValue){ 136 var delim = {style: ";", "class": " "}[attr]; 137 // style and class attributes are special and contain lists 138 // which need to be combined 139 if(delim){ 140 value += delim + domValue; 141 domValue = null; 142