Changeset 12827
- Timestamp:
- 03/03/08 03:36:23 (10 months ago)
- Location:
- dojo/trunk/_base
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
dojo/trunk/_base/array.js
r12798 r12827 22 22 // description: 23 23 // For details on this method, see: 24 // http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:indexOf24 // <http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:indexOf> 25 25 26 26 var step = 1, end = array.length, i = (fromIndex||0); -
dojo/trunk/_base/html.js
r12454 r12827 25 25 // id: String|DOMNode 26 26 // DOM id or DOM Node 27 // doc: DocumentElement 27 // doc: DocumentElement? 28 28 // Document to work in. Defaults to the current value of 29 29 // dojo.doc. Can be used to retreive -
dojo/trunk/_base/query.js
r12533 r12827 48 48 var d = dojo; 49 49 var childNodesName = dojo.isIE ? "children" : "childNodes"; 50 var caseSensitive = false; 50 51 51 52 var getQueryParts = function(query){ … … 255 256 var prefix; 256 257 var postfix = ""; 257 // FIXME: need to add support for ~ and +258 258 if(tqp.oper == ">"){ 259 259 prefix = "/"; … … 317 317 318 318 var doc = d.doc; 319 // var parent = d.body(); // FIXME 320 // FIXME: don't need to memoize. The closure scope handles it for us. 319 // don't need to memoize. The closure scope handles it for us. 321 320 var xpath = buildPath(path); 322 321 … … 349 348 // function. 350 349 351 // FIXME: need to add support for alternate roots352 350 return getXPathFunc(query)(); 353 351 } … … 937 935 ); 938 936 // uncomment to disable XPath for testing and tuning the DOM path 939 _getQueryFunc = getStepQueryFunc;937 // _getQueryFunc = getStepQueryFunc; 940 938 941 939 // FIXME: we've got problems w/ the NodeList query()/filter() functions if we go XPath for everything … … 981 979 982 980 // FIXME: 983 // Dean's newBase2 uses a system whereby queries themselves note if981 // Dean's Base2 uses a system whereby queries themselves note if 984 982 // they'll need duplicate filtering. We need to get on that plan!! 985 983 … … 1025 1023 // dojo.query() supports a rich set of CSS3 selectors, including: 1026 1024 // 1027 // * class selectors (e.g., ".foo") 1028 // * node type selectors like "span" 1029 // * " " descendant selectors 1030 // * ">" child element selectors 1031 // * "#foo" style ID selectors 1032 // * "*" universal selector 1025 // * class selectors (e.g., `.foo`) 1026 // * node type selectors like `span` 1027 // * ` ` descendant selectors 1028 // * `>` child element selectors 1029 // * `#foo` style ID selectors 1030 // * `*` universal selector 1031 // * `~`, the immediately preceeded-by sibling selector 1032 // * `+`, the preceeded-by sibling selector 1033 1033 // * attribute queries: 1034 // * "[foo]" attribute presence selector 1035 // * "[foo='bar']" attribute value exact match 1036 // * "[foo~='bar']" attribute value list item match 1037 // * "[foo^='bar']" attribute start match 1038 // * "[foo$='bar']" attribute end match 1039 // * "[foo*='bar']" attribute substring match 1040 // * ":first-child", ":last-child" positional selectors 1041 // * ":nth-child(n)", ":nth-child(2n+1)" style positional calculations 1042 // * ":nth-child(even)", ":nth-child(odd)" positional selectors 1043 // * ":not(...)" negation pseudo selectors 1034 // * `[foo]` attribute presence selector 1035 // * `[foo='bar']` attribute value exact match 1036 // * `[foo~='bar']` attribute value list item match 1037 // * `[foo^='bar']` attribute start match 1038 // * `[foo$='bar']` attribute end match 1039 // * `[foo*='bar']` attribute substring match 1040 // * `:first-child`, `:last-child` positional selectors 1041 // * `:empty` content emtpy selector 1042 // * `:empty` content emtpy selector 1043 // * `:nth-child(n)`, `:nth-child(2n+1)` style positional calculations 1044 // * `:nth-child(even)`, `:nth-child(odd)` positional selectors 1045 // * `:not(...)` negation pseudo selectors 1044 1046 // 1045 // Any legal combination of th ose selector types as per the CSS 3 sepc1046 // will work with dojo.query(), including compound selectors (","1047 // delimited). Very complex and useful searches can be constructed1048 // with thispalette of selectors and when combined with functions for1047 // Any legal combination of these selectors will work with 1048 // `dojo.query()`, including compound selectors ("," delimited). 1049 // Very complex and useful searches can be constructed with this 1050 // palette of selectors and when combined with functions for 1049 1051 // maniplation presented by dojo.NodeList, many types of DOM 1050 1052 // manipulation operations become very straightforward. 1051 1053 // 1052 1054 // Unsupported Selectors: 1053 // -------------------- 1055 // ---------------------- 1054 1056 // 1055 1057 // While dojo.query handles many CSS3 selectors, some fall outside of … … 1058 1060 // 1059 1061 // * namespace-differentiated selectors of any form 1060 // * "~", the immediately preceeded-by sibling selector 1061 // * "+", the preceeded-by sibling selector 1062 // * all "::" pseduo-element selectors 1062 // * all `::` pseduo-element selectors 1063 1063 // * certain pseduo-selectors which don't get a lot of day-to-day use: 1064 // * :root, :lang(), :target, :focus1064 // * `:root`, `:lang()`, `:target`, `:focus` 1065 1065 // * all visual and state selectors: 1066 // * :root, :active, :hover, :visisted, :link, :enabled, :disabled, :checked 1067 // * :*-of-type pseudo selectors 1066 // * `:root`, `:active`, `:hover`, `:visisted`, `:link`, 1067 // `:enabled`, `:disabled`, `:checked` 1068 // * `:*-of-type` pseudo selectors 1068 1069 // 1069 1070 // dojo.query and XML Documents: 1070 1071 // ----------------------------- 1071 // FIXME1072 1072 // 1073 // NOTE: elementsById is not currently supported 1074 // NOTE: ignores xpath-ish queries for now 1073 // `dojo.query` currently only supports searching XML documents 1074 // whose tags and attributes are 100% lower-case. This is a known 1075 // limitation and will [be addressed soon](http://trac.dojotoolkit.org/ticket/3866) 1076 // Non-selector Queries: 1077 // --------------------- 1078 // 1079 // If something other than a String is passed for the query, 1080 // `dojo.query` will return a new `dojo.NodeList` constructed from 1081 // that parameter alone and all further processing will stop. This 1082 // means that if you have a reference to a node or NodeList, you 1083 // can quickly construct a new NodeList from the original by 1084 // calling `dojo.query(node)` or `dojo.query(list)`. 1075 1085 // 1076 1086 // query: 1077 1087 // The CSS3 expression to match against. For details on the syntax of 1078 // CSS3 selectors, see: 1079 // http://www.w3.org/TR/css3-selectors/#selectors 1088 // CSS3 selectors, see <http://www.w3.org/TR/css3-selectors/#selectors> 1080 1089 // root: 1081 // A node (or string ID of a node) to scope the search from. Optional.1082 // returns: 1083 // An instance of dojo.NodeList. Many methods are available on1090 // A DOMNode (or node id) to scope the search from. Optional. 1091 // returns: dojo.NodeList 1092 // An instance of `dojo.NodeList`. Many methods are available on 1084 1093 // NodeLists for searching, iterating, manipulating, and handling 1085 1094 // events on the matched nodes in the returned list. 1095 // example: 1096 // search the entire document for elements with the class "foo": 1097 // | dojo.query(".foo"); 1098 // these elements will match: 1099 // | <span class="foo"></span> 1100 // | <span class="foo bar"></span> 1101 // | <p class="thud foo"></p> 1102 // example: 1103 // search the entire document for elements with the classes "foo" *and* "bar": 1104 // | dojo.query(".foo.bar"); 1105 // these elements will match: 1106 // | <span class="foo bar"></span> 1107 // while these will not: 1108 // | <span class="foo"></span> 1109 // | <p class="thud foo"></p> 1110 // example: 1111 // find `<span>` elements which are descendants of paragraphs and 1112 // which have a "highlighted" class: 1113 // | dojo.query("p span.highlighted"); 1114 // the innermost span in this fragment matches: 1115 // | <p class="foo"> 1116 // | <span>... 1117 // | <span class="highlighted foo bar">...</span> 1118 // | </span> 1119 // | </p> 1120 // example: 1121 // set an "odd" class on all odd table rows inside of the table 1122 // `#tabular_data`, using the `>` (direct child) selector to avoid 1123 // affecting any nested tables: 1124 // | dojo.query("#tabular_data > tbody > tr:nth-child(odd)").addClass("odd"); 1125 // example: 1126 // remove all elements with the class "error" from the document 1127 // and store them in a list: 1128 // | var errors = dojo.query(".error").orphan(); 1129 // example: 1130 // add an onclick handler to every submit button in the document 1131 // which causes the form to be sent via Ajax instead: 1132 // | dojo.query("input[type='submit']").onclick(function(e){ 1133 // | dojo.stopEvent(e); // prevent sending the form 1134 // | var btn = e.target; 1135 // | dojo.xhrPost({ 1136 // | form: btn.form, 1137 // | load: function(data){ 1138 // | // replace the form with the response 1139 // | var div = dojo.doc.createElement("div"); 1140 // | dojo.place(div, btn.form, "after"); 1141 // | div.innerHTML = data; 1142 // | dojo.style(btn.form, "display", "none"); 1143 // | } 1144 // | }); 1145 // | }); 1146 1147 1148 // NOTE: elementsById is not currently supported 1149 // NOTE: ignores xpath-ish queries for now 1086 1150 1087 1151 if(query.constructor == d.NodeList){ … … 1095 1159 } 1096 1160 1097 // FIXME: should support more methods on the return than the stock array. 1098 return _zip(getQueryFunc(query)(root||d.doc)); 1161 return _zip(getQueryFunc(query)(root||d.doc)); // dojo.NodeList 1099 1162 } 1100 1163 -
dojo/trunk/_base/window.js
r12662 r12827 62 62 // correctly in managed contexts. 63 63 // example: 64 // n.appendChild(dojo.doc.createElement('div'));64 // | n.appendChild(dojo.doc.createElement('div')); 65 65 } 66 66 =====*/ … … 72 72 // return the body object associated with dojo.doc 73 73 // example: 74 // dojo.body().appendChild(dojo.doc.createElement('div'));74 // | dojo.body().appendChild(dojo.doc.createElement('div')); 75 75 76 76 // Note: document.body is not defined for a strict xhtml document … … 83 83 // changes the behavior of many core Dojo functions that deal with 84 84 // namespace and DOM lookup, changing them to work in a new global 85 // context. The varibles dojo.global and dojo.doc 86 // are modified as a result of calling this function. 85 // context (e.g., an iframe). The varibles dojo.global and dojo.doc 86 // are modified as a result of calling this function and the result of 87 // `dojo.body()` likewise differs. 87 88 dojo.global = globalObject; 88 89 dojo.doc = globalDocument; -
dojo/trunk/_base/_loader/loader.js
r12814 r12827 14 14 _modulePrefixes: { 15 15 dojo: { name: "dojo", value: "." }, 16 dojox: { name: "dojox", value: "../dojox" },17 dijit: { name: "dijit", value: "../dijit" },16 // dojox: { name: "dojox", value: "../dojox" }, 17 // dijit: { name: "dijit", value: "../dijit" }, 18 18 doh: { name: "doh", value: "../util/doh" }, 19 19 tests: { name: "tests", value: "tests" } … … 79 79 } 80 80 81 dojo._loadUri = function(/*String (URL)*/uri, /*Function?*/cb){81 dojo._loadUri = function(/*String*/uri, /*Function?*/cb){ 82 82 // summary: 83 83 // Loads JavaScript from a URI … … 114 114 115 115 // FIXME: probably need to add logging to this method 116 dojo._loadUriAndCheck = function(/*String (URL)*/uri, /*String*/moduleName, /*Function?*/cb){116 dojo._loadUriAndCheck = function(/*String*/uri, /*String*/moduleName, /*Function?*/cb){ 117 117 // summary: calls loadUri then findModule and returns true if both succeed 118 118 var ok = false; … … 135 135 this._loadNotifying = true; 136 136 this._postLoad = true; 137 var mll = this._loaders;137 var mll = d._loaders; 138 138 139 139 //Clear listeners so new ones can be added … … 154 154 //after this first run. If something did, and we are not waiting for any 155 155 //more inflight resources, run again. 156 if(d._postLoad && d._inFlightCount == 0 && this._loaders.length){156 if(d._postLoad && d._inFlightCount == 0 && mll.length){ 157 157 d._callLoaded(); 158 158 }