From 14faa36a51320656a11465a2c996c4b50f257900 Mon Sep 17 00:00:00 2001 From: Julian Viereck Date: Sat, 21 May 2011 11:16:56 +0200 Subject: [PATCH] Update build_support for the bm build --- build_support/boot_textarea.js | 55 +++++++++++++++--------------- build_support/editor_textarea.html | 1 + 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/build_support/boot_textarea.js b/build_support/boot_textarea.js index 4d7e7f52..18c23383 100644 --- a/build_support/boot_textarea.js +++ b/build_support/boot_textarea.js @@ -39,20 +39,8 @@ (function() { var require = window.__ace_shadowed__.require; -var deps = [ - "pilot/fixoldbrowsers", - "pilot/index", - "pilot/plugin_manager", - "pilot/environment", - "ace/editor", - "ace/edit_session", - "ace/virtual_renderer", - "ace/undomanager", - "ace/theme/textmate" -]; - -require(deps, function() { +require("pilot/index"); var catalog = require("pilot/plugin_manager").catalog; catalog.registerPlugins([ "pilot/index" ]); @@ -65,6 +53,9 @@ var EditSession = require("ace/edit_session").EditSession; var UndoManager = require("ace/undomanager").UndoManager; var Renderer = require("ace/virtual_renderer").VirtualRenderer; +var catalog = require("pilot/plugin_manager").catalog; +catalog.registerPlugins([ "pilot/index" ]); + window.__ace_shadowed__.edit = function(el) { if (typeof(el) == "string") { el = document.getElementById(el); @@ -373,6 +364,10 @@ function setupApi(editor, editorDiv, settingDiv, ace, options) { case "showPrintMargin": renderer.setShowPrintMargin(toBool(value)); break + + case "showInvisibles": + editor.setShowInvisibles(toBool(value)); + break; } options[key] = value; @@ -407,7 +402,8 @@ function setupSettingPanel(settingDiv, settingOpener, api, options) { fontSize: "Font Size:", softWrap: "Soft Wrap:", showPrintMargin: "Show Print Margin:", - useSoftTabs: "Use Soft Tabs:" + useSoftTabs: "Use Soft Tabs:", + showInvisibles: "Show Invisibles" } var optionValues = { @@ -417,11 +413,16 @@ function setupSettingPanel(settingDiv, settingOpener, api, options) { coffee: "CoffeeScript", html: "HTML", css: "CSS", + xml: "XML", + svg: "SVG", c_cpp: "C++", + csharp: "C#", + java: "Java", php: "PHP", ruby: "Ruby", - python: "Python" - + perl: "Perl", + python: "Python", + clojure: "Clojure" }, theme: { textmate: "Textmate", @@ -451,8 +452,9 @@ function setupSettingPanel(settingDiv, settingOpener, api, options) { 80: "80", free: "Free" }, - showPrintMargin: BOOL, - useSoftTabs: BOOL + showPrintMargin: BOOL, + useSoftTabs: BOOL, + showInvisibles: BOOL } var table = []; @@ -511,15 +513,14 @@ function setupSettingPanel(settingDiv, settingOpener, api, options) { // Default startup options. window.__ace_shadowed__.options = { - mode: "text", - theme: "textmate", - gutter: "false", - fontSize: "12px", - softWrap: "off", - showPrintMargin: "false", - useSoftTabs: "true" + mode: "text", + theme: "textmate", + gutter: "false", + fontSize: "12px", + softWrap: "off", + showPrintMargin: "false", + useSoftTabs: "true", + showInvisibles: "true" } -}); - })() diff --git a/build_support/editor_textarea.html b/build_support/editor_textarea.html index c3c9a2b5..82a8f990 100644 --- a/build_support/editor_textarea.html +++ b/build_support/editor_textarea.html @@ -75,6 +75,7 @@ function inject() { load('ace.js', 'text!ace/css/editor.css', function() { var ace = window.__ace_shadowed__; + ace.options.mode = "javascript"; var Event = ace.require('pilot/event'); var areas = document.getElementsByTagName("textarea"); for (var i = 0; i < areas.length; i++) {