File tree 5 files changed +51
-31
lines changed
5 files changed +51
-31
lines changed Original file line number Diff line number Diff line change 1
1
/*global document, global*/
2
2
3
- var args = JSON . parse ( document . getElementById ( "object" ) . value ) ,
3
+ var args = JSON . parse ( document . getElementById ( "object" ) . value ) ,
4
4
button = document . getElementById ( "button" ) ;
5
5
button . onclick = function ( ) {
6
6
"use strict" ;
7
7
args . source = document
8
8
. getElementById ( "input" )
9
9
. 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
+ }
15
21
} ;
Original file line number Diff line number Diff line change 15
15
< label for ="object " style ="display:block "> Options object</ label >
16
16
< textarea id ="object " style ="height:200px;white-space:pre;min-width:400px " data-prettydiff-ignore ="true "> {
17
17
"mode": "beautify",
18
- "lang": "auto"
18
+ "lang": "auto",
19
+ "wrap": 80
19
20
}</ textarea >
20
21
</ p >
21
22
< p >
Original file line number Diff line number Diff line change 8
8
< h1 > Pretty Diff, barebones example</ h1 >
9
9
< p > < a href ="documentation.xhtml "> documentation</ a > </ p >
10
10
< 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 >
13
13
</ p >
14
14
< 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 "> {
17
21
"mode": "beautify",
18
- "lang": "auto"
22
+ "lang": "auto",
23
+ "wrap": 80
19
24
}</ textarea >
20
25
</ p >
21
26
< p >
22
27
< 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 >
24
29
</ p >
25
30
< p > < button type ="button " id ="button "> Beautify Code</ button > </ p >
26
31
< script src ="barebones_requirejs.js " type ="application/javascript "> </ script >
Original file line number Diff line number Diff line change 1
- /*global module*/ var today = 20160811 ; module . exports = today ;
1
+ /*global module*/ ( function ( ) { "use strict" ; var today = 20170418 ; module . exports = today ; } ( ) ) ;
You can’t perform that action at this time.
0 commit comments