File tree 2 files changed +27
-1
lines changed
2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 72
72
if ( window . localStorage ) {
73
73
localStorage . setItem ( 'phpCode' , editor . getSession ( ) . getValue ( ) ) ;
74
74
}
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
+ } ;
75
88
76
89
// eval server-side
77
90
$ . post ( '?js=1' , { code : editor . getSession ( ) . getValue ( ) } , function ( res ) {
78
91
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 ) ;
80
97
} else {
81
98
$ ( 'div.output' ) . html ( res + "<br /><br /><em>Script ended unexpectedly.</em>" ) ;
82
99
}
Original file line number Diff line number Diff line change 94
94
}
95
95
.footer a {
96
96
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 ;
97
106
}
You can’t perform that action at this time.
0 commit comments