From 5124a94e7fc349363a488b844a183840c5d90b8c Mon Sep 17 00:00:00 2001 From: Sahar Jafari Date: Sat, 19 Mar 2016 13:06:01 -0700 Subject: [PATCH] Depend on brace for Ace Editor --- index.html | 4 ---- package.json | 2 +- scripts/app.js | 4 +++- scripts/services/editor.js | 8 +++++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 88e17afccc7..bbdd317edc5 100644 --- a/index.html +++ b/index.html @@ -11,10 +11,6 @@
- - - - diff --git a/package.json b/package.json index 19a7468c8cc..8a2f1be1e31 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "url": "swagger-api/swagger-editor.git" }, "devDependencies": { - "ace-builds": "^1.2.2", "angular": "^1.5.1", "angular-json-schema-form": "^0.1.4", "angular-marked": "^1.0.1", @@ -27,6 +26,7 @@ "angular-ui-layout": "^1.4.2", "angular-ui-router": "^0.2.18", "bootstrap": "^3.3.6", + "brace": "^0.7.0", "chai": "^3.5.0", "css-loader": "^0.23.1", "extract-text-webpack-plugin": "^1.0.1", diff --git a/scripts/app.js b/scripts/app.js index c2cd21a8aa4..95ce66c5f7e 100644 --- a/scripts/app.js +++ b/scripts/app.js @@ -87,8 +87,10 @@ require('./plugins/jquery.scroll-into-view.js'); // Misc require('./ace/snippets/swagger.snippet.js'); -require('./ace/themes/theme-atom_dark.js'); require('./analytics/google.js'); +// Ace Editor +window.ace = require('brace'); + // Bootstrap require('./bootstrap'); diff --git a/scripts/services/editor.js b/scripts/services/editor.js index c83f7000b1f..b782f9b2e25 100644 --- a/scripts/services/editor.js +++ b/scripts/services/editor.js @@ -1,5 +1,9 @@ 'use strict'; +var ace = require('brace'); +require('brace/mode/yaml'); +require('../ace/themes/theme-atom_dark.js'); + SwaggerEditor.service('Editor', function Editor(Autocomplete, ASTManager, LocalStorage, defaults, $interval) { var editor = null; @@ -44,10 +48,8 @@ SwaggerEditor.service('Editor', function Editor(Autocomplete, ASTManager, function aceLoaded(e) { - // Assign class variable `editor` - window.e = editor = e; - ace.config.set('basePath', 'bower_components/ace-builds/src-noconflict'); + editor = e; Autocomplete.init(e);