File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 7272 if ( window . localStorage ) {
7373 localStorage . setItem ( 'phpCode' , editor . getSession ( ) . getValue ( ) ) ;
7474 }
75+
76+ var controlChars = {
77+ 'NUL' : / \x00 / g,
78+ 'SOH' : / \x01 / g,
79+ 'STX' : / \x02 / g,
80+ 'ETX' : / \x03 / g,
81+ 'EOT' : / \x04 / g,
82+ 'ENQ' : / \x05 / g,
83+ 'ACK' : / \x06 / g,
84+ 'BEL' : / \x07 / g,
85+ 'BS' : / \x08 / g,
86+ 'SUB' : / \x1A / g,
87+ } ;
7588
7689 // eval server-side
7790 $ . post ( '?js=1' , { code : editor . getSession ( ) . getValue ( ) } , function ( res ) {
7891 if ( res . match ( / # e n d - p h p - c o n s o l e - o u t p u t # $ / ) ) {
79- $ ( 'div.output' ) . html ( res . substring ( 0 , res . length - 24 ) ) ;
92+ var result = res . substring ( 0 , res . length - 24 ) ;
93+ for ( var k in controlChars ) {
94+ result = result . replace ( controlChars [ k ] , '<span class="control-char">' + k + '</span>' ) ;
95+ }
96+ $ ( 'div.output' ) . html ( result ) ;
8097 } else {
8198 $ ( 'div.output' ) . html ( res + "<br /><br /><em>Script ended unexpectedly.</em>" ) ;
8299 }
Original file line number Diff line number Diff line change 9494}
9595.footer a {
9696 color : # aaa ;
97+ }
98+
99+ .krumo-root .control-char {
100+ background : # 000 ;
101+ color : # fff ;
102+ margin-left : 2px ;
103+ margin-right : 2px ;
104+ -webkit-border-radius : 5px ;
105+ border-radius : 5px ;
97106}
You can’t perform that action at this time.
0 commit comments