1111 < link rel ="apple-touch-icon " sizes ="144x144 " href ="resources/images/codelf_logo.png ">
1212 < link rel ="apple-touch-icon-precomposed " href ="resources/images/codelf_logo.png ">
1313 < link rel ="stylesheet " href ="resources/css/bootstrap.min.css ">
14- < link rel ="stylesheet " href ="resources/css/highlight.min.css ">
1514 < style >
15+ /*google prettify*/
16+ . pln { color : # 000} @media screen{ . str { color : # 080} . kwd { color : # 008} . com { color : # 800} . typ { color : # 606} . lit { color : # 066} . pun , . opn , . clo { color : # 660} . tag { color : # 008} . atn { color : # 606} . atv { color : # 080} . dec , . var { color : # 606} . fun { color : red} } @media print, projection{ . str { color : # 060} . kwd { color : # 006; font-weight : bold} . com { color : # 600; font-style : italic} . typ { color : # 404; font-weight : bold} . lit { color : # 044} . pun , . opn , . clo { color : # 440} . tag { color : # 006; font-weight : bold} . atn { color : # 404} . atv { color : # 060} } pre . prettyprint { padding : 2px ; border : 1px solid # 888} ol . linenums { margin-top : 0 ; margin-bottom : 0 } li . L0 , li . L1 , li . L2 , li . L3 , li . L5 , li . L6 , li . L7 , li . L8 { list-style-type : none} li . L1 , li . L3 , li . L5 , li . L7 , li . L9 { background : # eee}
17+ /*end google prettify*/
18+
1619 html , body {
1720 -webkit-font-smoothing : antialiased;
1821 }
208211 overflow : scroll;
209212 -webkit-overflow-scrolling : touch;
210213 }
214+ . sourcecode-modal code {
215+ display : inline-block;
216+ }
211217 . variable-btns > . variable-btns__copy {
212218 display : none;
213219 }
@@ -335,17 +341,19 @@ <h5 class="variable-wrap" data-id="{id}" data-repo="{repo}" data-url="{url}" dat
335341 < a target ="_blank "> Repo</ a >
336342 </ div >
337343 < div class ="modal-body ">
338- < pre > < code > </ code > </ pre >
344+ < script type ="text/html ">
345+ < pre > < code class = "prettyprint linenums" > { code} < / c o d e > < / pre>
346+ </ script >
339347 </ div >
340348 </ div >
341349 </ div >
342350</ div >
343351< script type ="text/html " template ="variableMenu ">
344352 < div class = "btn-group-vertical variable-btns" role = "group" >
345- < button type = "button" class = "btn btn-secondary" > < a href = "{repo}" target = "_blank" > Repo</ a > < / b u t t o n >
346353 < button type = "button" class = "btn btn-secondary" > < a href = "#{val}" > Search</ a > < / b u t t o n >
347- < button type = "button" class = "btn btn-secondary variable-btns__code" data - id = "{id}" > Codes < / b u t t o n >
354+ < button type = "button" class = "btn btn-secondary" > < a href = "{repo}" target = "_blank" > Repo </ a > < / b u t t o n >
348355 < button type = "button" class = "btn btn-secondary variable-btns__copy" data - clipboard - text = "{val}" > Copy < / b u t t o n >
356+ < button type = "button" class = "btn btn-secondary variable-btns__code" data - id = "{id}" > Codes < / b u t t o n >
349357 </div >
350358</ script >
351359<!-- http://tholman.com/github-corners/ -->
@@ -354,8 +362,8 @@ <h5 class="variable-wrap" data-id="{id}" data-repo="{repo}" data-url="{url}" dat
354362< script src ="src/lib/tether.min.js "> </ script >
355363< script src ="src/lib/jquery.min.js "> </ script >
356364< script src ="src/lib/bootstrap.min.js "> </ script >
357- < script src ="src/lib/ZeroClipboard.min.js "> </ script >
358- < script src ="src/lib/highlight.min. js "> </ script >
365+ < script src ="src/lib/ZeroClipboard.min.js " defer > </ script >
366+ < script src ="src/lib/prettify. js " defer > </ script >
359367< script >
360368 $ ( function ( ) {
361369 //utils
@@ -622,7 +630,8 @@ <h5 class="variable-wrap" data-id="{id}" data-repo="{repo}" data-url="{url}" dat
622630 variableMenuTpl : $ ( 'script[template="variableMenu"]' ) . html ( ) ,
623631
624632 sourceCodeModal : $ ( '.sourcecode-modal' ) ,
625- sourceCodeContent : $ ( '.sourcecode-modal pre code' ) ,
633+ sourceCodeContent : $ ( '.sourcecode-modal .modal-body' ) ,
634+ sourceCodeContentTpl : $ ( '.sourcecode-modal .modal-body script' ) . html ( ) ,
626635
627636 githubCorner : $ ( '.github-corner svg' ) ,
628637
@@ -799,9 +808,6 @@ <h5 class="variable-wrap" data-id="{id}" data-repo="{repo}" data-url="{url}" dat
799808 }
800809 function renderGithubCorner ( ) {
801810 els . githubCorner . css ( { fill : randomColor ( ) } ) ;
802- setTimeout ( function ( ) {
803- hljs . highlightBlock ( els . sourceCodeContent [ 0 ] ) ;
804- } , 300 ) ;
805811 }
806812
807813 function renderSearchResult ( data , page ) {
@@ -895,9 +901,9 @@ <h5 class="variable-wrap" data-id="{id}" data-repo="{repo}" data-url="{url}" dat
895901
896902 function renderSourceCode ( data ) {
897903 if ( data ) {
898- els . sourceCodeContent . text ( data . code ) ;
904+ els . sourceCodeContent . html ( els . sourceCodeContentTpl . replace ( '{code}' , data . code ) ) ;
899905 setTimeout ( function ( ) {
900- hljs . highlightBlock ( els . sourceCodeContent [ 0 ] ) ;
906+ PR . prettyPrint ( ) ;
901907 } , 100 ) ;
902908 }
903909 }
0 commit comments