| author | ymh <ymh.work@gmail.com> |
| Wed, 02 Jul 2014 15:53:32 +0200 | |
| changeset 309 | 0c3e6e66881f |
| parent 290 | server/src/main/webapp/static/lib/dojo/_firebug/firebug.js.uncompressed.js@8a6eb26ac87f |
| permissions | -rw-r--r-- |
|
290
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
define("dojo/_firebug/firebug", [ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
"../_base/kernel", |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
"require", |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
"../_base/html", |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
"../sniff", |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
"../_base/array", |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
"../_base/lang", |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
"../_base/event", |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
"../_base/unload"], function(dojo, require, html, has){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
// module: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
// dojo/_firebug/firebug |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
14 |
// Firebug Lite, the baby brother to Joe Hewitt's Firebug for Mozilla Firefox |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
// description: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
16 |
// Opens a console for logging, debugging, and error messages. |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
// Contains partial functionality to Firebug. See function list below. |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
// |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
19 |
// NOTE: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
20 |
// Firebug is a Firefox extension created by Joe Hewitt (see license). You do not need Dojo to run Firebug. |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
21 |
// Firebug Lite is included in Dojo by permission from Joe Hewitt |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
22 |
// If you are new to Firebug, or used to the Dojo 0.4 dojo.debug, you can learn Firebug |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
23 |
// functionality by reading the function comments below or visiting http://www.getfirebug.com/docs.html |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
24 |
// |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
25 |
// NOTE: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
26 |
// To test Firebug Lite in Firefox: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
27 |
// |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
28 |
// - FF2: set "console = null" before loading dojo and set djConfig.isDebug=true |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
29 |
// - FF3: disable Firebug and set djConfig.isDebug=true |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
30 |
// |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
31 |
// example: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
32 |
// Supports inline objects in object inspector window (only simple trace of dom nodes, however) |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
33 |
// | console.log("my object", {foo:"bar"}) |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
34 |
// example: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
35 |
// Option for console to open in popup window |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
36 |
// | var djConfig = {isDebug: true, popup:true }; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
37 |
// example: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
38 |
// Option for console height (ignored for popup) |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
39 |
// | var djConfig = {isDebug: true, debugHeight:100 } |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
40 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
41 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
42 |
var isNewIE = (/Trident/.test(window.navigator.userAgent)); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
43 |
if(isNewIE){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
44 |
// Fixing IE's console |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
45 |
// IE doesn't insert space between arguments. How annoying. |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
46 |
var calls = ["log", "info", "debug", "warn", "error"]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
47 |
for(var i=0;i<calls.length;i++){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
48 |
var m = calls[i]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
49 |
if(!console[m] ||console[m]._fake){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
50 |
// IE9 doesn't have console.debug method, a fake one is added later |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
51 |
continue; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
52 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
53 |
var n = "_"+calls[i]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
54 |
console[n] = console[m]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
55 |
console[m] = (function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
56 |
var type = n; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
57 |
return function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
58 |
console[type](Array.prototype.join.call(arguments, " ")); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
59 |
}; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
60 |
})(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
61 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
62 |
// clear the console on load. This is more than a convenience - too many logs crashes it. |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
63 |
// If closed it throws an error |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
64 |
try{ console.clear(); }catch(e){} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
65 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
66 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
67 |
if( |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
68 |
has("ff") || // Firefox has Firebug |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
69 |
has("chrome") || // Chrome 3+ has a console |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
70 |
has("safari") || // Safari 4 has a console |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
71 |
isNewIE || // Has the new IE console |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
72 |
window.firebug || // Testing for mozilla firebug lite |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
73 |
(typeof console != "undefined" && console.firebug) || //The firebug console |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
74 |
dojo.config.useCustomLogger || // Allow custom loggers |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
75 |
has("air") // isDebug triggers AIRInsector, not Firebug |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
76 |
){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
77 |
return; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
78 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
79 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
80 |
// don't build firebug in iframes |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
81 |
try{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
82 |
if(window != window.parent){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
83 |
// but if we've got a parent logger, connect to it |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
84 |
if(window.parent["console"]){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
85 |
window.console = window.parent.console; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
86 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
87 |
return; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
88 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
89 |
}catch(e){/*squelch*/} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
90 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
91 |
// *************************************************************************** |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
92 |
// Placing these variables before the functions that use them to avoid a |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
93 |
// shrinksafe bug where variable renaming does not happen correctly otherwise. |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
94 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
95 |
// most of the objects in this script are run anonomously |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
96 |
var _firebugDoc = document; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
97 |
var _firebugWin = window; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
98 |
var __consoleAnchorId__ = 0; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
99 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
100 |
var consoleFrame = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
101 |
var consoleBody = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
102 |
var consoleObjectInspector = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
103 |
var fireBugTabs = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
104 |
var commandLine = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
105 |
var consoleToolbar = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
106 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
107 |
var frameVisible = false; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
108 |
var messageQueue = []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
109 |
var groupStack = []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
110 |
var timeMap = {}; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
111 |
var countMap = {}; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
112 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
113 |
var consoleDomInspector = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
114 |
var _inspectionMoveConnection; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
115 |
var _inspectionClickConnection; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
116 |
var _inspectionEnabled = false; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
117 |
var _inspectionTimer = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
118 |
var _inspectTempNode = document.createElement("div"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
119 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
120 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
121 |
var _inspectCurrentNode; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
122 |
var _restoreBorderStyle; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
123 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
124 |
// *************************************************************************** |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
125 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
126 |
window.console = { |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
127 |
_connects: [], |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
128 |
log: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
129 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
130 |
// Sends arguments to console. |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
131 |
logFormatted(arguments, ""); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
132 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
133 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
134 |
debug: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
135 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
136 |
// Sends arguments to console. Missing finctionality to show script line of trace. |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
137 |
logFormatted(arguments, "debug"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
138 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
139 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
140 |
info: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
141 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
142 |
// Sends arguments to console, highlighted with (I) icon. |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
143 |
logFormatted(arguments, "info"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
144 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
145 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
146 |
warn: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
147 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
148 |
// Sends warning arguments to console, highlighted with (!) icon and blue style. |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
149 |
logFormatted(arguments, "warning"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
150 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
151 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
152 |
error: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
153 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
154 |
// Sends error arguments (object) to console, highlighted with (X) icon and yellow style |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
155 |
// NEW: error object now displays in object inspector |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
156 |
logFormatted(arguments, "error"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
157 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
158 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
159 |
assert: function(truth, message){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
160 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
161 |
// Tests for true. Throws exception if false. |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
162 |
if(!truth){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
163 |
var args = []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
164 |
for(var i = 1; i < arguments.length; ++i){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
165 |
args.push(arguments[i]); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
166 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
167 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
168 |
logFormatted(args.length ? args : ["Assertion Failure"], "error"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
169 |
throw message ? message : "Assertion Failure"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
170 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
171 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
172 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
173 |
dir: function(obj){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
174 |
var str = printObject( obj ); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
175 |
str = str.replace(/\n/g, "<br />"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
176 |
str = str.replace(/\t/g, " "); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
177 |
logRow([str], "dir"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
178 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
179 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
180 |
dirxml: function(node){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
181 |
var html = []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
182 |
appendNode(node, html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
183 |
logRow(html, "dirxml"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
184 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
185 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
186 |
group: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
187 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
188 |
// collects log messages into a group, starting with this call and ending with |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
189 |
// groupEnd(). Missing collapse functionality |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
190 |
logRow(arguments, "group", pushGroup); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
191 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
192 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
193 |
groupEnd: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
194 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
195 |
// Closes group. See above |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
196 |
logRow(arguments, "", popGroup); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
197 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
198 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
199 |
time: function(name){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
200 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
201 |
// Starts timers assigned to name given in argument. Timer stops and displays on timeEnd(title); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
202 |
// example: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
203 |
// | console.time("load"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
204 |
// | console.time("myFunction"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
205 |
// | console.timeEnd("load"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
206 |
// | console.timeEnd("myFunction"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
207 |
timeMap[name] = new Date().getTime(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
208 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
209 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
210 |
timeEnd: function(name){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
211 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
212 |
// See above. |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
213 |
if(name in timeMap){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
214 |
var delta = (new Date()).getTime() - timeMap[name]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
215 |
logFormatted([name+ ":", delta+"ms"]); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
216 |
delete timeMap[name]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
217 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
218 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
219 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
220 |
count: function(name){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
221 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
222 |
// Not supported |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
223 |
if(!countMap[name]) countMap[name] = 0; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
224 |
countMap[name]++; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
225 |
logFormatted([name+": "+countMap[name]]); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
226 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
227 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
228 |
trace: function(_value){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
229 |
var stackAmt = _value || 3; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
230 |
var f = console.trace.caller; //function that called trace |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
231 |
console.log(">>> console.trace(stack)"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
232 |
for(var i=0;i<stackAmt;i++){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
233 |
var func = f.toString(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
234 |
var args=[]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
235 |
for (var a = 0; a < f.arguments.length; a++){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
236 |
args.push(f.arguments[a]); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
237 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
238 |
if(f.arguments.length){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
239 |
console.dir({"function":func, "arguments":args}); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
240 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
241 |
console.dir({"function":func}); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
242 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
243 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
244 |
f = f.caller; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
245 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
246 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
247 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
248 |
profile: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
249 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
250 |
// Not supported |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
251 |
this.warn(["profile() not supported."]); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
252 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
253 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
254 |
profileEnd: function(){ }, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
255 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
256 |
clear: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
257 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
258 |
// Clears message console. Do not call this directly |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
259 |
if(consoleBody){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
260 |
while(consoleBody.childNodes.length){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
261 |
dojo.destroy(consoleBody.firstChild); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
262 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
263 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
264 |
dojo.forEach(this._connects,dojo.disconnect); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
265 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
266 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
267 |
open: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
268 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
269 |
// Opens message console. Do not call this directly |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
270 |
toggleConsole(true); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
271 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
272 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
273 |
close: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
274 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
275 |
// Closes message console. Do not call this directly |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
276 |
if(frameVisible){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
277 |
toggleConsole(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
278 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
279 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
280 |
_restoreBorder: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
281 |
if(_inspectCurrentNode){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
282 |
_inspectCurrentNode.style.border = _restoreBorderStyle; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
283 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
284 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
285 |
openDomInspector: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
286 |
_inspectionEnabled = true; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
287 |
consoleBody.style.display = "none"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
288 |
consoleDomInspector.style.display = "block"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
289 |
consoleObjectInspector.style.display = "none"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
290 |
document.body.style.cursor = "pointer"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
291 |
_inspectionMoveConnection = dojo.connect(document, "mousemove", function(evt){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
292 |
if(!_inspectionEnabled){ return; } |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
293 |
if(!_inspectionTimer){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
294 |
_inspectionTimer = setTimeout(function(){ _inspectionTimer = null; }, 50); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
295 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
296 |
return; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
297 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
298 |
var node = evt.target; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
299 |
if(node && (_inspectCurrentNode !== node)){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
300 |
var parent = true; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
301 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
302 |
console._restoreBorder(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
303 |
var html = []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
304 |
appendNode(node, html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
305 |
consoleDomInspector.innerHTML = html.join(""); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
306 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
307 |
_inspectCurrentNode = node; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
308 |
_restoreBorderStyle = _inspectCurrentNode.style.border; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
309 |
_inspectCurrentNode.style.border = "#0000FF 1px solid"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
310 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
311 |
}); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
312 |
setTimeout(function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
313 |
_inspectionClickConnection = dojo.connect(document, "click", function(evt){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
314 |
document.body.style.cursor = ""; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
315 |
_inspectionEnabled = !_inspectionEnabled; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
316 |
dojo.disconnect(_inspectionClickConnection); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
317 |
// console._restoreBorder(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
318 |
}); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
319 |
}, 30); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
320 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
321 |
_closeDomInspector: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
322 |
document.body.style.cursor = ""; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
323 |
dojo.disconnect(_inspectionMoveConnection); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
324 |
dojo.disconnect(_inspectionClickConnection); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
325 |
_inspectionEnabled = false; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
326 |
console._restoreBorder(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
327 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
328 |
openConsole:function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
329 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
330 |
// Closes object inspector and opens message console. Do not call this directly |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
331 |
consoleBody.style.display = "block"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
332 |
consoleDomInspector.style.display = "none"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
333 |
consoleObjectInspector.style.display = "none"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
334 |
console._closeDomInspector(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
335 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
336 |
openObjectInspector:function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
337 |
consoleBody.style.display = "none"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
338 |
consoleDomInspector.style.display = "none"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
339 |
consoleObjectInspector.style.display = "block"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
340 |
console._closeDomInspector(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
341 |
}, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
342 |
recss: function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
343 |
// this is placed in dojo since the console is most likely |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
344 |
// in another window and dojo is easilly accessible |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
345 |
var i,a,s;a=document.getElementsByTagName('link'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
346 |
for(i=0;i<a.length;i++){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
347 |
s=a[i]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
348 |
if(s.rel.toLowerCase().indexOf('stylesheet')>=0&&s.href){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
349 |
var h=s.href.replace(/(&|%5C?)forceReload=\d+/,''); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
350 |
s.href=h+(h.indexOf('?')>=0?'&':'?')+'forceReload='+new Date().valueOf(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
351 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
352 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
353 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
354 |
}; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
355 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
356 |
// *************************************************************************** |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
357 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
358 |
function toggleConsole(forceOpen){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
359 |
frameVisible = forceOpen || !frameVisible; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
360 |
if(consoleFrame){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
361 |
consoleFrame.style.display = frameVisible ? "block" : "none"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
362 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
363 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
364 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
365 |
function focusCommandLine(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
366 |
toggleConsole(true); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
367 |
if(commandLine){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
368 |
commandLine.focus(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
369 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
370 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
371 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
372 |
function openWin(x,y,w,h){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
373 |
var win = window.open("","_firebug","status=0,menubar=0,resizable=1,top="+y+",left="+x+",width="+w+",height="+h+",scrollbars=1,addressbar=0"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
374 |
if(!win){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
375 |
var msg = "Firebug Lite could not open a pop-up window, most likely because of a blocker.\n" + |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
376 |
"Either enable pop-ups for this domain, or change the djConfig to popup=false."; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
377 |
alert(msg); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
378 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
379 |
createResizeHandler(win); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
380 |
var newDoc=win.document; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
381 |
//Safari needs an HTML height |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
382 |
var HTMLstring= '<html style="height:100%;"><head><title>Firebug Lite</title></head>\n' + |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
383 |
'<body bgColor="#ccc" style="height:97%;" onresize="opener.onFirebugResize()">\n' + |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
384 |
'<div id="fb"></div>' + |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
385 |
'</body></html>'; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
386 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
387 |
newDoc.write(HTMLstring); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
388 |
newDoc.close(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
389 |
return win; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
390 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
391 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
392 |
function createResizeHandler(wn){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
393 |
// summary: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
394 |
// Creates handle for onresize window. Called from script in popup's body tag (so that it will work with IE). |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
395 |
// |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
396 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
397 |
var d = new Date(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
398 |
d.setTime(d.getTime()+(60*24*60*60*1000)); // 60 days |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
399 |
d = d.toUTCString(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
400 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
401 |
var dc = wn.document, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
402 |
getViewport; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
403 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
404 |
if (wn.innerWidth){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
405 |
getViewport = function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
406 |
return{w:wn.innerWidth, h:wn.innerHeight}; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
407 |
}; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
408 |
}else if (dc.documentElement && dc.documentElement.clientWidth){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
409 |
getViewport = function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
410 |
return{w:dc.documentElement.clientWidth, h:dc.documentElement.clientHeight}; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
411 |
}; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
412 |
}else if (dc.body){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
413 |
getViewport = function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
414 |
return{w:dc.body.clientWidth, h:dc.body.clientHeight}; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
415 |
}; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
416 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
417 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
418 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
419 |
window.onFirebugResize = function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
420 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
421 |
//resize the height of the console log body |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
422 |
layout(getViewport().h); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
423 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
424 |
clearInterval(wn._firebugWin_resize); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
425 |
wn._firebugWin_resize = setTimeout(function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
426 |
var x = wn.screenLeft, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
427 |
y = wn.screenTop, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
428 |
w = wn.outerWidth || wn.document.body.offsetWidth, |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
429 |
h = wn.outerHeight || wn.document.body.offsetHeight; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
430 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
431 |
document.cookie = "_firebugPosition=" + [x,y,w,h].join(",") + "; expires="+d+"; path=/"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
432 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
433 |
}, 5000); //can't capture window.onMove - long timeout gives better chance of capturing a resize, then the move |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
434 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
435 |
}; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
436 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
437 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
438 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
439 |
/*****************************************************************************/ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
440 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
441 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
442 |
function createFrame(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
443 |
if(consoleFrame){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
444 |
return; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
445 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
446 |
toggleConsole(true); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
447 |
if(dojo.config.popup){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
448 |
var containerHeight = "100%"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
449 |
var cookieMatch = document.cookie.match(/(?:^|; )_firebugPosition=([^;]*)/); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
450 |
var p = cookieMatch ? cookieMatch[1].split(",") : [2,2,320,480]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
451 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
452 |
_firebugWin = openWin(p[0],p[1],p[2],p[3]); // global |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
453 |
_firebugDoc = _firebugWin.document; // global |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
454 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
455 |
dojo.config.debugContainerId = 'fb'; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
456 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
457 |
// connecting popup |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
458 |
_firebugWin.console = window.console; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
459 |
_firebugWin.dojo = window.dojo; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
460 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
461 |
_firebugDoc = document; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
462 |
containerHeight = (dojo.config.debugHeight || 300) + "px"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
463 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
464 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
465 |
var styleElement = _firebugDoc.createElement("link"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
466 |
styleElement.href = require.toUrl("./firebug.css"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
467 |
styleElement.rel = "stylesheet"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
468 |
styleElement.type = "text/css"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
469 |
var styleParent = _firebugDoc.getElementsByTagName("head"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
470 |
if(styleParent){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
471 |
styleParent = styleParent[0]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
472 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
473 |
if(!styleParent){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
474 |
styleParent = _firebugDoc.getElementsByTagName("html")[0]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
475 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
476 |
if(has("ie")){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
477 |
window.setTimeout(function(){ styleParent.appendChild(styleElement); }, 0); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
478 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
479 |
styleParent.appendChild(styleElement); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
480 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
481 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
482 |
if(dojo.config.debugContainerId){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
483 |
consoleFrame = _firebugDoc.getElementById(dojo.config.debugContainerId); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
484 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
485 |
if(!consoleFrame){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
486 |
consoleFrame = _firebugDoc.createElement("div"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
487 |
_firebugDoc.body.appendChild(consoleFrame); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
488 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
489 |
consoleFrame.className += " firebug"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
490 |
consoleFrame.id = "firebug"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
491 |
consoleFrame.style.height = containerHeight; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
492 |
consoleFrame.style.display = (frameVisible ? "block" : "none"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
493 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
494 |
var buildLink = function(label, title, method, _class){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
495 |
return '<li class="'+_class+'"><a href="javascript:void(0);" onclick="console.'+ method +'(); return false;" title="'+title+'">'+label+'</a></li>'; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
496 |
}; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
497 |
consoleFrame.innerHTML = |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
498 |
'<div id="firebugToolbar">' |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
499 |
+ ' <ul id="fireBugTabs" class="tabs">' |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
500 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
501 |
+ buildLink("Clear", "Remove All Console Logs", "clear", "") |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
502 |
+ buildLink("ReCSS", "Refresh CSS without reloading page", "recss", "") |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
503 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
504 |
+ buildLink("Console", "Show Console Logs", "openConsole", "gap") |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
505 |
+ buildLink("DOM", "Show DOM Inspector", "openDomInspector", "") |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
506 |
+ buildLink("Object", "Show Object Inspector", "openObjectInspector", "") |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
507 |
+ ((dojo.config.popup) ? "" : buildLink("Close", "Close the console", "close", "gap")) |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
508 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
509 |
+ ' </ul>' |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
510 |
+ '</div>' |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
511 |
+ '<input type="text" id="firebugCommandLine" />' |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
512 |
+ '<div id="firebugLog"></div>' |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
513 |
+ '<div id="objectLog" style="display:none;">Click on an object in the Log display</div>' |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
514 |
+ '<div id="domInspect" style="display:none;">Hover over HTML elements in the main page. Click to hold selection.</div>'; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
515 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
516 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
517 |
consoleToolbar = _firebugDoc.getElementById("firebugToolbar"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
518 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
519 |
commandLine = _firebugDoc.getElementById("firebugCommandLine"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
520 |
addEvent(commandLine, "keydown", onCommandLineKeyDown); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
521 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
522 |
addEvent(_firebugDoc, has("ie") || has("safari") ? "keydown" : "keypress", onKeyDown); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
523 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
524 |
consoleBody = _firebugDoc.getElementById("firebugLog"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
525 |
consoleObjectInspector = _firebugDoc.getElementById("objectLog"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
526 |
consoleDomInspector = _firebugDoc.getElementById("domInspect"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
527 |
fireBugTabs = _firebugDoc.getElementById("fireBugTabs"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
528 |
layout(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
529 |
flush(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
530 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
531 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
532 |
dojo.addOnLoad(createFrame); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
533 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
534 |
function clearFrame(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
535 |
_firebugDoc = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
536 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
537 |
if(_firebugWin.console){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
538 |
_firebugWin.console.clear(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
539 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
540 |
_firebugWin = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
541 |
consoleFrame = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
542 |
consoleBody = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
543 |
consoleObjectInspector = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
544 |
consoleDomInspector = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
545 |
commandLine = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
546 |
messageQueue = []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
547 |
groupStack = []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
548 |
timeMap = {}; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
549 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
550 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
551 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
552 |
function evalCommandLine(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
553 |
var text = commandLine.value; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
554 |
commandLine.value = ""; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
555 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
556 |
logRow(["> ", text], "command"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
557 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
558 |
var value; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
559 |
try{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
560 |
value = eval(text); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
561 |
}catch(e){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
562 |
console.debug(e); // put exception on the console |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
563 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
564 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
565 |
console.log(value); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
566 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
567 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
568 |
function layout(h){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
569 |
var tHeight = 25; //consoleToolbar.offsetHeight; // tab style not ready on load - throws off layout |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
570 |
var height = h ? |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
571 |
h - (tHeight + commandLine.offsetHeight +25 + (h*.01)) + "px" : |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
572 |
(consoleFrame.offsetHeight - tHeight - commandLine.offsetHeight) + "px"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
573 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
574 |
consoleBody.style.top = tHeight + "px"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
575 |
consoleBody.style.height = height; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
576 |
consoleObjectInspector.style.height = height; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
577 |
consoleObjectInspector.style.top = tHeight + "px"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
578 |
consoleDomInspector.style.height = height; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
579 |
consoleDomInspector.style.top = tHeight + "px"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
580 |
commandLine.style.bottom = 0; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
581 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
582 |
dojo.addOnWindowUnload(clearFrame); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
583 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
584 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
585 |
function logRow(message, className, handler){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
586 |
if(consoleBody){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
587 |
writeMessage(message, className, handler); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
588 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
589 |
messageQueue.push([message, className, handler]); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
590 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
591 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
592 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
593 |
function flush(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
594 |
var queue = messageQueue; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
595 |
messageQueue = []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
596 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
597 |
for(var i = 0; i < queue.length; ++i){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
598 |
writeMessage(queue[i][0], queue[i][1], queue[i][2]); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
599 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
600 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
601 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
602 |
function writeMessage(message, className, handler){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
603 |
var isScrolledToBottom = |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
604 |
consoleBody.scrollTop + consoleBody.offsetHeight >= consoleBody.scrollHeight; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
605 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
606 |
handler = handler||writeRow; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
607 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
608 |
handler(message, className); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
609 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
610 |
if(isScrolledToBottom){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
611 |
consoleBody.scrollTop = consoleBody.scrollHeight - consoleBody.offsetHeight; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
612 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
613 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
614 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
615 |
function appendRow(row){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
616 |
var container = groupStack.length ? groupStack[groupStack.length-1] : consoleBody; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
617 |
container.appendChild(row); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
618 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
619 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
620 |
function writeRow(message, className){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
621 |
var row = consoleBody.ownerDocument.createElement("div"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
622 |
row.className = "logRow" + (className ? " logRow-"+className : ""); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
623 |
row.innerHTML = message.join(""); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
624 |
appendRow(row); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
625 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
626 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
627 |
function pushGroup(message, className){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
628 |
logFormatted(message, className); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
629 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
630 |
//var groupRow = consoleBody.ownerDocument.createElement("div"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
631 |
//groupRow.className = "logGroup"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
632 |
var groupRowBox = consoleBody.ownerDocument.createElement("div"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
633 |
groupRowBox.className = "logGroupBox"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
634 |
//groupRow.appendChild(groupRowBox); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
635 |
appendRow(groupRowBox); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
636 |
groupStack.push(groupRowBox); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
637 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
638 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
639 |
function popGroup(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
640 |
groupStack.pop(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
641 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
642 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
643 |
// *************************************************************************** |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
644 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
645 |
function logFormatted(objects, className){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
646 |
var html = []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
647 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
648 |
var format = objects[0]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
649 |
var objIndex = 0; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
650 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
651 |
if(typeof(format) != "string"){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
652 |
format = ""; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
653 |
objIndex = -1; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
654 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
655 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
656 |
var parts = parseFormat(format); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
657 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
658 |
for(var i = 0; i < parts.length; ++i){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
659 |
var part = parts[i]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
660 |
if(part && typeof part == "object"){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
661 |
part.appender(objects[++objIndex], html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
662 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
663 |
appendText(part, html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
664 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
665 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
666 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
667 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
668 |
var ids = []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
669 |
var obs = []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
670 |
for(i = objIndex+1; i < objects.length; ++i){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
671 |
appendText(" ", html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
672 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
673 |
var object = objects[i]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
674 |
if(object === undefined || object === null ){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
675 |
appendNull(object, html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
676 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
677 |
}else if(typeof(object) == "string"){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
678 |
appendText(object, html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
679 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
680 |
}else if(object instanceof Date){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
681 |
appendText(object.toString(), html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
682 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
683 |
}else if(object.nodeType == 9){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
684 |
appendText("[ XmlDoc ]", html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
685 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
686 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
687 |
// Create link for object inspector |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
688 |
// need to create an ID for this link, since it is currently text |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
689 |
var id = "_a" + __consoleAnchorId__++; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
690 |
ids.push(id); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
691 |
// need to save the object, so the arrays line up |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
692 |
obs.push(object); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
693 |
var str = '<a id="'+id+'" href="javascript:void(0);">'+getObjectAbbr(object)+'</a>'; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
694 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
695 |
appendLink( str , html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
696 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
697 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
698 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
699 |
logRow(html, className); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
700 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
701 |
// Now that the row is inserted in the DOM, loop through all of the links that were just created |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
702 |
for(i=0; i<ids.length; i++){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
703 |
var btn = _firebugDoc.getElementById(ids[i]); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
704 |
if(!btn){ continue; } |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
705 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
706 |
// store the object in the dom btn for reference later |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
707 |
// avoid parsing these objects unless necessary |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
708 |
btn.obj = obs[i]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
709 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
710 |
_firebugWin.console._connects.push(dojo.connect(btn, "onclick", function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
711 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
712 |
console.openObjectInspector(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
713 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
714 |
try{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
715 |
printObject(this.obj); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
716 |
}catch(e){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
717 |
this.obj = e; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
718 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
719 |
consoleObjectInspector.innerHTML = "<pre>" + printObject( this.obj ) + "</pre>"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
720 |
})); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
721 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
722 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
723 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
724 |
function parseFormat(format){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
725 |
var parts = []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
726 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
727 |
var reg = /((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
728 |
var appenderMap = {s: appendText, d: appendInteger, i: appendInteger, f: appendFloat}; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
729 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
730 |
for(var m = reg.exec(format); m; m = reg.exec(format)){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
731 |
var type = m[8] ? m[8] : m[5]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
732 |
var appender = type in appenderMap ? appenderMap[type] : appendObject; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
733 |
var precision = m[3] ? parseInt(m[3]) : (m[4] == "." ? -1 : 0); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
734 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
735 |
parts.push(format.substr(0, m[0][0] == "%" ? m.index : m.index+1)); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
736 |
parts.push({appender: appender, precision: precision}); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
737 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
738 |
format = format.substr(m.index+m[0].length); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
739 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
740 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
741 |
parts.push(format); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
742 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
743 |
return parts; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
744 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
745 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
746 |
function escapeHTML(value){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
747 |
function replaceChars(ch){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
748 |
switch(ch){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
749 |
case "<": |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
750 |
return "<"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
751 |
case ">": |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
752 |
return ">"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
753 |
case "&": |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
754 |
return "&"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
755 |
case "'": |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
756 |
return "'"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
757 |
case '"': |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
758 |
return """; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
759 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
760 |
return "?"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
761 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
762 |
return String(value).replace(/[<>&"']/g, replaceChars); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
763 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
764 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
765 |
function objectToString(object){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
766 |
try{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
767 |
return object+""; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
768 |
}catch(e){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
769 |
return null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
770 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
771 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
772 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
773 |
// *************************************************************************** |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
774 |
function appendLink(object, html){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
775 |
// needed for object links - no HTML escaping |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
776 |
html.push( objectToString(object) ); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
777 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
778 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
779 |
function appendText(object, html){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
780 |
html.push(escapeHTML(objectToString(object))); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
781 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
782 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
783 |
function appendNull(object, html){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
784 |
html.push('<span class="objectBox-null">', escapeHTML(objectToString(object)), '</span>'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
785 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
786 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
787 |
function appendString(object, html){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
788 |
html.push('<span class="objectBox-string">"', escapeHTML(objectToString(object)), |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
789 |
'"</span>'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
790 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
791 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
792 |
function appendInteger(object, html){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
793 |
html.push('<span class="objectBox-number">', escapeHTML(objectToString(object)), '</span>'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
794 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
795 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
796 |
function appendFloat(object, html){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
797 |
html.push('<span class="objectBox-number">', escapeHTML(objectToString(object)), '</span>'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
798 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
799 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
800 |
function appendFunction(object, html){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
801 |
html.push('<span class="objectBox-function">', getObjectAbbr(object), '</span>'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
802 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
803 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
804 |
function appendObject(object, html){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
805 |
try{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
806 |
if(object === undefined){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
807 |
appendNull("undefined", html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
808 |
}else if(object === null){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
809 |
appendNull("null", html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
810 |
}else if(typeof object == "string"){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
811 |
appendString(object, html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
812 |
}else if(typeof object == "number"){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
813 |
appendInteger(object, html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
814 |
}else if(typeof object == "function"){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
815 |
appendFunction(object, html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
816 |
}else if(object.nodeType == 1){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
817 |
appendSelector(object, html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
818 |
}else if(typeof object == "object"){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
819 |
appendObjectFormatted(object, html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
820 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
821 |
appendText(object, html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
822 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
823 |
}catch(e){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
824 |
/* squelch */ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
825 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
826 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
827 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
828 |
function appendObjectFormatted(object, html){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
829 |
var text = objectToString(object); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
830 |
var reObject = /\[object (.*?)\]/; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
831 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
832 |
var m = reObject.exec(text); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
833 |
html.push('<span class="objectBox-object">', m ? m[1] : text, '</span>'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
834 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
835 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
836 |
function appendSelector(object, html){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
837 |
html.push('<span class="objectBox-selector">'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
838 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
839 |
html.push('<span class="selectorTag">', escapeHTML(object.nodeName.toLowerCase()), '</span>'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
840 |
if(object.id){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
841 |
html.push('<span class="selectorId">#', escapeHTML(object.id), '</span>'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
842 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
843 |
if(object.className){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
844 |
html.push('<span class="selectorClass">.', escapeHTML(object.className), '</span>'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
845 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
846 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
847 |
html.push('</span>'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
848 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
849 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
850 |
function appendNode(node, html){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
851 |
if(node.nodeType == 1){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
852 |
html.push( |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
853 |
'<div class="objectBox-element">', |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
854 |
'<<span class="nodeTag">', node.nodeName.toLowerCase(), '</span>'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
855 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
856 |
for(var i = 0; i < node.attributes.length; ++i){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
857 |
var attr = node.attributes[i]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
858 |
if(!attr.specified){ continue; } |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
859 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
860 |
html.push(' <span class="nodeName">', attr.nodeName.toLowerCase(), |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
861 |
'</span>="<span class="nodeValue">', escapeHTML(attr.nodeValue), |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
862 |
'</span>"'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
863 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
864 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
865 |
if(node.firstChild){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
866 |
html.push('></div><div class="nodeChildren">'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
867 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
868 |
for(var child = node.firstChild; child; child = child.nextSibling){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
869 |
appendNode(child, html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
870 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
871 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
872 |
html.push('</div><div class="objectBox-element"></<span class="nodeTag">', |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
873 |
node.nodeName.toLowerCase(), '></span></div>'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
874 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
875 |
html.push('/></div>'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
876 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
877 |
}else if (node.nodeType == 3){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
878 |
html.push('<div class="nodeText">', escapeHTML(node.nodeValue), |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
879 |
'</div>'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
880 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
881 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
882 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
883 |
// *************************************************************************** |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
884 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
885 |
function addEvent(object, name, handler){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
886 |
if(document.all){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
887 |
object.attachEvent("on"+name, handler); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
888 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
889 |
object.addEventListener(name, handler, false); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
890 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
891 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
892 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
893 |
function removeEvent(object, name, handler){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
894 |
if(document.all){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
895 |
object.detachEvent("on"+name, handler); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
896 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
897 |
object.removeEventListener(name, handler, false); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
898 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
899 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
900 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
901 |
function cancelEvent(event){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
902 |
if(document.all){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
903 |
event.cancelBubble = true; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
904 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
905 |
event.stopPropagation(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
906 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
907 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
908 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
909 |
function onError(msg, href, lineNo){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
910 |
var lastSlash = href.lastIndexOf("/"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
911 |
var fileName = lastSlash == -1 ? href : href.substr(lastSlash+1); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
912 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
913 |
var html = [ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
914 |
'<span class="errorMessage">', msg, '</span>', |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
915 |
'<div class="objectBox-sourceLink">', fileName, ' (line ', lineNo, ')</div>' |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
916 |
]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
917 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
918 |
logRow(html, "error"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
919 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
920 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
921 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
922 |
//After converting to div instead of iframe, now getting two keydowns right away in IE 6. |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
923 |
//Make sure there is a little bit of delay. |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
924 |
var onKeyDownTime = new Date().getTime(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
925 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
926 |
function onKeyDown(event){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
927 |
var timestamp = (new Date()).getTime(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
928 |
if(timestamp > onKeyDownTime + 200){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
929 |
event = dojo.fixEvent(event); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
930 |
var keys = dojo.keys; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
931 |
var ekc = event.keyCode; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
932 |
onKeyDownTime = timestamp; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
933 |
if(ekc == keys.F12){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
934 |
toggleConsole(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
935 |
}else if( |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
936 |
(ekc == keys.NUMPAD_ENTER || ekc == 76) && |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
937 |
event.shiftKey && |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
938 |
(event.metaKey || event.ctrlKey) |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
939 |
){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
940 |
focusCommandLine(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
941 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
942 |
return; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
943 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
944 |
cancelEvent(event); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
945 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
946 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
947 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
948 |
function onCommandLineKeyDown(e){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
949 |
var dk = dojo.keys; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
950 |
if(e.keyCode == 13 && commandLine.value){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
951 |
addToHistory(commandLine.value); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
952 |
evalCommandLine(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
953 |
}else if(e.keyCode == 27){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
954 |
commandLine.value = ""; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
955 |
}else if(e.keyCode == dk.UP_ARROW || e.charCode == dk.UP_ARROW){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
956 |
navigateHistory("older"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
957 |
}else if(e.keyCode == dk.DOWN_ARROW || e.charCode == dk.DOWN_ARROW){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
958 |
navigateHistory("newer"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
959 |
}else if(e.keyCode == dk.HOME || e.charCode == dk.HOME){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
960 |
historyPosition = 1; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
961 |
navigateHistory("older"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
962 |
}else if(e.keyCode == dk.END || e.charCode == dk.END){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
963 |
historyPosition = 999999; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
964 |
navigateHistory("newer"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
965 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
966 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
967 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
968 |
var historyPosition = -1; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
969 |
var historyCommandLine = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
970 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
971 |
function addToHistory(value){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
972 |
var history = cookie("firebug_history"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
973 |
history = (history) ? dojo.fromJson(history) : []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
974 |
var pos = dojo.indexOf(history, value); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
975 |
if (pos != -1){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
976 |
history.splice(pos, 1); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
977 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
978 |
history.push(value); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
979 |
cookie("firebug_history", dojo.toJson(history), 30); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
980 |
while(history.length && !cookie("firebug_history")){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
981 |
history.shift(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
982 |
cookie("firebug_history", dojo.toJson(history), 30); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
983 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
984 |
historyCommandLine = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
985 |
historyPosition = -1; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
986 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
987 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
988 |
function navigateHistory(direction){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
989 |
var history = cookie("firebug_history"); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
990 |
history = (history) ? dojo.fromJson(history) : []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
991 |
if(!history.length){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
992 |
return; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
993 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
994 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
995 |
if(historyCommandLine === null){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
996 |
historyCommandLine = commandLine.value; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
997 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
998 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
999 |
if(historyPosition == -1){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1000 |
historyPosition = history.length; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1001 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1002 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1003 |
if(direction == "older"){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1004 |
--historyPosition; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1005 |
if(historyPosition < 0){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1006 |
historyPosition = 0; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1007 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1008 |
}else if(direction == "newer"){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1009 |
++historyPosition; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1010 |
if(historyPosition > history.length){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1011 |
historyPosition = history.length; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1012 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1013 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1014 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1015 |
if(historyPosition == history.length){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1016 |
commandLine.value = historyCommandLine; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1017 |
historyCommandLine = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1018 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1019 |
commandLine.value = history[historyPosition]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1020 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1021 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1022 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1023 |
function cookie(name, value){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1024 |
var c = document.cookie; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1025 |
if(arguments.length == 1){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1026 |
var matches = c.match(new RegExp("(?:^|; )" + name + "=([^;]*)")); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1027 |
return matches ? decodeURIComponent(matches[1]) : undefined; // String or undefined |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1028 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1029 |
var d = new Date(); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1030 |
d.setMonth(d.getMonth()+1); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1031 |
document.cookie = name + "=" + encodeURIComponent(value) + ((d.toUtcString) ? "; expires=" + d.toUTCString() : ""); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1032 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1033 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1034 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1035 |
function isArray(it){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1036 |
return it && it instanceof Array || typeof it == "array"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1037 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1038 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1039 |
//*************************************************************************************************** |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1040 |
// Print Object Helpers |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1041 |
function objectLength(o){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1042 |
var cnt = 0; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1043 |
for(var nm in o){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1044 |
cnt++; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1045 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1046 |
return cnt; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1047 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1048 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1049 |
function printObject(o, i, txt, used){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1050 |
// Recursively trace object, indenting to represent depth for display in object inspector |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1051 |
var ind = " \t"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1052 |
txt = txt || ""; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1053 |
i = i || ind; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1054 |
used = used || []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1055 |
var opnCls; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1056 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1057 |
if(o && o.nodeType == 1){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1058 |
var html = []; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1059 |
appendNode(o, html); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1060 |
return html.join(""); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1061 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1062 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1063 |
var br=",\n", cnt = 0, length = objectLength(o); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1064 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1065 |
if(o instanceof Date){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1066 |
return i + o.toString() + br; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1067 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1068 |
looking: |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1069 |
for(var nm in o){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1070 |
cnt++; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1071 |
if(cnt==length){br = "\n";} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1072 |
if(o[nm] === window || o[nm] === document){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1073 |
// do nothing |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1074 |
}else if(o[nm] === null){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1075 |
txt += i+nm + " : NULL" + br; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1076 |
}else if(o[nm] && o[nm].nodeType){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1077 |
if(o[nm].nodeType == 1){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1078 |
//txt += i+nm + " : < "+o[nm].tagName+" id=\""+ o[nm].id+"\" />" + br; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1079 |
}else if(o[nm].nodeType == 3){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1080 |
txt += i+nm + " : [ TextNode "+o[nm].data + " ]" + br; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1081 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1082 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1083 |
}else if(typeof o[nm] == "object" && (o[nm] instanceof String || o[nm] instanceof Number || o[nm] instanceof Boolean)){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1084 |
txt += i+nm + " : " + o[nm] + "," + br; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1085 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1086 |
}else if(o[nm] instanceof Date){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1087 |
txt += i+nm + " : " + o[nm].toString() + br; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1088 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1089 |
}else if(typeof(o[nm]) == "object" && o[nm]){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1090 |
for(var j = 0, seen; seen = used[j]; j++){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1091 |
if(o[nm] === seen){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1092 |
txt += i+nm + " : RECURSION" + br; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1093 |
continue looking; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1094 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1095 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1096 |
used.push(o[nm]); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1097 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1098 |
opnCls = (isArray(o[nm]))?["[","]"]:["{","}"]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1099 |
txt += i+nm +" : " + opnCls[0] + "\n";//non-standard break, (no comma) |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1100 |
txt += printObject(o[nm], i+ind, "", used); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1101 |
txt += i + opnCls[1] + br; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1102 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1103 |
}else if(typeof o[nm] == "undefined"){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1104 |
txt += i+nm + " : undefined" + br; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1105 |
}else if(nm == "toString" && typeof o[nm] == "function"){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1106 |
var toString = o[nm](); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1107 |
if(typeof toString == "string" && toString.match(/function ?(.*?)\(/)){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1108 |
toString = escapeHTML(getObjectAbbr(o[nm])); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1109 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1110 |
txt += i+nm +" : " + toString + br; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1111 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1112 |
txt += i+nm +" : "+ escapeHTML(getObjectAbbr(o[nm])) + br; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1113 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1114 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1115 |
return txt; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1116 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1117 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1118 |
function getObjectAbbr(obj){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1119 |
// Gets an abbreviation of an object for display in log |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1120 |
// X items in object, including id |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1121 |
// X items in an array |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1122 |
// TODO: Firebug Sr. actually goes by char count |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1123 |
var isError = (obj instanceof Error); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1124 |
if(obj.nodeType == 1){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1125 |
return escapeHTML('< '+obj.tagName.toLowerCase()+' id=\"'+ obj.id+ '\" />'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1126 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1127 |
if(obj.nodeType == 3){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1128 |
return escapeHTML('[TextNode: "'+obj.nodeValue+'"]'); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1129 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1130 |
var nm = (obj && (obj.id || obj.name || obj.ObjectID || obj.widgetId)); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1131 |
if(!isError && nm){ return "{"+nm+"}"; } |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1132 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1133 |
var obCnt = 2; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1134 |
var arCnt = 4; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1135 |
var cnt = 0; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1136 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1137 |
if(isError){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1138 |
nm = "[ Error: "+(obj.message || obj.description || obj)+" ]"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1139 |
}else if(isArray(obj)){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1140 |
nm = "[" + obj.slice(0,arCnt).join(","); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1141 |
if(obj.length > arCnt){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1142 |
nm += " ... ("+obj.length+" items)"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1143 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1144 |
nm += "]"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1145 |
}else if(typeof obj == "function"){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1146 |
nm = obj + ""; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1147 |
var reg = /function\s*([^\(]*)(\([^\)]*\))[^\{]*\{/; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1148 |
var m = reg.exec(nm); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1149 |
if(m){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1150 |
if(!m[1]){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1151 |
m[1] = "function"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1152 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1153 |
nm = m[1] + m[2]; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1154 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1155 |
nm = "function()"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1156 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1157 |
}else if(typeof obj != "object" || typeof obj == "string"){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1158 |
nm = obj + ""; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1159 |
}else{ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1160 |
nm = "{"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1161 |
for(var i in obj){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1162 |
cnt++; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1163 |
if(cnt > obCnt){ break; } |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1164 |
nm += i+":"+escapeHTML(obj[i])+" "; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1165 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1166 |
nm+="}"; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1167 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1168 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1169 |
return nm; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1170 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1171 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1172 |
//************************************************************************************* |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1173 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1174 |
//window.onerror = onError; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1175 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1176 |
addEvent(document, has("ie") || has("safari") ? "keydown" : "keypress", onKeyDown); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1177 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1178 |
if( (document.documentElement.getAttribute("debug") == "true")|| |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1179 |
(dojo.config.isDebug) |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1180 |
){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1181 |
toggleConsole(true); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1182 |
} |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1183 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1184 |
dojo.addOnWindowUnload(function(){ |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1185 |
// Erase the globals and event handlers I created, to prevent spurious leak warnings |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1186 |
removeEvent(document, has("ie") || has("safari") ? "keydown" : "keypress", onKeyDown); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1187 |
window.onFirebugResize = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1188 |
window.console = null; |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1189 |
}); |
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1190 |
|
|
8a6eb26ac87f
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1191 |
}); |