index.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <title>Depender - A MooTools Dependency Builder</title>
  5. <link rel="stylesheet" href="../../styles/depender.css" type="text/css" media="screen" title="no title" charset="utf-8">
  6. <style>
  7. h1 {
  8. margin: 0;
  9. }
  10. body {
  11. padding: 30px 0px;
  12. }
  13. #bod {
  14. margin: 0px 20px;
  15. }
  16. </style>
  17. <script src="../../showdown.js" type="text/javascript" charset="utf-8"></script>
  18. <script>
  19. function get(url, callback) {
  20. var xmlHttpReq = false;
  21. var self = this;
  22. // Mozilla/Safari
  23. if (window.XMLHttpRequest) {
  24. self.xmlHttpReq = new XMLHttpRequest();
  25. }
  26. // IE
  27. else if (window.ActiveXObject) {
  28. self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
  29. }
  30. self.xmlHttpReq.open('GET', url, true);
  31. self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  32. self.xmlHttpReq.onreadystatechange = function() {
  33. if (self.xmlHttpReq.readyState == 4) {
  34. callback(self.xmlHttpReq.responseText);
  35. }
  36. };
  37. self.xmlHttpReq.send();
  38. };
  39. window.onload = function(){
  40. get('Depender.Client.md', function(text){
  41. var converter = new Showdown.converter();
  42. var html = converter.makeHtml(text);
  43. html = html.replace(/\\?\{\#([^{}]+)\}/g, '')
  44. document.getElementById('bod').innerHTML = html;
  45. });
  46. };
  47. </script>
  48. </head>
  49. <body>
  50. <div id="bod">
  51. </div>
  52. </body>
  53. </html>