rack-mini-profiler 1.0.1 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +60 -20
- data/README.md +16 -8
- data/lib/html/dot.1.1.2.min.js +2 -0
- data/lib/html/includes.css +102 -34
- data/lib/html/includes.js +1295 -1011
- data/lib/html/includes.scss +515 -441
- data/lib/html/includes.tmpl +138 -148
- data/lib/html/pretty-print.js +810 -0
- data/lib/html/share.html +0 -1
- data/lib/html/vendor.js +840 -0
- data/lib/mini_profiler/asset_version.rb +3 -2
- data/lib/mini_profiler/client_settings.rb +10 -3
- data/lib/mini_profiler/config.rb +4 -4
- data/lib/mini_profiler/gc_profiler.rb +1 -1
- data/lib/mini_profiler/profiler.rb +41 -11
- data/lib/mini_profiler/profiling_methods.rb +2 -6
- data/lib/mini_profiler/storage/file_store.rb +3 -3
- data/lib/mini_profiler/storage/memcache_store.rb +2 -0
- data/lib/mini_profiler/storage/memory_store.rb +1 -1
- data/lib/mini_profiler/timer_struct/sql.rb +1 -1
- data/lib/mini_profiler/version.rb +1 -1
- data/lib/mini_profiler_rails/railtie.rb +2 -0
- data/lib/patches/db/mongo.rb +1 -1
- data/lib/patches/db/moped.rb +1 -1
- data/lib/patches/db/plucky.rb +4 -4
- data/lib/patches/sql_patches.rb +1 -1
- data/rack-mini-profiler.gemspec +5 -1
- metadata +35 -10
- data/lib/html/jquery.1.7.1.js +0 -4
- data/lib/html/jquery.tmpl.js +0 -486
- data/lib/html/list.css +0 -9
- data/lib/html/list.js +0 -38
- data/lib/html/list.tmpl +0 -34
data/lib/html/includes.tmpl
CHANGED
@@ -1,25 +1,23 @@
|
|
1
|
-
<script id="profilerTemplate" type="text/x-
|
2
|
-
|
1
|
+
<script id="profilerTemplate" type="text/x-dot-tmpl">
|
3
2
|
<div class="profiler-result">
|
4
|
-
|
5
|
-
|
6
|
-
{{if has_duplicate_sql_timings}}<span class="profiler-nuclear">!</span>{{/if}}
|
7
|
-
<span class="profiler-number">
|
8
|
-
${MiniProfiler.formatDuration(duration_milliseconds)} <span class="profiler-unit">ms</span>
|
9
|
-
</span>
|
10
|
-
{{if MiniProfiler.showTotalSqlCount()}}
|
3
|
+
<div class="profiler-button {{? it.has_duplicate_sql_timings}}profiler-warning{{?}}">
|
4
|
+
{{? it.has_duplicate_sql_timings}}<span class="profiler-nuclear">!</span>{{?}}
|
11
5
|
<span class="profiler-number">
|
12
|
-
|
6
|
+
{{= MiniProfiler.formatDuration(it.duration_milliseconds)}} <span class="profiler-unit">ms</span>
|
13
7
|
</span>
|
14
|
-
{{
|
8
|
+
{{? MiniProfiler.showTotalSqlCount()}}
|
9
|
+
<span class="profiler-number">
|
10
|
+
{{= it.sql_count}} <span class="profiler-unit">sql</span>
|
11
|
+
</span>
|
12
|
+
{{?}}
|
15
13
|
</div>
|
16
14
|
|
17
15
|
<div class="profiler-popup">
|
18
16
|
<div class="profiler-info">
|
19
17
|
<span class="profiler-name">
|
20
|
-
|
18
|
+
{{= it.name}} <span class="profiler-overall-duration">({{= MiniProfiler.formatDuration(it.duration_milliseconds)}} ms)</span>
|
21
19
|
</span>
|
22
|
-
<span class="profiler-server-time"
|
20
|
+
<span class="profiler-server-time">{{= it.machine_name}} on {{= MiniProfiler.renderDate(it.started)}}</span>
|
23
21
|
</div>
|
24
22
|
<div class="profiler-output">
|
25
23
|
<table class="profiler-timings">
|
@@ -29,200 +27,192 @@
|
|
29
27
|
<th>duration (ms)</th>
|
30
28
|
<th class="profiler-duration-with-children">with children (ms)</th>
|
31
29
|
<th class="time-from-start">from start (ms)</th>
|
32
|
-
{{
|
30
|
+
{{? it.has_sql_timings}}
|
33
31
|
<th colspan="2">query time (ms)</th>
|
34
|
-
{{
|
35
|
-
{{
|
36
|
-
<th colspan="2"
|
37
|
-
{{
|
32
|
+
{{?}}
|
33
|
+
{{~ it.custom_timing_names :value}}
|
34
|
+
<th colspan="2">{{= value.toLowerCase() }} (ms)</th>
|
35
|
+
{{~}}
|
38
36
|
</tr>
|
39
37
|
</thead>
|
40
38
|
<tbody>
|
41
|
-
{{
|
39
|
+
{{= MiniProfiler.templates.timingTemplate({timing: it.root, page: it}) }}
|
42
40
|
</tbody>
|
43
41
|
<tfoot>
|
44
42
|
<tr>
|
45
43
|
<td colspan="3">
|
46
|
-
{{
|
47
|
-
|
48
|
-
{{
|
44
|
+
{{? !it.client_timings}}
|
45
|
+
{{= MiniProfiler.templates.linksTemplate({timing: it.root, page: it}) }}
|
46
|
+
{{?}}
|
49
47
|
<a class="profiler-toggle-duration-with-children" title="toggles column with aggregate child durations">show time with children</a>
|
50
48
|
</td>
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
49
|
+
{{? it.has_sql_timings}}
|
50
|
+
<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">
|
51
|
+
{{= MiniProfiler.formatDuration(it.duration_milliseconds_in_sql / it.duration_milliseconds * 100) }}
|
52
|
+
<span class="profiler-unit">% in sql</span>
|
53
|
+
</td>
|
54
|
+
{{?}}
|
55
|
+
{{~ it.custom_timing_names :value}}
|
56
|
+
<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">
|
57
|
+
{{= MiniProfiler.formatDuration(it.custom_timing_stats[value].duration / it.duration_milliseconds * 100) }}
|
58
|
+
<span class="profiler-unit">% in {{= value.toLowerCase() }}</span>
|
59
|
+
</td>
|
60
|
+
{{~}}
|
63
61
|
</tr>
|
64
62
|
</tfoot>
|
65
63
|
</table>
|
66
|
-
{{
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
64
|
+
{{? it.client_timings}}
|
65
|
+
<table class="profiler-timings profiler-client-timings">
|
66
|
+
<thead>
|
67
|
+
<tr>
|
68
|
+
<th>client event</th>
|
69
|
+
<th>duration (ms)</th>
|
70
|
+
<th>from start (ms)</th>
|
71
|
+
</tr>
|
72
|
+
</thead>
|
73
|
+
<tbody>
|
74
|
+
{{~ MiniProfiler.getClientTimings(it.client_timings) :value}}
|
75
|
+
<tr class="{{? value.isTrivial }}profiler-trivial{{?}}">
|
76
|
+
<td class="profiler-label">{{= value.name }}</td>
|
77
|
+
<td class="profiler-duration">
|
78
|
+
{{? value.duration >= 0}}
|
79
|
+
<span class="profiler-unit"></span>{{= MiniProfiler.formatDuration(value.duration) }}
|
80
|
+
{{?}}
|
81
|
+
</td>
|
82
|
+
<td class="profiler-duration time-from-start">
|
83
|
+
<span class="profiler-unit">+</span>{{= MiniProfiler.formatDuration(value.start) }}
|
84
|
+
</td>
|
85
|
+
</tr>
|
86
|
+
{{~}}
|
87
|
+
</tbody>
|
88
|
+
<tfoot>
|
89
|
+
<td colspan="3">
|
90
|
+
{{= MiniProfiler.templates.linksTemplate({timing: it.root, page: it}) }}
|
86
91
|
</td>
|
87
|
-
</
|
88
|
-
|
89
|
-
|
90
|
-
<tfoot>
|
91
|
-
<td colspan="3">
|
92
|
-
{{tmpl "#linksTemplate"}}
|
93
|
-
</td>
|
94
|
-
</tfoot>
|
95
|
-
</table>
|
96
|
-
{{/if}}
|
92
|
+
</tfoot>
|
93
|
+
</table>
|
94
|
+
{{?}}
|
97
95
|
</div>
|
98
96
|
</div>
|
99
97
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
98
|
+
{{? it.has_sql_timings}}
|
99
|
+
<div class="profiler-queries">
|
100
|
+
<table>
|
101
|
+
<thead>
|
102
|
+
<tr>
|
103
|
+
<th style="text-align:right">step<br />time from start<br />query type<br />duration</th>
|
104
|
+
<th style="text-align:left">call stack<br />query</th>
|
105
|
+
</tr>
|
106
|
+
</thead>
|
107
|
+
<tbody>
|
108
|
+
{{~ MiniProfiler.getSqlTimings(it.root) :value:index}}
|
109
|
+
{{= MiniProfiler.templates.sqlGapTemplate({g: value.prevGap}) }}
|
110
|
+
{{= MiniProfiler.templates.sqlTimingTemplate({i: index, s: value}) }}
|
111
|
+
{{? value.nextGap}}
|
112
|
+
{{= MiniProfiler.templates.sqlGapTemplate({g: value.nextGap}) }}
|
113
|
+
{{?}}
|
114
|
+
{{~}}
|
115
|
+
</tbody>
|
116
|
+
</table>
|
117
|
+
<p class="profiler-trivial-gap-container">
|
118
|
+
<a class="profiler-toggle-trivial-gaps">show trivial gaps</a>
|
119
|
+
</p>
|
120
|
+
</div>
|
121
|
+
{{?}}
|
125
122
|
</div>
|
126
|
-
|
127
123
|
</script>
|
128
124
|
|
129
|
-
<script id="linksTemplate" type="text/x-
|
130
|
-
<a href="
|
131
|
-
<a href="
|
132
|
-
{{
|
133
|
-
|
134
|
-
{{
|
135
|
-
{{
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
{{
|
125
|
+
<script id="linksTemplate" type="text/x-dot-tmpl">
|
126
|
+
<a href="{{= MiniProfiler.shareUrl(it.page.id) }}" class="profiler-share-profiler-results" target="_blank">share</a>
|
127
|
+
<a href="{{= MiniProfiler.moreUrl(it.timing.name) }}" class="profiler-more-actions">more</a>
|
128
|
+
{{? it.custom_link}}
|
129
|
+
<a href="{{= it.custom_link }}" class="profiler-custom-link" target="_blank">{{= it.custom_link_name }}</a>
|
130
|
+
{{?}}
|
131
|
+
{{? it.has_trivial_timings}}
|
132
|
+
<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">
|
133
|
+
show trivial
|
134
|
+
</a>
|
135
|
+
{{?}}
|
140
136
|
</script>
|
141
137
|
|
142
|
-
<script id="timingTemplate" type="text/x-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
<span class="profiler-indent">${MiniProfiler.renderIndent(timing.depth)}</span> ${timing.name.slice(0,45)}{{if timing.name && timing.name.length > 45 }}...{{/if}}
|
138
|
+
<script id="timingTemplate" type="text/x-dot-tmpl">
|
139
|
+
<tr class="{{? it.timing.is_trivial }}profiler-trivial{{?}}" data-timing-id="{{= it.timing.id }}">
|
140
|
+
<td class="profiler-label" title="{{? it.timing.name && it.timing.name.length > 45 }}{{= it.timing.name }}{{?}}">
|
141
|
+
<span class="profiler-indent">{{= MiniProfiler.renderIndent(it.timing.depth) }}</span> {{= it.timing.name.slice(0,45) }}{{? it.timing.name && it.timing.name.length > 45 }}...{{?}}
|
147
142
|
</td>
|
148
143
|
<td class="profiler-duration" title="duration of this step without any children's durations">
|
149
|
-
|
144
|
+
{{= MiniProfiler.formatDuration(it.timing.duration_without_children_milliseconds) }}
|
150
145
|
</td>
|
151
146
|
<td class="profiler-duration profiler-duration-with-children" title="duration of this step and its children">
|
152
|
-
|
147
|
+
{{= MiniProfiler.formatDuration(it.timing.duration_milliseconds) }}
|
153
148
|
</td>
|
154
149
|
<td class="profiler-duration time-from-start" title="time elapsed since profiling started">
|
155
|
-
<span class="profiler-unit">+</span
|
150
|
+
<span class="profiler-unit">+</span>{{= MiniProfiler.formatDuration(it.timing.start_milliseconds) }}
|
156
151
|
</td>
|
157
152
|
|
158
|
-
{{
|
159
|
-
<td class="profiler-duration {{
|
153
|
+
{{? it.timing.has_sql_timings}}
|
154
|
+
<td class="profiler-duration {{? it.timing.has_duplicate_sql_timings}}profiler-warning{{?}}" title="{{? it.timing.has_duplicate_sql_timings}}duplicate queries detected - {{?}}{{? it.timing.executed_readers > 0 || it.timing.executed_scalars > 0 || it.timing.executed_non_queries > 0}}{{= it.timing.executed_readers }} reader, {{= it.timing.executed_scalars }} scalar, {{= it.timing.executed_non_queries }} non-query statements executed{{?}}">
|
160
155
|
<a class="profiler-queries-show">
|
161
|
-
{{
|
162
|
-
|
156
|
+
{{? it.timing.has_duplicate_sql_timings}}<span class="profiler-nuclear">!</span>{{?}}
|
157
|
+
{{= it.timing.sql_timings.length }} <span class="profiler-unit">sql</span>
|
163
158
|
</a>
|
164
159
|
</td>
|
165
160
|
<td class="profiler-duration" title="aggregate duration of all queries in this step (excludes children)">
|
166
|
-
|
161
|
+
{{= MiniProfiler.formatDuration(it.timing.sql_timings_duration_milliseconds) }}
|
167
162
|
</td>
|
168
|
-
{{
|
163
|
+
{{??}}
|
169
164
|
<td colspan="2"></td>
|
170
|
-
{{
|
165
|
+
{{?}}
|
171
166
|
|
172
|
-
{{
|
173
|
-
{{
|
174
|
-
<td class="profiler-duration" title="aggregate number of all
|
175
|
-
|
167
|
+
{{~ it.page.custom_timing_names :value}}
|
168
|
+
{{? it.timing.custom_timings && it.timing.custom_timings[value]}}
|
169
|
+
<td class="profiler-duration" title="aggregate number of all {{= value.toLowerCase() }} invocations in this step (excludes children)">
|
170
|
+
{{= it.timing.custom_timings[value].length }} {{= value.toLowerCase() }}
|
176
171
|
</td>
|
177
|
-
<td class="profiler-duration" title="aggregate duration of all
|
178
|
-
|
172
|
+
<td class="profiler-duration" title="aggregate duration of all {{= value.toLowerCase() }} invocations in this step (excludes children)">
|
173
|
+
{{= MiniProfiler.formatDuration(it.timing.custom_timing_stats[value].duration) }}
|
179
174
|
</td>
|
180
|
-
{{
|
175
|
+
{{??}}
|
181
176
|
<td colspan="2"></td>
|
182
|
-
{{
|
183
|
-
{{
|
177
|
+
{{?}}
|
178
|
+
{{~}}
|
184
179
|
|
185
180
|
</tr>
|
186
181
|
|
187
|
-
{{
|
188
|
-
{{
|
189
|
-
{{
|
190
|
-
{{
|
191
|
-
{{
|
192
|
-
|
182
|
+
{{? it.timing.has_children}}
|
183
|
+
{{~ it.timing.children :value}}
|
184
|
+
{{= MiniProfiler.templates.timingTemplate({timing: value, page: it.page}) }}
|
185
|
+
{{~}}
|
186
|
+
{{?}}
|
193
187
|
</script>
|
194
188
|
|
195
|
-
<script id="sqlTimingTemplate" type="text/x-
|
196
|
-
|
197
|
-
<tr class="${s.row_class}" data-timing-id="${s.parent_timing_id}">
|
189
|
+
<script id="sqlTimingTemplate" type="text/x-dot-tmpl">
|
190
|
+
<tr class="{{= it.s.row_class || '' }}" data-timing-id="{{= it.s.parent_timing_id }}">
|
198
191
|
<td class="profiler-info">
|
199
|
-
<div
|
200
|
-
<div class="profiler-number"><span class="profiler-unit">T+</span
|
192
|
+
<div>{{= it.s.parent_timing_name }}</div>
|
193
|
+
<div class="profiler-number"><span class="profiler-unit">T+</span>{{= MiniProfiler.formatDuration(it.s.start_milliseconds) }} <span class="profiler-unit">ms</span></div>
|
201
194
|
<div>
|
202
|
-
{{
|
203
|
-
|
195
|
+
{{? it.s.is_duplicate}}<span class="profiler-warning">DUPLICATE</span>{{?}}
|
196
|
+
{{= MiniProfiler.renderExecuteType(it.s.execute_type) }}
|
204
197
|
</div>
|
205
|
-
<div title="{{
|
198
|
+
<div title="{{? it.s.execute_type == 3}}first result fetched: {{= it.s.first_fetch_duration_milliseconds }}ms{{?}}">{{= MiniProfiler.formatDuration(it.s.duration_milliseconds) }} <span class="profiler-unit">ms</span></div>
|
206
199
|
</td>
|
207
200
|
<td>
|
208
201
|
<div class="query">
|
209
|
-
<pre class="profiler-stack-trace"
|
210
|
-
<pre class="prettyprint lang-sql"><code
|
202
|
+
<pre class="profiler-stack-trace">{{= it.s.stack_trace_snippet }}</pre>
|
203
|
+
<pre class="prettyprint lang-sql"><code>{{= it.s.formatted_command_string }}; {{= MiniProfiler.formatParameters(it.s.parameters) }}</code></pre>
|
211
204
|
</div>
|
212
205
|
</td>
|
213
206
|
</tr>
|
214
|
-
|
215
207
|
</script>
|
216
208
|
|
217
|
-
<script id="sqlGapTemplate" type="text/x-
|
218
|
-
|
219
|
-
<tr class="profiler-gap-info{{if g.duration < 4}} profiler-trivial-gaps{{/if}}">
|
209
|
+
<script id="sqlGapTemplate" type="text/x-dot-tmpl">
|
210
|
+
<tr class="profiler-gap-info{{? it.g.duration < 4}} profiler-trivial-gaps{{?}}">
|
220
211
|
<td class="profiler-info">
|
221
|
-
|
212
|
+
{{= it.g.duration }} <span class="profiler-unit">ms</span>
|
222
213
|
</td>
|
223
214
|
<td class="query">
|
224
|
-
<div
|
215
|
+
<div>{{= it.g.topReason.name }} — {{= it.g.topReason.duration.toFixed(2) }} <span class="profiler-unit">ms</span></div>
|
225
216
|
</td>
|
226
217
|
</tr>
|
227
|
-
|
228
218
|
</script>
|
@@ -0,0 +1,810 @@
|
|
1
|
+
if (typeof prettyPrint === "undefined") {
|
2
|
+
// prettify.js
|
3
|
+
// http://code.google.com/p/google-code-prettify/
|
4
|
+
// prettier-ignore
|
5
|
+
window.PR_SHOULD_USE_CONTINUATION = true;
|
6
|
+
window.PR_TAB_WIDTH = 8;
|
7
|
+
window.PR_normalizedHtml = window.PR = window.prettyPrintOne = window.prettyPrint = void 0;
|
8
|
+
|
9
|
+
window._pr_isIE6 = function() {
|
10
|
+
var y =
|
11
|
+
navigator &&
|
12
|
+
navigator.userAgent &&
|
13
|
+
navigator.userAgent.match(/\bMSIE ([678])\./);
|
14
|
+
y = y ? +y[1] : false;
|
15
|
+
|
16
|
+
window._pr_isIE6 = function() {
|
17
|
+
return y;
|
18
|
+
};
|
19
|
+
|
20
|
+
return y;
|
21
|
+
};
|
22
|
+
|
23
|
+
(function () {
|
24
|
+
function y(b) {
|
25
|
+
return b.replace(L, "&").replace(M, "<").replace(N, ">");
|
26
|
+
}
|
27
|
+
|
28
|
+
function H(b, f, i) {
|
29
|
+
switch (b.nodeType) {
|
30
|
+
case 1:
|
31
|
+
var o = b.tagName.toLowerCase();
|
32
|
+
f.push("<", o);
|
33
|
+
var l = b.attributes,
|
34
|
+
n = l.length;
|
35
|
+
|
36
|
+
if (n) {
|
37
|
+
if (i) {
|
38
|
+
for (var r = [], j = n; --j >= 0;) {
|
39
|
+
r[j] = l[j];
|
40
|
+
}
|
41
|
+
|
42
|
+
r.sort(function (q, m) {
|
43
|
+
return q.name < m.name ? -1 : q.name === m.name ? 0 : 1;
|
44
|
+
});
|
45
|
+
l = r;
|
46
|
+
}
|
47
|
+
|
48
|
+
for (j = 0; j < n; ++j) {
|
49
|
+
r = l[j];
|
50
|
+
r.specified && f.push(" ", r.name.toLowerCase(), '="', r.value.replace(L, "&").replace(M, "<").replace(N, ">").replace(X, """), '"');
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
f.push(">");
|
55
|
+
|
56
|
+
for (l = b.firstChild; l; l = l.nextSibling) {
|
57
|
+
H(l, f, i);
|
58
|
+
}
|
59
|
+
|
60
|
+
if (b.firstChild || !/^(?:br|link|img)$/.test(o)) f.push("</", o, ">");
|
61
|
+
break;
|
62
|
+
|
63
|
+
case 3:
|
64
|
+
case 4:
|
65
|
+
f.push(y(b.nodeValue));
|
66
|
+
break;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
function O(b) {
|
71
|
+
function f(c) {
|
72
|
+
if (c.charAt(0) !== "\\") return c.charCodeAt(0);
|
73
|
+
|
74
|
+
switch (c.charAt(1)) {
|
75
|
+
case "b":
|
76
|
+
return 8;
|
77
|
+
|
78
|
+
case "t":
|
79
|
+
return 9;
|
80
|
+
|
81
|
+
case "n":
|
82
|
+
return 10;
|
83
|
+
|
84
|
+
case "v":
|
85
|
+
return 11;
|
86
|
+
|
87
|
+
case "f":
|
88
|
+
return 12;
|
89
|
+
|
90
|
+
case "r":
|
91
|
+
return 13;
|
92
|
+
|
93
|
+
case "u":
|
94
|
+
case "x":
|
95
|
+
return parseInt(c.substring(2), 16) || c.charCodeAt(1);
|
96
|
+
|
97
|
+
case "0":
|
98
|
+
case "1":
|
99
|
+
case "2":
|
100
|
+
case "3":
|
101
|
+
case "4":
|
102
|
+
case "5":
|
103
|
+
case "6":
|
104
|
+
case "7":
|
105
|
+
return parseInt(c.substring(1), 8);
|
106
|
+
|
107
|
+
default:
|
108
|
+
return c.charCodeAt(1);
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
function i(c) {
|
113
|
+
if (c < 32) return (c < 16 ? "\\x0" : "\\x") + c.toString(16);
|
114
|
+
c = String.fromCharCode(c);
|
115
|
+
if (c === "\\" || c === "-" || c === "[" || c === "]") c = "\\" + c;
|
116
|
+
return c;
|
117
|
+
}
|
118
|
+
|
119
|
+
function o(c) {
|
120
|
+
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"));
|
121
|
+
c = [];
|
122
|
+
|
123
|
+
for (var a = [], k = d[0] === "^", e = k ? 1 : 0, h = d.length; e < h; ++e) {
|
124
|
+
var g = d[e];
|
125
|
+
|
126
|
+
switch (g) {
|
127
|
+
case "\\B":
|
128
|
+
case "\\b":
|
129
|
+
case "\\D":
|
130
|
+
case "\\d":
|
131
|
+
case "\\S":
|
132
|
+
case "\\s":
|
133
|
+
case "\\W":
|
134
|
+
case "\\w":
|
135
|
+
c.push(g);
|
136
|
+
continue;
|
137
|
+
}
|
138
|
+
|
139
|
+
g = f(g);
|
140
|
+
var s;
|
141
|
+
|
142
|
+
if (e + 2 < h && "-" === d[e + 1]) {
|
143
|
+
s = f(d[e + 2]);
|
144
|
+
e += 2;
|
145
|
+
} else s = g;
|
146
|
+
|
147
|
+
a.push([g, s]);
|
148
|
+
|
149
|
+
if (!(s < 65 || g > 122)) {
|
150
|
+
s < 65 || g > 90 || a.push([Math.max(65, g) | 32, Math.min(s, 90) | 32]);
|
151
|
+
s < 97 || g > 122 || a.push([Math.max(97, g) & -33, Math.min(s, 122) & -33]);
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
a.sort(function (v, w) {
|
156
|
+
return v[0] - w[0] || w[1] - v[1];
|
157
|
+
});
|
158
|
+
d = [];
|
159
|
+
g = [NaN, NaN];
|
160
|
+
|
161
|
+
for (e = 0; e < a.length; ++e) {
|
162
|
+
h = a[e];
|
163
|
+
if (h[0] <= g[1] + 1) g[1] = Math.max(g[1], h[1]);else d.push(g = h);
|
164
|
+
}
|
165
|
+
|
166
|
+
a = ["["];
|
167
|
+
k && a.push("^");
|
168
|
+
a.push.apply(a, c);
|
169
|
+
|
170
|
+
for (e = 0; e < d.length; ++e) {
|
171
|
+
h = d[e];
|
172
|
+
a.push(i(h[0]));
|
173
|
+
|
174
|
+
if (h[1] > h[0]) {
|
175
|
+
h[1] + 1 > h[0] && a.push("-");
|
176
|
+
a.push(i(h[1]));
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
a.push("]");
|
181
|
+
return a.join("");
|
182
|
+
}
|
183
|
+
|
184
|
+
function l(c) {
|
185
|
+
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) {
|
186
|
+
var g = d[e];
|
187
|
+
if (g === "(") ++h;else if ("\\" === g.charAt(0)) if ((g = +g.substring(1)) && g <= h) k[g] = -1;
|
188
|
+
}
|
189
|
+
|
190
|
+
for (e = 1; e < k.length; ++e) {
|
191
|
+
if (-1 === k[e]) k[e] = ++n;
|
192
|
+
}
|
193
|
+
|
194
|
+
for (h = e = 0; e < a; ++e) {
|
195
|
+
g = d[e];
|
196
|
+
|
197
|
+
if (g === "(") {
|
198
|
+
++h;
|
199
|
+
if (k[h] === undefined) d[e] = "(?:";
|
200
|
+
} else if ("\\" === g.charAt(0)) if ((g = +g.substring(1)) && g <= h) d[e] = "\\" + k[h];
|
201
|
+
}
|
202
|
+
|
203
|
+
for (h = e = 0; e < a; ++e) {
|
204
|
+
if ("^" === d[e] && "^" !== d[e + 1]) d[e] = "";
|
205
|
+
}
|
206
|
+
|
207
|
+
if (c.ignoreCase && r) for (e = 0; e < a; ++e) {
|
208
|
+
g = d[e];
|
209
|
+
c = g.charAt(0);
|
210
|
+
if (g.length >= 2 && c === "[") d[e] = o(g);else if (c !== "\\") d[e] = g.replace(/[a-zA-Z]/g, function (s) {
|
211
|
+
s = s.charCodeAt(0);
|
212
|
+
return "[" + String.fromCharCode(s & -33, s | 32) + "]";
|
213
|
+
});
|
214
|
+
}
|
215
|
+
return d.join("");
|
216
|
+
}
|
217
|
+
|
218
|
+
for (var n = 0, r = false, j = false, q = 0, m = b.length; q < m; ++q) {
|
219
|
+
var t = b[q];
|
220
|
+
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, ""))) {
|
221
|
+
r = true;
|
222
|
+
j = false;
|
223
|
+
break;
|
224
|
+
}
|
225
|
+
}
|
226
|
+
|
227
|
+
var p = [];
|
228
|
+
q = 0;
|
229
|
+
|
230
|
+
for (m = b.length; q < m; ++q) {
|
231
|
+
t = b[q];
|
232
|
+
if (t.global || t.multiline) throw Error("" + t);
|
233
|
+
p.push("(?:" + l(t) + ")");
|
234
|
+
}
|
235
|
+
|
236
|
+
return RegExp(p.join("|"), j ? "gi" : "g");
|
237
|
+
}
|
238
|
+
|
239
|
+
function Y(b) {
|
240
|
+
var f = 0;
|
241
|
+
return function (i) {
|
242
|
+
for (var o = null, l = 0, n = 0, r = i.length; n < r; ++n) {
|
243
|
+
switch (i.charAt(n)) {
|
244
|
+
case "\t":
|
245
|
+
o || (o = []);
|
246
|
+
o.push(i.substring(l, n));
|
247
|
+
l = b - f % b;
|
248
|
+
|
249
|
+
for (f += l; l >= 0; l -= 16) {
|
250
|
+
o.push(" ".substring(0, l));
|
251
|
+
}
|
252
|
+
|
253
|
+
l = n + 1;
|
254
|
+
break;
|
255
|
+
|
256
|
+
case "\n":
|
257
|
+
f = 0;
|
258
|
+
break;
|
259
|
+
|
260
|
+
default:
|
261
|
+
++f;
|
262
|
+
}
|
263
|
+
}
|
264
|
+
|
265
|
+
if (!o) return i;
|
266
|
+
o.push(i.substring(l));
|
267
|
+
return o.join("");
|
268
|
+
};
|
269
|
+
}
|
270
|
+
|
271
|
+
function I(b, f, i, o) {
|
272
|
+
if (f) {
|
273
|
+
b = {
|
274
|
+
source: f,
|
275
|
+
c: b
|
276
|
+
};
|
277
|
+
i(b);
|
278
|
+
o.push.apply(o, b.d);
|
279
|
+
}
|
280
|
+
}
|
281
|
+
|
282
|
+
function B(b, f) {
|
283
|
+
var i = {},
|
284
|
+
o;
|
285
|
+
|
286
|
+
(function () {
|
287
|
+
for (var r = b.concat(f), j = [], q = {}, m = 0, t = r.length; m < t; ++m) {
|
288
|
+
var p = r[m],
|
289
|
+
c = p[3];
|
290
|
+
if (c) for (var d = c.length; --d >= 0;) {
|
291
|
+
i[c.charAt(d)] = p;
|
292
|
+
}
|
293
|
+
p = p[1];
|
294
|
+
c = "" + p;
|
295
|
+
|
296
|
+
if (!q.hasOwnProperty(c)) {
|
297
|
+
j.push(p);
|
298
|
+
q[c] = null;
|
299
|
+
}
|
300
|
+
}
|
301
|
+
|
302
|
+
j.push(/[\0-\uffff]/);
|
303
|
+
o = O(j);
|
304
|
+
})();
|
305
|
+
|
306
|
+
var l = f.length;
|
307
|
+
|
308
|
+
function n(r) {
|
309
|
+
for (var j = r.c, q = [j, z], m = 0, t = r.source.match(o) || [], p = {}, c = 0, d = t.length; c < d; ++c) {
|
310
|
+
var a = t[c],
|
311
|
+
k = p[a],
|
312
|
+
e = void 0,
|
313
|
+
h;
|
314
|
+
if (typeof k === "string") h = false;else {
|
315
|
+
var g = i[a.charAt(0)];
|
316
|
+
|
317
|
+
if (g) {
|
318
|
+
e = a.match(g[1]);
|
319
|
+
k = g[0];
|
320
|
+
} else {
|
321
|
+
for (h = 0; h < l; ++h) {
|
322
|
+
g = f[h];
|
323
|
+
|
324
|
+
if (e = a.match(g[1])) {
|
325
|
+
k = g[0];
|
326
|
+
break;
|
327
|
+
}
|
328
|
+
}
|
329
|
+
|
330
|
+
e || (k = z);
|
331
|
+
}
|
332
|
+
|
333
|
+
if ((h = k.length >= 5 && "lang-" === k.substring(0, 5)) && !(e && typeof e[1] === "string")) {
|
334
|
+
h = false;
|
335
|
+
k = P;
|
336
|
+
}
|
337
|
+
|
338
|
+
h || (p[a] = k);
|
339
|
+
}
|
340
|
+
g = m;
|
341
|
+
m += a.length;
|
342
|
+
|
343
|
+
if (h) {
|
344
|
+
h = e[1];
|
345
|
+
var s = a.indexOf(h),
|
346
|
+
v = s + h.length;
|
347
|
+
|
348
|
+
if (e[2]) {
|
349
|
+
v = a.length - e[2].length;
|
350
|
+
s = v - h.length;
|
351
|
+
}
|
352
|
+
|
353
|
+
k = k.substring(5);
|
354
|
+
I(j + g, a.substring(0, s), n, q);
|
355
|
+
I(j + g + s, h, Q(k, h), q);
|
356
|
+
I(j + g + v, a.substring(v), n, q);
|
357
|
+
} else q.push(j + g, k);
|
358
|
+
}
|
359
|
+
|
360
|
+
r.d = q;
|
361
|
+
}
|
362
|
+
|
363
|
+
return n;
|
364
|
+
}
|
365
|
+
|
366
|
+
function x(b) {
|
367
|
+
var f = [],
|
368
|
+
i = [];
|
369
|
+
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, "\"'"]);
|
370
|
+
b.verbatimStrings && i.push([A, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null]);
|
371
|
+
if (b.hashComments) if (b.cStyleComments) {
|
372
|
+
f.push([C, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/, null, "#"]);
|
373
|
+
i.push([A, /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/, null]);
|
374
|
+
} else f.push([C, /^#[^\r\n]*/, null, "#"]);
|
375
|
+
|
376
|
+
if (b.cStyleComments) {
|
377
|
+
i.push([C, /^\/\/[^\r\n]*/, null]);
|
378
|
+
i.push([C, /^\/\*[\s\S]*?(?:\*\/|$)/, null]);
|
379
|
+
}
|
380
|
+
|
381
|
+
b.regexLiterals && i.push(["lang-regex", RegExp("^" + Z + "(/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/)")]);
|
382
|
+
b = b.keywords.replace(/^\s+|\s+$/g, "");
|
383
|
+
b.length && i.push([R, RegExp("^(?:" + b.replace(/\s+/g, "|") + ")\\b"), null]);
|
384
|
+
f.push([z, /^\s+/, null, " \r\n\t\xA0"]);
|
385
|
+
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]);
|
386
|
+
return B(f, i);
|
387
|
+
}
|
388
|
+
|
389
|
+
function $(b) {
|
390
|
+
function f(D) {
|
391
|
+
if (D > r) {
|
392
|
+
if (j && j !== q) {
|
393
|
+
n.push("</span>");
|
394
|
+
j = null;
|
395
|
+
}
|
396
|
+
|
397
|
+
if (!j && q) {
|
398
|
+
j = q;
|
399
|
+
n.push('<span class="', j, '">');
|
400
|
+
}
|
401
|
+
|
402
|
+
var T = y(p(i.substring(r, D))).replace(e ? d : c, "$1 ");
|
403
|
+
e = k.test(T);
|
404
|
+
n.push(T.replace(a, s));
|
405
|
+
r = D;
|
406
|
+
}
|
407
|
+
}
|
408
|
+
|
409
|
+
var i = b.source,
|
410
|
+
o = b.g,
|
411
|
+
l = b.d,
|
412
|
+
n = [],
|
413
|
+
r = 0,
|
414
|
+
j = null,
|
415
|
+
q = null,
|
416
|
+
m = 0,
|
417
|
+
t = 0,
|
418
|
+
p = Y(window.PR_TAB_WIDTH),
|
419
|
+
c = /([\r\n ]) /g,
|
420
|
+
d = /(^| ) /gm,
|
421
|
+
a = /\r\n?|\n/g,
|
422
|
+
k = /[ \r\n]$/,
|
423
|
+
e = true,
|
424
|
+
h = window._pr_isIE6();
|
425
|
+
|
426
|
+
h = h ? b.b.tagName === "PRE" ? h === 6 ? " \r\n" : h === 7 ? " <br>\r" : " \r" : " <br />" : "<br />";
|
427
|
+
var g = b.b.className.match(/\blinenums\b(?::(\d+))?/),
|
428
|
+
s;
|
429
|
+
|
430
|
+
if (g) {
|
431
|
+
for (var v = [], w = 0; w < 10; ++w) {
|
432
|
+
v[w] = h + '</li><li class="L' + w + '">';
|
433
|
+
}
|
434
|
+
|
435
|
+
var F = g[1] && g[1].length ? g[1] - 1 : 0;
|
436
|
+
n.push('<ol class="linenums"><li class="L', F % 10, '"');
|
437
|
+
F && n.push(' value="', F + 1, '"');
|
438
|
+
n.push(">");
|
439
|
+
|
440
|
+
s = function s() {
|
441
|
+
var D = v[++F % 10];
|
442
|
+
return j ? "</span>" + D + '<span class="' + j + '">' : D;
|
443
|
+
};
|
444
|
+
} else s = h;
|
445
|
+
|
446
|
+
for (;;) {
|
447
|
+
if (m < o.length ? t < l.length ? o[m] <= l[t] : true : false) {
|
448
|
+
f(o[m]);
|
449
|
+
|
450
|
+
if (j) {
|
451
|
+
n.push("</span>");
|
452
|
+
j = null;
|
453
|
+
}
|
454
|
+
|
455
|
+
n.push(o[m + 1]);
|
456
|
+
m += 2;
|
457
|
+
} else if (t < l.length) {
|
458
|
+
f(l[t]);
|
459
|
+
q = l[t + 1];
|
460
|
+
t += 2;
|
461
|
+
} else break;
|
462
|
+
}
|
463
|
+
|
464
|
+
f(i.length);
|
465
|
+
j && n.push("</span>");
|
466
|
+
g && n.push("</li></ol>");
|
467
|
+
b.a = n.join("");
|
468
|
+
}
|
469
|
+
|
470
|
+
function u(b, f) {
|
471
|
+
for (var i = f.length; --i >= 0;) {
|
472
|
+
var o = f[i];
|
473
|
+
if (G.hasOwnProperty(o)) "console" in window && console.warn("cannot override language handler %s", o);else G[o] = b;
|
474
|
+
}
|
475
|
+
}
|
476
|
+
|
477
|
+
function Q(b, f) {
|
478
|
+
b && G.hasOwnProperty(b) || (b = /^\s*</.test(f) ? "default-markup" : "default-code");
|
479
|
+
return G[b];
|
480
|
+
}
|
481
|
+
|
482
|
+
function U(b) {
|
483
|
+
var f = b.f,
|
484
|
+
i = b.e;
|
485
|
+
b.a = f;
|
486
|
+
|
487
|
+
try {
|
488
|
+
var o,
|
489
|
+
l = f.match(aa);
|
490
|
+
f = [];
|
491
|
+
var n = 0,
|
492
|
+
r = [];
|
493
|
+
if (l) for (var j = 0, q = l.length; j < q; ++j) {
|
494
|
+
var m = l[j];
|
495
|
+
|
496
|
+
if (m.length > 1 && m.charAt(0) === "<") {
|
497
|
+
if (!ba.test(m)) if (ca.test(m)) {
|
498
|
+
f.push(m.substring(9, m.length - 3));
|
499
|
+
n += m.length - 12;
|
500
|
+
} else if (da.test(m)) {
|
501
|
+
f.push("\n");
|
502
|
+
++n;
|
503
|
+
} 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/)) {
|
504
|
+
var t = m.match(W)[2],
|
505
|
+
p = 1,
|
506
|
+
c;
|
507
|
+
c = j + 1;
|
508
|
+
|
509
|
+
a: for (; c < q; ++c) {
|
510
|
+
var d = l[c].match(W);
|
511
|
+
if (d && d[2] === t) if (d[1] === "/") {
|
512
|
+
if (--p === 0) break a;
|
513
|
+
} else ++p;
|
514
|
+
}
|
515
|
+
|
516
|
+
if (c < q) {
|
517
|
+
r.push(n, l.slice(j, c + 1).join(""));
|
518
|
+
j = c;
|
519
|
+
} else r.push(n, m);
|
520
|
+
} else r.push(n, m);
|
521
|
+
} else {
|
522
|
+
var a;
|
523
|
+
p = m;
|
524
|
+
var k = p.indexOf("&");
|
525
|
+
if (k < 0) a = p;else {
|
526
|
+
for (--k; (k = p.indexOf("&#", k + 1)) >= 0;) {
|
527
|
+
var e = p.indexOf(";", k);
|
528
|
+
|
529
|
+
if (e >= 0) {
|
530
|
+
var h = p.substring(k + 3, e),
|
531
|
+
g = 10;
|
532
|
+
|
533
|
+
if (h && h.charAt(0) === "x") {
|
534
|
+
h = h.substring(1);
|
535
|
+
g = 16;
|
536
|
+
}
|
537
|
+
|
538
|
+
var s = parseInt(h, g);
|
539
|
+
isNaN(s) || (p = p.substring(0, k) + String.fromCharCode(s) + p.substring(e + 1));
|
540
|
+
}
|
541
|
+
}
|
542
|
+
|
543
|
+
a = p.replace(ea, "<").replace(fa, ">").replace(ga, "'").replace(ha, '"').replace(ia, " ").replace(ja, "&");
|
544
|
+
}
|
545
|
+
f.push(a);
|
546
|
+
n += a.length;
|
547
|
+
}
|
548
|
+
}
|
549
|
+
o = {
|
550
|
+
source: f.join(""),
|
551
|
+
h: r
|
552
|
+
};
|
553
|
+
var v = o.source;
|
554
|
+
b.source = v;
|
555
|
+
b.c = 0;
|
556
|
+
b.g = o.h;
|
557
|
+
Q(i, v)(b);
|
558
|
+
$(b);
|
559
|
+
} catch (w) {
|
560
|
+
if ("console" in window) console.log(w && w.stack ? w.stack : w);
|
561
|
+
}
|
562
|
+
}
|
563
|
+
|
564
|
+
var A = "str",
|
565
|
+
R = "kwd",
|
566
|
+
C = "com",
|
567
|
+
S = "typ",
|
568
|
+
J = "lit",
|
569
|
+
E = "pun",
|
570
|
+
z = "pln",
|
571
|
+
P = "src",
|
572
|
+
V = "nocode",
|
573
|
+
Z = function () {
|
574
|
+
for (var b = ["!", "!=", "!==", "#", "%", "%=", "&", "&&", "&&=", "&=", "(", "*", "*=", "+=", ",", "-=", "->", "/", "/=", ":", "::", ";", "<", "<<", "<<=", "<=", "=", "==", "===", ">", ">=", ">>", ">>=", ">>>", ">>>=", "?", "@", "[", "^", "^=", "^^", "^^=", "{", "|", "|=", "||", "||=", "~", "break", "case", "continue", "delete", "do", "else", "finally", "instanceof", "return", "throw", "try", "typeof"], f = "(?:^^|[+-]", i = 0; i < b.length; ++i) {
|
575
|
+
f += "|" + b[i].replace(/([^=<>:&a-z])/g, "\\$1");
|
576
|
+
}
|
577
|
+
|
578
|
+
f += ")\\s*";
|
579
|
+
return f;
|
580
|
+
}(),
|
581
|
+
L = /&/g,
|
582
|
+
M = /</g,
|
583
|
+
N = />/g,
|
584
|
+
X = /\"/g,
|
585
|
+
ea = /</g,
|
586
|
+
fa = />/g,
|
587
|
+
ga = /'/g,
|
588
|
+
ha = /"/g,
|
589
|
+
ja = /&/g,
|
590
|
+
ia = / /g,
|
591
|
+
ka = /[\r\n]/g,
|
592
|
+
K = null,
|
593
|
+
aa = RegExp("[^<]+|<!--[\\s\\S]*?-->|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>|</?[a-zA-Z](?:[^>\"']|'[^']*'|\"[^\"]*\")*>|<", "g"),
|
594
|
+
ba = /^<\!--/,
|
595
|
+
ca = /^<!\[CDATA\[/,
|
596
|
+
da = /^<br\b/i,
|
597
|
+
W = /^<(\/?)([a-zA-Z][a-zA-Z0-9]*)/,
|
598
|
+
la = x({
|
599
|
+
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 ",
|
600
|
+
hashComments: true,
|
601
|
+
cStyleComments: true,
|
602
|
+
multiLineStrings: true,
|
603
|
+
regexLiterals: true
|
604
|
+
}),
|
605
|
+
G = {};
|
606
|
+
|
607
|
+
u(la, ["default-code"]);
|
608
|
+
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"]);
|
609
|
+
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"]);
|
610
|
+
u(B([], [["atv", /^[\s\S]+/]]), ["uq.val"]);
|
611
|
+
u(x({
|
612
|
+
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 ",
|
613
|
+
hashComments: true,
|
614
|
+
cStyleComments: true
|
615
|
+
}), ["c", "cc", "cpp", "cxx", "cyc", "m"]);
|
616
|
+
u(x({
|
617
|
+
keywords: "null true false"
|
618
|
+
}), ["json"]);
|
619
|
+
u(x({
|
620
|
+
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 ",
|
621
|
+
hashComments: true,
|
622
|
+
cStyleComments: true,
|
623
|
+
verbatimStrings: true
|
624
|
+
}), ["cs"]);
|
625
|
+
u(x({
|
626
|
+
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 ",
|
627
|
+
cStyleComments: true
|
628
|
+
}), ["java"]);
|
629
|
+
u(x({
|
630
|
+
keywords: "break continue do else for if return while case done elif esac eval fi function in local set then until ",
|
631
|
+
hashComments: true,
|
632
|
+
multiLineStrings: true
|
633
|
+
}), ["bsh", "csh", "sh"]);
|
634
|
+
u(x({
|
635
|
+
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 ",
|
636
|
+
hashComments: true,
|
637
|
+
multiLineStrings: true,
|
638
|
+
tripleQuotedStrings: true
|
639
|
+
}), ["cv", "py"]);
|
640
|
+
u(x({
|
641
|
+
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 ",
|
642
|
+
hashComments: true,
|
643
|
+
multiLineStrings: true,
|
644
|
+
regexLiterals: true
|
645
|
+
}), ["perl", "pl", "pm"]);
|
646
|
+
u(x({
|
647
|
+
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 ",
|
648
|
+
hashComments: true,
|
649
|
+
multiLineStrings: true,
|
650
|
+
regexLiterals: true
|
651
|
+
}), ["rb"]);
|
652
|
+
u(x({
|
653
|
+
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 ",
|
654
|
+
cStyleComments: true,
|
655
|
+
regexLiterals: true
|
656
|
+
}), ["js"]);
|
657
|
+
u(B([], [[A, /^[\s\S]+/]]), ["regex"]);
|
658
|
+
window.PR_normalizedHtml = H;
|
659
|
+
|
660
|
+
window.prettyPrintOne = function (b, f) {
|
661
|
+
var i = {
|
662
|
+
f: b,
|
663
|
+
e: f
|
664
|
+
};
|
665
|
+
U(i);
|
666
|
+
return i.a;
|
667
|
+
};
|
668
|
+
|
669
|
+
window.prettyPrint = function (b) {
|
670
|
+
function f() {
|
671
|
+
for (var t = window.PR_SHOULD_USE_CONTINUATION ? j.now() + 250 : Infinity; q < o.length && j.now() < t; q++) {
|
672
|
+
var p = o[q];
|
673
|
+
|
674
|
+
if (p.className && p.className.indexOf("prettyprint") >= 0) {
|
675
|
+
var c = p.className.match(/\blang-(\w+)\b/);
|
676
|
+
if (c) c = c[1];
|
677
|
+
|
678
|
+
for (var d = false, a = p.parentNode; a; a = a.parentNode) {
|
679
|
+
if ((a.tagName === "pre" || a.tagName === "code" || a.tagName === "xmp") && a.className && a.className.indexOf("prettyprint") >= 0) {
|
680
|
+
d = true;
|
681
|
+
break;
|
682
|
+
}
|
683
|
+
}
|
684
|
+
|
685
|
+
if (!d) {
|
686
|
+
a = p;
|
687
|
+
|
688
|
+
if (null === K) {
|
689
|
+
d = document.createElement("PRE");
|
690
|
+
d.appendChild(document.createTextNode('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />'));
|
691
|
+
K = !/</.test(d.innerHTML);
|
692
|
+
}
|
693
|
+
|
694
|
+
if (K) {
|
695
|
+
d = a.innerHTML;
|
696
|
+
if ("XMP" === a.tagName) d = y(d);else {
|
697
|
+
a = a;
|
698
|
+
if ("PRE" === a.tagName) a = true;else if (ka.test(d)) {
|
699
|
+
var k = "";
|
700
|
+
if (a.currentStyle) k = a.currentStyle.whiteSpace;else if (window.getComputedStyle) k = window.getComputedStyle(a, null).whiteSpace;
|
701
|
+
a = !k || k === "pre";
|
702
|
+
} else a = true;
|
703
|
+
a || (d = d.replace(/(<br\s*\/?>)[\r\n]+/g, "$1").replace(/(?:[\r\n]+[ \t]*)+/g, " "));
|
704
|
+
}
|
705
|
+
d = d;
|
706
|
+
} else {
|
707
|
+
d = [];
|
708
|
+
|
709
|
+
for (a = a.firstChild; a; a = a.nextSibling) {
|
710
|
+
H(a, d);
|
711
|
+
}
|
712
|
+
|
713
|
+
d = d.join("");
|
714
|
+
}
|
715
|
+
|
716
|
+
d = d.replace(/(?:\r\n?|\n)$/, "");
|
717
|
+
m = {
|
718
|
+
f: d,
|
719
|
+
e: c,
|
720
|
+
b: p
|
721
|
+
};
|
722
|
+
U(m);
|
723
|
+
|
724
|
+
if (p = m.a) {
|
725
|
+
c = m.b;
|
726
|
+
|
727
|
+
if ("XMP" === c.tagName) {
|
728
|
+
d = document.createElement("PRE");
|
729
|
+
|
730
|
+
for (a = 0; a < c.attributes.length; ++a) {
|
731
|
+
k = c.attributes[a];
|
732
|
+
if (k.specified) if (k.name.toLowerCase() === "class") d.className = k.value;else d.setAttribute(k.name, k.value);
|
733
|
+
}
|
734
|
+
|
735
|
+
d.innerHTML = p;
|
736
|
+
c.parentNode.replaceChild(d, c);
|
737
|
+
} else c.innerHTML = p;
|
738
|
+
}
|
739
|
+
}
|
740
|
+
}
|
741
|
+
}
|
742
|
+
|
743
|
+
if (q < o.length) setTimeout(f, 250);else b && b();
|
744
|
+
}
|
745
|
+
|
746
|
+
for (var i = [document.getElementsByTagName("pre"), document.getElementsByTagName("code"), document.getElementsByTagName("xmp")], o = [], l = 0; l < i.length; ++l) {
|
747
|
+
for (var n = 0, r = i[l].length; n < r; ++n) {
|
748
|
+
o.push(i[l][n]);
|
749
|
+
}
|
750
|
+
}
|
751
|
+
|
752
|
+
i = null;
|
753
|
+
var j = Date;
|
754
|
+
j.now || (j = {
|
755
|
+
now: function now() {
|
756
|
+
return new Date().getTime();
|
757
|
+
}
|
758
|
+
});
|
759
|
+
var q = 0,
|
760
|
+
m;
|
761
|
+
f();
|
762
|
+
};
|
763
|
+
|
764
|
+
window.PR = {
|
765
|
+
combinePrefixPatterns: O,
|
766
|
+
createSimpleLexer: B,
|
767
|
+
registerLangHandler: u,
|
768
|
+
sourceDecorator: x,
|
769
|
+
PR_ATTRIB_NAME: "atn",
|
770
|
+
PR_ATTRIB_VALUE: "atv",
|
771
|
+
PR_COMMENT: C,
|
772
|
+
PR_DECLARATION: "dec",
|
773
|
+
PR_KEYWORD: R,
|
774
|
+
PR_LITERAL: J,
|
775
|
+
PR_NOCODE: V,
|
776
|
+
PR_PLAIN: z,
|
777
|
+
PR_PUNCTUATION: E,
|
778
|
+
PR_SOURCE: P,
|
779
|
+
PR_STRING: A,
|
780
|
+
PR_TAG: "tag",
|
781
|
+
PR_TYPE: S
|
782
|
+
};
|
783
|
+
})(); // prettier-ignore
|
784
|
+
// lang-sql.js
|
785
|
+
// http://code.google.com/p/google-code-prettify/
|
786
|
+
|
787
|
+
PR.registerLangHandler(
|
788
|
+
PR.createSimpleLexer(
|
789
|
+
[
|
790
|
+
["pln", /^[\t\n\r \xA0]+/, null, "\t\n\r \xA0"],
|
791
|
+
["str", /^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/, null, "\"'"]
|
792
|
+
],
|
793
|
+
[
|
794
|
+
["com", /^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/],
|
795
|
+
[
|
796
|
+
"kwd",
|
797
|
+
/^(?: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,
|
798
|
+
null
|
799
|
+
],
|
800
|
+
[
|
801
|
+
"lit",
|
802
|
+
/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i
|
803
|
+
],
|
804
|
+
["pln", /^[a-z_][\w-]*/i],
|
805
|
+
["pun", /^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0+\-\"\']*/]
|
806
|
+
]
|
807
|
+
),
|
808
|
+
["sql"]
|
809
|
+
);
|
810
|
+
}
|