File tree Expand file tree Collapse file tree 3 files changed +2440
-0
lines changed Expand file tree Collapse file tree 3 files changed +2440
-0
lines changed Original file line number Diff line number Diff line change 9
9
< script src ="codemirror/markdown/markdown.js "> </ script >
10
10
< script src ="codemirror/gfm/gfm.js "> </ script >
11
11
< script src ="codemirror/javascript/javascript.js "> </ script >
12
+ < script src ="rawinflate.js "> </ script >
13
+ < script src ="rawdeflate.js "> </ script >
12
14
< link rel ="stylesheet " href ="codemirror/lib/codemirror.css ">
13
15
< link rel ="stylesheet " href ="default.css ">
14
16
< style >
81
83
c . className += ' ' + ( c . getAttribute ( 'language' ) || 'no-highlight' ) ;
82
84
hljs . highlightBlock ( c ) ;
83
85
}
86
+
87
+ clearTimeout ( hashto ) ;
88
+ hashto = setTimeout ( updateHash , 1000 ) ;
84
89
}
85
90
86
91
var SD = new Showdown . converter ( ) ;
137
142
}
138
143
} )
139
144
145
+ var hashto ;
146
+
147
+ function updateHash ( ) {
148
+ window . location . hash = btoa ( RawDeflate . deflate ( editor . getValue ( ) ) ) ;
149
+ }
150
+
151
+ if ( window . location . hash ) {
152
+ editor . setValue ( RawDeflate . inflate ( atob ( window . location . hash . replace ( / ^ # / , '' ) ) ) ) ;
153
+ }
154
+
155
+
140
156
update ( editor ) ;
141
157
142
158
editor . focus ( ) ;
You can’t perform that action at this time.
0 commit comments