diff --git a/demo/demo_startup.js b/demo/demo_startup.js index 9ce6b585..139850e8 100644 --- a/demo/demo_startup.js +++ b/demo/demo_startup.js @@ -50,6 +50,7 @@ exports.launch = function(env) { var CssMode = require("ace/mode/css").Css; var HtmlMode = require("ace/mode/html").Html; var XmlMode = require("ace/mode/xml").Xml; + var PythonMode = require("ace/mode/python").Python; var TextMode = require("ace/mode/text").Text; var UndoManager = require("ace/undomanager").UndoManager; @@ -67,6 +68,10 @@ exports.launch = function(env) { docs.html.setMode(new HtmlMode()); docs.html.setUndoManager(new UndoManager()); + docs.python = new Document(document.getElementById("pythontext").innerHTML); + docs.python.setMode(new PythonMode()); + docs.python.setUndoManager(new UndoManager()); + var docEl = document.getElementById("doc"); var container = document.getElementById("editor"); @@ -89,6 +94,9 @@ exports.launch = function(env) { else if (mode instanceof XmlMode) { modeEl.value = "xml"; } + else if (mode instanceof PythonMode) { + modeEl.value = "python"; + } else { modeEl.value = "text"; } @@ -111,7 +119,8 @@ exports.launch = function(env) { xml: new XmlMode(), html: new HtmlMode(), css: new CssMode(), - javascript: new JavaScriptMode() + javascript: new JavaScriptMode(), + python: new PythonMode() }; function getMode() { @@ -182,6 +191,8 @@ exports.launch = function(env) { mode = "html"; } else if (/^.*\.css$/i.test(file.name)) { mode = "css"; + } else if (/^.*\.py$/i.test(file.name)) { + mode = "python"; } env.editor.onTextInput(reader.result); diff --git a/editor.html b/editor.html index ba91335a..cb2919cb 100644 --- a/editor.html +++ b/editor.html @@ -150,6 +150,23 @@ } + +
+