Changeset 3713
- Timestamp:
- 04/29/06 17:06:28 (3 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 79 modified
-
buildscripts/build.xml (modified) (2 diffs)
-
buildscripts/doctool/inline.html (modified) (1 diff)
-
buildscripts/getDependencyList.js (modified) (4 diffs)
-
documents/apis/dojo.html (modified) (2 diffs)
-
documents/apis/hostenv.html (modified) (1 diff)
-
documents/articles/dojo_classes.rest (modified) (1 diff)
-
documents/articles/fast_widget_authoring.rest (modified) (1 diff)
-
documents/manual/rest/dojo.rest (modified) (3 diffs)
-
dojo.js (modified) (2 diffs)
-
src/bootstrap1.js (modified) (7 diffs)
-
src/bootstrap2.js (modified) (4 diffs)
-
src/browser_debug.js (modified) (4 diffs)
-
src/collections/BinaryTree.js (modified) (1 diff)
-
src/collections/SkipList.js (modified) (1 diff)
-
src/compat (added)
-
src/compat/0.2.2.js (added)
-
src/crypto/Rijndael.js (modified) (1 diff)
-
src/crypto/SHA1.js (modified) (1 diff)
-
src/crypto/SHA256.js (modified) (1 diff)
-
src/data/__package__.js (modified) (1 diff)
-
src/debug.js (added)
-
src/experimental.js (added)
-
src/hostenv_adobesvg.js (modified) (10 diffs)
-
src/hostenv_browser.js (modified) (3 diffs)
-
src/hostenv_jsc.js (modified) (3 diffs)
-
src/hostenv_rhino.js (modified) (2 diffs)
-
src/hostenv_spidermonkey.js (modified) (1 diff)
-
src/hostenv_svg.js (modified) (2 diffs)
-
src/hostenv_wsh.js (modified) (1 diff)
-
src/io/BrowserIO.js (modified) (1 diff)
-
src/io/cookies.js (modified) (1 diff)
-
src/lang/Lang.js (modified) (1 diff)
-
src/logging/Logger.js (modified) (3 diffs)
-
src/math/Math.js (modified) (1 diff)
-
src/reflect/reflection.js (modified) (1 diff)
-
src/reflect/__package__.js (modified) (1 diff)
-
src/text/Builder.js (modified) (1 diff)
-
src/text/String.js (modified) (1 diff)
-
src/text/Text.js (modified) (1 diff)
-
src/uuid/__package__.js (modified) (1 diff)
-
src/widget/AccordionPane.js (modified) (1 diff)
-
src/widget/Button.js (modified) (1 diff)
-
src/widget/Button2.js (modified) (1 diff)
-
src/widget/Checkbox.js (modified) (1 diff)
-
src/widget/ComboBox.js (modified) (1 diff)
-
src/widget/ContentPane.js (modified) (1 diff)
-
src/widget/ContextMenu.js (modified) (1 diff)
-
src/widget/DatePicker.js (modified) (1 diff)
-
src/widget/DebugConsole.js (modified) (1 diff)
-
src/widget/DocPane.js (modified) (1 diff)
-
src/widget/DomWidget.js (modified) (2 diffs)
-
src/widget/DropdownButton.js (modified) (1 diff)
-
src/widget/HslColorPicker.js (modified) (1 diff)
-
src/widget/html/ContextMenu.js (modified) (1 diff)
-
src/widget/HtmlWidget.js (modified) (1 diff)
-
src/widget/LinkPane.js (modified) (1 diff)
-
src/widget/Manager.js (modified) (2 diffs)
-
src/widget/Menu.js (modified) (1 diff)
-
src/widget/MenuItem.js (modified) (1 diff)
-
src/widget/MonthlyCalendar.js (modified) (1 diff)
-
src/widget/Parse.js (modified) (1 diff)
-
src/widget/SortableTable.js (modified) (1 diff)
-
src/widget/SvgWidget.js (modified) (1 diff)
-
src/widget/TaskBar.js (modified) (1 diff)
-
src/widget/TimePicker.js (modified) (1 diff)
-
src/widget/TitlePane.js (modified) (1 diff)
-
src/widget/Tooltip.js (modified) (1 diff)
-
src/widget/Widget.js (modified) (6 diffs)
-
src/xml/domUtil.js (modified) (1 diff)
-
src/xml/htmlUtil.js (modified) (8 diffs)
-
tests/compat (added)
-
tests/compat/test_compat.html (added)
-
tests/event/test_browserevent.html (modified) (1 diff)
-
tests/fx/test_color.html (modified) (1 diff)
-
tests/io/test_BrowserIO.cache.html (modified) (1 diff)
-
tests/io/test_BrowserIO.formNode.html (modified) (1 diff)
-
tests/io/test_BrowserIO.html (modified) (1 diff)
-
tests/io/test_BrowserIO.timeout.html (modified) (1 diff)
-
tests/io/test_Cookies.html (modified) (1 diff)
-
tests/logging/test_Logger.js (modified) (1 diff)
-
tests/test_bootstrap.html (modified) (1 diff)
-
tests/test_dom.html (modified) (1 diff)
-
tests/test_hostenv_adobesvg.svg (modified) (2 diffs)
-
tests/widget/deprecated/test_Button_lots2.html (modified) (1 diff)
-
tests/widget/test_Toolbar.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/buildscripts/build.xml
r3481 r3713 8 8 should we support these as HTML? Or just JS files? 9 9 NOTE: the following command issued from the top-level seems to work correctly: 10 perl buildscripts/jslink.pl -pre cat -i release/testUsage.js -l src/bootstrap1.js -l src/ hostenv_browser.js -l src/bootstrap2.js -l src/io/IO.js -l src/io/BrowserIO.js -o - > release/minimal.js10 perl buildscripts/jslink.pl -pre cat -i release/testUsage.js -l src/bootstrap1.js -l src/bootstrap2.js -l src/hostenv_browser.js -l src/io/IO.js -l src/io/BrowserIO.js -o - > release/minimal.js 11 11 This correctly "links" the files together, but mangles some 12 12 identifiers and places anonymous inner functions at the wrong places … … 486 486 </concat> 487 487 <!-- 488 clobber require AfterIf and requireAfterstatements since they488 clobber requireIf and requireAfterIf statements since they 489 489 aren't applicable in build 490 490 --> 491 <replaceregexp match="dojo.require AfterIf\((.*?)\);"491 <replaceregexp match="dojo.requireIf\((.*?)\);" 492 492 byline="true" flags="g" file="${release_dir}/source.__package__.js"> 493 493 <substitution expression=""/> 494 494 </replaceregexp> 495 495 496 <replaceregexp match="dojo.requireAfter \((.*?)\);"496 <replaceregexp match="dojo.requireAfterIf\((.*?)\);" 497 497 byline="true" flags="g" file="${release_dir}/source.__package__.js"> 498 498 <substitution expression=""/> -
trunk/buildscripts/doctool/inline.html
r1568 r3713 133 133 dj_eval_object_path 134 134 dj_error_to_string 135 dj_debug136 dj_throw137 dj_rethrow138 135 dj_eval 139 dj_unimplemented140 dj_deprecated141 dj_inherits142 136 dj_load 143 137 dj_last_script_src -
trunk/buildscripts/getDependencyList.js
r3005 r3713 28 28 29 29 load("../src/bootstrap1.js"); 30 load("../src/bootstrap2.js"); 30 31 load("../src/hostenv_rhino.js"); 31 load("../src/bootstrap2.js");32 32 // FIXME: is this really what we want to say? 33 33 dojo.render.html.capable = true; 34 34 35 35 dojo.hostenv.loadedUris.push("../src/bootstrap1.js"); 36 dojo.hostenv.loadedUris.push("../src/bootstrap2.js"); 36 37 if(!this["hostenvType"]){ 37 38 hostenvType = "browser"; … … 46 47 dojo.hostenv.loadedUris.push("../src/hostenv_"+hostenvType+".js"); 47 48 } 48 dojo.hostenv.loadedUris.push("../src/bootstrap2.js");49 49 50 50 if(dependencies["prefixes"]){ … … 95 95 var tmp; 96 96 RegExp.lastIndex = 0; 97 var testExp = /dojo.(hostenv.loadModule|hosetnv.require|require| requireIf|requireAll|hostenv.conditionalLoadModule|hostenv.startPackage|hostenv.provide|provide)\([\w\W]*?\)/mg;97 var testExp = /dojo.(hostenv.loadModule|hosetnv.require|require|hostenv.conditionalLoadModule|hostenv.startPackage|provide)\([\w\W]*?\)/mg; 98 98 while((tmp = testExp.exec(contents)) != null){ 99 99 deps.push(tmp[0]); … … 110 110 var tmp; 111 111 RegExp.lastIndex = 0; 112 var testExp = /dojo.(requireAfterIf|require After)\([\w\W]*?\)/mg;112 var testExp = /dojo.(requireAfterIf|requireIf)\([\w\W]*?\)/mg; 113 113 while((tmp = testExp.exec(contents)) != null){ 114 114 deps.push(tmp[0]); -
trunk/documents/apis/dojo.html
r1562 r3713 4 4 dj_eval_object_path 5 5 dj_error_to_string 6 dj_debug7 dj_throw8 dj_rethrow9 6 dj_eval 10 dj_unimplemented11 dj_deprecated12 dj_inherits13 7 dj_load 14 8 dj_last_script_src … … 24 18 require () 25 19 requireIf () 26 conditionalRequire ()27 kwCompoundRequire ()28 20 provide () 29 21 </pre><h3>Properties</h3><pre>Object <a href="version.html">version</a> -
trunk/documents/apis/hostenv.html
r1562 r3713 4 4 getVersion () 5 5 getText (uri, _81, _82) 6 getLibraryScriptUri ()7 6 getBaseScriptUri () 8 setBaseScriptUri (uri)9 7 loadPath (_37, _38, cb) 10 8 loadUri (uri, cb) -
trunk/documents/articles/dojo_classes.rest
r2522 r3713 137 137 138 138 fixes to ecmascript implementations 139 dj_import(), dj_class(), dj_throw(),and any othe pseduo language extensions139 dj_import(), dj_class(), and any othe pseduo language extensions 140 140 141 141 .. raw:: html -
trunk/documents/articles/fast_widget_authoring.rest
r3130 r3713 78 78 } 79 79 // complete the inheritance process 80 d j_inherits(dojo.widget.SlideShow, dojo.widget.HtmlWidget);80 dojo.inherits(dojo.widget.SlideShow, dojo.widget.HtmlWidget); 81 81 // make it a tag 82 82 dojo.widget.tags.addParseTreeHandler("dojo:slideshow"); -
trunk/documents/manual/rest/dojo.rest
r3193 r3713 145 145 been loaded. For example, the contents of ``src/io/__package__.js`` may be:: 146 146 147 dojo. kwCompoundRequire({147 dojo.hostenv.conditionalLoadModule({ 148 148 common: ["dojo.io"], 149 149 rhino: ["dojo.io.RhinoIO"], … … 207 207 Nothing. 208 208 209 ``requireAfter(modulename)``: 210 211 Load ``modulename`` *after* the current namespace has finished evaluating. 209 ``requireAfterIf(condition, modulename)``: 210 211 Deprecated. Alias for requireIf. Use that method instead. 212 213 ``condition``: 214 String or Boolean. 212 215 213 216 ``modulename``: … … 217 220 Nothing. 218 221 219 ``requireAfterIf(condition, modulename)``: 220 221 Load ``modulename`` *after* the current namespace has finished evaluating if 222 ``condition`` is met. 223 224 ``condition``: 225 String or Boolean. 226 227 ``modulename``: 228 String. The name of the module to load. 229 230 *return*: 231 Nothing. 232 233 ``kwCompoundRequire(requireMap)``: 222 ``hostenv.conditionalLoadModule(requireMap)``: 234 223 235 224 Loads specified modules based on hostenv type. When the following map is 236 225 used:: 237 226 238 dojo. kwCompoundRequire({227 dojo.hostenv.conditionalLoadModule({ 239 228 common: ["dojo.io"], 240 229 rhino: ["dojo.io.RhinoIO"], -
trunk/dojo.js
r3507 r3713 14 14 hostEnv = "dashboard"; 15 15 } 16 var tmps = ["bootstrap1.js", " hostenv_"+hostEnv+".js", "bootstrap2.js"];16 var tmps = ["bootstrap1.js", "bootstrap2.js", "hostenv_"+hostEnv+".js"]; 17 17 18 18 if(hostEnv == "dashboard"){ … … 52 52 } 53 53 54 //Support compatibility packages. Right now this only allows setting one 55 //compatibility package. Might need to revisit later down the line to support 56 //more than one. 57 if((this["djConfig"])&&(djConfig["compat"])){ 58 tmps.push("compat/" + djConfig["compat"] + ".js"); 59 } 60 61 if((this["djConfig"])&&((djConfig["isDebug"])||(djConfig["debugAtAllCosts"]))){ 62 tmps.push("debug.js"); 63 } 64 54 65 if((this["djConfig"])&&(djConfig["debugAtAllCosts"])&&(!isRhino)&&(!isDashboard)){ 55 66 tmps.push("browser_debug.js"); -
trunk/src/bootstrap1.js
r3458 r3713 123 123 } 124 124 125 dj_throw = dj_rethrow = function(m, e){ 126 dojo.deprecated("dj_throw and dj_rethrow deprecated, use dojo.raise instead"); 127 dojo.raise(m, e); 128 } 129 130 /** 131 * Produce a line of debug output. 132 * Does nothing unless djConfig.isDebug is true. 133 * varargs, joined with ''. 134 * Caller should not supply a trailing "\n". 135 */ 136 dojo.debug = function(){ 137 if (!djConfig.isDebug) { return; } 138 var args = arguments; 139 if(dj_undef("println", dojo.hostenv)){ 140 dojo.raise("dojo.debug not available (yet?)"); 141 } 142 var isJUM = dj_global["jum"] && !dj_global["jum"].isBrowser; 143 var s = [(isJUM ? "": "DEBUG: ")]; 144 for(var i=0;i<args.length;++i){ 145 if(!false && args[i] instanceof Error){ 146 var msg = "[" + args[i].name + ": " + dojo.errorToString(args[i]) + 147 (args[i].fileName ? ", file: " + args[i].fileName : "") + 148 (args[i].lineNumber ? ", line: " + args[i].lineNumber : "") + "]"; 149 } else { 150 try { 151 var msg = String(args[i]); 152 } catch(e) { 153 if(dojo.render.html.ie) { 154 var msg = "[ActiveXObject]"; 155 } else { 156 var msg = "[unknown]"; 157 } 158 } 159 } 160 s.push(msg); 161 } 162 if(isJUM){ // this seems to be the only way to get JUM to "play nice" 163 jum.debug(s.join(" ")); 164 }else{ 165 dojo.hostenv.println(s.join(" ")); 166 } 167 } 168 169 /** 170 * this is really hacky for now - just 171 * display the properties of the object 172 **/ 173 174 dojo.debugShallow = function(obj){ 175 if (!djConfig.isDebug) { return; } 176 dojo.debug('------------------------------------------------------------'); 177 dojo.debug('Object: '+obj); 178 var props = []; 179 for(var prop in obj){ 180 try { 181 props.push(prop + ': ' + obj[prop]); 182 } catch(E) { 183 props.push(prop + ': ERROR - ' + E.message); 184 } 185 } 186 props.sort(); 187 for(var i = 0; i < props.length; i++) { 188 dojo.debug(props[i]); 189 } 190 dojo.debug('------------------------------------------------------------'); 191 } 192 193 var dj_debug = dojo.debug; 125 //Stub functions so things don't break. 126 dojo.debug = function(){} 127 dojo.debugShallow = function(obj){} 128 dojo.profile = { start: function(){}, end: function(){}, stop: function(){}, dump: function(){} }; 194 129 195 130 /** … … 209 144 * implemented. 210 145 */ 211 d j_unimplemented = dojo.unimplemented = function(funcname, extra){146 dojo.unimplemented = function(funcname, extra){ 212 147 // FIXME: need to move this away from dj_* 213 148 var mess = "'" + funcname + "' not implemented"; … … 219 154 * Convenience for informing of deprecated behaviour. 220 155 */ 221 d j_deprecated = dojo.deprecated = function(behaviour, extra, removal){156 dojo.deprecated = function(behaviour, extra, removal){ 222 157 var mess = "DEPRECATED: " + behaviour; 223 158 if(extra){ mess += " " + extra; } 224 159 if(removal){ mess += " -- will be removed in version: " + removal; } 225 dojo.debug(mess);226 }227 228 /**229 * Convenience for informing of experimental code.230 */231 dojo.experimental = function(packageName, extra){232 var mess = "EXPERIMENTAL: " + packageName;233 mess += " -- Not yet ready for use. APIs subject to change without notice.";234 if(extra){ mess += " " + extra; }235 160 dojo.debug(mess); 236 161 } … … 248 173 // DEPRICATED: super is a reserved word, use 'superclass' 249 174 subclass['super'] = superclass.prototype; 250 }251 252 dj_inherits = function(subclass, superclass){253 dojo.deprecated("dj_inherits deprecated, use dojo.inherits instead");254 dojo.inherits(subclass, superclass);255 175 } 256 176 … … 322 242 } 323 243 324 var djc = djConfig;325 function _def(obj, name, def){326 return (dj_undef(name, obj) ? def : obj[name]);327 }328 329 244 return { 330 245 name_: '(unset)', 331 246 version_: '(unset)', 332 pkgFileName: "__package__", 333 334 // for recursion protection 335 loading_modules_: {}, 336 loaded_modules_: {}, 337 addedToLoadingCount: [], 338 removedFromLoadingCount: [], 339 inFlightCount: 0, 340 // FIXME: it should be possible to pull module prefixes in from djConfig 341 modulePrefixes_: { 342 dojo: {name: "dojo", value: "src"} 343 }, 344 345 346 setModulePrefix: function(module, prefix){ 347 this.modulePrefixes_[module] = {name: module, value: prefix}; 348 }, 349 350 getModulePrefix: function(module){ 351 var mp = this.modulePrefixes_; 352 if((mp[module])&&(mp[module]["name"])){ 353 return mp[module].value; 354 } 355 return module; 356 }, 357 358 getTextStack: [], 359 loadUriStack: [], 360 loadedUris: [], 361 // lookup cache for modules. 362 // NOTE: this is partially redundant a private variable in the jsdown 363 // implementation, but we don't want to couple the two. 364 // modules_ : {}, 365 post_load_: false, 366 modulesLoadedListeners: [], 247 367 248 /** 368 249 * Return the name of the hostenv. … … 382 263 getText: function(uri){ 383 264 dojo.unimplemented('getText', "uri=" + uri); 384 },385 386 /**387 * return the uri of the script that defined this function388 * private method that must be implemented by the hostenv.389 */390 getLibraryScriptUri: function(){391 // FIXME: need to implement!!!392 dojo.unimplemented('getLibraryScriptUri','');393 265 } 394 266 }; 395 267 })(); 396 397 /**398 * Display a line of text to the user.399 * The line argument should not contain a trailing "\n"; that is added by the400 * implementation.401 */402 //dojo.hostenv.println = function(line) {}403 404 // ****************************************************************405 // dojo.hostenv methods not defined in hostenv_*.js406 // ****************************************************************407 268 408 269 /** … … 421 282 return djConfig.baseScriptUri; 422 283 } 423 424 /**425 * Set the base script uri.426 */427 // In JScript .NET, see interface System._AppDomain implemented by428 // System.AppDomain.CurrentDomain. Members include AppendPrivatePath,429 // RelativeSearchPath, BaseDirectory.430 dojo.hostenv.setBaseScriptUri = function(uri){ djConfig.baseScriptUri = uri }431 432 /**433 * Loads and interprets the script located at relpath, which is relative to the434 * script root directory. If the script is found but its interpretation causes435 * a runtime exception, that exception is not caught by us, so the caller will436 * see it. We return a true value if and only if the script is found.437 *438 * For now, we do not have an implementation of a true search path. We439 * consider only the single base script uri, as returned by getBaseScriptUri().440 *441 * @param relpath A relative path to a script (no leading '/', and typically442 * ending in '.js').443 * @param module A module whose existance to check for after loading a path.444 * Can be used to determine success or failure of the load.445 */446 dojo.hostenv.loadPath = function(relpath, module /*optional*/, cb /*optional*/){447 if((relpath.charAt(0) == '/')||(relpath.match(/^\w+:/))){448 dojo.raise("relpath '" + relpath + "'; must be relative");449 }450 var uri = this.getBaseScriptUri() + relpath;451 if(djConfig.cacheBust && dojo.render.html.capable) { uri += "?" + String(djConfig.cacheBust).replace(/\W+/g,""); }452 try{453 return ((!module) ? this.loadUri(uri, cb) : this.loadUriAndCheck(uri, module, cb));454 }catch(e){455 dojo.debug(e);456 return false;457 }458 }459 460 /**461 * Reads the contents of the URI, and evaluates the contents.462 * Returns true if it succeeded. Returns false if the URI reading failed.463 * Throws if the evaluation throws.464 * The result of the eval is not available to the caller.465 */466 dojo.hostenv.loadUri = function(uri, cb){467 if(this.loadedUris[uri]){468 return;469 }470 var contents = this.getText(uri, null, true);471 if(contents == null){ return 0; }472 this.loadedUris[uri] = true;473 var value = dj_eval(contents);474 return 1;475 }476 477 // FIXME: probably need to add logging to this method478 dojo.hostenv.loadUriAndCheck = function(uri, module, cb){479 var ok = true;480 try{481 ok = this.loadUri(uri, cb);482 }catch(e){483 dojo.debug("failed loading ", uri, " with error: ", e);484 }485 return ((ok)&&(this.findModule(module, false))) ? true : false;486 }487 488 dojo.loaded = function(){ }489 490 dojo.hostenv.loaded = function(){491 this.post_load_ = true;492 var mll = this.modulesLoadedListeners;493 for(var x=0; x<mll.length; x++){494 mll[x]();495 }496 dojo.loaded();497 }498 499 /*500 Call styles:501 dojo.addOnLoad(functionPointer)502 dojo.addOnLoad(object, "functionName")503 */504 dojo.addOnLoad = function(obj, fcnName) {505 if(arguments.length == 1) {506 dojo.hostenv.modulesLoadedListeners.push(obj);507 } else if(arguments.length > 1) {508 dojo.hostenv.modulesLoadedListeners.push(function() {509 obj[fcnName]();510 });511 }512 }513 514 dojo.hostenv.modulesLoaded = function(){515 if(this.post_load_){ return; }516 if((this.loadUriStack.length==0)&&(this.getTextStack.length==0)){517 if(this.inFlightCount > 0){