Benoît Hubert пре 8 година
родитељ
комит
149e592d52
3 измењених фајлова са 36 додато и 0 уклоњено
  1. 3 0
      .gitmodules
  2. 1 0
      ace
  3. 32 0
      editor.html

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
+[submodule "ace"]
+	path = ace
+	url = git://github.com/ajaxorg/ace.git

+ 1 - 0
ace

@@ -0,0 +1 @@
+Subproject commit 243cb467fce7ebee0dd98691bd9d472a861fda8e

+ 32 - 0
editor.html

@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<title>ACE in Action</title>
+<style type="text/css" media="screen">
+    #editor { 
+        position: absolute;
+        top: 0;
+        right: 50%;
+        bottom: 0;
+        left: 0;
+    }
+</style>
+</head>
+<body>
+
+<div id="editor">function foo(items) {
+    var x = "All this is syntax highlighted";
+    return x;
+}</div>
+    
+<script src="ace/build/src/ace.js" type="text/javascript" charset="utf-8"></script>
+<script>
+    var editor = ace.edit("editor");
+    editor.setTheme("ace/theme/eclipse");
+    editor.getSession().setMode("ace/mode/javascript");
+    editor.getSession().on('change', function() {
+    console.log(arguments)
+    });
+</script>
+</body>
+</html>