rack-mini-profiler 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/html/includes.js +20 -869
- data/lib/html/pretty-print.js +810 -0
- data/lib/html/vendor.js +840 -0
- data/lib/mini_profiler/asset_version.rb +1 -1
- data/lib/mini_profiler/version.rb +1 -1
- data/rack-mini-profiler.gemspec +2 -0
- metadata +32 -2
data/lib/html/vendor.js
ADDED
@@ -0,0 +1,840 @@
|
|
1
|
+
/**
|
2
|
+
THIS FILE IS AUTOMATICALLY GENERATED BY THE `write_vendor_js` RAKE TASK.
|
3
|
+
DON'T EDIT THIS FILE BY HAND; CHANGES WILL BE OVERRIDEN.
|
4
|
+
**/
|
5
|
+
|
6
|
+
"use strict";
|
7
|
+
MiniProfiler.templates = {};
|
8
|
+
MiniProfiler.templates["profilerTemplate"] = function anonymous(it
|
9
|
+
) {
|
10
|
+
var out=' <div class="profiler-result"> <div class="profiler-button ';if(it.has_duplicate_sql_timings){out+='profiler-warning';}out+='"> ';if(it.has_duplicate_sql_timings){out+='<span class="profiler-nuclear">!</span>';}out+=' <span class="profiler-number"> '+( MiniProfiler.formatDuration(it.duration_milliseconds))+' <span class="profiler-unit">ms</span> </span> ';if(MiniProfiler.showTotalSqlCount()){out+=' <span class="profiler-number"> '+( it.sql_count)+' <span class="profiler-unit">sql</span> </span> ';}out+=' </div> <div class="profiler-popup"> <div class="profiler-info"> <span class="profiler-name"> '+( it.name)+' <span class="profiler-overall-duration">('+( MiniProfiler.formatDuration(it.duration_milliseconds))+' ms)</span> </span> <span class="profiler-server-time">'+( it.machine_name)+' on '+( MiniProfiler.renderDate(it.started))+'</span> </div> <div class="profiler-output"> <table class="profiler-timings"> <thead> <tr> <th></th> <th>duration (ms)</th> <th class="profiler-duration-with-children">with children (ms)</th> <th class="time-from-start">from start (ms)</th> ';if(it.has_sql_timings){out+=' <th colspan="2">query time (ms)</th> ';}out+=' ';var arr1=it.custom_timing_names;if(arr1){var value,i1=-1,l1=arr1.length-1;while(i1<l1){value=arr1[i1+=1];out+=' <th colspan="2">'+( value.toLowerCase() )+' (ms)</th> ';} } out+=' </tr> </thead> <tbody> '+( MiniProfiler.templates.timingTemplate({timing: it.root, page: it}) )+' </tbody> <tfoot> <tr> <td colspan="3"> ';if(!it.client_timings){out+=' '+( MiniProfiler.templates.linksTemplate({timing: it.root, page: it}) )+' ';}out+=' <a class="profiler-toggle-duration-with-children" title="toggles column with aggregate child durations">show time with children</a> </td> ';if(it.has_sql_timings){out+=' <td colspan="2" class="profiler-number profiler-percent-in-sql" title="'+( MiniProfiler.getSqlTimingsCount(it.root) )+' queries spent '+( MiniProfiler.formatDuration(it.duration_milliseconds_in_sql) )+' ms of total request time"> '+( MiniProfiler.formatDuration(it.duration_milliseconds_in_sql / it.duration_milliseconds * 100) )+' <span class="profiler-unit">% in sql</span> </td> ';}out+=' ';var arr2=it.custom_timing_names;if(arr2){var value,i2=-1,l2=arr2.length-1;while(i2<l2){value=arr2[i2+=1];out+=' <td colspan="2" class="profiler-number profiler-percentage-in-sql" title="'+( it.custom_timing_stats[value].count )+' '+( value.toLowerCase() )+' invocations spent '+( MiniProfiler.formatDuration(it.custom_timing_stats[value].duration) )+' ms of total request time"> '+( MiniProfiler.formatDuration(it.custom_timing_stats[value].duration / it.duration_milliseconds * 100) )+' <span class="profiler-unit">% in '+( value.toLowerCase() )+'</span> </td> ';} } out+=' </tr> </tfoot> </table> ';if(it.client_timings){out+=' <table class="profiler-timings profiler-client-timings"> <thead> <tr> <th>client event</th> <th>duration (ms)</th> <th>from start (ms)</th> </tr> </thead> <tbody> ';var arr3=MiniProfiler.getClientTimings(it.client_timings);if(arr3){var value,i3=-1,l3=arr3.length-1;while(i3<l3){value=arr3[i3+=1];out+=' <tr class="';if(value.isTrivial){out+='profiler-trivial';}out+='"> <td class="profiler-label">'+( value.name )+'</td> <td class="profiler-duration"> ';if(value.duration >= 0){out+=' <span class="profiler-unit"></span>'+( MiniProfiler.formatDuration(value.duration) )+' ';}out+=' </td> <td class="profiler-duration time-from-start"> <span class="profiler-unit">+</span>'+( MiniProfiler.formatDuration(value.start) )+' </td> </tr> ';} } out+=' </tbody> <tfoot> <td colspan="3"> '+( MiniProfiler.templates.linksTemplate({timing: it.root, page: it}) )+' </td> </tfoot> </table> ';}out+=' </div> </div> ';if(it.has_sql_timings){out+=' <div class="profiler-queries"> <table> <thead> <tr> <th style="text-align:right">step<br />time from start<br />query type<br />duration</th> <th style="text-align:left">call stack<br />query</th> </tr> </thead> <tbody> ';var arr4=MiniProfiler.getSqlTimings(it.root);if(arr4){var value,index=-1,l4=arr4.length-1;while(index<l4){value=arr4[index+=1];out+=' '+( MiniProfiler.templates.sqlGapTemplate({g: value.prevGap}) )+' '+( MiniProfiler.templates.sqlTimingTemplate({i: index, s: value}) )+' ';if(value.nextGap){out+=' '+( MiniProfiler.templates.sqlGapTemplate({g: value.nextGap}) )+' ';}out+=' ';} } out+=' </tbody> </table> <p class="profiler-trivial-gap-container"> <a class="profiler-toggle-trivial-gaps">show trivial gaps</a> </p> </div> ';}out+=' </div>';return out;
|
11
|
+
}
|
12
|
+
MiniProfiler.templates["linksTemplate"] = function anonymous(it
|
13
|
+
) {
|
14
|
+
var out=' <a href="'+( MiniProfiler.shareUrl(it.page.id) )+'" class="profiler-share-profiler-results" target="_blank">share</a> <a href="'+( MiniProfiler.moreUrl(it.timing.name) )+'" class="profiler-more-actions">more</a> ';if(it.custom_link){out+=' <a href="'+( it.custom_link )+'" class="profiler-custom-link" target="_blank">'+( it.custom_link_name )+'</a> ';}out+=' ';if(it.has_trivial_timings){out+=' <a class="profiler-toggle-trivial" data-show-on-load="'+( it.has_all_trivial_timings )+'" title="toggles any rows with < '+( it.trivial_duration_threshold_milliseconds )+' ms"> show trivial </a> ';}return out;
|
15
|
+
}
|
16
|
+
MiniProfiler.templates["timingTemplate"] = function anonymous(it
|
17
|
+
) {
|
18
|
+
var out=' <tr class="';if(it.timing.is_trivial){out+='profiler-trivial';}out+='" data-timing-id="'+( it.timing.id )+'"> <td class="profiler-label" title="';if(it.timing.name && it.timing.name.length > 45){out+=''+( it.timing.name );}out+='"> <span class="profiler-indent">'+( MiniProfiler.renderIndent(it.timing.depth) )+'</span> '+( it.timing.name.slice(0,45) );if(it.timing.name && it.timing.name.length > 45){out+='...';}out+=' </td> <td class="profiler-duration" title="duration of this step without any children\'s durations"> '+( MiniProfiler.formatDuration(it.timing.duration_without_children_milliseconds) )+' </td> <td class="profiler-duration profiler-duration-with-children" title="duration of this step and its children"> '+( MiniProfiler.formatDuration(it.timing.duration_milliseconds) )+' </td> <td class="profiler-duration time-from-start" title="time elapsed since profiling started"> <span class="profiler-unit">+</span>'+( MiniProfiler.formatDuration(it.timing.start_milliseconds) )+' </td> ';if(it.timing.has_sql_timings){out+=' <td class="profiler-duration ';if(it.timing.has_duplicate_sql_timings){out+='profiler-warning';}out+='" title="';if(it.timing.has_duplicate_sql_timings){out+='duplicate queries detected - ';}if(it.timing.executed_readers > 0 || it.timing.executed_scalars > 0 || it.timing.executed_non_queries > 0){out+=''+( it.timing.executed_readers )+' reader, '+( it.timing.executed_scalars )+' scalar, '+( it.timing.executed_non_queries )+' non-query statements executed';}out+='"> <a class="profiler-queries-show"> ';if(it.timing.has_duplicate_sql_timings){out+='<span class="profiler-nuclear">!</span>';}out+=' '+( it.timing.sql_timings.length )+' <span class="profiler-unit">sql</span> </a> </td> <td class="profiler-duration" title="aggregate duration of all queries in this step (excludes children)"> '+( MiniProfiler.formatDuration(it.timing.sql_timings_duration_milliseconds) )+' </td> ';}else{out+=' <td colspan="2"></td> ';}out+=' ';var arr1=it.page.custom_timing_names;if(arr1){var value,i1=-1,l1=arr1.length-1;while(i1<l1){value=arr1[i1+=1];out+=' ';if(it.timing.custom_timings && it.timing.custom_timings[value]){out+=' <td class="profiler-duration" title="aggregate number of all '+( value.toLowerCase() )+' invocations in this step (excludes children)"> '+( it.timing.custom_timings[value].length )+' '+( value.toLowerCase() )+' </td> <td class="profiler-duration" title="aggregate duration of all '+( value.toLowerCase() )+' invocations in this step (excludes children)"> '+( MiniProfiler.formatDuration(it.timing.custom_timing_stats[value].duration) )+' </td> ';}else{out+=' <td colspan="2"></td> ';}out+=' ';} } out+=' </tr> ';if(it.timing.has_children){out+=' ';var arr2=it.timing.children;if(arr2){var value,i2=-1,l2=arr2.length-1;while(i2<l2){value=arr2[i2+=1];out+=' '+( MiniProfiler.templates.timingTemplate({timing: value, page: it}) )+' ';} } out+=' ';}return out;
|
19
|
+
}
|
20
|
+
MiniProfiler.templates["sqlTimingTemplate"] = function anonymous(it
|
21
|
+
) {
|
22
|
+
var out=' <tr class="'+( it.s.row_class || '' )+'" data-timing-id="'+( it.s.parent_timing_id )+'"> <td class="profiler-info"> <div>'+( it.s.parent_timing_name )+'</div> <div class="profiler-number"><span class="profiler-unit">T+</span>'+( MiniProfiler.formatDuration(it.s.start_milliseconds) )+' <span class="profiler-unit">ms</span></div> <div> ';if(it.s.is_duplicate){out+='<span class="profiler-warning">DUPLICATE</span>';}out+=' '+( MiniProfiler.renderExecuteType(it.s.execute_type) )+' </div> <div title="';if(it.s.execute_type == 3){out+='first result fetched: '+( it.s.first_fetch_duration_milliseconds )+'ms';}out+='">'+( MiniProfiler.formatDuration(it.s.duration_milliseconds) )+' <span class="profiler-unit">ms</span></div> </td> <td> <div class="query"> <pre class="profiler-stack-trace">'+( it.s.stack_trace_snippet )+'</pre> <pre class="prettyprint lang-sql"><code>'+( it.s.formatted_command_string )+'; '+( MiniProfiler.formatParameters(it.s.parameters) )+'</code></pre> </div> </td> </tr>';return out;
|
23
|
+
}
|
24
|
+
MiniProfiler.templates["sqlGapTemplate"] = function anonymous(it
|
25
|
+
) {
|
26
|
+
var out=' <tr class="profiler-gap-info';if(it.g.duration < 4){out+=' profiler-trivial-gaps';}out+='"> <td class="profiler-info"> '+( it.g.duration )+' <span class="profiler-unit">ms</span> </td> <td class="query"> <div>'+( it.g.topReason.name )+' — '+( it.g.topReason.duration.toFixed(2) )+' <span class="profiler-unit">ms</span></div> </td> </tr>';return out;
|
27
|
+
}
|
28
|
+
|
29
|
+
if (typeof prettyPrint === "undefined") {
|
30
|
+
// prettify.js
|
31
|
+
// http://code.google.com/p/google-code-prettify/
|
32
|
+
// prettier-ignore
|
33
|
+
window.PR_SHOULD_USE_CONTINUATION = true;
|
34
|
+
window.PR_TAB_WIDTH = 8;
|
35
|
+
window.PR_normalizedHtml = window.PR = window.prettyPrintOne = window.prettyPrint = void 0;
|
36
|
+
|
37
|
+
window._pr_isIE6 = function() {
|
38
|
+
var y =
|
39
|
+
navigator &&
|
40
|
+
navigator.userAgent &&
|
41
|
+
navigator.userAgent.match(/\bMSIE ([678])\./);
|
42
|
+
y = y ? +y[1] : false;
|
43
|
+
|
44
|
+
window._pr_isIE6 = function() {
|
45
|
+
return y;
|
46
|
+
};
|
47
|
+
|
48
|
+
return y;
|
49
|
+
};
|
50
|
+
|
51
|
+
(function () {
|
52
|
+
function y(b) {
|
53
|
+
return b.replace(L, "&").replace(M, "<").replace(N, ">");
|
54
|
+
}
|
55
|
+
|
56
|
+
function H(b, f, i) {
|
57
|
+
switch (b.nodeType) {
|
58
|
+
case 1:
|
59
|
+
var o = b.tagName.toLowerCase();
|
60
|
+
f.push("<", o);
|
61
|
+
var l = b.attributes,
|
62
|
+
n = l.length;
|
63
|
+
|
64
|
+
if (n) {
|
65
|
+
if (i) {
|
66
|
+
for (var r = [], j = n; --j >= 0;) {
|
67
|
+
r[j] = l[j];
|
68
|
+
}
|
69
|
+
|
70
|
+
r.sort(function (q, m) {
|
71
|
+
return q.name < m.name ? -1 : q.name === m.name ? 0 : 1;
|
72
|
+
});
|
73
|
+
l = r;
|
74
|
+
}
|
75
|
+
|
76
|
+
for (j = 0; j < n; ++j) {
|
77
|
+
r = l[j];
|
78
|
+
r.specified && f.push(" ", r.name.toLowerCase(), '="', r.value.replace(L, "&").replace(M, "<").replace(N, ">").replace(X, """), '"');
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
f.push(">");
|
83
|
+
|
84
|
+
for (l = b.firstChild; l; l = l.nextSibling) {
|
85
|
+
H(l, f, i);
|
86
|
+
}
|
87
|
+
|
88
|
+
if (b.firstChild || !/^(?:br|link|img)$/.test(o)) f.push("</", o, ">");
|
89
|
+
break;
|
90
|
+
|
91
|
+
case 3:
|
92
|
+
case 4:
|
93
|
+
f.push(y(b.nodeValue));
|
94
|
+
break;
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
function O(b) {
|
99
|
+
function f(c) {
|
100
|
+
if (c.charAt(0) !== "\\") return c.charCodeAt(0);
|
101
|
+
|
102
|
+
switch (c.charAt(1)) {
|
103
|
+
case "b":
|
104
|
+
return 8;
|
105
|
+
|
106
|
+
case "t":
|
107
|
+
return 9;
|
108
|
+
|
109
|
+
case "n":
|
110
|
+
return 10;
|
111
|
+
|
112
|
+
case "v":
|
113
|
+
return 11;
|
114
|
+
|
115
|
+
case "f":
|
116
|
+
return 12;
|
117
|
+
|
118
|
+
case "r":
|
119
|
+
return 13;
|
120
|
+
|
121
|
+
case "u":
|
122
|
+
case "x":
|
123
|
+
return parseInt(c.substring(2), 16) || c.charCodeAt(1);
|
124
|
+
|
125
|
+
case "0":
|
126
|
+
case "1":
|
127
|
+
case "2":
|
128
|
+
case "3":
|
129
|
+
case "4":
|
130
|
+
case "5":
|
131
|
+
case "6":
|
132
|
+
case "7":
|
133
|
+
return parseInt(c.substring(1), 8);
|
134
|
+
|
135
|
+
default:
|
136
|
+
return c.charCodeAt(1);
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
function i(c) {
|
141
|
+
if (c < 32) return (c < 16 ? "\\x0" : "\\x") + c.toString(16);
|
142
|
+
c = String.fromCharCode(c);
|
143
|
+
if (c === "\\" || c === "-" || c === "[" || c === "]") c = "\\" + c;
|
144
|
+
return c;
|
145
|
+
}
|
146
|
+
|
147
|
+
function o(c) {
|
148
|
+
var d = c.substring(1, c.length - 1).match(RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]", "g"));
|
149
|
+
c = [];
|
150
|
+
|
151
|
+
for (var a = [], k = d[0] === "^", e = k ? 1 : 0, h = d.length; e < h; ++e) {
|
152
|
+
var g = d[e];
|
153
|
+
|
154
|
+
switch (g) {
|
155
|
+
case "\\B":
|
156
|
+
case "\\b":
|
157
|
+
case "\\D":
|
158
|
+
case "\\d":
|
159
|
+
case "\\S":
|
160
|
+
case "\\s":
|
161
|
+
case "\\W":
|
162
|
+
case "\\w":
|
163
|
+
c.push(g);
|
164
|
+
continue;
|
165
|
+
}
|
166
|
+
|
167
|
+
g = f(g);
|
168
|
+
var s;
|
169
|
+
|
170
|
+
if (e + 2 < h && "-" === d[e + 1]) {
|
171
|
+
s = f(d[e + 2]);
|
172
|
+
e += 2;
|
173
|
+
} else s = g;
|
174
|
+
|
175
|
+
a.push([g, s]);
|
176
|
+
|
177
|
+
if (!(s < 65 || g > 122)) {
|
178
|
+
s < 65 || g > 90 || a.push([Math.max(65, g) | 32, Math.min(s, 90) | 32]);
|
179
|
+
s < 97 || g > 122 || a.push([Math.max(97, g) & -33, Math.min(s, 122) & -33]);
|
180
|
+
}
|
181
|
+
}
|
182
|
+
|
183
|
+
a.sort(function (v, w) {
|
184
|
+
return v[0] - w[0] || w[1] - v[1];
|
185
|
+
});
|
186
|
+
d = [];
|
187
|
+
g = [NaN, NaN];
|
188
|
+
|
189
|
+
for (e = 0; e < a.length; ++e) {
|
190
|
+
h = a[e];
|
191
|
+
if (h[0] <= g[1] + 1) g[1] = Math.max(g[1], h[1]);else d.push(g = h);
|
192
|
+
}
|
193
|
+
|
194
|
+
a = ["["];
|
195
|
+
k && a.push("^");
|
196
|
+
a.push.apply(a, c);
|
197
|
+
|
198
|
+
for (e = 0; e < d.length; ++e) {
|
199
|
+
h = d[e];
|
200
|
+
a.push(i(h[0]));
|
201
|
+
|
202
|
+
if (h[1] > h[0]) {
|
203
|
+
h[1] + 1 > h[0] && a.push("-");
|
204
|
+
a.push(i(h[1]));
|
205
|
+
}
|
206
|
+
}
|
207
|
+
|
208
|
+
a.push("]");
|
209
|
+
return a.join("");
|
210
|
+
}
|
211
|
+
|
212
|
+
function l(c) {
|
213
|
+
for (var d = c.source.match(RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)", "g")), a = d.length, k = [], e = 0, h = 0; e < a; ++e) {
|
214
|
+
var g = d[e];
|
215
|
+
if (g === "(") ++h;else if ("\\" === g.charAt(0)) if ((g = +g.substring(1)) && g <= h) k[g] = -1;
|
216
|
+
}
|
217
|
+
|
218
|
+
for (e = 1; e < k.length; ++e) {
|
219
|
+
if (-1 === k[e]) k[e] = ++n;
|
220
|
+
}
|
221
|
+
|
222
|
+
for (h = e = 0; e < a; ++e) {
|
223
|
+
g = d[e];
|
224
|
+
|
225
|
+
if (g === "(") {
|
226
|
+
++h;
|
227
|
+
if (k[h] === undefined) d[e] = "(?:";
|
228
|
+
} else if ("\\" === g.charAt(0)) if ((g = +g.substring(1)) && g <= h) d[e] = "\\" + k[h];
|
229
|
+
}
|
230
|
+
|
231
|
+
for (h = e = 0; e < a; ++e) {
|
232
|
+
if ("^" === d[e] && "^" !== d[e + 1]) d[e] = "";
|
233
|
+
}
|
234
|
+
|
235
|
+
if (c.ignoreCase && r) for (e = 0; e < a; ++e) {
|
236
|
+
g = d[e];
|
237
|
+
c = g.charAt(0);
|
238
|
+
if (g.length >= 2 && c === "[") d[e] = o(g);else if (c !== "\\") d[e] = g.replace(/[a-zA-Z]/g, function (s) {
|
239
|
+
s = s.charCodeAt(0);
|
240
|
+
return "[" + String.fromCharCode(s & -33, s | 32) + "]";
|
241
|
+
});
|
242
|
+
}
|
243
|
+
return d.join("");
|
244
|
+
}
|
245
|
+
|
246
|
+
for (var n = 0, r = false, j = false, q = 0, m = b.length; q < m; ++q) {
|
247
|
+
var t = b[q];
|
248
|
+
if (t.ignoreCase) j = true;else if (/[a-z]/i.test(t.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ""))) {
|
249
|
+
r = true;
|
250
|
+
j = false;
|
251
|
+
break;
|
252
|
+
}
|
253
|
+
}
|
254
|
+
|
255
|
+
var p = [];
|
256
|
+
q = 0;
|
257
|
+
|
258
|
+
for (m = b.length; q < m; ++q) {
|
259
|
+
t = b[q];
|
260
|
+
if (t.global || t.multiline) throw Error("" + t);
|
261
|
+
p.push("(?:" + l(t) + ")");
|
262
|
+
}
|
263
|
+
|
264
|
+
return RegExp(p.join("|"), j ? "gi" : "g");
|
265
|
+
}
|
266
|
+
|
267
|
+
function Y(b) {
|
268
|
+
var f = 0;
|
269
|
+
return function (i) {
|
270
|
+
for (var o = null, l = 0, n = 0, r = i.length; n < r; ++n) {
|
271
|
+
switch (i.charAt(n)) {
|
272
|
+
case "\t":
|
273
|
+
o || (o = []);
|
274
|
+
o.push(i.substring(l, n));
|
275
|
+
l = b - f % b;
|
276
|
+
|
277
|
+
for (f += l; l >= 0; l -= 16) {
|
278
|
+
o.push(" ".substring(0, l));
|
279
|
+
}
|
280
|
+
|
281
|
+
l = n + 1;
|
282
|
+
break;
|
283
|
+
|
284
|
+
case "\n":
|
285
|
+
f = 0;
|
286
|
+
break;
|
287
|
+
|
288
|
+
default:
|
289
|
+
++f;
|
290
|
+
}
|
291
|
+
}
|
292
|
+
|
293
|
+
if (!o) return i;
|
294
|
+
o.push(i.substring(l));
|
295
|
+
return o.join("");
|
296
|
+
};
|
297
|
+
}
|
298
|
+
|
299
|
+
function I(b, f, i, o) {
|
300
|
+
if (f) {
|
301
|
+
b = {
|
302
|
+
source: f,
|
303
|
+
c: b
|
304
|
+
};
|
305
|
+
i(b);
|
306
|
+
o.push.apply(o, b.d);
|
307
|
+
}
|
308
|
+
}
|
309
|
+
|
310
|
+
function B(b, f) {
|
311
|
+
var i = {},
|
312
|
+
o;
|
313
|
+
|
314
|
+
(function () {
|
315
|
+
for (var r = b.concat(f), j = [], q = {}, m = 0, t = r.length; m < t; ++m) {
|
316
|
+
var p = r[m],
|
317
|
+
c = p[3];
|
318
|
+
if (c) for (var d = c.length; --d >= 0;) {
|
319
|
+
i[c.charAt(d)] = p;
|
320
|
+
}
|
321
|
+
p = p[1];
|
322
|
+
c = "" + p;
|
323
|
+
|
324
|
+
if (!q.hasOwnProperty(c)) {
|
325
|
+
j.push(p);
|
326
|
+
q[c] = null;
|
327
|
+
}
|
328
|
+
}
|
329
|
+
|
330
|
+
j.push(/[\0-\uffff]/);
|
331
|
+
o = O(j);
|
332
|
+
})();
|
333
|
+
|
334
|
+
var l = f.length;
|
335
|
+
|
336
|
+
function n(r) {
|
337
|
+
for (var j = r.c, q = [j, z], m = 0, t = r.source.match(o) || [], p = {}, c = 0, d = t.length; c < d; ++c) {
|
338
|
+
var a = t[c],
|
339
|
+
k = p[a],
|
340
|
+
e = void 0,
|
341
|
+
h;
|
342
|
+
if (typeof k === "string") h = false;else {
|
343
|
+
var g = i[a.charAt(0)];
|
344
|
+
|
345
|
+
if (g) {
|
346
|
+
e = a.match(g[1]);
|
347
|
+
k = g[0];
|
348
|
+
} else {
|
349
|
+
for (h = 0; h < l; ++h) {
|
350
|
+
g = f[h];
|
351
|
+
|
352
|
+
if (e = a.match(g[1])) {
|
353
|
+
k = g[0];
|
354
|
+
break;
|
355
|
+
}
|
356
|
+
}
|
357
|
+
|
358
|
+
e || (k = z);
|
359
|
+
}
|
360
|
+
|
361
|
+
if ((h = k.length >= 5 && "lang-" === k.substring(0, 5)) && !(e && typeof e[1] === "string")) {
|
362
|
+
h = false;
|
363
|
+
k = P;
|
364
|
+
}
|
365
|
+
|
366
|
+
h || (p[a] = k);
|
367
|
+
}
|
368
|
+
g = m;
|
369
|
+
m += a.length;
|
370
|
+
|
371
|
+
if (h) {
|
372
|
+
h = e[1];
|
373
|
+
var s = a.indexOf(h),
|
374
|
+
v = s + h.length;
|
375
|
+
|
376
|
+
if (e[2]) {
|
377
|
+
v = a.length - e[2].length;
|
378
|
+
s = v - h.length;
|
379
|
+
}
|
380
|
+
|
381
|
+
k = k.substring(5);
|
382
|
+
I(j + g, a.substring(0, s), n, q);
|
383
|
+
I(j + g + s, h, Q(k, h), q);
|
384
|
+
I(j + g + v, a.substring(v), n, q);
|
385
|
+
} else q.push(j + g, k);
|
386
|
+
}
|
387
|
+
|
388
|
+
r.d = q;
|
389
|
+
}
|
390
|
+
|
391
|
+
return n;
|
392
|
+
}
|
393
|
+
|
394
|
+
function x(b) {
|
395
|
+
var f = [],
|
396
|
+
i = [];
|
397
|
+
if (b.tripleQuotedStrings) f.push([A, /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/, null, "'\""]);else b.multiLineStrings ? f.push([A, /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/, null, "'\"`"]) : f.push([A, /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/, null, "\"'"]);
|
398
|
+
b.verbatimStrings && i.push([A, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null]);
|
399
|
+
if (b.hashComments) if (b.cStyleComments) {
|
400
|
+
f.push([C, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/, null, "#"]);
|
401
|
+
i.push([A, /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/, null]);
|
402
|
+
} else f.push([C, /^#[^\r\n]*/, null, "#"]);
|
403
|
+
|
404
|
+
if (b.cStyleComments) {
|
405
|
+
i.push([C, /^\/\/[^\r\n]*/, null]);
|
406
|
+
i.push([C, /^\/\*[\s\S]*?(?:\*\/|$)/, null]);
|
407
|
+
}
|
408
|
+
|
409
|
+
b.regexLiterals && i.push(["lang-regex", RegExp("^" + Z + "(/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/)")]);
|
410
|
+
b = b.keywords.replace(/^\s+|\s+$/g, "");
|
411
|
+
b.length && i.push([R, RegExp("^(?:" + b.replace(/\s+/g, "|") + ")\\b"), null]);
|
412
|
+
f.push([z, /^\s+/, null, " \r\n\t\xA0"]);
|
413
|
+
i.push([J, /^@[a-z_$][a-z_$@0-9]*/i, null], [S, /^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/, null], [z, /^[a-z_$][a-z_$@0-9]*/i, null], [J, /^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i, null, "0123456789"], [E, /^.[^\s\w\.$@\'\"\`\/\#]*/, null]);
|
414
|
+
return B(f, i);
|
415
|
+
}
|
416
|
+
|
417
|
+
function $(b) {
|
418
|
+
function f(D) {
|
419
|
+
if (D > r) {
|
420
|
+
if (j && j !== q) {
|
421
|
+
n.push("</span>");
|
422
|
+
j = null;
|
423
|
+
}
|
424
|
+
|
425
|
+
if (!j && q) {
|
426
|
+
j = q;
|
427
|
+
n.push('<span class="', j, '">');
|
428
|
+
}
|
429
|
+
|
430
|
+
var T = y(p(i.substring(r, D))).replace(e ? d : c, "$1 ");
|
431
|
+
e = k.test(T);
|
432
|
+
n.push(T.replace(a, s));
|
433
|
+
r = D;
|
434
|
+
}
|
435
|
+
}
|
436
|
+
|
437
|
+
var i = b.source,
|
438
|
+
o = b.g,
|
439
|
+
l = b.d,
|
440
|
+
n = [],
|
441
|
+
r = 0,
|
442
|
+
j = null,
|
443
|
+
q = null,
|
444
|
+
m = 0,
|
445
|
+
t = 0,
|
446
|
+
p = Y(window.PR_TAB_WIDTH),
|
447
|
+
c = /([\r\n ]) /g,
|
448
|
+
d = /(^| ) /gm,
|
449
|
+
a = /\r\n?|\n/g,
|
450
|
+
k = /[ \r\n]$/,
|
451
|
+
e = true,
|
452
|
+
h = window._pr_isIE6();
|
453
|
+
|
454
|
+
h = h ? b.b.tagName === "PRE" ? h === 6 ? " \r\n" : h === 7 ? " <br>\r" : " \r" : " <br />" : "<br />";
|
455
|
+
var g = b.b.className.match(/\blinenums\b(?::(\d+))?/),
|
456
|
+
s;
|
457
|
+
|
458
|
+
if (g) {
|
459
|
+
for (var v = [], w = 0; w < 10; ++w) {
|
460
|
+
v[w] = h + '</li><li class="L' + w + '">';
|
461
|
+
}
|
462
|
+
|
463
|
+
var F = g[1] && g[1].length ? g[1] - 1 : 0;
|
464
|
+
n.push('<ol class="linenums"><li class="L', F % 10, '"');
|
465
|
+
F && n.push(' value="', F + 1, '"');
|
466
|
+
n.push(">");
|
467
|
+
|
468
|
+
s = function s() {
|
469
|
+
var D = v[++F % 10];
|
470
|
+
return j ? "</span>" + D + '<span class="' + j + '">' : D;
|
471
|
+
};
|
472
|
+
} else s = h;
|
473
|
+
|
474
|
+
for (;;) {
|
475
|
+
if (m < o.length ? t < l.length ? o[m] <= l[t] : true : false) {
|
476
|
+
f(o[m]);
|
477
|
+
|
478
|
+
if (j) {
|
479
|
+
n.push("</span>");
|
480
|
+
j = null;
|
481
|
+
}
|
482
|
+
|
483
|
+
n.push(o[m + 1]);
|
484
|
+
m += 2;
|
485
|
+
} else if (t < l.length) {
|
486
|
+
f(l[t]);
|
487
|
+
q = l[t + 1];
|
488
|
+
t += 2;
|
489
|
+
} else break;
|
490
|
+
}
|
491
|
+
|
492
|
+
f(i.length);
|
493
|
+
j && n.push("</span>");
|
494
|
+
g && n.push("</li></ol>");
|
495
|
+
b.a = n.join("");
|
496
|
+
}
|
497
|
+
|
498
|
+
function u(b, f) {
|
499
|
+
for (var i = f.length; --i >= 0;) {
|
500
|
+
var o = f[i];
|
501
|
+
if (G.hasOwnProperty(o)) "console" in window && console.warn("cannot override language handler %s", o);else G[o] = b;
|
502
|
+
}
|
503
|
+
}
|
504
|
+
|
505
|
+
function Q(b, f) {
|
506
|
+
b && G.hasOwnProperty(b) || (b = /^\s*</.test(f) ? "default-markup" : "default-code");
|
507
|
+
return G[b];
|
508
|
+
}
|
509
|
+
|
510
|
+
function U(b) {
|
511
|
+
var f = b.f,
|
512
|
+
i = b.e;
|
513
|
+
b.a = f;
|
514
|
+
|
515
|
+
try {
|
516
|
+
var o,
|
517
|
+
l = f.match(aa);
|
518
|
+
f = [];
|
519
|
+
var n = 0,
|
520
|
+
r = [];
|
521
|
+
if (l) for (var j = 0, q = l.length; j < q; ++j) {
|
522
|
+
var m = l[j];
|
523
|
+
|
524
|
+
if (m.length > 1 && m.charAt(0) === "<") {
|
525
|
+
if (!ba.test(m)) if (ca.test(m)) {
|
526
|
+
f.push(m.substring(9, m.length - 3));
|
527
|
+
n += m.length - 12;
|
528
|
+
} else if (da.test(m)) {
|
529
|
+
f.push("\n");
|
530
|
+
++n;
|
531
|
+
} else if (m.indexOf(V) >= 0 && m.replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g, ' $1="$2$3$4"').match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/)) {
|
532
|
+
var t = m.match(W)[2],
|
533
|
+
p = 1,
|
534
|
+
c;
|
535
|
+
c = j + 1;
|
536
|
+
|
537
|
+
a: for (; c < q; ++c) {
|
538
|
+
var d = l[c].match(W);
|
539
|
+
if (d && d[2] === t) if (d[1] === "/") {
|
540
|
+
if (--p === 0) break a;
|
541
|
+
} else ++p;
|
542
|
+
}
|
543
|
+
|
544
|
+
if (c < q) {
|
545
|
+
r.push(n, l.slice(j, c + 1).join(""));
|
546
|
+
j = c;
|
547
|
+
} else r.push(n, m);
|
548
|
+
} else r.push(n, m);
|
549
|
+
} else {
|
550
|
+
var a;
|
551
|
+
p = m;
|
552
|
+
var k = p.indexOf("&");
|
553
|
+
if (k < 0) a = p;else {
|
554
|
+
for (--k; (k = p.indexOf("&#", k + 1)) >= 0;) {
|
555
|
+
var e = p.indexOf(";", k);
|
556
|
+
|
557
|
+
if (e >= 0) {
|
558
|
+
var h = p.substring(k + 3, e),
|
559
|
+
g = 10;
|
560
|
+
|
561
|
+
if (h && h.charAt(0) === "x") {
|
562
|
+
h = h.substring(1);
|
563
|
+
g = 16;
|
564
|
+
}
|
565
|
+
|
566
|
+
var s = parseInt(h, g);
|
567
|
+
isNaN(s) || (p = p.substring(0, k) + String.fromCharCode(s) + p.substring(e + 1));
|
568
|
+
}
|
569
|
+
}
|
570
|
+
|
571
|
+
a = p.replace(ea, "<").replace(fa, ">").replace(ga, "'").replace(ha, '"').replace(ia, " ").replace(ja, "&");
|
572
|
+
}
|
573
|
+
f.push(a);
|
574
|
+
n += a.length;
|
575
|
+
}
|
576
|
+
}
|
577
|
+
o = {
|
578
|
+
source: f.join(""),
|
579
|
+
h: r
|
580
|
+
};
|
581
|
+
var v = o.source;
|
582
|
+
b.source = v;
|
583
|
+
b.c = 0;
|
584
|
+
b.g = o.h;
|
585
|
+
Q(i, v)(b);
|
586
|
+
$(b);
|
587
|
+
} catch (w) {
|
588
|
+
if ("console" in window) console.log(w && w.stack ? w.stack : w);
|
589
|
+
}
|
590
|
+
}
|
591
|
+
|
592
|
+
var A = "str",
|
593
|
+
R = "kwd",
|
594
|
+
C = "com",
|
595
|
+
S = "typ",
|
596
|
+
J = "lit",
|
597
|
+
E = "pun",
|
598
|
+
z = "pln",
|
599
|
+
P = "src",
|
600
|
+
V = "nocode",
|
601
|
+
Z = function () {
|
602
|
+
for (var b = ["!", "!=", "!==", "#", "%", "%=", "&", "&&", "&&=", "&=", "(", "*", "*=", "+=", ",", "-=", "->", "/", "/=", ":", "::", ";", "<", "<<", "<<=", "<=", "=", "==", "===", ">", ">=", ">>", ">>=", ">>>", ">>>=", "?", "@", "[", "^", "^=", "^^", "^^=", "{", "|", "|=", "||", "||=", "~", "break", "case", "continue", "delete", "do", "else", "finally", "instanceof", "return", "throw", "try", "typeof"], f = "(?:^^|[+-]", i = 0; i < b.length; ++i) {
|
603
|
+
f += "|" + b[i].replace(/([^=<>:&a-z])/g, "\\$1");
|
604
|
+
}
|
605
|
+
|
606
|
+
f += ")\\s*";
|
607
|
+
return f;
|
608
|
+
}(),
|
609
|
+
L = /&/g,
|
610
|
+
M = /</g,
|
611
|
+
N = />/g,
|
612
|
+
X = /\"/g,
|
613
|
+
ea = /</g,
|
614
|
+
fa = />/g,
|
615
|
+
ga = /'/g,
|
616
|
+
ha = /"/g,
|
617
|
+
ja = /&/g,
|
618
|
+
ia = / /g,
|
619
|
+
ka = /[\r\n]/g,
|
620
|
+
K = null,
|
621
|
+
aa = RegExp("[^<]+|<!--[\\s\\S]*?-->|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>|</?[a-zA-Z](?:[^>\"']|'[^']*'|\"[^\"]*\")*>|<", "g"),
|
622
|
+
ba = /^<\!--/,
|
623
|
+
ca = /^<!\[CDATA\[/,
|
624
|
+
da = /^<br\b/i,
|
625
|
+
W = /^<(\/?)([a-zA-Z][a-zA-Z0-9]*)/,
|
626
|
+
la = x({
|
627
|
+
keywords: "break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename using virtual wchar_t where break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof abstract boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params partial readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof debugger eval export function get null set undefined var with Infinity NaN caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END break continue do else for if return while case done elif esac eval fi function in local set then until ",
|
628
|
+
hashComments: true,
|
629
|
+
cStyleComments: true,
|
630
|
+
multiLineStrings: true,
|
631
|
+
regexLiterals: true
|
632
|
+
}),
|
633
|
+
G = {};
|
634
|
+
|
635
|
+
u(la, ["default-code"]);
|
636
|
+
u(B([], [[z, /^[^<?]+/], ["dec", /^<!\w[^>]*(?:>|$)/], [C, /^<\!--[\s\S]*?(?:-\->|$)/], ["lang-", /^<\?([\s\S]+?)(?:\?>|$)/], ["lang-", /^<%([\s\S]+?)(?:%>|$)/], [E, /^(?:<[%?]|[%?]>)/], ["lang-", /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i], ["lang-js", /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i], ["lang-css", /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i], ["lang-in.tag", /^(<\/?[a-z][^<>]*>)/i]]), ["default-markup", "htm", "html", "mxml", "xhtml", "xml", "xsl"]);
|
637
|
+
u(B([[z, /^[\s]+/, null, " \t\r\n"], ["atv", /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, "\"'"]], [["tag", /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i], ["atn", /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i], ["lang-uq.val", /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/], [E, /^[=<>\/]+/], ["lang-js", /^on\w+\s*=\s*\"([^\"]+)\"/i], ["lang-js", /^on\w+\s*=\s*\'([^\']+)\'/i], ["lang-js", /^on\w+\s*=\s*([^\"\'>\s]+)/i], ["lang-css", /^style\s*=\s*\"([^\"]+)\"/i], ["lang-css", /^style\s*=\s*\'([^\']+)\'/i], ["lang-css", /^style\s*=\s*([^\"\'>\s]+)/i]]), ["in.tag"]);
|
638
|
+
u(B([], [["atv", /^[\s\S]+/]]), ["uq.val"]);
|
639
|
+
u(x({
|
640
|
+
keywords: "break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename using virtual wchar_t where ",
|
641
|
+
hashComments: true,
|
642
|
+
cStyleComments: true
|
643
|
+
}), ["c", "cc", "cpp", "cxx", "cyc", "m"]);
|
644
|
+
u(x({
|
645
|
+
keywords: "null true false"
|
646
|
+
}), ["json"]);
|
647
|
+
u(x({
|
648
|
+
keywords: "break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof abstract boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params partial readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var ",
|
649
|
+
hashComments: true,
|
650
|
+
cStyleComments: true,
|
651
|
+
verbatimStrings: true
|
652
|
+
}), ["cs"]);
|
653
|
+
u(x({
|
654
|
+
keywords: "break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof abstract boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient ",
|
655
|
+
cStyleComments: true
|
656
|
+
}), ["java"]);
|
657
|
+
u(x({
|
658
|
+
keywords: "break continue do else for if return while case done elif esac eval fi function in local set then until ",
|
659
|
+
hashComments: true,
|
660
|
+
multiLineStrings: true
|
661
|
+
}), ["bsh", "csh", "sh"]);
|
662
|
+
u(x({
|
663
|
+
keywords: "break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None ",
|
664
|
+
hashComments: true,
|
665
|
+
multiLineStrings: true,
|
666
|
+
tripleQuotedStrings: true
|
667
|
+
}), ["cv", "py"]);
|
668
|
+
u(x({
|
669
|
+
keywords: "caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END ",
|
670
|
+
hashComments: true,
|
671
|
+
multiLineStrings: true,
|
672
|
+
regexLiterals: true
|
673
|
+
}), ["perl", "pl", "pm"]);
|
674
|
+
u(x({
|
675
|
+
keywords: "break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END ",
|
676
|
+
hashComments: true,
|
677
|
+
multiLineStrings: true,
|
678
|
+
regexLiterals: true
|
679
|
+
}), ["rb"]);
|
680
|
+
u(x({
|
681
|
+
keywords: "break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof debugger eval export function get null set undefined var with Infinity NaN ",
|
682
|
+
cStyleComments: true,
|
683
|
+
regexLiterals: true
|
684
|
+
}), ["js"]);
|
685
|
+
u(B([], [[A, /^[\s\S]+/]]), ["regex"]);
|
686
|
+
window.PR_normalizedHtml = H;
|
687
|
+
|
688
|
+
window.prettyPrintOne = function (b, f) {
|
689
|
+
var i = {
|
690
|
+
f: b,
|
691
|
+
e: f
|
692
|
+
};
|
693
|
+
U(i);
|
694
|
+
return i.a;
|
695
|
+
};
|
696
|
+
|
697
|
+
window.prettyPrint = function (b) {
|
698
|
+
function f() {
|
699
|
+
for (var t = window.PR_SHOULD_USE_CONTINUATION ? j.now() + 250 : Infinity; q < o.length && j.now() < t; q++) {
|
700
|
+
var p = o[q];
|
701
|
+
|
702
|
+
if (p.className && p.className.indexOf("prettyprint") >= 0) {
|
703
|
+
var c = p.className.match(/\blang-(\w+)\b/);
|
704
|
+
if (c) c = c[1];
|
705
|
+
|
706
|
+
for (var d = false, a = p.parentNode; a; a = a.parentNode) {
|
707
|
+
if ((a.tagName === "pre" || a.tagName === "code" || a.tagName === "xmp") && a.className && a.className.indexOf("prettyprint") >= 0) {
|
708
|
+
d = true;
|
709
|
+
break;
|
710
|
+
}
|
711
|
+
}
|
712
|
+
|
713
|
+
if (!d) {
|
714
|
+
a = p;
|
715
|
+
|
716
|
+
if (null === K) {
|
717
|
+
d = document.createElement("PRE");
|
718
|
+
d.appendChild(document.createTextNode('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />'));
|
719
|
+
K = !/</.test(d.innerHTML);
|
720
|
+
}
|
721
|
+
|
722
|
+
if (K) {
|
723
|
+
d = a.innerHTML;
|
724
|
+
if ("XMP" === a.tagName) d = y(d);else {
|
725
|
+
a = a;
|
726
|
+
if ("PRE" === a.tagName) a = true;else if (ka.test(d)) {
|
727
|
+
var k = "";
|
728
|
+
if (a.currentStyle) k = a.currentStyle.whiteSpace;else if (window.getComputedStyle) k = window.getComputedStyle(a, null).whiteSpace;
|
729
|
+
a = !k || k === "pre";
|
730
|
+
} else a = true;
|
731
|
+
a || (d = d.replace(/(<br\s*\/?>)[\r\n]+/g, "$1").replace(/(?:[\r\n]+[ \t]*)+/g, " "));
|
732
|
+
}
|
733
|
+
d = d;
|
734
|
+
} else {
|
735
|
+
d = [];
|
736
|
+
|
737
|
+
for (a = a.firstChild; a; a = a.nextSibling) {
|
738
|
+
H(a, d);
|
739
|
+
}
|
740
|
+
|
741
|
+
d = d.join("");
|
742
|
+
}
|
743
|
+
|
744
|
+
d = d.replace(/(?:\r\n?|\n)$/, "");
|
745
|
+
m = {
|
746
|
+
f: d,
|
747
|
+
e: c,
|
748
|
+
b: p
|
749
|
+
};
|
750
|
+
U(m);
|
751
|
+
|
752
|
+
if (p = m.a) {
|
753
|
+
c = m.b;
|
754
|
+
|
755
|
+
if ("XMP" === c.tagName) {
|
756
|
+
d = document.createElement("PRE");
|
757
|
+
|
758
|
+
for (a = 0; a < c.attributes.length; ++a) {
|
759
|
+
k = c.attributes[a];
|
760
|
+
if (k.specified) if (k.name.toLowerCase() === "class") d.className = k.value;else d.setAttribute(k.name, k.value);
|
761
|
+
}
|
762
|
+
|
763
|
+
d.innerHTML = p;
|
764
|
+
c.parentNode.replaceChild(d, c);
|
765
|
+
} else c.innerHTML = p;
|
766
|
+
}
|
767
|
+
}
|
768
|
+
}
|
769
|
+
}
|
770
|
+
|
771
|
+
if (q < o.length) setTimeout(f, 250);else b && b();
|
772
|
+
}
|
773
|
+
|
774
|
+
for (var i = [document.getElementsByTagName("pre"), document.getElementsByTagName("code"), document.getElementsByTagName("xmp")], o = [], l = 0; l < i.length; ++l) {
|
775
|
+
for (var n = 0, r = i[l].length; n < r; ++n) {
|
776
|
+
o.push(i[l][n]);
|
777
|
+
}
|
778
|
+
}
|
779
|
+
|
780
|
+
i = null;
|
781
|
+
var j = Date;
|
782
|
+
j.now || (j = {
|
783
|
+
now: function now() {
|
784
|
+
return new Date().getTime();
|
785
|
+
}
|
786
|
+
});
|
787
|
+
var q = 0,
|
788
|
+
m;
|
789
|
+
f();
|
790
|
+
};
|
791
|
+
|
792
|
+
window.PR = {
|
793
|
+
combinePrefixPatterns: O,
|
794
|
+
createSimpleLexer: B,
|
795
|
+
registerLangHandler: u,
|
796
|
+
sourceDecorator: x,
|
797
|
+
PR_ATTRIB_NAME: "atn",
|
798
|
+
PR_ATTRIB_VALUE: "atv",
|
799
|
+
PR_COMMENT: C,
|
800
|
+
PR_DECLARATION: "dec",
|
801
|
+
PR_KEYWORD: R,
|
802
|
+
PR_LITERAL: J,
|
803
|
+
PR_NOCODE: V,
|
804
|
+
PR_PLAIN: z,
|
805
|
+
PR_PUNCTUATION: E,
|
806
|
+
PR_SOURCE: P,
|
807
|
+
PR_STRING: A,
|
808
|
+
PR_TAG: "tag",
|
809
|
+
PR_TYPE: S
|
810
|
+
};
|
811
|
+
})(); // prettier-ignore
|
812
|
+
// lang-sql.js
|
813
|
+
// http://code.google.com/p/google-code-prettify/
|
814
|
+
|
815
|
+
PR.registerLangHandler(
|
816
|
+
PR.createSimpleLexer(
|
817
|
+
[
|
818
|
+
["pln", /^[\t\n\r \xA0]+/, null, "\t\n\r \xA0"],
|
819
|
+
["str", /^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/, null, "\"'"]
|
820
|
+
],
|
821
|
+
[
|
822
|
+
["com", /^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/],
|
823
|
+
[
|
824
|
+
"kwd",
|
825
|
+
/^(?:ADD|ALL|ALTER|AND|ANY|AS|ASC|AUTHORIZATION|BACKUP|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|COMPUTE|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|ELSE|END|ERRLVL|ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LINENO|LOAD|NATIONAL|NOCHECK|NONCLUSTERED|NOT|NULL|NULLIF|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUTER|OVER|PERCENT|PLAN|PRECISION|PRIMARY|PRINT|PROC|PROCEDURE|PUBLIC|RAISERROR|READ|READTEXT|RECONFIGURE|REFERENCES|REPLICATION|RESTORE|RESTRICT|RETURN|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|ROWGUIDCOL|RULE|SAVE|SCHEMA|SELECT|SESSION_USER|SET|SETUSER|SHUTDOWN|SOME|STATISTICS|SYSTEM_USER|TABLE|TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|UNION|UNIQUE|UPDATE|UPDATETEXT|USE|USER|VALUES|VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WRITETEXT)(?=[^\w-]|$)/i,
|
826
|
+
null
|
827
|
+
],
|
828
|
+
[
|
829
|
+
"lit",
|
830
|
+
/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i
|
831
|
+
],
|
832
|
+
["pln", /^[a-z_][\w-]*/i],
|
833
|
+
["pun", /^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0+\-\"\']*/]
|
834
|
+
]
|
835
|
+
),
|
836
|
+
["sql"]
|
837
|
+
);
|
838
|
+
}
|
839
|
+
|
840
|
+
MiniProfiler.loadedVendor = true;
|