summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarren Smith <garren.smith@gmail.com>2013-11-21 10:11:29 +0200
committerGarren Smith <garren.smith@gmail.com>2013-11-21 10:12:22 +0200
commit186846e6e66a0053d0c823fd80c498757d7a1828 (patch)
treeecdb332bcb2ca7f6703820f3fd1621aa75e5f96d
parent0693f98e2678017f382e1f047532469d2098175f (diff)
downloadcouchdb-186846e6e66a0053d0c823fd80c498757d7a1828.tar.gz
Fauxton: Fix ace editor to work with compiled Fauxton
-rw-r--r--src/fauxton/Gruntfile.js18
-rw-r--r--src/fauxton/app/config.js4
-rw-r--r--src/fauxton/app/modules/fauxton/components.js12
3 files changed, 28 insertions, 6 deletions
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index 29a70ba7a..94fbf2d2c 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -185,6 +185,11 @@ module.exports = function(grunt) {
test_config_js: {
src: ["dist/debug/templates.js", "test/test.config.js"],
dest: 'test/test.config.js'
+ },
+
+ boom: {
+ dest: "dist/release/js/require.js",
+ src: "dist/debug/js/require.js"
}
},
@@ -265,6 +270,7 @@ module.exports = function(grunt) {
// Do not wrap everything in an IIFE.
wrap: false,
optimize: "none",
+ findNestedDependencies: true
}
}
},
@@ -290,6 +296,14 @@ module.exports = function(grunt) {
{src: ["**"], dest: "../../share/www/fauxton/css/", cwd:"dist/debug/css/", expand: true}
]
},
+ ace: {
+ files: [
+ {src: "assets/js/libs/ace/worker-json.js", dest: "dist/release/js/ace/worker-json.js"},
+ {src: "assets/js/libs/ace/mode-json.js", dest: "dist/release/js/ace/mode-json.js"},
+ {src: "assets/js/libs/ace/theme-crimson_editor.js", dest: "dist/release/js/ace/theme-crimson_editor.js"},
+ ]
+ },
+
dist:{
files:[
{src: "dist/debug/index.html", dest: "dist/release/index.html"},
@@ -392,7 +406,7 @@ module.exports = function(grunt) {
// build templates, js and css
grunt.registerTask('build', ['less', 'concat:index_css', 'jst', 'requirejs', 'concat:requirejs', 'template:release']);
// minify code and css, ready for release.
- grunt.registerTask('minify', ['uglify', 'cssmin:compress']);
+ grunt.registerTask('minify', ['concat:boom', 'cssmin:compress']);
/*
* Build the app in either dev, debug, or release mode
@@ -413,7 +427,7 @@ module.exports = function(grunt) {
// make a development install that is server by mochiweb under _utils
grunt.registerTask('couchdebug', ['debug', 'copy:couchdebug']);
// make a minimized install that is server by mochiweb under _utils
- grunt.registerTask('couchdb', ['release', 'copy:couchdb']);
+ grunt.registerTask('couchdb', ['release', 'copy:ace', 'copy:couchdb']);
// make an install that can be deployed as a couchapp
grunt.registerTask('couchapp_setup', ['release']);
// install fauxton as couchapp
diff --git a/src/fauxton/app/config.js b/src/fauxton/app/config.js
index 8cc6ee20a..297796963 100644
--- a/src/fauxton/app/config.js
+++ b/src/fauxton/app/config.js
@@ -37,10 +37,8 @@ require.config({
map: {
"*": {
- 'underscore': 'lodash',
- //'./lib/dom':'ace/lib/dom'
+ 'underscore': 'lodash'
}
-
},
shim: {
diff --git a/src/fauxton/app/modules/fauxton/components.js b/src/fauxton/app/modules/fauxton/components.js
index 1a20cbea3..1263bd488 100644
--- a/src/fauxton/app/modules/fauxton/components.js
+++ b/src/fauxton/app/modules/fauxton/components.js
@@ -10,11 +10,21 @@
// License for the specific language governing permissions and limitations under
// the License.
+define('ace_configuration', ["app", "ace/ace"], function (app, ace) {
+ var path = app.host + app.root + 'js/ace';
+ var config = require("ace/config");
+ config.set("packaged", true);
+ config.set("workerPath",path);
+ config.set("modePath",path);
+ config.set("themePath", path);
+ return ace;
+});
+
define([
"app",
// Libs
"api",
- "ace/ace"
+ "ace_configuration",
],
function(app, FauxtonAPI, ace) {