|
@@ -18,9 +18,8 @@ else:
|
18
|
18
|
<link type="text/css" rel="stylesheet" href="css/print.css" media="print" />
|
19
|
19
|
<link type="text/css" rel="stylesheet" href="css/gh-fork-ribbon.css" />
|
20
|
20
|
<link type="text/css" rel="stylesheet" href="css/lightgallery.min.css" />
|
21
|
|
- <script type="text/javascript" src="js/sh_main.js"></script>
|
22
|
21
|
</head>
|
23
|
|
-<body onload="sh_highlightDocument('/js/sh/', '.min.js');">
|
|
22
|
+<body onload="loadPage()">
|
24
|
23
|
<!--%
|
25
|
24
|
link = ""
|
26
|
25
|
|
|
@@ -145,6 +144,33 @@ else:
|
145
|
144
|
·
|
146
|
145
|
<a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_send-money&nav=1&email=xythobuz@me.com">PayPal</a>
|
147
|
146
|
</div>
|
|
147
|
+ <script type="text/javascript">
|
|
148
|
+ function loadPage() {
|
|
149
|
+ // adapted from https://sourceforge.net/p/shjs/feature-requests/5/#0940
|
|
150
|
+ $("pre[class^='sh_']").each(function() {
|
|
151
|
+ // wrap pre with div._sh
|
|
152
|
+ $('<div class="_sh"><div class="_sh_lines"></div></div>').insertBefore($(this));
|
|
153
|
+ $(this).appendTo($(this).prev('._sh'));
|
|
154
|
+
|
|
155
|
+ // split content of pre with linebreaks so we can get total line number
|
|
156
|
+ var content = $.trim($(this).html());
|
|
157
|
+ var lines = content.split('\n');
|
|
158
|
+
|
|
159
|
+ // append line number to span._sh_lines
|
|
160
|
+ for(var line = 1; line < lines.length + 1; line++) {
|
|
161
|
+ $(this).prev('._sh_lines').append('<span data-line="' + line + '">' + line + '</span>');
|
|
162
|
+ }
|
|
163
|
+ });
|
|
164
|
+ $("pre:not([class^='sh_']):not([class='ascii'])").each(function() {
|
|
165
|
+ // wrap pre with div._sh
|
|
166
|
+ $('<div class="_sh"></div>').insertBefore($(this));
|
|
167
|
+ $(this).appendTo($(this).prev('._sh'));
|
|
168
|
+ });
|
|
169
|
+
|
|
170
|
+ sh_highlightDocument('/js/sh/', '.min.js');
|
|
171
|
+ }
|
|
172
|
+ </script>
|
|
173
|
+ <script type="text/javascript" src="js/sh_main.js"></script>
|
148
|
174
|
<script type="text/javascript" src="js/jquery.min.js"></script>
|
149
|
175
|
<!--%
|
150
|
176
|
if page.get("comments", "false") == "true":
|