File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change 2626 < meta name ="google-site-verification " content ="qSnbeMPNVgZ3kIpGVsPIAPIvEdwYSg583kPdwgJtFO8 " />
2727 < meta name ="yandex-verification " content ="315535a6d9f1c0bd " />
2828 < script >
29- function sleep ( time ) {
30- return new Promise ( ( resolve ) => setTimeout ( resolve , time ) ) ;
31- }
32-
3329 $ ( document ) . ready ( function ( ) {
3430 $ ( "#previewBtn" ) . click ( function ( ) {
3531 var markdown = $ ( "#markdownInput" ) . val ( ) ;
3632 var URL = "https://us-central1-cp-algorithms.cloudfunctions.net/convert-markdown" ;
3733 var data = { "markdown" : markdown } ;
34+ var refresh_script = `<scr` + `ipt>MathJax.Hub.Queue(["Typeset", MathJax.Hub]);</scr` + `ipt>` ;
3835 $ . ajax ( {
3936 url : URL ,
4037 contentType : "application/json" ,
4138 method : 'POST' ,
4239 data : JSON . stringify ( data ) ,
43- success : function ( data ) { $ ( "#previewArea" ) . html ( data ) ; }
44- } ) ;
45- sleep ( 500 ) . then ( ( ) => {
46- MathJax . Hub . Queue ( [ "Typeset" , MathJax . Hub ] ) ;
40+ success : function ( data ) { $ ( "#previewArea" ) . html ( data + "\n" + refresh_script ) ; }
4741 } ) ;
4842 } ) ;
4943 } ) ;
6054 </ span >
6155 </ div >
6256
63- < h1 > Preview:</ h1 >
57+ < center >
58+ < h1 > Test your page in Markdown format</ h1 >
6459
6560< form >
66- < textarea id ="markdownInput " rows ="8 " cols ="80 "> </ textarea >
61+ < textarea style ="width:90%;height:400px; " id ="markdownInput " placeholder ="paste your text here... "> </ textarea >
62+ < br />
6763 < br />
6864 < button type ='button ' id ="previewBtn "> Preview</ button >
6965</ form >
66+ </ center >
7067< br />
7168< hr />
7269
Original file line number Diff line number Diff line change @@ -228,4 +228,4 @@ and adding new articles to the collection.*
228228
229229---
230230
231- [ Information for contributors] ( ./contrib.html ) and [ Test-Your-Page form] ( ./test.php )
231+ [ Information for contributors] ( ./contrib.html ) and [ Test-Your-Page form] ( ./preview.html )
You can’t perform that action at this time.
0 commit comments