language_template.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Monkey2 Language Reference</title>
  6. <link rel="stylesheet" href="style.css">
  7. <link rel="stylesheet" href="jstree/dist/themes/default/style.min.css" />
  8. <script src="jstree/dist/libs/jquery-1.9.1.min.js"></script>
  9. <script src="jstree/dist/jstree.min.js"></script>
  10. <script>
  11. window.onload=function(){
  12. document.getElementById( 'docs' ).src="The Monkey2 Language.html";
  13. }
  14. function scrollToTopic( id ){
  15. var childWindow=document.getElementById( 'docs' ).contentWindow;
  16. childWindow.scrollTo( 0,childWindow.document.getElementById( id ).offsetTop-16 );
  17. }
  18. </script>
  19. </head>
  20. <body class="page_body">
  21. <div class="modules_content">
  22. <!-- CONTENT -->
  23. <div class="modules_nav_wrapper">
  24. <form role="search"><input type="text" id="search" placeholder="Topic search" style="width:100%;" /></form>
  25. <div id="tree" class="modules_nav_tree"></div>
  26. </div>
  27. <div class="modules_docs_wrapper">
  28. <iframe id="docs" class="modules_docs_iframe"></iframe>
  29. </div>
  30. <script>
  31. jQuery( function($){
  32. $('#tree').jstree( {
  33. 'core':{
  34. 'multiple' : false,
  35. 'animation' : false,
  36. 'themes':{
  37. 'dots' : false,
  38. 'icons' : false,
  39. 'stripes' : false
  40. },
  41. 'data':[ ${LANG_NAV} ]
  42. },
  43. 'plugins':[ 'search' ]
  44. });
  45. $('#tree').on( 'changed.jstree',function( e,data ){
  46. var node=data.instance.get_node( data.selected[0] );
  47. if( !node || !node.data ) return;
  48. var topic=node.data.topic;
  49. if( !topic ) return;
  50. scrollToTopic( topic );
  51. } );
  52. var to=false;
  53. $('#search').keyup( function(){
  54. if( to ) { clearTimeout( to ); }
  55. to = setTimeout( function(){
  56. var v = $('#search').val();
  57. $('#tree').jstree( true ).search( v );
  58. },250 );
  59. });
  60. } );
  61. </script>
  62. <!-- END -->
  63. </div>
  64. </body>
  65. </html>