diff options
author | Andrew Dolgov <[email protected]> | 2011-11-08 20:40:44 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-11-08 20:40:44 +0400 |
commit | 81bea17aefb26859f825b9293c7c99192874806e (patch) | |
tree | fb244408ca271affa2899adb634788802c9a89d8 /lib/dojo/_firebug | |
parent | 870a70e109ac9e80a88047044530de53d0404ec7 (diff) |
upgrade Dojo to 1.6.1
Diffstat (limited to 'lib/dojo/_firebug')
-rw-r--r-- | lib/dojo/_firebug/firebug.js | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/lib/dojo/_firebug/firebug.js b/lib/dojo/_firebug/firebug.js index d1f112f69..c78b50fa6 100644 --- a/lib/dojo/_firebug/firebug.js +++ b/lib/dojo/_firebug/firebug.js @@ -1,5 +1,5 @@ /* - Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. + Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ @@ -8,13 +8,14 @@ if(!dojo._hasResource["dojo._firebug.firebug"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. dojo._hasResource["dojo._firebug.firebug"] = true; dojo.provide("dojo._firebug.firebug"); + dojo.deprecated = function(/*String*/ behaviour, /*String?*/ extra, /*String?*/ removal){ - // summary: + // summary: // Log a debug message to indicate that a behavior has been // deprecated. // extra: Text to append to the message. - // removal: + // removal: // Text to indicate when in the future the behavior will be removed. var message = "DEPRECATED: " + behaviour; if(extra){ message += " " + extra; } @@ -24,16 +25,16 @@ dojo.deprecated = function(/*String*/ behaviour, /*String?*/ extra, /*String?*/ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ // summary: Marks code as experimental. - // description: + // description: // This can be used to mark a function, file, or module as // experimental. Experimental code is not ready to be used, and the // APIs are subject to change without notice. Experimental code may be // completed deleted without going through the normal deprecation // process. - // moduleName: + // moduleName: // The name of a module, or the name of a module file or a specific // function - // extra: + // extra: // some additional message for the user // example: // | dojo.experimental("dojo.data.Result"); @@ -49,10 +50,10 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ // description: // Opens a console for logging, debugging, and error messages. // Contains partial functionality to Firebug. See function list below. - // NOTE: + // NOTE: // Firebug is a Firefox extension created by Joe Hewitt (see license). You do not need Dojo to run Firebug. // Firebug Lite is included in Dojo by permission from Joe Hewitt - // If you are new to Firebug, or used to the Dojo 0.4 dojo.debug, you can learn Firebug + // If you are new to Firebug, or used to the Dojo 0.4 dojo.debug, you can learn Firebug // functionality by reading the function comments below or visiting http://www.getfirebug.com/docs.html // NOTE: // To test Firebug Lite in Firefox: @@ -80,13 +81,13 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ var calls = ["log", "info", "debug", "warn", "error"]; for(var i=0;i<calls.length;i++){ var m = calls[i]; - var n = "_"+calls[i] + var n = "_"+calls[i]; console[n] = console[m]; console[m] = (function(){ var type = n; return function(){ console[type](Array.prototype.slice.call(arguments).join(" ")); - } + }; })(); } // clear the console on load. This is more than a convenience - too many logs crashes it. @@ -96,8 +97,8 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ if( !dojo.isFF && // Firefox has Firebug - (!dojo.isChrome || dojo.isChrome < 3) && - (!dojo.isSafari || dojo.isSafari < 4) && // Safari 4 has a console + !dojo.isChrome && // Chrome 3+ has a console + !dojo.isSafari && // Safari 4 has a console !isNewIE && // Has the new IE console !window.firebug && // Testing for mozilla firebug lite (typeof console != "undefined" && !console.firebug) && //A console that is not firebug's @@ -108,17 +109,17 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ // don't build firebug in iframes try{ - if(window != window.parent){ + if(window != window.parent){ // but if we've got a parent logger, connect to it if(window.parent["console"]){ window.console = window.parent.console; } - return; + return; } }catch(e){/*squelch*/} // *************************************************************************** - // Placing these variables before the functions that use them to avoid a + // Placing these variables before the functions that use them to avoid a // shrinksafe bug where variable renaming does not happen correctly otherwise. // most of the objects in this script are run anonomously @@ -155,38 +156,38 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ window.console = { _connects: [], log: function(){ - // summary: + // summary: // Sends arguments to console. logFormatted(arguments, ""); }, debug: function(){ - // summary: + // summary: // Sends arguments to console. Missing finctionality to show script line of trace. logFormatted(arguments, "debug"); }, info: function(){ - // summary: + // summary: // Sends arguments to console, highlighted with (I) icon. logFormatted(arguments, "info"); }, warn: function(){ - // summary: + // summary: // Sends warning arguments to console, highlighted with (!) icon and blue style. logFormatted(arguments, "warning"); }, error: function(){ - // summary: + // summary: // Sends error arguments (object) to console, highlighted with (X) icon and yellow style // NEW: error object now displays in object inspector logFormatted(arguments, "error"); }, assert: function(truth, message){ - // summary: + // summary: // Tests for true. Throws exception if false. if(!truth){ var args = []; @@ -207,7 +208,7 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ }, dirxml: function(node){ - // summary: + // summary: // var html = []; appendNode(node, html); @@ -215,20 +216,20 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ }, group: function(){ - // summary: - // collects log messages into a group, starting with this call and ending with + // summary: + // collects log messages into a group, starting with this call and ending with // groupEnd(). Missing collapse functionality logRow(arguments, "group", pushGroup); }, groupEnd: function(){ - // summary: + // summary: // Closes group. See above logRow(arguments, "", popGroup); }, time: function(name){ - // summary: + // summary: // Starts timers assigned to name given in argument. Timer stops and displays on timeEnd(title); // example: // | console.time("load"); @@ -239,7 +240,7 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ }, timeEnd: function(name){ - // summary: + // summary: // See above. if(name in timeMap){ var delta = (new Date()).getTime() - timeMap[name]; @@ -249,7 +250,7 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ }, count: function(name){ - // summary: + // summary: // Not supported if(!countMap[name]) countMap[name] = 0; countMap[name]++; @@ -264,20 +265,20 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ var func = f.toString(); var args=[]; for (var a = 0; a < f.arguments.length; a++) { - args.push(f.arguments[a]) + args.push(f.arguments[a]); } if(f.arguments.length){ - console.dir({"function":func, "arguments":args}); + console.dir({"function":func, "arguments":args}); }else{ console.dir({"function":func}); } f = f.caller; - } + } }, profile: function(){ - // summary: + // summary: // Not supported this.warn(["profile() not supported."]); }, @@ -285,24 +286,24 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ profileEnd: function(){ }, clear: function(){ - // summary: + // summary: // Clears message console. Do not call this directly if(consoleBody){ while(consoleBody.childNodes.length){ - dojo.destroy(consoleBody.firstChild); + dojo.destroy(consoleBody.firstChild); } } dojo.forEach(this._connects,dojo.disconnect); }, - open: function(){ - // summary: + open: function(){ + // summary: // Opens message console. Do not call this directly - toggleConsole(true); + toggleConsole(true); }, close: function(){ - // summary: + // summary: // Closes message console. Do not call this directly if(frameVisible){ toggleConsole(); @@ -343,7 +344,7 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ setTimeout(function(){ _inspectionClickConnection = dojo.connect(document, "click", function(evt){ document.body.style.cursor = ""; - _inspectionEnabled = !_inspectionEnabled; + _inspectionEnabled = !_inspectionEnabled; dojo.disconnect(_inspectionClickConnection); // console._restoreBorder(); }); @@ -357,7 +358,7 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ console._restoreBorder(); }, openConsole:function(){ - // summary: + // summary: // Closes object inspector and opens message console. Do not call this directly consoleBody.style.display = "block"; consoleDomInspector.style.display = "none"; @@ -383,7 +384,7 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ } } } - } + }; // *************************************************************************** @@ -448,7 +449,7 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ } - window.onFirebugResize = function(){ + window.onFirebugResize = function(){ //resize the height of the console log body layout(getViewport().h); @@ -520,12 +521,12 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ } consoleFrame.className += " firebug"; consoleFrame.style.height = containerHeight; - consoleFrame.style.display = (frameVisible ? "block" : "none"); + consoleFrame.style.display = (frameVisible ? "block" : "none"); var buildLink = function(label, title, method, _class){ return '<li class="'+_class+'"><a href="javascript:void(0);" onclick="console.'+ method +'(); return false;" title="'+title+'">'+label+'</a></li>'; }; - consoleFrame.innerHTML = + consoleFrame.innerHTML = '<div id="firebugToolbar">' + ' <ul id="fireBugTabs" class="tabs">' @@ -598,8 +599,8 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ function layout(h){ var tHeight = 25; //consoleToolbar.offsetHeight; // tab style not ready on load - throws off layout - var height = h ? - h - (tHeight + commandLine.offsetHeight +25 + (h*.01)) + "px" : + var height = h ? + h - (tHeight + commandLine.offsetHeight +25 + (h*.01)) + "px" : (consoleFrame.offsetHeight - tHeight - commandLine.offsetHeight) + "px"; consoleBody.style.top = tHeight + "px"; @@ -610,7 +611,7 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ consoleDomInspector.style.top = tHeight + "px"; commandLine.style.bottom = 0; - dojo.addOnWindowUnload(clearFrame) + dojo.addOnWindowUnload(clearFrame); } function logRow(message, className, handler){ @@ -755,7 +756,7 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ function parseFormat(format){ var parts = []; - var reg = /((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/; + var reg = /((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/; var appenderMap = {s: appendText, d: appendInteger, i: appendInteger, f: appendFloat}; for(var m = reg.exec(format); m; m = reg.exec(format)){ @@ -900,7 +901,7 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ appendNode(child, html); } - html.push('</div><div class="objectBox-element"></<span class="nodeTag">', + html.push('</div><div class="objectBox-element"></<span class="nodeTag">', node.nodeName.toLowerCase(), '></span></div>'); }else{ html.push('/></div>'); @@ -933,7 +934,7 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ if(document.all){ event.cancelBubble = true; }else{ - event.stopPropagation(); + event.stopPropagation(); } } @@ -942,7 +943,7 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ var fileName = lastSlash == -1 ? href : href.substr(lastSlash+1); var html = [ - '<span class="errorMessage">', msg, '</span>', + '<span class="errorMessage">', msg, '</span>', '<div class="objectBox-sourceLink">', fileName, ' (line ', lineNo, ')</div>' ]; @@ -965,7 +966,7 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ toggleConsole(); }else if( (ekc == keys.NUMPAD_ENTER || ekc == 76) && - event.shiftKey && + event.shiftKey && (event.metaKey || event.ctrlKey) ){ focusCommandLine(); @@ -1072,7 +1073,7 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ function objectLength(o){ var cnt = 0; for(var nm in o){ - cnt++ + cnt++; } return cnt; } @@ -1222,5 +1223,4 @@ dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ })(); - } |