Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
94de5384
Commit
94de5384
authored
Aug 06, 2007
by
Nigel McNie
Browse files
Added firebug for non-firefox developermode
parent
f0e41d5c
Changes
7
Hide whitespace changes
Inline
Side-by-side
htdocs/js/firebug/errorIcon.png
0 → 100644
View file @
94de5384
457 Bytes
htdocs/js/firebug/firebug.css
0 → 100644
View file @
94de5384
html
,
body
{
margin
:
0
;
background
:
#FFFFFF
;
font-family
:
Lucida
Grande
,
Tahoma
,
sans-serif
;
font-size
:
11px
;
overflow
:
hidden
;
}
a
{
text-decoration
:
none
;
}
a
:hover
{
text-decoration
:
underline
;
}
.toolbar
{
height
:
14px
;
border-top
:
1px
solid
ThreeDHighlight
;
border-bottom
:
1px
solid
ThreeDShadow
;
padding
:
2px
6px
;
background
:
ThreeDFace
;
}
.toolbarRight
{
position
:
absolute
;
top
:
4px
;
right
:
6px
;
}
#log
{
overflow
:
auto
;
position
:
absolute
;
left
:
0
;
width
:
100%
;
}
#commandLine
{
position
:
absolute
;
bottom
:
0
;
left
:
0
;
width
:
100%
;
height
:
18px
;
border
:
none
;
border-top
:
1px
solid
ThreeDShadow
;
}
/************************************************************************************************/
.logRow
{
position
:
relative
;
border-bottom
:
1px
solid
#D7D7D7
;
padding
:
2px
4px
1px
6px
;
background-color
:
#FFFFFF
;
}
.logRow-command
{
font-family
:
Monaco
,
monospace
;
color
:
blue
;
}
.objectBox-null
{
padding
:
0
2px
;
border
:
1px
solid
#666666
;
background-color
:
#888888
;
color
:
#FFFFFF
;
}
.objectBox-string
{
font-family
:
Monaco
,
monospace
;
color
:
red
;
white-space
:
pre
;
}
.objectBox-number
{
color
:
#000088
;
}
.objectBox-function
{
font-family
:
Monaco
,
monospace
;
color
:
DarkGreen
;
}
.objectBox-object
{
color
:
DarkGreen
;
font-weight
:
bold
;
}
/************************************************************************************************/
.logRow-info
,
.logRow-error
,
.logRow-warning
{
background
:
#FFFFFF
no-repeat
2px
2px
;
padding-left
:
20px
;
padding-bottom
:
3px
;
}
.logRow-info
{
background-image
:
url(infoIcon.png)
;
}
.logRow-warning
{
background-color
:
cyan
;
background-image
:
url(warningIcon.png)
;
}
.logRow-error
{
background-color
:
LightYellow
;
background-image
:
url(errorIcon.png)
;
}
.errorMessage
{
vertical-align
:
top
;
color
:
#FF0000
;
}
.objectBox-sourceLink
{
position
:
absolute
;
right
:
4px
;
top
:
2px
;
padding-left
:
8px
;
font-family
:
Lucida
Grande
,
sans-serif
;
font-weight
:
bold
;
color
:
#0000FF
;
}
/************************************************************************************************/
.logRow-group
{
background
:
#EEEEEE
;
border-bottom
:
none
;
}
.logGroup
{
background
:
#EEEEEE
;
}
.logGroupBox
{
margin-left
:
24px
;
border-top
:
1px
solid
#D7D7D7
;
border-left
:
1px
solid
#D7D7D7
;
}
/************************************************************************************************/
.selectorTag
,
.selectorId
,
.selectorClass
{
font-family
:
Monaco
,
monospace
;
font-weight
:
normal
;
}
.selectorTag
{
color
:
#0000FF
;
}
.selectorId
{
color
:
DarkBlue
;
}
.selectorClass
{
color
:
red
;
}
/************************************************************************************************/
.objectBox-element
{
font-family
:
Monaco
,
monospace
;
color
:
#000088
;
}
.nodeChildren
{
margin-left
:
16px
;
}
.nodeTag
{
color
:
blue
;
}
.nodeValue
{
color
:
#FF0000
;
font-weight
:
normal
;
}
.nodeText
,
.nodeComment
{
margin
:
0
2px
;
vertical-align
:
top
;
}
.nodeText
{
color
:
#333333
;
}
.nodeComment
{
color
:
DarkGreen
;
}
/************************************************************************************************/
.propertyNameCell
{
vertical-align
:
top
;
}
.propertyName
{
font-weight
:
bold
;
}
htdocs/js/firebug/firebug.html
0 → 100644
View file @
94de5384
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
>
<head>
<title>
Firebug
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"firebug.css"
>
</head>
<body>
<div
id=
"toolbar"
class=
"toolbar"
>
<a
href=
"#"
onclick=
"parent.console.clear()"
>
Clear
</a>
<span
class=
"toolbarRight"
>
<a
href=
"#"
onclick=
"parent.console.close()"
>
Close
</a>
</span>
</div>
<div
id=
"log"
></div>
<input
type=
"text"
id=
"commandLine"
>
<script>
parent
.
onFirebugReady
(
document
);
</script>
</body>
</html>
htdocs/js/firebug/firebug.js
0 → 100644
View file @
94de5384
if
(
!
(
"
console
"
in
window
)
||
!
(
"
firebug
"
in
console
))
{
(
function
()
{
window
.
console
=
{
log
:
function
()
{
logFormatted
(
arguments
,
""
);
},
debug
:
function
()
{
logFormatted
(
arguments
,
"
debug
"
);
},
info
:
function
()
{
logFormatted
(
arguments
,
"
info
"
);
},
warn
:
function
()
{
logFormatted
(
arguments
,
"
warning
"
);
},
error
:
function
()
{
logFormatted
(
arguments
,
"
error
"
);
},
assert
:
function
(
truth
,
message
)
{
if
(
!
truth
)
{
var
args
=
[];
for
(
var
i
=
1
;
i
<
arguments
.
length
;
++
i
)
args
.
push
(
arguments
[
i
]);
logFormatted
(
args
.
length
?
args
:
[
"
Assertion Failure
"
],
"
error
"
);
throw
message
?
message
:
"
Assertion Failure
"
;
}
},
dir
:
function
(
object
)
{
var
html
=
[];
var
pairs
=
[];
for
(
var
name
in
object
)
{
try
{
pairs
.
push
([
name
,
object
[
name
]]);
}
catch
(
exc
)
{
}
}
pairs
.
sort
(
function
(
a
,
b
)
{
return
a
[
0
]
<
b
[
0
]
?
-
1
:
1
;
});
html
.
push
(
'
<table>
'
);
for
(
var
i
=
0
;
i
<
pairs
.
length
;
++
i
)
{
var
name
=
pairs
[
i
][
0
],
value
=
pairs
[
i
][
1
];
html
.
push
(
'
<tr>
'
,
'
<td class="propertyNameCell"><span class="propertyName">
'
,
escapeHTML
(
name
),
'
</span></td>
'
,
'
<td><span class="propertyValue">
'
);
appendObject
(
value
,
html
);
html
.
push
(
'
</span></td></tr>
'
);
}
html
.
push
(
'
</table>
'
);
logRow
(
html
,
"
dir
"
);
},
dirxml
:
function
(
node
)
{
var
html
=
[];
appendNode
(
node
,
html
);
logRow
(
html
,
"
dirxml
"
);
},
group
:
function
()
{
logRow
(
arguments
,
"
group
"
,
pushGroup
);
},
groupEnd
:
function
()
{
logRow
(
arguments
,
""
,
popGroup
);
},
time
:
function
(
name
)
{
timeMap
[
name
]
=
(
new
Date
()).
getTime
();
},
timeEnd
:
function
(
name
)
{
if
(
name
in
timeMap
)
{
var
delta
=
(
new
Date
()).
getTime
()
-
timeMap
[
name
];
logFormatted
([
name
+
"
:
"
,
delta
+
"
ms
"
]);
delete
timeMap
[
name
];
}
},
count
:
function
()
{
this
.
warn
([
"
count() not supported.
"
]);
},
trace
:
function
()
{
this
.
warn
([
"
trace() not supported.
"
]);
},
profile
:
function
()
{
this
.
warn
([
"
profile() not supported.
"
]);
},
profileEnd
:
function
()
{
},
clear
:
function
()
{
consoleBody
.
innerHTML
=
""
;
},
open
:
function
()
{
toggleConsole
(
true
);
},
close
:
function
()
{
if
(
frameVisible
)
toggleConsole
();
}
};
// ********************************************************************************************
var
consoleFrame
=
null
;
var
consoleBody
=
null
;
var
commandLine
=
null
;
var
frameVisible
=
false
;
var
messageQueue
=
[];
var
groupStack
=
[];
var
timeMap
=
{};
var
clPrefix
=
"
>>>
"
;
var
isFirefox
=
navigator
.
userAgent
.
indexOf
(
"
Firefox
"
)
!=
-
1
;
var
isIE
=
navigator
.
userAgent
.
indexOf
(
"
MSIE
"
)
!=
-
1
;
var
isOpera
=
navigator
.
userAgent
.
indexOf
(
"
Opera
"
)
!=
-
1
;
var
isSafari
=
navigator
.
userAgent
.
indexOf
(
"
AppleWebKit
"
)
!=
-
1
;
// ********************************************************************************************
function
toggleConsole
(
forceOpen
)
{
frameVisible
=
forceOpen
||
!
frameVisible
;
if
(
consoleFrame
)
consoleFrame
.
style
.
visibility
=
frameVisible
?
"
visible
"
:
"
hidden
"
;
else
waitForBody
();
}
function
focusCommandLine
()
{
toggleConsole
(
true
);
if
(
commandLine
)
commandLine
.
focus
();
}
function
waitForBody
()
{
if
(
document
.
body
)
createFrame
();
else
setTimeout
(
waitForBody
,
200
);
}
function
createFrame
()
{
if
(
consoleFrame
)
return
;
window
.
onFirebugReady
=
function
(
doc
)
{
window
.
onFirebugReady
=
null
;
var
toolbar
=
doc
.
getElementById
(
"
toolbar
"
);
toolbar
.
onmousedown
=
onSplitterMouseDown
;
commandLine
=
doc
.
getElementById
(
"
commandLine
"
);
addEvent
(
commandLine
,
"
keydown
"
,
onCommandLineKeyDown
);
addEvent
(
doc
,
isIE
||
isSafari
?
"
keydown
"
:
"
keypress
"
,
onKeyDown
);
consoleBody
=
doc
.
getElementById
(
"
log
"
);
layout
();
flush
();
}
var
baseURL
=
getFirebugURL
();
consoleFrame
=
document
.
createElement
(
"
iframe
"
);
consoleFrame
.
setAttribute
(
"
src
"
,
baseURL
+
"
/firebug.html
"
);
consoleFrame
.
setAttribute
(
"
frameBorder
"
,
"
0
"
);
consoleFrame
.
style
.
visibility
=
(
frameVisible
?
"
visible
"
:
"
hidden
"
);
consoleFrame
.
style
.
zIndex
=
"
2147483647
"
;
consoleFrame
.
style
.
position
=
"
fixed
"
;
consoleFrame
.
style
.
width
=
"
100%
"
;
consoleFrame
.
style
.
left
=
"
0
"
;
consoleFrame
.
style
.
bottom
=
"
0
"
;
consoleFrame
.
style
.
height
=
"
200px
"
;
document
.
body
.
appendChild
(
consoleFrame
);
}
function
getFirebugURL
()
{
var
scripts
=
document
.
getElementsByTagName
(
"
script
"
);
for
(
var
i
=
0
;
i
<
scripts
.
length
;
++
i
)
{
if
(
scripts
[
i
].
src
.
indexOf
(
"
firebug.js
"
)
!=
-
1
)
{
var
lastSlash
=
scripts
[
i
].
src
.
lastIndexOf
(
"
/
"
);
return
scripts
[
i
].
src
.
substr
(
0
,
lastSlash
);
}
}
}
function
evalCommandLine
()
{
var
text
=
commandLine
.
value
;
commandLine
.
value
=
""
;
logRow
([
clPrefix
,
text
],
"
command
"
);
var
value
;
try
{
value
=
eval
(
text
);
}
catch
(
exc
)
{
}
console
.
log
(
value
);
}
function
layout
()
{
var
toolbar
=
consoleBody
.
ownerDocument
.
getElementById
(
"
toolbar
"
);
var
height
=
consoleFrame
.
offsetHeight
-
(
toolbar
.
offsetHeight
+
commandLine
.
offsetHeight
);
consoleBody
.
style
.
top
=
toolbar
.
offsetHeight
+
"
px
"
;
consoleBody
.
style
.
height
=
height
+
"
px
"
;
commandLine
.
style
.
top
=
(
consoleFrame
.
offsetHeight
-
commandLine
.
offsetHeight
)
+
"
px
"
;
}
function
logRow
(
message
,
className
,
handler
)
{
if
(
consoleBody
)
writeMessage
(
message
,
className
,
handler
);
else
{
messageQueue
.
push
([
message
,
className
,
handler
]);
waitForBody
();
}
}
function
flush
()
{
var
queue
=
messageQueue
;
messageQueue
=
[];
for
(
var
i
=
0
;
i
<
queue
.
length
;
++
i
)
writeMessage
(
queue
[
i
][
0
],
queue
[
i
][
1
],
queue
[
i
][
2
]);
}
function
writeMessage
(
message
,
className
,
handler
)
{
var
isScrolledToBottom
=
consoleBody
.
scrollTop
+
consoleBody
.
offsetHeight
>=
consoleBody
.
scrollHeight
;
if
(
!
handler
)
handler
=
writeRow
;
handler
(
message
,
className
);
if
(
isScrolledToBottom
)
consoleBody
.
scrollTop
=
consoleBody
.
scrollHeight
-
consoleBody
.
offsetHeight
;
}
function
appendRow
(
row
)
{
var
container
=
groupStack
.
length
?
groupStack
[
groupStack
.
length
-
1
]
:
consoleBody
;
container
.
appendChild
(
row
);
}
function
writeRow
(
message
,
className
)
{
var
row
=
consoleBody
.
ownerDocument
.
createElement
(
"
div
"
);
row
.
className
=
"
logRow
"
+
(
className
?
"
logRow-
"
+
className
:
""
);
row
.
innerHTML
=
message
.
join
(
""
);
appendRow
(
row
);
}
function
pushGroup
(
message
,
className
)
{
logFormatted
(
message
,
className
);
var
groupRow
=
consoleBody
.
ownerDocument
.
createElement
(
"
div
"
);
groupRow
.
className
=
"
logGroup
"
;
var
groupRowBox
=
consoleBody
.
ownerDocument
.
createElement
(
"
div
"
);
groupRowBox
.
className
=
"
logGroupBox
"
;
groupRow
.
appendChild
(
groupRowBox
);
appendRow
(
groupRowBox
);
groupStack
.
push
(
groupRowBox
);
}
function
popGroup
()
{
groupStack
.
pop
();
}
// ********************************************************************************************
function
logFormatted
(
objects
,
className
)
{
var
html
=
[];
var
format
=
objects
[
0
];
var
objIndex
=
0
;
if
(
typeof
(
format
)
!=
"
string
"
)
{
format
=
""
;
objIndex
=
-
1
;
}
var
parts
=
parseFormat
(
format
);
for
(
var
i
=
0
;
i
<
parts
.
length
;
++
i
)
{
var
part
=
parts
[
i
];
if
(
part
&&
typeof
(
part
)
==
"
object
"
)
{
var
object
=
objects
[
++
objIndex
];
part
.
appender
(
object
,
html
);
}
else
appendText
(
part
,
html
);
}
for
(
var
i
=
objIndex
+
1
;
i
<
objects
.
length
;
++
i
)
{
appendText
(
"
"
,
html
);
var
object
=
objects
[
i
];
if
(
typeof
(
object
)
==
"
string
"
)
appendText
(
object
,
html
);
else
appendObject
(
object
,
html
);
}
logRow
(
html
,
className
);
}
function
parseFormat
(
format
)
{
var
parts
=
[];
var
reg
=
/
((
^%|
[^\\]
%
)(\d
+
)?(\.)([
a-zA-Z
]))
|
((
^%|
[^\\]
%