1 |
<!DOCTYPE html SYSTEM> |
2 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
3 |
<head> |
4 |
<title lang="en">Object Viewer</title> |
5 |
<style type="text/css" media="all"> |
6 |
body { |
7 |
line-height: 2.0; |
8 |
} |
9 |
|
10 |
code, pre { |
11 |
font-size: 100%; |
12 |
} |
13 |
|
14 |
.attribute-name { |
15 |
width: 10em; |
16 |
color: green; |
17 |
font-family: "Courier New", "Courier", monospace; |
18 |
} |
19 |
|
20 |
.attribute-value { |
21 |
display: inline; |
22 |
height: 2em; |
23 |
border-left: 1px #C0C0C0 solid; |
24 |
border-right: 1px #C0C0C0 solid; |
25 |
padding-left: 0.2em; |
26 |
padding-right: 0.2em; |
27 |
overflow: auto; |
28 |
} |
29 |
|
30 |
.boolean { |
31 |
list-style-image: url(http://suika.fam.cx/icons/pie4); |
32 |
} |
33 |
.number { |
34 |
list-style-image: url(http://suika.fam.cx/icons/binary); |
35 |
} |
36 |
.string { |
37 |
list-style-image: url(http://suika.fam.cx/icons/text); |
38 |
} |
39 |
.function { |
40 |
list-style-image: url(http://suika.fam.cx/icons/link); |
41 |
} |
42 |
.object { |
43 |
list-style-image: url(http://suika.fam.cx/icons/sphere2); |
44 |
} |
45 |
.open { |
46 |
list-style-image: url(http://suika.fam.cx/icons/sphere1); |
47 |
} |
48 |
.undefined { |
49 |
list-style-image: url(http://suika.fam.cx/icons/unknown); |
50 |
} |
51 |
.error { |
52 |
list-style-image: url(http://suika.fam.cx/icons/bomb); |
53 |
} |
54 |
|
55 |
</style> |
56 |
</head> |
57 |
<body> |
58 |
<h1 lang="en">Object Viewer</h1> |
59 |
|
60 |
<div id="documentObjectViewerContainer"> |
61 |
<input type="url" value="" style="width: 95%" onchange=" |
62 |
parent.contentFrame.location.href = value; |
63 |
" /> |
64 |
|
65 |
<button lang="en" onclick=" |
66 |
var list = document.getElementById ('documentObjectViewerList'); |
67 |
list.innerHTML = ''; |
68 |
expandChild (list, 'parent.contentFrame'); |
69 |
">Reconstruct</button> |
70 |
|
71 |
<div id="documentObjectViewerList"></div> |
72 |
|
73 |
<script type="text/javascript"> |
74 |
function changeState (parentElement, varName) { |
75 |
var ul = parentElement.getElementsByTagName ('ul')[0]; |
76 |
if (ul) { |
77 |
parentElement.removeChild (ul); |
78 |
parentElement.className = parentElement.className.replace (/\bopen\b/, 'close'); |
79 |
} else { |
80 |
expandChild (parentElement, varName); |
81 |
parentElement.className = parentElement.className.replace (/\bclose\b/, 'open'); |
82 |
} |
83 |
} |
84 |
|
85 |
function expandChild (parentElement, varName) { |
86 |
var list = document.createElement ('ul'); |
87 |
parentElement.appendChild (list); |
88 |
for (var a in eval(varName)) { |
89 |
var af = varName + "['" + a.replace (/([\\'])/, '\\$1') + "']"; |
90 |
appendItem (list, a, af); |
91 |
} |
92 |
} |
93 |
function appendItem (list, a, af) { |
94 |
var li = list.appendChild (document.createElement ('li')); |
95 |
var attrname = li.appendChild (document.createElement ('code')); |
96 |
attrname.className = 'attribute-name'; |
97 |
attrname.appendChild (document.createTextNode (a)); |
98 |
attrname.onclick = new Function ('changeState (this.parentNode, "' + |
99 |
af.replace (/([\\"])/, '\\$1') + '")'); |
100 |
try { |
101 |
li.className = 'close ' + typeof eval (af); |
102 |
} catch (e) { |
103 |
li.className = 'close error'; |
104 |
} |
105 |
li.appendChild (document.createTextNode (' ')); |
106 |
var attrval = li.appendChild (document.createElement ('pre')); |
107 |
attrval.className = 'attribute-value'; |
108 |
try { |
109 |
attrval.appendChild (document.createTextNode (eval (af))); |
110 |
} catch (e) { |
111 |
} |
112 |
} |
113 |
|
114 |
function init () { |
115 |
expandChild (document.getElementById ('documentObjectViewerList'), |
116 |
'parent.contentFrame'); |
117 |
} |
118 |
</script> |
119 |
</div> |
120 |
|
121 |
</body> |
122 |
</html> |
123 |
|
124 |
<!-- Revision: $Date: 2005/04/24 07:58:59 $ --> |
125 |
|
126 |
<!-- ***** BEGIN LICENSE BLOCK ***** |
127 |
- Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
128 |
- |
129 |
- The contents of this file are subject to the Mozilla Public License Version |
130 |
- 1.1 (the "License"); you may not use this file except in compliance with |
131 |
- the License. You may obtain a copy of the License at |
132 |
- <http://www.mozilla.org/MPL/> |
133 |
- |
134 |
- Software distributed under the License is distributed on an "AS IS" basis, |
135 |
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
136 |
- for the specific language governing rights and limitations under the |
137 |
- License. |
138 |
- |
139 |
- The Original Code is Object Viewer code. |
140 |
- |
141 |
- The Initial Developer of the Original Code is Wakaba. |
142 |
- Portions created by the Initial Developer are Copyright (C) 2005 |
143 |
- the Initial Developer. All Rights Reserved. |
144 |
- |
145 |
- Contributor(s): |
146 |
- Wakaba <w@suika.fam.cx> |
147 |
- |
148 |
- Alternatively, the contents of this file may be used under the terms of |
149 |
- either the GNU General Public License Version 2 or later (the "GPL"), or |
150 |
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
151 |
- in which case the provisions of the GPL or the LGPL are applicable instead |
152 |
- of those above. If you wish to allow use of your version of this file only |
153 |
- under the terms of either the GPL or the LGPL, and not to allow others to |
154 |
- use your version of this file under the terms of the MPL, indicate your |
155 |
- decision by deleting the provisions above and replace them with the notice |
156 |
- and other provisions required by the LGPL or the GPL. If you do not delete |
157 |
- the provisions above, a recipient may use your version of this file under |
158 |
- the terms of any one of the MPL, the GPL or the LGPL. |
159 |
- |
160 |
- ***** END LICENSE BLOCK ***** --> |