Skip to content

Commit 0ebe099

Browse files
committed
updating barebones samples
1 parent 607199e commit 0ebe099

File tree

5 files changed

+51
-31
lines changed

5 files changed

+51
-31
lines changed

test/barebones/barebones.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
/*global document, global*/
22

3-
var args = JSON.parse(document.getElementById("object").value),
3+
var args = JSON.parse(document.getElementById("object").value),
44
button = document.getElementById("button");
55
button.onclick = function () {
66
"use strict";
77
args.source = document
88
.getElementById("input")
99
.value;
10-
document
11-
.getElementById("output")
12-
.value = global
13-
.prettydiff
14-
.prettydiff(args);
10+
if (args.mode === "parse") {
11+
document
12+
.getElementById("output")
13+
.value = JSON.stringify(global.prettydiff.prettydiff(args));
14+
} else {
15+
document
16+
.getElementById("output")
17+
.value = global
18+
.prettydiff
19+
.prettydiff(args);
20+
}
1521
};

test/barebones/barebones.xhtml

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
<label for="object" style="display:block">Options object</label>
1616
<textarea id="object" style="height:200px;white-space:pre;min-width:400px" data-prettydiff-ignore="true">{
1717
"mode": "beautify",
18-
"lang": "auto"
18+
"lang": "auto",
19+
"wrap": 80
1920
}</textarea>
2021
</p>
2122
<p>

test/barebones/barebones_requirejs.js

+25-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/barebones/barebones_requirejs.xhtml

+11-6
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,24 @@
88
<h1>Pretty Diff, barebones example</h1>
99
<p><a href="documentation.xhtml">documentation</a></p>
1010
<p>
11-
<label for="input" style="display:block">Input</label>
12-
<textarea id="input" style="height:200px;white-space:pre;min-width:400px">var a;function g(){return function y() {return q;};};</textarea>
11+
<label for="input" style="display:block">Source Sample</label>
12+
<textarea id="input" style="height:120px;white-space:pre;min-width:400px">var a;function g(){return function y() {return q;};};</textarea>
1313
</p>
1414
<p>
15-
<label for="object" style="display:block">Options object</label>
16-
<textarea id="object" style="height:200px;white-space:pre;min-width:400px" data-prettydiff-ignore="true">{
15+
<label for="diff" style="display:block">Diff Sample</label>
16+
<textarea id="diff" style="height:120px;white-space:pre;min-width:400px">var b;function h(){return function y() {return z;};};</textarea>
17+
</p>
18+
<p>
19+
<label for="object" style="display:block">Options Object</label>
20+
<textarea id="object" style="height:120px;white-space:pre;min-width:400px" data-prettydiff-ignore="true">{
1721
"mode": "beautify",
18-
"lang": "auto"
22+
"lang": "auto",
23+
"wrap": 80
1924
}</textarea>
2025
</p>
2126
<p>
2227
<label for="output" style="display:block">Output</label>
23-
<textarea id="output" style="height:200px;white-space:pre;min-width:400px"></textarea>
28+
<textarea id="output" style="height:120px;white-space:pre;min-width:400px"></textarea>
2429
</p>
2530
<p><button type="button" id="button">Beautify Code</button></p>
2631
<script src="barebones_requirejs.js" type="application/javascript"></script>

test/today.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/*global module*/var today=20160811;module.exports=today;
1+
/*global module*/(function () {"use strict";var today=20170418;module.exports=today;}());

0 commit comments

Comments
 (0)