Skip to content

Commit

Permalink
Depend on brace for Ace Editor
Browse files Browse the repository at this point in the history
  • Loading branch information
saharj committed Mar 22, 2016
1 parent 27b3aa3 commit 5124a94
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 0 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
</head>
<body>
<div class="total-wrapper" ui-view></div>

<!--TODO: use webpack to include me-->
<script src="node_modules/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>

<script src="dist/bundle.js"></script>
<script src="scripts/branding.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
8 changes: 5 additions & 3 deletions scripts/services/editor.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 5124a94

Please sign in to comment.