Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit

commit 940839e0cffa94c77f3fe4aef5df1c2c962cc1d7 0 parents
Brenton Fletcher authored
22 LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2006-2009 Brenton Fletcher (http://i.bloople.net i@bloople.net)
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
3  bt.css
@@ -0,0 +1,3 @@
+.tooltip { width: 18em; background-color: #ffffcc; border: 1px solid #a0a0a0;
+padding: 5px; margin-top: 0.4em; margin-left: 0.6em; }
+.tooltip span.top { }
6 get.php
@@ -0,0 +1,6 @@
+<?
+$prefix = substr($_GET["url"], 0, 4);
+if($prefix != "http") die();
+echo file_get_contents($_GET["url"]);
+//header("Location: ".$_GET["url"]);
+?>
BIN  images/_alpha.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/array.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/arrayt.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/back.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/break.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/donate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/info.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/json.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/max.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/min.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/object.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/objectt.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/prototype.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/top.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/top1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 index.htm
@@ -0,0 +1,87 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+<title>JSON 2 HTML</title>
+<link rel="StyleSheet" type="text/css" href="style.css" />
+<script type="text/javascript" src="scripts/json-min.js"></script>
+<script type="text/javascript" src="scripts/BubbleTooltips.js"></script>
+<script type="text/javascript" src="scripts/parse.js"></script>
+<!--[if lt IE 7]>
+<script defer type="text/javascript" src="scripts/pngfix.js"></script>
+<![endif]-->
+
+<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
+</head>
+<body id="body" onmouseover="stopFocus();">
+<a name="_top" class="noa"></a>
+
+<div class="header">
+<div class="alpha"><a href="javascript:void(0);" onclick="doDonate();"><img src="images/donate.png" alt="Please Donate!" /></a></div>
+<div class="shoutboxcon"><a href="javascript:showShoutbox();" id="shoutboxlink">show shoutbox!</a>
+ <div id="shoutbox">
+ <!-- Begin Shoutbox - http://www.shoutmix.com -->
+ <iframe title="bloopletech" src="http://www.shoutmix.com/?bloopletech" width="160" height="400" frameborder="0" scrolling="auto">
+ <a href="http://www.shoutmix.com/?bloopletech">View shoutbox</a>
+ </iframe>
+ <!-- End Shoutbox -->
+ </div>
+</div>
+<img src="images/logo.png" alt="json 2 html" />
+</div>
+
+<div class="mainbody">
+ <div id="bodywrap" class="bodywrap"></div>
+ <div id="desc" class="desc">
+ <p><img class="jsonlogo" src="images/json.gif" alt="JSON logo" /><h3>json</h3>
+ <i>Quoting from the home page of <a href="http://www.json.org/">JSON</a></i><br />
+ JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.</p>
+ <p><h3>syntax highlighting:</h3>
+ <span class='string'>Colour for text and null values.</span><br />
+ <span class='number'>Colour for numbers.</span><br />
+ <span class='boolean'>Colour for true and false values.</span><br />
+ <span class='void'>Colour for void values.</span><br />
+ <img class="ex" src="images/object.png" /> Background for Objects.<br />
+ <img class="ex" src="images/array.png" /> Background for Arrays.<br />
+ <img class="ex" src="images/objectt.png" /> Background for Object name/value pair tables.<br />
+ <img class="ex" src="images/arrayt.png" /> Background for Array value tables.</p>
+ <p><h3>dependencies</h3>
+ This page uses the JSON JavaScript <a href="http://www.json.org/js.html">parsing library</a>.</p>
+ <p><h3>note</h3>
+ Words longer than 30 characters may be broken into two or more lines to save space.</p>
+ <p class="closep"><input type="button" onclick="hideHelp();" value="close" /></p>
+ </div>
+ <div id="donate" class="desc">
+ <p><h3>Donation</h3>
+ I create projects like this one for people like you.
+ It would be great if you donated, say, $5 so I can continue to create new projects and support the projects I've
+ already completed.</p>
+ <p><form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+ <input type="hidden" name="cmd" value="_s-xclick">
+ If you want to donate, you can so in less than two minutes via PayPal. Just click
+ <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">.
+ <img alt="" border="0" src="https://www.paypal.com/en_AU/i/scr/pixel.gif" width="1" height="1">
+ <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----">
+ </form></p>
+ <p class="closep"><input type="button" onclick="hideDonate();" value="close" /></p>
+ </div>
+
+ <form onsubmit="doParse(); return false;">
+ <p class="mast">This page offers an easy way to visualize a string of JSON text.
+ Put some JSON into the text area, and this page will instantly display the text as a set of nested boxes,
+ corresponding to the objects, arrays and values in the JSON string.<br />
+ You can also paste a URL into the textarea, and the JSON string will be loaded from the URL.<br />
+ Check out my new project, <a href="http://rss.budgetwebdesign.org/">rss2html</a> - embed RSS feeds directly into HTML.
+ </p>
+ <div id="inputcontainer"><textarea id="text" rows="12"></textarea></div>
+ <div class="clear"></div>
+ <div class="lfloat"><input type="submit" id="submit" value="json 2 html" onclick="doParse(); return false;" /> <input type="button" id="reset" value="reset" onclick="clearPage();" /></div>
+ <div class="rfloat"><input type="button" id="help" value="help" onclick="doHelp();" /></div>
+ <div class="clear"></div>
+ <hr />
+ <a name="_output" class="noa"></a>
+ <div id="stats" class="stats"></div>
+ <div id="output" class="output"></div>
+ </form>
+ <div class="footer">Check out my portfolio at <a href="http://i.bloople.net">i.bloople.net</a>. &copy; Brenton Fletcher. Comments? e-mail me: <a href="mailto:impactbc@hotmail.com">impactbc@hotmail.com</a>.</div>
+</body>
+</html>
BIN  scripts/._parse.js
Binary file not shown
91 scripts/BubbleTooltips.js
@@ -0,0 +1,91 @@
+/*javascript for Bubble Tooltips by Alessandro Fulciniti
+- http://pro.html.it - http://web-graphics.com */
+//Modified by Brenton Fletcher
+
+function enableTooltips(id){
+var links,i,h;
+if(!document.getElementById || !document.getElementsByTagName) return;
+AddCss();
+h=document.createElement("span");
+h.id="btc";
+h.setAttribute("id","btc");
+h.style.position="absolute";
+document.getElementsByTagName("body")[0].appendChild(h);
+doTooltips(id);
+}
+
+function doTooltips(id)
+{
+ if(id==null) links=document.getElementsByTagName("span");
+ else links=document.getElementById(id).getElementsByTagName("span");
+ for(i=0;i<links.length;i++) Prepare(links[i]);
+}
+
+function Prepare(el){
+var tooltip,t,b,s,l;
+t=el.getAttribute("title");
+if(t==null || t.length==0) return;
+el.removeAttribute("title");
+tooltip=CreateEl("span","tooltip");
+s=CreateEl("span","top");
+s.appendChild(document.createTextNode(t));
+tooltip.appendChild(s);
+setOpacity(tooltip);
+el.tooltip=tooltip;
+el.onmouseover=showTooltip;
+el.onmouseout=hideTooltip;
+el.onmousemove=Locate;
+}
+
+function showTooltip(e){
+document.getElementById("btc").appendChild(this.tooltip);
+Locate(e);
+}
+
+function hideTooltip(e){
+var d=document.getElementById("btc");
+if(d.childNodes.length>0) d.removeChild(d.firstChild);
+}
+
+function setOpacity(el){
+el.style.filter="alpha(opacity:95)";
+el.style.KHTMLOpacity="0.95";
+el.style.MozOpacity="0.95";
+el.style.opacity="0.95";
+}
+
+function CreateEl(t,c){
+var x=document.createElement(t);
+x.className=c;
+x.style.display="block";
+return(x);
+}
+
+function AddCss(){
+var l=CreateEl("link");
+l.setAttribute("type","text/css");
+l.setAttribute("rel","stylesheet");
+l.setAttribute("href","bt.css");
+l.setAttribute("media","screen");
+document.getElementsByTagName("head")[0].appendChild(l);
+}
+
+function Locate(e){
+var posx=0,posy=0;
+if(e==null) e=window.event;
+if(e.pageX || e.pageY){
+ posx=e.pageX; posy=e.pageY;
+ }
+else if(e.clientX || e.clientY){
+ if(document.documentElement.scrollTop){
+ posx=e.clientX+document.documentElement.scrollLeft;
+ posy=e.clientY+document.documentElement.scrollTop;
+ }
+ else{
+ posx=e.clientX+document.body.scrollLeft;
+ posy=e.clientY+document.body.scrollTop;
+ }
+ }
+document.getElementById("btc").style.top=(posy+10)+"px";
+document.getElementById("btc").style.left=(posx-20)+"px";
+}
615 scripts/highlight.js
@@ -0,0 +1,615 @@
+var JSEOptions = window.JSEOptions || {};
+setdefault(JSEOptions,
+ {newlineElements: setObject("P", "DIV", "LI"),
+ safeKeys: setObject("KEY_ARROW_UP", "KEY_ARROW_DOWN", "KEY_ARROW_LEFT", "KEY_ARROW_RIGHT", "KEY_END", "KEY_HOME",
+ "KEY_PAGE_UP", "KEY_PAGE_DOWN", "KEY_SHIFT", "KEY_CTRL", "KEY_ALT", "KEY_SELECT"),
+ stylesheet: "highlight.css",
+ indentOnClosingBrace: true});
+
+var JSEditor = function(){
+ function simplifyDOM(root) {
+ var doc = root.ownerDocument;
+ var current = root;
+ var result = [];
+ var leaving = false;
+
+ function simplifyNode(node) {
+ leaving = false;
+
+ if (node.nodeType == 3) {
+ node.nodeValue = node.nodeValue.replace(/[\n\r]/g, "").replace(/[\t ]/g, nbsp);
+ result.push(node);
+ }
+ else if (node.nodeName == "BR" && node.childNodes.length == 0) {
+ result.push(node);
+ }
+ else {
+ forEach(node.childNodes, simplifyNode);
+ if (!leaving && JSEOptions.newlineElements.hasOwnProperty(node.nodeName)) {
+ leaving = true;
+ result.push(withDocument(doc, BR));
+ }
+ }
+ }
+
+ simplifyNode(root);
+ return result;
+ }
+
+ function traverseDOM(start){
+ function yield(value, c){cc = c; return value;}
+ function push(fun, arg, c){return function(){return fun(arg, c);};}
+ function stop(){cc = stop; throw StopIteration;};
+ var cc = push(scanNode, start, stop);
+ var owner = start.ownerDocument;
+
+ function pointAt(node){
+ var parent = node.parentNode;
+ var next = node.nextSibling;
+ if (next)
+ return function(newnode){parent.insertBefore(newnode, next);};
+ else
+ return function(newnode){parent.appendChild(newnode);};
+ }
+ var point = null;
+
+ function insertPart(part){
+ var text = "\n";
+ if (part.nodeType == 3) {
+ var text = part.nodeValue;
+ part = withDocument(owner, partial(SPAN, {"class": "part"}, part));
+ part.currentText = text;
+ }
+ part.dirty = true;
+ point(part);
+ return text;
+ }
+
+ function writeNode(node, c){
+ var toYield = [];
+ forEach(simplifyDOM(node), function(part) {
+ toYield.push(insertPart(part));
+ });
+ return yield(toYield.join(""), c);
+ }
+
+ function partNode(node){
+ if (node.nodeName == "SPAN" && node.childNodes.length == 1 && node.firstChild.nodeType == 3){
+ node.currentText = node.firstChild.nodeValue;
+ return true;
+ }
+ return false;
+ }
+
+ function scanNode(node, c){
+ if (node.nextSibling)
+ c = push(scanNode, node.nextSibling, c);
+
+ if (partNode(node)){
+ return yield(node.currentText, c);
+ }
+ else if (node.nodeName == "BR") {
+ return yield("\n", c);
+ }
+ else {
+ point = pointAt(node);
+ removeElement(node);
+ return writeNode(node, c);
+ }
+ }
+
+ return {next: function(){return cc();}};
+ }
+
+ var atomicTypes = setObject("atom", "number", "variable", "string", "regexp");
+
+ function parse(tokens){
+ var cc = [statements];
+ var consume, marked;
+ var context = null;
+ var lexical = {indented: -2, column: 0, type: "block", align: false};
+ var column = 0;
+ var indented = 0;
+
+ var parser = {next: next, copy: copy};
+
+ function next(){
+ while(cc[cc.length - 1].lex)
+ cc.pop()();
+
+ var token = tokens.next();
+ if (token.type == "whitespace" && column == 0)
+ indented = token.value.length;
+ column += token.value.length;
+ if (token.type == "newline"){
+ indented = column = 0;
+ if (!("align" in lexical))
+ lexical.align = false;
+ token.lexicalContext = lexical;
+ }
+ if (token.type == "whitespace" || token.type == "newline" || token.type == "comment")
+ return token;
+ if (!("align" in lexical))
+ lexical.align = true;
+
+ while(true){
+ consume = marked = false;
+ cc.pop()(token.type, token.name);
+ if (consume){
+ if (marked)
+ token.style = marked;
+ else if (token.type == "variable" && inScope(token.name))
+ token.style = "localvariable";
+ return token;
+ }
+ }
+ }
+ function copy(){
+ var _context = context, _lexical = lexical, _cc = copyArray(cc), _regexp = tokens.regexp, _comment = tokens.inComment;
+
+ return function(_tokens){
+ context = _context;
+ lexical = _lexical;
+ cc = copyArray(_cc);
+ column = indented = 0;
+ tokens = _tokens;
+ tokens.regexp = _regexp;
+ tokens.inComment = _comment;
+ return parser;
+ };
+ }
+
+ function push(fs){
+ for (var i = fs.length - 1; i >= 0; i--)
+ cc.push(fs[i]);
+ }
+ function cont(){
+ push(arguments);
+ consume = true;
+ }
+ function pass(){
+ push(arguments);
+ consume = false;
+ }
+ function mark(style){
+ marked = style;
+ }
+
+ function pushcontext(){
+ context = {prev: context, vars: {}};
+ }
+ function popcontext(){
+ context = context.prev;
+ }
+ function register(varname){
+ if (context){
+ mark("variabledef");
+ context.vars[varname] = true;
+ }
+ }
+ function inScope(varname){
+ var cursor = context;
+ while (cursor) {
+ if (cursor.vars[varname])
+ return true;
+ cursor = cursor.prev;
+ }
+ return false;
+ }
+
+ function pushlex(type){
+ var result = function(){
+ lexical = {prev: lexical, indented: indented, column: column, type: type};
+ };
+ result.lex = true;
+ return result;
+ }
+ function poplex(){
+ lexical = lexical.prev;
+ }
+ poplex.lex = true;
+
+ function expect(wanted){
+ return function(type){
+ if (type == wanted) cont();
+ else cont(arguments.callee);
+ };
+ }
+
+ function statements(type){
+ return pass(statement, statements);
+ }
+ function statement(type){
+ if (type == "var") cont(pushlex("vardef"), vardef1, expect(";"), poplex);
+ else if (type == "keyword a") cont(pushlex("stat"), expression, statement, poplex);
+ else if (type == "keyword b") cont(pushlex("stat"), statement, poplex);
+ else if (type == "{") cont(pushlex("}"), block, poplex);
+ else if (type == "function") cont(functiondef);
+ else if (type == "for") cont(pushlex("stat"), expect("("), pushlex(")"), forspec1, expect(")"), poplex, statement, poplex);
+ else if (type == "case") cont(expression, expect(":"));
+ else if (type == "variable") cont(pushlex("stat"), maybelabel);
+ else if (type == "catch") cont(pushlex("stat"), pushcontext, expect("("), funarg, expect(")"), statement, poplex, popcontext);
+ else pass(pushlex("stat"), expression, expect(";"), poplex);
+ }
+ function expression(type){
+ if (atomicTypes.hasOwnProperty(type)) cont(maybeoperator);
+ else if (type == "function") cont(functiondef);
+ else if (type == "keyword c") cont(expression);
+ else if (type == "(") cont(pushlex(")"), expression, expect(")"), poplex);
+ else if (type == "operator") cont(expression);
+ else if (type == "[") cont(pushlex("]"), commasep(expression), expect("]"), poplex);
+ else if (type == "{") cont(pushlex("}"), commasep(objprop), expect("}"), poplex);
+ }
+ function maybeoperator(type){
+ if (type == "operator") cont(expression);
+ else if (type == "(") cont(pushlex(")"), expression, commasep(expression), expect(")"), poplex);
+ else if (type == ".") cont(property, maybeoperator);
+ else if (type == "[") cont(pushlex("]"), expression, expect("]"), poplex);
+ }
+ function maybelabel(type){
+ if (type == ":") cont(poplex, statement);
+ else pass(maybeoperator, expect(";"), poplex);
+ }
+ function property(type){
+ if (type == "variable") {mark("property"); cont();}
+ }
+ function objprop(type){
+ if (type == "variable") mark("property");
+ if (atomicTypes.hasOwnProperty(type)) cont(expect(":"), expression);
+ }
+ function commasep(what){
+ function proceed(type) {
+ if (type == ",") cont(what, proceed);
+ };
+ return function() {
+ pass(what, proceed);
+ };
+ }
+ function block(type){
+ if (type == "}") cont();
+ else pass(statement, block);
+ }
+ function vardef1(type, value){
+ if (type == "variable"){register(value); cont(vardef2);}
+ else cont();
+ }
+ function vardef2(type){
+ if (type == "operator") cont(expression, vardef2);
+ else if (type == ",") cont(vardef1);
+ }
+ function forspec1(type, value){
+ if (type == "var") cont(vardef1, forspec2);
+ else cont(expression, forspec2);
+ }
+ function forspec2(type){
+ if (type == ",") cont(forspec1);
+ if (type == ";") cont(expression, expect(";"), expression);
+ }
+ function functiondef(type, value){
+ if (type == "variable"){register(value); cont(functiondef);}
+ else if (type == "(") cont(pushcontext, commasep(funarg), expect(")"), statement, popcontext);
+ }
+ function funarg(type, value){
+ if (type == "variable"){register(value); cont();}
+ }
+
+ return parser;
+ }
+
+ function indentation(lexical, closing){
+ if (lexical.type == "vardef")
+ return lexical.indented + 4;
+ if (lexical.type == "stat")
+ return lexical.indented + 2;
+ else if (lexical.align)
+ return lexical.column - (closing ? 1 : 0);
+ else
+ return lexical.indented + (closing ? 0 : 2);
+ }
+
+ function JSEditor(place, width, height, content) {
+ this.frame = createDOM("IFRAME", {"style": "border: 0; width: " + (width || 400) + "px; height: " + (height || 200) + "px; display: block;"});
+ place(this.frame);
+ this.win = this.frame.contentWindow;
+ this.doc = this.win.document;
+ this.doc.designMode = "on";
+ this.doc.open();
+ this.doc.write("<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"" + JSEOptions.stylesheet + "\"/></head>" +
+ "<body class=\"editbox\" spellcheck=\"false\"></body></html>");
+ this.doc.close();
+
+ this.dirty = [];
+
+ if (this.doc.body)
+ this.init(content);
+ else
+ connect(this.frame, "onload", bind(function(){disconnectAll(this.frame, "onload"); this.init(content);}, this));
+ }
+
+ var nbspRegexp = new RegExp(nbsp, "g");
+
+ JSEditor.prototype = {
+ linesPerShot: 10,
+ shotDelay: 300,
+
+ init: function (code) {
+ this.container = this.doc.body;
+ if (code)
+ this.importCode(code);
+ connect(this.doc, "onkeydown", method(this, "keyDown"));
+ connect(this.doc, "onkeyup", method(this, "keyUp"));
+ },
+
+ importCode: function(code) {
+ replaceChildNodes(this.container);
+ var lines = code.replace(/[ \t]/g, nbsp).replace(/\r\n?/g, "\n").split("\n");
+ for (var i = 0; i != lines.length; i++) {
+ if (i > 0)
+ this.container.appendChild(withDocument(this.doc, BR));
+ var line = lines[i];
+ if (line.length > 0)
+ this.container.appendChild(this.doc.createTextNode(line));
+ }
+ if (this.container.firstChild){
+ this.addDirtyNode(this.container.firstChild);
+ this.scheduleHighlight();
+ }
+ },
+
+ getCode: function() {
+ if (!this.container.firstChild)
+ return "";
+
+ var accum = [];
+ forEach(traverseDOM(this.container.firstChild), method(accum, "push"));
+ return accum.join("").replace(nbspRegexp, " ");
+ },
+
+ keyDown: function(event) {
+ var name = event.key().string;
+ if (ie_selection && event.key().string == "KEY_ENTER") {
+ insertNewlineAtCursor(this.win);
+ this.indentAtCursor();
+ event.stop();
+ }
+ else if ((name == "KEY_SPACEBAR" || name == "KEY_I") && event.modifier().ctrl) {
+ this.indentAtCursor();
+ event.stop();
+ }
+ },
+
+ keyUp: function(event) {
+ var name = event.key().string;
+ if (name == "KEY_ENTER" || (JSEOptions.indentOnClosingBrace && name == "KEY_RIGHT_SQUARE_BRACKET"))
+ this.indentAtCursor();
+ else if (!JSEOptions.safeKeys.hasOwnProperty(name))
+ this.markCursorDirty();
+ },
+
+ highlightAtCursor: function(cursor) {
+ if (cursor.valid) {
+ var node = cursor.start || this.container.firstChild;
+ if (node) {
+ if (node.nodeType != 3)
+ node.dirty = true;
+ var sel = markSelection(this.win);
+ this.highlight(node, true);
+ selectMarked(sel);
+ cursor = new Cursor(this.container);
+ }
+ }
+ return cursor;
+ },
+
+ indentAtCursor: function() {
+ var cursor = new Cursor(this.container)
+ cursor = this.highlightAtCursor(cursor);
+ if (!cursor.valid)
+ return;
+
+ var start = cursor.startOfLine();
+ var whiteSpace = start ? start.nextSibling : this.container.lastChild;
+ if (whiteSpace && !hasClass(whiteSpace, "whitespace"))
+ whiteSpace = null;
+
+ var firstText = whiteSpace ? whiteSpace.nextSibling : start ? start.nextSibling : this.container.firstChild;
+ var closing = start && firstText && firstText.currentText && firstText.currentText.charAt(0) == start.lexicalContext.type;
+ var indent = start ? indentation(start.lexicalContext, closing) : 0;
+ var indentDiff = indent - (whiteSpace ? whiteSpace.currentText.length : 0);
+
+ if (indentDiff < 0) {
+ whiteSpace.currentText = repeatString(nbsp, indent);
+ whiteSpace.firstChild.nodeValue = whiteSpace.currentText;
+ }
+ else if (indentDiff > 0) {
+ if (whiteSpace) {
+ whiteSpace.currentText += repeatString(nbsp, indentDiff);
+ whiteSpace.firstChild.nodeValue = whiteSpace.currentText;
+ }
+ else {
+ whiteSpace = withDocument(this.doc, function(){return SPAN({"class": "part whitespace"}, repeatString(nbsp, indentDiff))});
+ if (start)
+ insertAfter(whiteSpace, start);
+ else
+ insertAtStart(whiteSpace, this.containter);
+ }
+ if (cursor.start == start)
+ cursor.start = whiteSpace;
+ }
+ if (cursor.start == whiteSpace)
+ cursor.focus();
+ },
+
+ highlight: highlight,
+
+ markCursorDirty: function() {
+ var cursor = new Cursor(this.container);
+ if (cursor.valid) {
+ var node = cursor.start || this.container.firstChild;
+ if (node) {
+ this.scheduleHighlight();
+ this.addDirtyNode(node);
+ }
+ }
+ },
+
+ addDirtyNode: function(node) {
+ if (!member(this.dirty, node)){
+ if (node.nodeType != 3)
+ node.dirty = true;
+ this.dirty.push(node);
+ }
+ },
+
+ scheduleHighlight: function() {
+ clearTimeout(this.highlightTimeout);
+ this.highlightTimeout = setTimeout(bind(this.highlightDirty, this, this.linesPerShot), this.shotDelay);
+ },
+
+ getDirtyNode: function() {
+ while (this.dirty.length > 0) {
+ var found = this.dirty.pop();
+ if ((found.dirty || found.nodeType == 3) && found.parentNode)
+ return found;
+ }
+ return null;
+ },
+
+ highlightDirty: function(lines) {
+ var sel = markSelection(this.win);
+ var start;
+ while (lines > 0 && (start = this.getDirtyNode())){
+ var result = this.highlight(start, true, lines);
+ if (result) {
+ lines = result.left;
+ if (result.node && result.dirty)
+ this.addDirtyNode(result.node);
+ }
+ }
+ selectMarked(sel);
+ if (start)
+ this.scheduleHighlight();
+ }
+ }
+
+ function highlight(from, onlyDirtyLines, lines){
+ var container = this.container;
+ var document = this.doc;
+
+ if (!container.firstChild)
+ return;
+ while (from && !from.parserFromHere)
+ from = from.previousSibling;
+ if (from && !from.nextSibling)
+ return;
+
+ function correctPart(token, part){
+ return !part.reduced && part.currentText == token.value && hasClass(part, token.style);
+ }
+ function shortenPart(part, minus){
+ part.currentText = part.currentText.substring(minus);
+ part.reduced = true;
+ }
+ function tokenPart(token){
+ var part = withDocument(document, partial(SPAN, {"class": "part " + token.style}, token.value));
+ part.currentText = token.value;
+ return part;
+ }
+
+ var parsed = from ? from.parserFromHere(tokenize(multiStringStream(traverseDOM(from.nextSibling))))
+ : parse(tokenize(multiStringStream(traverseDOM(container.firstChild))));
+
+ var parts = {
+ current: null,
+ forward: false,
+ get: function(){
+ if (!this.current){
+ this.current = from ? from.nextSibling : container.firstChild;
+ }
+ else if (this.forward){
+ this.forward = false;
+ this.current = this.current.nextSibling;
+ }
+ return this.current;
+ },
+ next: function(){
+ if (this.forward)
+ this.get();
+ this.forward = true;
+ },
+ remove: function(){
+ this.current = this.get().previousSibling;
+ container.removeChild(this.current ? this.current.nextSibling : container.firstChild);
+ this.forward = true;
+ },
+ nextNonEmpty: function(){
+ var part = this.get();
+ while (part.nodeName == "SPAN" && part.currentText == ""){
+ var old = part;
+ this.remove();
+ part = this.get();
+ replaceSelection(old.firstChild, part.firstChild || part, 0, 0);
+ }
+ return part;
+ }
+ };
+
+ var lineDirty = false;
+
+ forEach(parsed, function(token){
+ var part = parts.nextNonEmpty();
+ if (token.type == "newline"){
+ if (part.nodeName != "BR")
+ throw "Parser out of sync. Expected BR.";
+ if (part.dirty || !part.lexicalContext)
+ lineDirty = true;
+ part.parserFromHere = parsed.copy();
+ part.lexicalContext = token.lexicalContext;
+ part.dirty = false;
+ if ((lines !== undefined && --lines <= 0) ||
+ (onlyDirtyLines && !lineDirty))
+ throw StopIteration;
+ lineDirty = false;
+ parts.next();
+ }
+ else {
+ if (part.nodeName != "SPAN")
+ throw "Parser out of sync. Expected SPAN.";
+ if (part.dirty)
+ lineDirty = true;
+
+ if (correctPart(token, part)){
+ part.dirty = false;
+ parts.next();
+ }
+ else {
+ lineDirty = true;
+ var newPart = tokenPart(token);
+ container.insertBefore(newPart, part);
+ var tokensize = token.value.length;
+ var offset = 0;
+ while (tokensize > 0) {
+ part = parts.get();
+ var partsize = part.currentText.length;
+ replaceSelection(part.firstChild, newPart.firstChild, tokensize, offset);
+ if (partsize > tokensize){
+ shortenPart(part, tokensize);
+ tokensize = 0;
+ }
+ else {
+ tokensize -= partsize;
+ offset += partsize;
+ parts.remove();
+ }
+ }
+ }
+ }
+ });
+
+ return {left: lines,
+ node: parts.get(),
+ dirty: lineDirty};
+ }
+
+ return JSEditor;
+}();
21 scripts/json-min.js
@@ -0,0 +1,21 @@
+
+Array.prototype.toJSONString=function(){var a=['['],b,i,l=this.length,v;function p(s){if(b){a.push(',');}
+a.push(s);b=true;}
+for(i=0;i<l;i+=1){v=this[i];switch(typeof v){case'undefined':case'function':case'unknown':break;case'object':if(v){if(typeof v.toJSONString==='function'){p(v.toJSONString());}}else{p("null");}
+break;default:p(v.toJSONString());}}
+a.push(']');return a.join('');};Boolean.prototype.toJSONString=function(){return String(this);};Date.prototype.toJSONString=function(){function f(n){return n<10?'0'+n:n;}
+return'"'+this.getFullYear()+'-'+
+f(this.getMonth()+1)+'-'+
+f(this.getDate())+'T'+
+f(this.getHours())+':'+
+f(this.getMinutes())+':'+
+f(this.getSeconds())+'"';};Number.prototype.toJSONString=function(){return isFinite(this)?String(this):"null";};Object.prototype.toJSONString=function(){var a=['{'],b,i,v;function p(s){if(b){a.push(',');}
+a.push(i.toJSONString(),':',s);b=true;}
+for(i in this){if(this.hasOwnProperty(i)){v=this[i];switch(typeof v){case'undefined':case'function':case'unknown':break;case'object':if(v){if(typeof v.toJSONString==='function'){p(v.toJSONString());}}else{p("null");}
+break;default:p(v.toJSONString());}}}
+a.push('}');return a.join('');};(function(s){var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};s.parseJSON=function(){try{if(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(this)){return eval('('+this+')');}}catch(e){}
+throw new SyntaxError("parseJSON");};s.toJSONString=function(){if(/["\\\x00-\x1f]/.test(this)){return'"'+this.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c;}
+c=b.charCodeAt();return'\\u00'+
+Math.floor(c/16).toString(16)+
+(c%16).toString(16);})+'"';}
+return'"'+this+'"';};})(String.prototype);
382 scripts/parse.js
@@ -0,0 +1,382 @@
+function $(ele)
+{
+ var t = document.getElementById(ele);
+ if(t == null) t = document.getElementsByName(ele);
+ if(t.length == 1) t = t.item(0);
+ return t;
+}
+
+function escapeHTML(str)
+{
+ //code portion borrowed from prototype library
+ var div = document.createElement('div');
+ var text = document.createTextNode(str);
+ div.appendChild(text);
+ return div.innerHTML;
+ //end portion
+}
+
+function wordwrap(str)
+{
+ parts = str.split(" ");
+ for(i = 0; i < parts.length; i++)
+ {
+ if(parts[i].length <= 30) continue;
+
+ t = parts[i].length;
+ p = "";
+
+ while(t > 30)
+ {
+ p += parts[i].substr(t - 30, t) + "<wbr />";
+ t -= 30;
+ }
+ parts[i] = p;
+ }
+ return parts.join(" ");
+}
+
+var elementCount = 0;
+var arrayCount = 0;
+var objectCount = 0;
+var nestingLevel = 0;
+
+function doStats()
+{
+ var out = "<input type='button' id='statst' onclick='showStats();' value='Show Statistics' style='float: right;' />\n"
+ + "<div class='clear'></div>\n"
+ + "<div id='statscon'>\n<table>\n<tr>\n<td>Number of Arrays:</td>\n<td>" + arrayCount + "</td>\n</tr>\n"
+ + "<tr>\n<td>Number of Objects:</td>\n<td>" + objectCount + "</td>\n</tr>\n"
+ + "<tr>\n<td>Total number of all elements:</td>\n<td>" + elementCount + "</td>\n</tr>\n"
+ + "<tr>\n<td>Nesting depth:</td>\n<td>" + nestingLevel + "</td>\n</tr>\n"
+ + "</table>\n</div>\n</div>\n";
+ return out;
+}
+
+function parseValue(val, parent, level)
+{
+ elementCount++;
+ if(parent == null) parent = "";
+ if(level == null) level = 1;
+
+ if(typeof(val) == "object")
+ {
+ if(level > nestingLevel) nestingLevel = level;
+ if(val instanceof Array)
+ {
+ arrayCount++;
+ parent = parent + (parent != "" ? " > " : "") + "Array (" + val.length + " item" + (val.length != 1 ? "s)" : ")");
+
+ var out = "<div class='wrap'>\n<div class='array' onmouseover='doFocus(event, this);'>\n<div class='widgets'><img src='images/min.gif' onclick='hideChild(this);' /></div>\n<h3><span class='titled' title='" + parent + "'>Array</span></h3>\n";
+
+ if(val.length > 0)
+ {
+ out += "<table class='arraytable'>\n<tr><th>Index</th><th>Value</th></tr>\n";
+
+ for(prop in val)
+ {
+ if(typeof(val[prop]) == "function") continue;
+ out += "<tr><td>" + prop + "</td><td>" + parseValue(val[prop], parent, level + 1) + "</td></tr>\n";
+ }
+
+ out += "</table>\n";
+ }
+ else
+ {
+
+ return "(empty <span class='titled' title='" + parent + "'>Array</span>)\n";
+ }
+
+ out += "</div>\n</div>\n";
+ return out;
+ }
+ else
+ {
+ objectCount++;
+ i = 0;
+ for(prop in val)
+ {
+ if(typeof(val[prop]) != "function") i++;
+ }
+
+ parent = parent + (parent != "" ? " > " : "") + "Object (" + i + " item" + (i != 1 ? "s)" : ")");
+
+ var out = "<div class='wrap'>\n<div class='object' onmouseover='doFocus(event, this);'>\n<div class='widgets'><img src='images/min.gif' onclick='hideChild(this);' /></div>\n<h3><span class='titled' title='" + parent + "'>Object</span></h3>\n";
+
+ if(i > 0)
+ {
+ out += "<table class='objecttable'>\n<tr><th>Name</th><th>Value</th></tr>\n";
+ for(prop in val)
+ {
+ if(typeof(val[prop]) == "function") continue;
+ out += "<tr><td>" + prop + "</td><td>" + parseValue(val[prop], parent, level + 1) + "</td></tr>\n";
+ }
+
+ out += "</table><div class='clear'></div>\n";
+ }
+ else
+ {
+ return "(empty <span class='titled' title='" + parent + "'>Object</span>)\n";
+ }
+
+ out += "</div>\n</div>\n";
+ return out;
+ }
+ }
+ else
+ {
+ if(typeof(val) == "string") return "<span class='string'>" + wordwrap(val.replace(/\n/g, "<br />")) + "</span>";
+ else if(typeof(val) == "number") return "<span class='number'>" + val + "</span>";
+ else if(typeof(val) == "boolean") return "<span class='boolean'>" + val + "</span>";
+ else return "<span class='void'>(null)</span>";
+ }
+}
+
+function parse(str)
+{
+ elementCount = 0;
+ arrayCount = 0;
+ objectCount = 0;
+
+ var obj = null;
+ try
+ {
+ obj = str.parseJSON();
+ }
+ catch(e)
+ {
+ if(e instanceof SyntaxError)
+ {
+ alert("There was a syntax error in your JSON string.\n" + e.message + "\nPlease check your syntax and try again.");
+ $("text").focus();
+ return;
+ }
+
+ alert("There was an unknown error. Perhaps the JSON string contained a deep level of nesting.");
+ $("text").focus();
+ return
+ }
+
+ return parseValue(obj, null, null);
+}
+
+function doParse()
+{
+ $("submit").value = "processing...";
+ $("submit").disabled = "disabled";
+
+ setTimeout(doParse2, 50);
+}
+
+function doParse2()
+{
+ var value = $("text").value;
+ if(value.substr(0, 4) == "http" || value.substr(0, 4) == "file" || value.substr(0, 3) == "ftp")
+ {
+ getURL(value);
+ }
+ else
+ {
+ var result = parse(escapeHTML(value), null);
+ if(result != null) $("output").innerHTML = result;
+
+ $("stats").innerHTML = doStats();
+ $("stats").className = "";
+
+ doTooltips();
+
+ $("submit").value = "json 2 html";
+ $("submit").disabled = null;
+
+ location.href = "#_output";
+ }
+}
+
+var http = null;
+
+function getURL(str)
+{
+ http.open("get", "get.php?url=" + str);
+ http.onreadystatechange = gotURL;
+ http.send(null);
+}
+
+function gotURL()
+{
+ if(http.readyState == 4)
+ {
+ var result = parse(escapeHTML(http.responseText), null);
+ if(result != null) $("output").innerHTML = result;
+
+ $("stats").innerHTML = doStats();
+
+ doTooltips();
+
+ $("submit").value = "json 2 html";
+ $("submit").disabled = null;
+
+ location.href = "#_output";
+ }
+}
+
+function showStats()
+{
+ if($("statscon").style.display != "block")
+ {
+ $("statscon").style.display = "block";
+ $("stats").className = "statson";
+ $("statst").value = "Hide Statistics";
+ }
+ else
+ {
+ $("statscon").style.display = "none";
+ $("stats").className = "";
+ $("statst").value = "Show Statistics";
+ }
+}
+
+function hideChild(ele)
+{
+ var src = ele.src + "";
+ var minimizing = (src.indexOf("min.gif") != -1);
+
+ var nodes = ele.parentNode.parentNode.childNodes;
+ for(i = 0; i < nodes.length; i++)
+ {
+ if(nodes[i].tagName == "TABLE")
+ {
+ nodes[i].style.display = (minimizing ? "none" : "");
+
+ ele.parentNode.parentNode.style.paddingRight = (minimizing ? "2.0em" : "1.5em");
+ ele.parentNode.style.right = (minimizing ? "1em" : "1.5em");
+
+ ele.src = (minimizing ? "images/max.gif" : "images/min.gif");
+
+ return;
+ }
+ }
+}
+
+var currentlyFocused = null;
+function doFocus(event, ele)
+{
+ if(currentlyFocused != null) currentlyFocused.style.border = "1px solid #000000";
+ ele.style.border = "1px solid #ffa000";
+
+ currentlyFocused = ele;
+
+ if(!event) event = window.event;
+ event.cancelBubble = true;
+ if(event.stopPropagation) event.stopPropagation();
+}
+
+function stopFocus()
+{
+ if(currentlyFocused != null) currentlyFocused.style.border = "1px solid #000000";
+}
+
+//code from Painfully Obvious.
+//based on code from quirksmode.org
+var Client = {
+ viewportWidth: function() {
+ return self.innerWidth || (document.documentElement.clientWidth || document.body.clientWidth);
+ },
+
+ viewportHeight: function() {
+ return self.innerHeight || (document.documentElement.clientHeight || document.body.clientHeight);
+ },
+
+ viewportSize: function() {
+ return { width: this.viewportWidth(), height: this.viewportHeight() };
+ }
+};
+
+function doHelp()
+{
+ $("desc").style.display = "block";
+ bodySize = Client.viewportSize();
+
+ $("bodywrap").style.width = bodySize.width + "px";
+ $("bodywrap").style.height = bodySize.height + "px";
+ $("bodywrap").style.display = "block";
+ $("bodywrap").style.opacity = "0.6";
+
+ $("desc").style.left = ((bodySize.width / 2) - ($("desc").offsetWidth / 2)) + "px";
+ $("desc").style.top = ((bodySize.height / 2) - ($("desc").offsetHeight / 2)) + "px";
+ location.href = "#_top";
+}
+
+function hideHelp()
+{
+ $("desc").style.display = "none";
+ $("bodywrap").style.display = "none";
+ $("text").focus();
+}
+
+function doDonate()
+{
+ $("donate").style.display = "block";
+ bodySize = Client.viewportSize();
+
+ $("bodywrap").style.width = bodySize.width + "px";
+ $("bodywrap").style.height = bodySize.height + "px";
+ $("bodywrap").style.display = "block";
+ $("bodywrap").style.opacity = "0.6";
+
+ $("donate").style.left = ((bodySize.width / 2) - ($("donate").offsetWidth / 2)) + "px";
+ $("donate").style.top = ((bodySize.height / 2) - ($("donate").offsetHeight / 2)) + "px";
+ location.href = "#_top";
+}
+
+function hideDonate()
+{
+ $("donate").style.display = "none";
+ $("bodywrap").style.display = "none";
+ $("text").focus();
+}
+
+function showShoutbox()
+{
+ if($("shoutbox").style.display == "" || $("shoutbox").style.display == "none")
+ {
+ $("shoutbox").style.display = "block";
+ $("shoutboxlink").innerHTML = "hide shoutbox";
+ }
+ else
+ {
+ $("shoutbox").style.display = "none";
+ $("shoutboxlink").innerHTML = "show shoutbox!";
+ }
+}
+
+function clearPage()
+{
+ $("stats").innerHTML = "";
+ $("output").innerHTML = "";
+}
+
+function load()
+{
+ enableTooltips();
+
+ try
+ {
+ http = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ catch(e)
+ {
+ try
+ {
+ http = new XMLHttpRequest();
+ }
+ catch(e)
+ {
+ }
+ }
+
+ bodySize = Client.viewportSize();
+
+ if($("text").focus) $("text").focus();
+}
+
+window.onload = load;
40 scripts/pngfix.js
@@ -0,0 +1,40 @@
+/*
+
+Correctly handle PNG transparency in Win IE 5.5 & 6.
+http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.
+
+Use in <HEAD> with DEFER keyword wrapped in conditional comments:
+<!--[if lt IE 7]>
+<script defer type="text/javascript" src="pngfix.js"></script>
+<![endif]-->
+
+*/
+//Modified by Brenton Fletcher November 2006.
+
+var arVersion = navigator.appVersion.split("MSIE")
+var version = parseFloat(arVersion[1])
+
+if ((version >= 5.5) && (document.body.filters))
+{
+ for(var i=0; i<document.images.length; i++)
+ {
+ var img = document.images[i];
+ var imgName = img.src.toUpperCase();
+ if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
+ {
+ var imgID = (img.id) ? "id='" + img.id + "' " : "";
+ var imgClass = (img.className) ? "class='" + img.className + "' " : "";
+ var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
+ var imgStyle = "display:inline-block;" + img.style.cssText ;
+ if (img.align == "left") imgStyle = "float:left;" + imgStyle;
+ if (img.align == "right") imgStyle = "float:right;" + imgStyle;
+ if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
+ var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
+ img.outerHTML = strNewHTML;
+ i = i-1;
+ }
+ }
+}
74 style.css
@@ -0,0 +1,74 @@
+body { min-height: 100%; font-family: Verdana, "Trebuchet MS", Helvicita, Arial, sans-serif; font-size: 95%;
+ background-color: #ffffff; color: #000000; padding: 0px; margin: 0px; margin-bottom: 10px;
+ background-image: url(images/back.png); }
+hr { border: none; height: 1px; background-color: #808080; }
+form { padding: 0px; margin: 0px; }
+
+.header { text-align: center; padding-top: 17px; padding-left: 110px; height: 90px;
+ background: url(images/top1.png) repeat-x; }
+.bodywrap { background-color: #000000; display: none; position: absolute; top: 0px; left: 0px; z-index: 99; }
+
+.alpha { float: right; margin-top: -17px; margin-right: 17px; padding-bottom: 10px; z-index: 5; }
+.shoutboxcon { float: right; margin-top: 25px; margin-right: 17px; padding-bottom: 10px; z-index: 5;
+ color: #000000; padding: 5px; background-color: #cccccc; text-align: left; position: absolute; right: 130px; }
+
+.mast { font-size: 105%; margin-top: 0px; }
+form > .mast { font-size: 110%; }
+.jsonlogo { float: right; margin-left: 1em; }
+.mainbody { padding-left: 1em; padding-right: 1em; }
+
+.footer { background-color: #ffffaa; padding: 3px; }
+
+img { border: 0px; }
+wbr:after { content: "\00200B"; }
+.noa { line-height: 0em; font-size: 0em; }
+.titled { border-bottom: 1px dashed #000000; }
+
+.output { margin-top: 1em; margin-bottom: 1em; }
+.desc { display: none; width: 40%; position: absolute; z-index: 99; padding: 1em; border: 1px solid #000000; background-color: #ffffee; }
+.closep { text-align: center; margin-bottom: 0px; }
+
+h3 { margin-top: -0.3em; margin-bottom: 0.5em; font-size: 105%; }
+
+table { border: 1px solid #000000; border-collapse: collapse; }
+table td, table th { padding: 0.2em 0.3em; border: 1px solid #000000; vertical-align: top; }
+
+div.object { padding: 1.5em; border: 1px solid #000000; background-color: #eeeeee; height: 1%; position: relative; }
+.objecttable { background-color: #ffffff; }
+div.array { padding: 1.5em; border: 1px solid #000000; background-color: #eeeeff; height: 1%; position: relative; }
+.arraytable { background-color: #ffffee; }
+
+.wrap { display: table; margin: 0.3em; }
+
+.string { color: #000000; }
+.number { color: #0000ff; }
+.boolean { color: #ff8000; }
+.void { color: #0000ff; }
+
+.widgets { position: absolute; top: 1em; right: 1.5em; width: 9px; height: 20px; }
+
+.statson { padding: 0.5em; background-color: #ffffff; border: 1px solid #a0a0a0; }
+#statscon { display: none; }
+#stats table { border: none; }
+#stats table tr { border: none; }
+#stats table td { border: none; }
+
+.ex { vertical-align: middle; margin-bottom: 1px; margin-top: 1px; }
+
+.clear { clear: both; }
+.lfloat { float: left; }
+.rfloat { float: right; }
+
+
+div > #submit { font-size: large; }
+div > #reset { font-size: large; }
+div > #help { font-size: large; }
+div > #statst { font-size: large; }
+#text { width: 99%; margin-bottom: 0.5em; border: 1px solid purple; padding: 1px; }
+#inputcontainer > #text { width: 100%; }
+.framed { width: 99%; margin-bottom: 0.5em; border: 1px solid purple; display: block; }
+
+#donate form { vertical-align: middle; }
+#donate form input { vertical-align: middle; }
+
+#shoutbox { display: none; border: 1px solid #000000; background-color: #ffffff; margin-top: 0.5em; }
Please sign in to comment.
Something went wrong with that request. Please try again.