couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject git commit: updated refs/heads/master to 186846e
Date Thu, 21 Nov 2013 08:12:46 GMT
Updated Branches:
  refs/heads/master 0693f98e2 -> 186846e6e


Fauxton: Fix ace editor to work with compiled Fauxton


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/186846e6
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/186846e6
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/186846e6

Branch: refs/heads/master
Commit: 186846e6e66a0053d0c823fd80c498757d7a1828
Parents: 0693f98
Author: Garren Smith <garren.smith@gmail.com>
Authored: Thu Nov 21 10:11:29 2013 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Thu Nov 21 10:12:22 2013 +0200

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js                      | 18 ++++++++++++++++--
 src/fauxton/app/config.js                     |  4 +---
 src/fauxton/app/modules/fauxton/components.js | 12 +++++++++++-
 3 files changed, 28 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/186846e6/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index 29a70ba..94fbf2d 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

http://git-wip-us.apache.org/repos/asf/couchdb/blob/186846e6/src/fauxton/app/config.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/config.js b/src/fauxton/app/config.js
index 8cc6ee2..2977969 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: {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/186846e6/src/fauxton/app/modules/fauxton/components.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/fauxton/components.js b/src/fauxton/app/modules/fauxton/components.js
index 1a20cbe..1263bd4 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) {


Mime
View raw message