2 // console.log.apply(console, arguments);
5 function is_constant(s
) {
6 return s
.length
> 1 && s
.toUpperCase(s
) === s
;
9 function is_variable(s
) {
10 return s
.substring(0,1) === "$";
13 var is_in_string
= false;
15 function type(s
, nn
) {
19 if (!s
.match(/[a-zA-Z]/)) {
37 case "ErrorException":
44 case "IteratorAggregate":
48 case "RecursiveArrayIterator":
57 return "<br> <em>";
77 if (-1 !== (i
= s
.indexOf("::"))) {
79 if (!is_constant(t
) && !is_variable(t
)) {
81 return "<a href=\"/" + s
.replace(/::|\\/g, "/") + "\">";
84 if (-1 !== (j = s.indexOf("\\"))) {
85 return "<a href
=\"/" + s.replace(/\\/g, "/").replace(/::|$/, "#") + "\">";
88 switch (s.toLowerCase()) {
91 if (!is_variable(s)) {
98 return "<span
class=\"var\">";
102 if (is_constant(s)) {
103 return "<span
class=\"constant
\">";
107 function node(s, nn) {
112 if ((t = type(s, nn))) {
115 return document.createTextNode(s);
117 function wrap(n, nn) {
121 $n.text().split(/([^a-zA-Z0-9_\\\$:]+)/).forEach(function(v) {
126 function walk(i, e) {
129 $.each($.makeArray(e.childNodes), function(i, n) {
130 switch (n.nodeName) {
148 $c.fadeOut("slow
").queue(function(next) {
149 this.style.color = "red
";
151 }).fadeIn("fast
").fadeOut("fast
").queue(function(next) {
152 this.style.color = "";
157 function hashchange() {
158 if (location.hash.length > 1) {
159 var hash = location.hash.substring(1);
160 var name = is_variable(hash) ? ".var" : ".constant
";
161 var scrolled = false;
163 $(name).each(hash.substring(hash.length-1) === "_
" ? function(i, c) {
164 if (c.textContent.substring(0, hash.length) === hash) {
166 $(window).scrollTop($(c).offset().top - 100);
172 if (c.textContent === hash) {
173 $(window).scrollTop($(c).offset().top - 100);
182 $("h1
,h2
,h3
,h4
,h5
,h6
,p
,li
,code
").each(walk);
183 $(window).on("hashchange
", hashchange);