You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by dj...@apache.org on 2013/08/07 18:04:34 UTC
[03/26] Remove fauxton from 1.4.x branch.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/a2b7d6a1/src/fauxton/test/mocha/testUtils.js
----------------------------------------------------------------------
diff --git a/src/fauxton/test/mocha/testUtils.js b/src/fauxton/test/mocha/testUtils.js
deleted file mode 100644
index 08b46de..0000000
--- a/src/fauxton/test/mocha/testUtils.js
+++ /dev/null
@@ -1,25 +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.
-
-define([
- "chai",
- "sinon-chai",
-],
-function(chai, sinonChai) {
- chai.use(sinonChai);
-
- return {
- chai: chai,
- assert: chai.assert
- };
-});
-
http://git-wip-us.apache.org/repos/asf/couchdb/blob/a2b7d6a1/src/fauxton/test/runner.html
----------------------------------------------------------------------
diff --git a/src/fauxton/test/runner.html b/src/fauxton/test/runner.html
deleted file mode 100644
index b86855e..0000000
--- a/src/fauxton/test/runner.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<html>
- <head>
- <meta charset="utf-8">
- <title>testrunnner Fauxton</title>
- <link rel="stylesheet" href="mocha/mocha.css" />
- </head>
- <body>
- <div id="mocha"></div>
- <script type="text/javascript" src="mocha/mocha.js"></script>
- <script type="text/javascript" src="mocha/sinon.js"></script>
- <script type="text/javascript">
- // MOCHA SETUP
- mocha.setup('bdd');
- </script>
- <script data-main="./test.config.js" src="../assets/js/libs/require.js"></script>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/couchdb/blob/a2b7d6a1/src/fauxton/test/test.config.js
----------------------------------------------------------------------
diff --git a/src/fauxton/test/test.config.js b/src/fauxton/test/test.config.js
deleted file mode 100644
index f876bb3..0000000
--- a/src/fauxton/test/test.config.js
+++ /dev/null
@@ -1,71 +0,0 @@
-// vim: set ft=javascript:
-// Set the require.js configuration for your test setup.
-require.config(
-{
- "paths": {
- "libs": "../assets/js/libs",
- "plugins": "../assets/js/plugins",
- "jquery": "../assets/js/libs/jquery",
- "lodash": "../assets/js/libs/lodash",
- "backbone": "../assets/js/libs/backbone",
- "bootstrap": "../assets/js/libs/bootstrap",
- "codemirror": "../assets/js/libs/codemirror",
- "jshint": "../assets/js/libs/jshint",
- "d3": "../assets/js/libs/d3",
- "nv.d3": "../assets/js/libs/nv.d3",
- "chai": "../test/mocha/chai",
- "sinon-chai": "../test/mocha/sinon-chai",
- "testUtils": "../test/mocha/testUtils"
- },
- "baseUrl": "../app",
- "shim": {
- "backbone": {
- "deps": [
- "lodash",
- "jquery"
- ],
- "exports": "Backbone"
- },
- "bootstrap": {
- "deps": [
- "jquery"
- ],
- "exports": "Bootstrap"
- },
- "codemirror": {
- "deps": [
- "jquery"
- ],
- "exports": "CodeMirror"
- },
- "jshint": {
- "deps": [
- "jquery"
- ],
- "exports": "JSHINT"
- },
- "plugins/backbone.layoutmanager": [
- "backbone"
- ],
- "plugins/codemirror-javascript": [
- "codemirror"
- ],
- "plugins/prettify": [],
- "plugins/jquery.form": [
- "jquery"
- ]
- }
-}
-);
-
-require([
-
- '.././test/core/routeObjectSpec.js',
-
- '.././app/addons/logs/tests/logSpec.js',
-
-], function() {
- if (window.mochaPhantomJS) { mochaPhantomJS.run(); }
- else { mocha.run(); }
-});
-
http://git-wip-us.apache.org/repos/asf/couchdb/blob/a2b7d6a1/src/fauxton/test/test.config.underscore
----------------------------------------------------------------------
diff --git a/src/fauxton/test/test.config.underscore b/src/fauxton/test/test.config.underscore
deleted file mode 100644
index dda16f2..0000000
--- a/src/fauxton/test/test.config.underscore
+++ /dev/null
@@ -1,15 +0,0 @@
-// vim: set ft=javascript:
-// Set the require.js configuration for your test setup.
-require.config(
-<%= JSON.stringify(configInfo, null, '\t') %>
-);
-
-require([
- <% _.each(testFiles, function (test) {%>
- '../<%= test %>',
- <% }) %>
-], function() {
- if (window.mochaPhantomJS) { mochaPhantomJS.run(); }
- else { mocha.run(); }
-});
-
http://git-wip-us.apache.org/repos/asf/couchdb/blob/a2b7d6a1/src/fauxton/writing_addons.md
----------------------------------------------------------------------
diff --git a/src/fauxton/writing_addons.md b/src/fauxton/writing_addons.md
deleted file mode 100644
index e0a85fa..0000000
--- a/src/fauxton/writing_addons.md
+++ /dev/null
@@ -1,163 +0,0 @@
-# Addons
-Addons allow you to extend Fauxton for a specific use case. Addons will usually
-have the following structure:
-
- * templates/
- * my_addon.html - _underscore template fragments_
- * base.js - _entry point to the addon_
- * resources.js - _models and collections of the addon_
- * routes.js - _URL routing for the addon_
- * views.js - _views that the model provides_
-
- [optional]
- * assets/less
- * my_addon.less
-
-## Generating an addon
-We have a `grunt-init` template that lets you create a skeleton addon,
-including all the boiler plate code. Run `grunt-init tasks/addon` and answer
-the questions it asks to create an addon:
-
- ± grunt-init tasks/addon
- path.existsSync is now called `fs.existsSync`.
- Running "addon" task
-
- Please answer the following:
- [?] Add on Name (WickedCool) SuperAddon
- [?] Location of add ons (app/addons)
- [?] Do you need an assets folder?(for .less) (y/N)
- [?] Do you need to make any changes to the above before continuing? (y/N)
-
- Created addon SuperAddon in app/addons
-
- Done, without errors.
-
-Once the addon is created add the name to the settings.json file to get it
-compiled and added on the next install.
-
-## Routes and hooks
-An addon can insert itself into fauxton in two ways; via a route or via a hook.
-
-### Routes
-An addon will override an existing route should one exist, but in all other
-ways is just a normal backbone route/view. This is how you would add a whole
-new feature.
-
-### Hooks
-Hooks let you modify/extend an existing feature. They modify a DOM element by
-selector for a named set of routes, for example:
-
- var Search = new FauxtonAPI.addon();
- Search.hooks = {
- // Render additional content into the sidebar
- "#sidebar-content": {
- routes:[
- "database/:database/_design/:ddoc/_search/:search",
- "database/:database/_design/:ddoc/_view/:view",
- "database/:database/_:handler"],
- callback: searchSidebar
- }
- };
- return Search;
-
-adds the `searchSidebar` callback to `#sidebar-content` for three routes.
-
-## Hello world addon
-First create the addon skeleton:
-
- ± bbb addon
- path.existsSync is now called `fs.existsSync`.
- Running "addon" task
-
- Please answer the following:
- [?] Add on Name (WickedCool) Hello
- [?] Location of add ons (app/addons)
- [?] Do you need to make any changes to the above before continuing? (y/N)
-
- Created addon Hello in app/addons
-
- Done, without errors.
-
-In `app/addons/hello/templates/hello.html` place:
-
- <h1>Hello!</h1>
-
-Next, we'll defined a simple view in `resources.js` (for more complex addons
-you may want to have a views.js) that renders that template:
-
- define([
- "app",
- "api"
- ],
-
- function (app, FauxtonAPI) {
- var Resources = {};
-
- Resources.Hello = FauxtonAPI.View.extend({
- template: "addons/hello/templates/hello"
- });
-
- return Resources;
- });
-
-
-Then define a route in `routes.js` that the addon is accessible at:
-
- define([
- "app",
- "api",
- "addons/hello/resources"
- ],
-
- function(app, FauxtonAPI, Resources) {
- var helloRoute = function () {
- console.log('helloRoute callback yo');
- return {
- layout: "one_pane",
- crumbs: [
- {"name": "Hello","link": "_hello"}
- ],
- views: {
- "#dashboard-content": new Resources.Hello({})
- },
- apiUrl: 'hello'
- };
- };
-
- Routes = {
- "_hello": helloRoute
- };
-
- return Routes;
- });
-
-
-Then wire it all together in base.js:
-
- define([
- "app",
- "api",
- "addons/hello/routes"
- ],
-
- function(app, FauxtonAPI, HelloRoutes) {
- var Hello = new FauxtonAPI.addon();
- console.log('hello from hello');
-
- Hello.initialize = function() {
- FauxtonAPI.addHeaderLink({title: "Hello", href: "#_hello"});
- };
-
- Hello.Routes = HelloRoutes;
- console.log(Hello);
- return Hello;
- });
-
-Once the code is in place include the add on in your `settings.json` so that it
-gets included by the `require` task. Your addon is included in one of three
-ways; a local path, a git URL or a name. Named plugins assume the plugin is in
-the fauxton base directory, addons with a git URL will be cloned into the
-application, local paths will be copied. Addons included from a local path will
-be cleaned out by the clean task, others are left alone.
-
-**TODO:** addons via npm module