aboutsummaryrefslogtreecommitdiffstats
path: root/infrastructure/ace/build/index.html
diff options
context:
space:
mode:
authorEgil Moeller <egil.moller@freecode.no>2010-03-22 00:16:53 +0100
committerEgil Moeller <egil.moller@freecode.no>2010-03-22 00:16:53 +0100
commitfc00cfedd6c25d1634a1e0d28a7b7bc5f42e1cd7 (patch)
tree928419d6bfe794865e4b8f0634bd792f795c4b8a /infrastructure/ace/build/index.html
parent0fdab3db005c4fa31fb8306b573c0b35073d3e56 (diff)
parentd56b9b3b82cdebcaeb00eec0fcb4326ad21adaa8 (diff)
downloadetherpad-fc00cfedd6c25d1634a1e0d28a7b7bc5f42e1cd7.tar.gz
etherpad-fc00cfedd6c25d1634a1e0d28a7b7bc5f42e1cd7.tar.xz
etherpad-fc00cfedd6c25d1634a1e0d28a7b7bc5f42e1cd7.zip
Merge branch 'master' into plugin-framework
Diffstat (limited to 'infrastructure/ace/build/index.html')
-rw-r--r--infrastructure/ace/build/index.html47
1 files changed, 47 insertions, 0 deletions
diff --git a/infrastructure/ace/build/index.html b/infrastructure/ace/build/index.html
new file mode 100644
index 0000000..b8c8505
--- /dev/null
+++ b/infrastructure/ace/build/index.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+ <head>
+ <title>A Code Editor</title>
+ <script src="jquery-1.2.1.js"></script>
+
+ <script src="testcode.js"></script>
+ <script src="ace2.js"></script>
+ <script>
+ $(document).ready(function() {
+ var editor = new Ace2Editor();
+ editor.init("editorcontainer", getTestCode(), editorReady);
+
+ editor.setOnKeyPress(function (evt) {
+ if (evt.ctrlKey && evt.which == "s".charCodeAt(0)) {
+ alert("You tried to save.");
+ return false;
+ }
+ return true;
+ });
+
+ function editorReady() {
+ resizeEditor();
+ $(window).bind("resize", resizeEditor);
+ setTimeout(function() {editor.focus();}, 0);
+ }
+
+ function resizeEditor() {
+ $("#editorcontainer").get(0).style.height = "100%";
+ editor.getFrame().style.height = ((document.documentElement.clientHeight)-1)+"px";
+ editor.adjustSize();
+ }
+ });
+ </script>
+ <style>
+ html { overflow: hidden } /* for Win IE 6 */
+ body { margin:0; padding:0; border:0; overflow: hidden; }
+ #editorcontainer { height: 1000px; /* changed programmatically */ }
+ #editorcontainer iframe { width: 100%; height: 100%; border:0; padding:0; margin:0; }
+ </style>
+ </head>
+ <body>
+ <div id="editorcontainer"><!-- --></div>
+ </body>
+</html>