code_editor.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>H+ 后台主题UI框架 - 代码编辑器</title>
  7. <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
  8. <meta name="description" content="H+是一个完全响应式,基于Bootstrap3最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术">
  9. <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.7" rel="stylesheet">
  10. <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
  11. <link href="css/animate.css" rel="stylesheet">
  12. <link href="css/plugins/codemirror/codemirror.css" rel="stylesheet">
  13. <link href="css/plugins/codemirror/ambiance.css" rel="stylesheet">
  14. <link href="css/style.css?v=4.1.0" rel="stylesheet">
  15. </head>
  16. <body class="gray-bg">
  17. <div class="wrapper wrapper-content animated fadeInRight">
  18. <div class="row">
  19. <div class="col-sm-6">
  20. <div class="ibox ">
  21. <div class="ibox-title">
  22. <h5>基本编辑器</h5>
  23. </div>
  24. <div class="ibox-content">
  25. <p class="m-b-lg">
  26. <strong>CodeMirror</strong> 是一个灵活的文本代码编辑器。它是专门用于编辑代码,并附带一些语言模块和插件,实现更先进的编辑功能。
  27. </p>
  28. <textarea id="code1">
  29. <script>
  30. // Code goes here
  31. // For demo purpose - animation css script
  32. function animationHover(element, animation) {
  33. element = $(element);
  34. element.hover(
  35. function () {
  36. element.addClass('animated ' + animation);
  37. },
  38. function () {
  39. //wait for animation to finish before removing classes
  40. window.setTimeout(function () {
  41. element.removeClass('animated ' + animation);
  42. }, 2000);
  43. });
  44. }
  45. </script>
  46. </textarea>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="col-sm-6">
  51. <div class="ibox ">
  52. <div class="ibox-title">
  53. <h5>主题示例</h5>
  54. </div>
  55. <div class="ibox-content">
  56. <p class="m-b-lg">
  57. <strong>CodeMirror</strong>提供丰富的API接口和CSS主题,详情请访问
  58. <a href="http://codemirror.net/" target="_blank">http://codemirror.net/</a>
  59. </p>
  60. <textarea id="code2">
  61. var SpeechApp = angular.module('SpeechApp', []);
  62. function VoiceCtrl($scope) {
  63. $scope.said='...';
  64. $scope.helloWorld = function() {
  65. $scope.said = "Hello world!";
  66. }
  67. $scope.commands = {
  68. 'hello (world)': function() {
  69. if (typeof console !== "undefined") console.log('hello world!')
  70. $scope.$apply($scope.helloWorld);
  71. },
  72. 'hey': function() {
  73. if (typeof console !== "undefined") console.log('hey!')
  74. $scope.$apply($scope.helloWorld);
  75. }
  76. };
  77. annyang.debug();
  78. annyang.init($scope.commands);
  79. annyang.start();
  80. }
  81. </textarea>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <!-- 全局js -->
  88. <script src="js/jquery.min.js?v=2.1.4"></script>
  89. <script src="js/bootstrap.min.js?v=3.3.7"></script>
  90. <!-- Peity -->
  91. <script src="js/plugins/peity/jquery.peity.min.js"></script>
  92. <!-- CodeMirror -->
  93. <script src="js/plugins/codemirror/codemirror.js"></script>
  94. <script src="js/plugins/codemirror/mode/javascript/javascript.js"></script>
  95. <!-- 自定义js -->
  96. <script src="js/content.js?v=1.0.0"></script>
  97. <script>
  98. $(document).ready(function () {
  99. var editor_one = CodeMirror.fromTextArea(document.getElementById("code1"), {
  100. lineNumbers: true,
  101. matchBrackets: true,
  102. styleActiveLine: true,
  103. theme: "ambiance"
  104. });
  105. var editor_two = CodeMirror.fromTextArea(document.getElementById("code2"), {
  106. lineNumbers: true,
  107. matchBrackets: true,
  108. styleActiveLine: true
  109. });
  110. });
  111. </script>
  112. <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
  113. <!--统计代码,可删除-->
  114. </body>
  115. </html>