2 // console.log.apply(console, arguments);
5 function is_constant(s
) {
6 s
= s
.replace(/v\d+(_\d+)?$/, "");
10 return s
.toUpperCase(s
) === s
;
13 function is_variable(s
) {
14 return s
.substring(0,1) === "$";
17 var is_in_string
= false;
19 function type(s
, nn
) {
23 if (!s
.match(/[a-zA-Z]/)) {
42 case "ErrorException":
43 case "RuntimeException":
44 case "UnexpectedValueException":
45 case "DomainException":
46 case "InvalidArgumentException":
47 case "BadMethodCallException":
54 case "IteratorAggregate":
58 case "RecursiveArrayIterator":
61 case "SplObjectStorage":
72 return "<br> <em>";
92 if (-1 !== (i
= s
.indexOf("::"))) {
94 if (!is_constant(t
) && !is_variable(t
)) {
96 return "<a href=\"" + s
.replace(/::|\\/g, "/") + "\">";
99 if (-1 !== (j = s.indexOf("\\")) && s.substr(j+1,1) !== "n
") {
100 return "<a href
=\"" + s.replace(/\\/g, "/").replace(/::|$/, "#") + "\">";
103 switch (s.toLowerCase()) {
106 if (!is_variable(s)) {
113 return "<span
class=\"var\">";
117 if (is_constant(s)) {
118 return "<span
class=\"constant
\">";
122 function node(s, nn) {
127 if ((t = type(s, nn))) {
130 return document.createTextNode(s);
132 function wrap(n, nn) {
136 $n.text().split(/([^a-zA-Z0-9_\\\$:]+)/).forEach(function(v) {
141 function walk(i, e) {
144 $.each($.makeArray(e.childNodes), function(i, n) {
145 switch (n.nodeName) {
163 $c.fadeOut("fast
").queue(function(next) {
164 this.style.color = "red
";
166 }).fadeIn("fast
").fadeOut("slow
").queue(function(next) {
167 this.style.color = "";
172 function hashchange() {
173 if (location.hash.length > 1) {
174 var hash = location.hash.substring(1);
175 var name = is_variable(hash) ? ".var" : ".constant
";
176 var scrolled = false;
178 $(name).each(hash.substring(hash.length-1) === "_
" ? function(i, c) {
179 if (c.textContent.substring(0, hash.length) === hash) {
181 $(window).scrollTop($(c).offset().top - 100);
187 if (c.textContent === hash) {
188 $(window).scrollTop($(c).offset().top - 100);
197 $("h1
,h2
,h3
,h4
,h5
,h6
,p
,li
,code
").each(walk);
198 $(window).on("hashchange
", hashchange);