summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Ramage <ryan.ramage@gmail.com>2013-05-12 09:59:51 -0600
committerRyan Ramage <ryan.ramage@gmail.com>2013-05-12 09:59:51 -0600
commitc090e9ef722643b23f55fd9180f9fba926a8b7a8 (patch)
treef2dbf65e06e795ba215ec7f0e9d567fe95ae5610
parent4615a788dcc1ab00d0f63b43530aa6921654c538 (diff)
downloadcouchdb-fauxton-simpler-build.tar.gz
Support loading addons.\n\n Addons are enabled in the addons.js file. External addons are loaded in the sibling directory to fauxtonfauxton-simpler-build
-rw-r--r--src/fauxton/addons.js11
-rw-r--r--src/fauxton/js/load_addons.js27
-rw-r--r--src/fauxton/js/load_addons.js.underscore27
-rw-r--r--src/fauxton/js/router.js2
-rwxr-xr-xsrc/fauxton/rebuild8
5 files changed, 19 insertions, 56 deletions
diff --git a/src/fauxton/addons.js b/src/fauxton/addons.js
new file mode 100644
index 000000000..3c6b60d4a
--- /dev/null
+++ b/src/fauxton/addons.js
@@ -0,0 +1,11 @@
+define([
+ "js/addons/config/base",
+ "js/addons/logs/base",
+ "js/addons/stats/base",
+ "js/addons/contribute/base"
+ // ,"../fauxton-demo-plugin/base"
+], function() {
+ return {
+ addons: arguments
+ };
+}); \ No newline at end of file
diff --git a/src/fauxton/js/load_addons.js b/src/fauxton/js/load_addons.js
deleted file mode 100644
index 8203c8f92..000000000
--- a/src/fauxton/js/load_addons.js
+++ /dev/null
@@ -1,27 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-
-/*
- * ::WARNING::
- * THIS IS A GENERATED FILE. DO NOT EDIT.
- */
-define([
- "js/addons/config/base","js/addons/logs/base","js/addons/stats/base","js/addons/contribute/base"
-],
-function() {
- var LoadAddons = {
- addons: arguments
- };
-
- return LoadAddons;
-});
diff --git a/src/fauxton/js/load_addons.js.underscore b/src/fauxton/js/load_addons.js.underscore
deleted file mode 100644
index 9686ad76b..000000000
--- a/src/fauxton/js/load_addons.js.underscore
+++ /dev/null
@@ -1,27 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-
-/*
- * ::WARNING::
- * THIS IS A GENERATED FILE. DO NOT EDIT.
- */
-define([
- <%= '"' + deps.join('","') + '"' %>
-],
-function() {
- var LoadAddons = {
- addons: arguments
- };
-
- return LoadAddons;
-});
diff --git a/src/fauxton/js/router.js b/src/fauxton/js/router.js
index e5de71c73..87d67793c 100644
--- a/src/fauxton/js/router.js
+++ b/src/fauxton/js/router.js
@@ -39,7 +39,7 @@ define([
// "modules/logs/base",
// "modules/config/base",
- "js/load_addons"
+ "addons"
],
function(req, app, Initialize, FauxtonAPI, Fauxton, Layout, Databases, Documents, Pouch, LoadAddons) {
diff --git a/src/fauxton/rebuild b/src/fauxton/rebuild
index 42219c045..908bd85ab 100755
--- a/src/fauxton/rebuild
+++ b/src/fauxton/rebuild
@@ -1,7 +1,13 @@
#!/usr/bin/env bash
if [ -n "$1" ] && [ "$1" == "compile" ]; then
- jam compile -i js/main -o jam/require.prod.js;
+
+ ADDONS=""
+ if [ -e addons.js ]; then
+ ADDONS=" -i ./addons.js "
+ fi
+
+ jam compile -i js/main $ADDONS -o jam/require.prod.js;
else
if [ -e "jam/require.prod.js" ]; then
rm jam/require.prod.js;