couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [1/5] fauxton commit: updated refs/heads/master to 2a7fc64
Date Tue, 20 Jan 2015 08:03:42 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 60d29b745 -> 2a7fc648e


React building blocks


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

Branch: refs/heads/master
Commit: 66425e8496b7e3512fcf912941cadcdad44e8879
Parents: 7cca283
Author: Garren Smith <garren.smith@gmail.com>
Authored: Thu Jan 8 15:53:17 2015 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Tue Jan 20 10:02:53 2015 +0200

----------------------------------------------------------------------
 .gitignore                  |  3 ++-
 Gruntfile.js                |  4 ++--
 app/core/api.js             | 21 +++++++++++++--------
 app/core/store.js           | 34 ++++++++++++++++++++++++++++++++++
 settings.json.default       |  2 --
 tasks/fauxton.js            |  6 ++++--
 test/test.config.underscore |  2 +-
 7 files changed, 56 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/66425e84/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 680e5b2..83729dd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,9 +24,10 @@ settings.json*
 !assets/js/plugins/zeroclipboard/ZeroClipboard.swf
 test/test.config.js
 app/initialize.js
+.module-cache
 test/nightwatch_tests/nightwatch.json
 test/nightwatch_tests/reports/*
 test/nightwatch_tests/selenium/*
 !test/nightwatch_tests/selenium/.gitkeep
 .DS_Store
-
+*.react.js

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/66425e84/Gruntfile.js
----------------------------------------------------------------------
diff --git a/Gruntfile.js b/Gruntfile.js
index 54f8350..13d8fc6 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -394,7 +394,7 @@ module.exports = function(grunt) {
 
     mochaSetup: {
       default: {
-        files: { src: helper.watchFiles(['[Ss]pec.js'], ['./app/addons/**/*[Ss]pec.js'])},
+        files: { src: helper.watchFiles(['[Ss]pec.js'], ['./app/addons/**/*[Ss]pec.js', './app/addons/**/*[Ss]pec.react.js'])},
         template: 'test/test.config.underscore',
         config: './app/config.js'
       }
@@ -407,7 +407,7 @@ module.exports = function(grunt) {
     shell: {
         'build-jsx': {
             command: [
-              'jsx -x jsx app/addons/ app/addons/',
+              './node_modules/react-tools/bin/jsx -x jsx app/addons/ app/addons/',
                 'rm -rf <%= src_path %>/js/app/views/.module-cache/'
             ].join(' && '),
             stdout: true,

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/66425e84/app/core/api.js
----------------------------------------------------------------------
diff --git a/app/core/api.js b/app/core/api.js
index b794b53..30daad9 100644
--- a/app/core/api.js
+++ b/app/core/api.js
@@ -11,22 +11,27 @@
 // the License.
 
 define([
-  'core/base',
-  'core/layout',
-  'core/router',
-  'core/routeObject',
-  'core/utils'
+  "./base",
+       "core/layout",
+       "core/router",
+       "core/routeObject",
+       "core/utils",
+       "core/store",
+       "flux"
 ],
 
-function(FauxtonAPI, Layout, Router, RouteObject, utils) {
+function(FauxtonAPI, Layout, Router, RouteObject, utils, Store, Flux) {
   FauxtonAPI = _.extend(FauxtonAPI, {
     Layout: Layout,
     Router: Router,
     RouteObject: RouteObject,
-    utils: utils
+    utils: utils,
+    Store: Store,
+    Events: _.extend({}, Backbone.Events),
+    dispatcher: new Flux.Dispatcher()
   });
 
-  FauxtonAPI.Events = _.extend({}, Backbone.Events);
+  FauxtonAPI.dispatch = _.bind(FauxtonAPI.dispatcher.dispatch, FauxtonAPI.dispatcher);
 
   FauxtonAPI.navigate = function (url, _opts) {
     var options = _.extend({trigger: true}, _opts);

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/66425e84/app/core/store.js
----------------------------------------------------------------------
diff --git a/app/core/store.js b/app/core/store.js
new file mode 100644
index 0000000..e98870c
--- /dev/null
+++ b/app/core/store.js
@@ -0,0 +1,34 @@
+// 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([
+  "backbone"
+],
+function(Backbone) {
+
+  var Store = function () {
+    this.initialize.apply(this, arguments);
+    _.bindAll(this);
+  };
+
+  Store.extend = Backbone.Model.extend;
+  _.extend(Store.prototype, Backbone.Events, {
+    triggerChange: function () {
+      this.trigger('change');
+    },
+
+    initialize: function () {}
+  });
+
+  return Store; 
+});
+

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/66425e84/settings.json.default
----------------------------------------------------------------------
diff --git a/settings.json.default b/settings.json.default
index 4d91255..8e88c0e 100644
--- a/settings.json.default
+++ b/settings.json.default
@@ -3,12 +3,10 @@
   { "name": "fauxton" },
   { "name": "databases" },
   { "name": "documents" },
-  { "name": "pouchdb" },
   { "name": "activetasks" },
   { "name": "config" },
   { "name": "replication" },
   { "name": "plugins" },
-  { "name": "contribute" },
   { "name": "permissions" },
   { "name": "compaction" },
   { "name": "auth" },

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/66425e84/tasks/fauxton.js
----------------------------------------------------------------------
diff --git a/tasks/fauxton.js b/tasks/fauxton.js
index 0afd2d7..e3204a3 100644
--- a/tasks/fauxton.js
+++ b/tasks/fauxton.js
@@ -112,8 +112,10 @@ module.exports = function(grunt) {
     var data = this.data,
         configInfo,
         _ = grunt.util._,
-        configTemplateSrc = data.template,
-        testFiles = grunt.file.expand(data.files.src);
+        configTemplateSrc = data.template;
+
+   var fileSrc = grunt.option('file') || data.files.src;
+   var testFiles =  grunt.file.expand(fileSrc);
 
     var configTemplate = _.template(grunt.file.read(configTemplateSrc));
     // a bit of a nasty hack to read our current config.js and get the info so we can change
it 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/66425e84/test/test.config.underscore
----------------------------------------------------------------------
diff --git a/test/test.config.underscore b/test/test.config.underscore
index 95494a4..c6e1d53 100644
--- a/test/test.config.underscore
+++ b/test/test.config.underscore
@@ -5,7 +5,7 @@ require.config(
 );
 
 require([
-        "app",
+        "es5-shim",
         <% _.each(testFiles, function (test) {%>
            <% if (test[0] === '.') { %>
            '../<%= test %>',


Mime
View raw message