Skip to content

Commit f91bb60

Browse files
committed
js: Migrate code to not use deprecated 2.x features
1 parent 43b0624 commit f91bb60

File tree

6 files changed

+8
-19
lines changed

6 files changed

+8
-19
lines changed

dpl-docs/views/layout.dt

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,5 +244,5 @@ html(lang='en-US')
244244
script(type='text/javascript', src='#{root_dir}js/listanchors.js')
245245
script(type="text/javascript", src="#{root_dir}js/ddox.js")
246246
script(type='text/javascript').
247-
jQuery(document).ready(listanchors);
247+
jQuery(listanchors);
248248
setupDdox();

js/run.js

+3-14
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ All examples are replaced with custom form by default. You need to do additional
4242
your example to have default standard input or default standard arguments.
4343
*/
4444

45-
var nl2br = function()
46-
{
47-
return this.replace(/\n/g, "<br>");
48-
}
49-
5045
function safeVar(data, path)
5146
{
5247
var p = path.split(".");
@@ -150,10 +145,7 @@ function parseOutput(res, o, oTitle)
150145
if (res.cstatus != 0)
151146
{
152147
oTitle.text("Compilation output ("+res.cstatus+": "+res.cerr+")");
153-
if ($.browser.msie)
154-
o.html(nl2br(res.cout));
155-
else
156-
o.text(res.cout);
148+
o.text(res.cout);
157149

158150
return;
159151
}
@@ -172,10 +164,7 @@ function parseOutput(res, o, oTitle)
172164
oTitle.text("Application output ("+res.rstatus+": "+res.rerr+")");
173165
}
174166

175-
if ($.browser.msie)
176-
o.html(nl2br(res.cout));
177-
else
178-
o.text(output);
167+
o.text(output);
179168
}
180169

181170
// wraps a unittest into a runnable script
@@ -197,7 +186,7 @@ function wrapIntoMain(code, compile) {
197186
}
198187
}
199188

200-
$(document).ready(function()
189+
$(function()
201190
{
202191
setUpExamples();
203192

js/run_examples.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function wrapIntoMain(code) {
3737
return codeOut;
3838
}
3939

40-
$(document).ready(function()
40+
$(function()
4141
{
4242
if ($('body')[0].id == "Home")
4343
return;

js/show_contributors.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function isPackage()
1414
return $('.tip.smallprint a[href*="package.d"]').length > 0;
1515
}
1616

17-
$(document).ready(function()
17+
$(function()
1818
{
1919
// only for library documentation
2020
if (!$('body').hasClass("std"))

spec/spec.ddoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,5 @@ RAWHTML=$0
139139
_=
140140
LAYOUT_SUFFIX =
141141
$(SCRIPTLOAD ../js/listanchors.js)
142-
$(SCRIPT jQuery(document).ready(addVersionSelector);)
142+
$(SCRIPT jQuery(addVersionSelector);)
143143
_=

std.ddoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ BODY_PREFIX = $(DIVCID quickindex, quickindex, )
77
LAYOUT_SUFFIX =
88
$(SCRIPTLOAD ../js/listanchors.js)
99
$(SCRIPTLOAD ../js/show_contributors.js)
10-
$(SCRIPT jQuery(document).ready(listanchors);)
10+
$(SCRIPT jQuery(listanchors);)
1111
LAYOUT_TITLE=$(H1 $(D_TITLE $(TITLE)))
1212
_=
1313

0 commit comments

Comments
 (0)