couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [1/7] Fauxton: move modules to addons
Date Mon, 06 Jan 2014 14:16:30 GMT
Updated Branches:
  refs/heads/fauxton-modularise [created] 752819c1a


http://git-wip-us.apache.org/repos/asf/couchdb/blob/fae1de24/src/fauxton/app/router.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/router.js b/src/fauxton/app/router.js
index e3a1636..7cf69ad 100644
--- a/src/fauxton/app/router.js
+++ b/src/fauxton/app/router.js
@@ -25,27 +25,14 @@ define([
        "api",
 
        // Modules
-       "modules/fauxton/base",
+       "addons/fauxton/base",
        // Layout
-       "modules/fauxton/layout",
-
-       // Routes return the module that they define routes for
-       "modules/databases/base",
-       "modules/documents/base",
-       "modules/pouchdb/base",
-
-
-       // this needs to be added as a plugin later
-       // "modules/logs/base",
-       // "modules/config/base",
+       "addons/fauxton/layout",
 
        "load_addons"
 ],
 
-function(req, app, Initialize, FauxtonAPI, Fauxton, Layout, Databases, Documents, Pouch,
LoadAddons) {
-
-  // TODO: auto generate this list if possible
-  var modules = [Databases, Documents];
+function(req, app, Initialize, FauxtonAPI, Fauxton, Layout, LoadAddons) {
 
   var beforeUnloads = {};
 
@@ -106,11 +93,6 @@ function(req, app, Initialize, FauxtonAPI, Fauxton, Layout, Databases,
Documents
     },
 
     setModuleRoutes: function() {
-      _.each(modules, function(module) {
-        if (module){
-          _.each(module.RouteObjects, this.addModuleRouteObject, this);
-        }
-      }, this);
       _.each(LoadAddons.addons, function(module) {
         if (module){
           module.initialize();
@@ -122,21 +104,6 @@ function(req, app, Initialize, FauxtonAPI, Fauxton, Layout, Databases,
Documents
       }, this);
     },
 
-    /*setAddonHooks: function() {
-      _.each(LoadAddons.addons, function(module) {
-        // This is updates to views by the addon
-        if (module && module.hooks){
-          _.each(module.hooks, function(callback, route){
-            if (this.masterLayout.hooks[route]) {
-              this.masterLayout.hooks[route].push(callback);
-            } else {
-              this.masterLayout.hooks[route] = [callback];
-            }
-          }, this);
-        }
-      }, this);
-    },*/
-
     initialize: function() {
       //TODO: It would be nice to handle this with a router
       this.navBar = app.navBar = new Fauxton.NavBar();

http://git-wip-us.apache.org/repos/asf/couchdb/blob/fae1de24/src/fauxton/settings.json.default
----------------------------------------------------------------------
diff --git a/src/fauxton/settings.json.default b/src/fauxton/settings.json.default
index ad7e6b5..cb09eb2 100644
--- a/src/fauxton/settings.json.default
+++ b/src/fauxton/settings.json.default
@@ -1,5 +1,8 @@
 {
   "deps": [
+  { "name": "databases" },
+  { "name": "documents" },
+  { "name": "pouchdb" },
   { "name": "activetasks" },
   { "name": "config" },
   { "name": "logs" },


Mime
View raw message