index.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>i12bretro Tutorials</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  7. <script type="text/javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
  8. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  9. <style>
  10. table { width: 65%; max-width: 950px; }
  11. tr { line-height: 24px; }
  12. tbody tr td { vertical-align: bottom; }
  13. .dataTables_filter { position: absolute; top: 50px; right: 100px; z-index: 100; }
  14. </style>
  15. </head>
  16. <body>
  17. <div id="gridContainer">
  18. <div class="topMargin"></div>
  19. <div id="listName" class="topMargin">
  20. <h1>i12bretro Tutorials</h1>
  21. </div>
  22. <div></div>
  23. <div id="content">
  24. <table border="0" cellspacing="2" cellpadding="2" align="center">
  25. <thead>
  26. <tr><th width="80">ID</th><th>Title</th><th width="175">Last Modified</th></tr>
  27. </thead>
  28. <tbody id="tutorialList">
  29. </tbody>
  30. </table>
  31. </div>
  32. </div>
  33. </body>
  34. <script>
  35. $.ajax({ type:'GET', url: 'https://api.allorigins.win/raw?url='+ encodeURIComponent('https://github.com/i12bretro/tutorials/file-list/main'), success: function(html){
  36. m = null;
  37. console.log(html);
  38. regex = /<div role="rowheader".*?>.*?<a.*?href="\/i12bretro\/tutorials\/commit\/(.*?)">(\d{4}): (.*?)<\/a>.*?<time-ago.*?>(.*?)<\/time-ago>/gmsi
  39. while ( (m = regex.exec( html )) != null ){
  40. $('#tutorialList').append('<tr><td align="center">'+ m[2] +'</td><td align="left"><a href="https://i12bretro.github.io/tutorials/'+ m[2] +'.html" target="_blank">'+ m[3] +'</a></td><td align="center">'+ m[4] +'</td></tr>');
  41. }
  42. initTable();
  43. }
  44. });
  45. function initTable(){
  46. $('table').DataTable({'paging': false });
  47. }
  48. </script>
  49. </html>