Rust reimplementation of Angry.Im
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

code.html 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>Angry.Im - Paste</title>
  8. <!-- Bootstrap -->
  9. <link href="https://cdn.css.net/files/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet">
  10. <!-- Hightlight.js -->
  11. <link href="https://cdn.css.net/files/highlight.js/9.9.0/styles/zenburn.min.css" rel="stylesheet">
  12. <style>
  13. pre {
  14. border-radius: 5px;
  15. font-size: 1em;
  16. }
  17. </style>
  18. </head>
  19. <body>
  20. <div class="container">
  21. <div class="card card-outline-info text-center">
  22. <div class="card-block">
  23. <pre class="text-left"><code id="code">{{code}}</code></pre>
  24. </div>
  25. </div>
  26. </div>
  27. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  28. <script src="https://cdn.css.net/files/jquery/1.12.4/jquery.min.js"></script>
  29. <!-- Include all compiled plugins (below), or include individual files as needed -->
  30. <script src="https://cdn.css.net/files/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
  31. <!-- Hightlight.js -->
  32. <script src="https://cdn.css.net/files/highlight.js/9.9.0/highlight.min.js"></script>
  33. <script>
  34. var code = ""
  35. $(document).ready(function() {
  36. code = $("#code").text()
  37. var lang = getParameterByName('lang')
  38. if (lang != null && lang != "") {
  39. toggleLanguage(lang)
  40. } else {
  41. hljs.initHighlighting()
  42. }
  43. })
  44. function getParameterByName(name, url) {
  45. if (!url) {
  46. url = window.location.href;
  47. }
  48. name = name.replace(/[\[\]]/g, "\\$&");
  49. var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
  50. results = regex.exec(url);
  51. if (!results) return null;
  52. if (!results[2]) return '';
  53. return decodeURIComponent(results[2].replace(/\+/g, " "));
  54. }
  55. function toggleLanguage(lang) {
  56. $('#code').removeClass()
  57. $('#code').addClass(lang)
  58. $('#code').text(code)
  59. // Add language
  60. $.getScript('https://cdn.css.net/files/highlight.js/9.9.0/languages/' + lang + '.min.js', function () {
  61. hljs.initHighlighting()
  62. })
  63. }
  64. </script>
  65. </body>
  66. </html>