couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [12/27] fauxton commit: updated refs/heads/master to 0ca35da
Date Tue, 31 May 2016 07:58:40 GMT
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/documents/queryoptions/stores.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/queryoptions/stores.js b/app/addons/documents/queryoptions/stores.js
index e45c64a..1516c7e 100644
--- a/app/addons/documents/queryoptions/stores.js
+++ b/app/addons/documents/queryoptions/stores.js
@@ -10,284 +10,278 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../../app',
-  '../../../core/api',
-  './actiontypes'
-],
-
-function (app, FauxtonAPI, ActionTypes) {
-  var Stores = {};
-
-  Stores.QueryOptionsStore = FauxtonAPI.Store.extend({
-
-    initialize: function () {
-      this.reset();
-    },
-
-    reset: function () {
-      this._loading = true;
-      this._showByKeys = false;
+import app from "../../../app";
+import FauxtonAPI from "../../../core/api";
+import ActionTypes from "./actiontypes";
+var Stores = {};
+
+Stores.QueryOptionsStore = FauxtonAPI.Store.extend({
+
+  initialize: function () {
+    this.reset();
+  },
+
+  reset: function () {
+    this._loading = true;
+    this._showByKeys = false;
+    this._showBetweenKeys = false;
+    this._includeDocs = false;
+    this._betweenKeys = {
+      include: true,
+    };
+
+    this._trayVisible = false;
+
+    this._byKeys = '';
+    this._descending = false;
+    this._skip = '';
+    this._limit = "none";
+    this._reduce = false;
+    this._groupLevel = 'exact';
+
+    this._showReduce = false;
+  },
+
+  isLoading: function () {
+    return this._loading;
+  },
+
+  setTrayVisible: function (trayVisible) {
+    this._trayVisible = trayVisible;
+  },
+
+  getTrayVisible: function () {
+    return this._trayVisible;
+  },
+
+  showReduce: function () {
+    return this._showReduce;
+  },
+
+  reduce: function () {
+    return this._reduce;
+  },
+
+  betweenKeys: function () {
+    return this._betweenKeys;
+  },
+
+  updateBetweenKeys: function (newBetweenKeys) {
+    this._betweenKeys = newBetweenKeys;
+  },
+
+  updateSkip: function (skip) {
+    this._skip = skip;
+  },
+
+  skip: function () {
+    return this._skip;
+  },
+
+  limit: function () {
+    return this._limit;
+  },
+
+  updateLimit: function (limit) {
+    this._limit = limit;
+  },
+
+  byKeys: function () {
+    return this._byKeys;
+  },
+
+  updateByKeys: function (keys) {
+    this._byKeys = keys;
+  },
+
+  includeDocs: function () {
+    return this._includeDocs;
+  },
+
+  descending: function () {
+    return this._descending;
+  },
+
+  groupLevel: function () {
+    return this._groupLevel;
+  },
+
+  toggleByKeys: function () {
+    this._showByKeys = !this._showByKeys;
+
+    if (this._showByKeys) {
       this._showBetweenKeys = false;
-      this._includeDocs = false;
-      this._betweenKeys = {
-        include: true,
-      };
-
-      this._trayVisible = false;
-
-      this._byKeys = '';
-      this._descending = false;
-      this._skip = '';
-      this._limit = "none";
-      this._reduce = false;
-      this._groupLevel = 'exact';
-
-      this._showReduce = false;
-    },
-
-    isLoading: function () {
-      return this._loading;
-    },
-
-    setTrayVisible: function (trayVisible) {
-      this._trayVisible = trayVisible;
-    },
-
-    getTrayVisible: function () {
-      return this._trayVisible;
-    },
-
-    showReduce: function () {
-      return this._showReduce;
-    },
-
-    reduce: function () {
-      return this._reduce;
-    },
-
-    betweenKeys: function () {
-      return this._betweenKeys;
-    },
-
-    updateBetweenKeys: function (newBetweenKeys) {
-      this._betweenKeys = newBetweenKeys;
-    },
-
-    updateSkip: function (skip) {
-      this._skip = skip;
-    },
-
-    skip: function () {
-      return this._skip;
-    },
-
-    limit: function () {
-      return this._limit;
-    },
+    }
+  },
 
-    updateLimit: function (limit) {
-      this._limit = limit;
-    },
+  toggleBetweenKeys: function () {
+    this._showBetweenKeys = !this._showBetweenKeys;
 
-    byKeys: function () {
-      return this._byKeys;
-    },
+    if (this._showBetweenKeys) {
+      this._showByKeys = false;
+    }
+  },
 
-    updateByKeys: function (keys) {
-      this._byKeys = keys;
-    },
+  showByKeys: function () {
+    return this._showByKeys;
+  },
 
-    includeDocs: function () {
-      return this._includeDocs;
-    },
+  showBetweenKeys: function () {
+    return this._showBetweenKeys;
+  },
 
-    descending: function () {
-      return this._descending;
-    },
+  updateGroupLevel: function (groupLevel) {
+    this._groupLevel = groupLevel;
+  },
 
-    groupLevel: function () {
-      return this._groupLevel;
-    },
+  setQueryParams: function (params) {
+    this.reset();
+    if (params.include_docs) {
+      this._includeDocs = true;
+    }
 
-    toggleByKeys: function () {
-      this._showByKeys = !this._showByKeys;
+    if (params.start_key || params.end_key) {
+      var include = true;
 
-      if (this._showByKeys) {
-        this._showBetweenKeys = false;
+      if (params.inclusive_end) {
+        include = params.inclusive_end === 'true';
       }
-    },
-
-    toggleBetweenKeys: function () {
-      this._showBetweenKeys = !this._showBetweenKeys;
-
-      if (this._showBetweenKeys) {
-        this._showByKeys = false;
+      this._betweenKeys = { include: include };
+      if (params.start_key) {
+        this._betweenKeys.startkey = params.start_key;
       }
-    },
-
-    showByKeys: function () {
-      return this._showByKeys;
-    },
-
-    showBetweenKeys: function () {
-      return this._showBetweenKeys;
-    },
-
-    updateGroupLevel: function (groupLevel) {
-      this._groupLevel = groupLevel;
-    },
-
-    setQueryParams: function (params) {
-      this.reset();
-      if (params.include_docs) {
-        this._includeDocs = true;
+      if (params.end_key) {
+        this._betweenKeys.endkey = params.end_key;
       }
+      this._showBetweenKeys = true;
 
-      if (params.start_key || params.end_key) {
-        var include = true;
-
-        if (params.inclusive_end) {
-          include = params.inclusive_end === 'true';
-        }
-        this._betweenKeys = { include: include };
-        if (params.start_key) {
-          this._betweenKeys.startkey = params.start_key;
-        }
-        if (params.end_key) {
-          this._betweenKeys.endkey = params.end_key;
-        }
-        this._showBetweenKeys = true;
-
-      } else if (params.keys) {
-        this._byKeys = params.keys;
-        this._showByKeys = true;
-      }
+    } else if (params.keys) {
+      this._byKeys = params.keys;
+      this._showByKeys = true;
+    }
 
-      if (params.limit && params.limit !== 'none') {
-        this._limit = params.limit;
-      }
+    if (params.limit && params.limit !== 'none') {
+      this._limit = params.limit;
+    }
 
-      if (params.skip) {
-        this._skip = params.skip;
-      }
+    if (params.skip) {
+      this._skip = params.skip;
+    }
 
-      if (params.descending) {
-        this._descending = params.descending;
-      }
+    if (params.descending) {
+      this._descending = params.descending;
+    }
 
-      if (params.reduce) {
-        if (params.group) {
-          this._groupLevel = 'exact';
-        } else {
-          this._groupLevel = params.group_level;
-        }
-        this._reduce = true;
+    if (params.reduce) {
+      if (params.group) {
+        this._groupLevel = 'exact';
+      } else {
+        this._groupLevel = params.group_level;
       }
-    },
+      this._reduce = true;
+    }
+  },
 
-    getQueryParams: function () {
-      var params = {};
+  getQueryParams: function () {
+    var params = {};
 
-      if (this._includeDocs) {
-        params.include_docs = this._includeDocs;
-      }
+    if (this._includeDocs) {
+      params.include_docs = this._includeDocs;
+    }
 
-      if (this._showBetweenKeys) {
-        var betweenKeys = this._betweenKeys;
-        params.inclusive_end = betweenKeys.include;
-        if (betweenKeys.startkey && betweenKeys.startkey !== '') {
-          params.start_key = betweenKeys.startkey;
-        }
-        if (betweenKeys.endkey && betweenKeys.endkey !== '') {
-          params.end_key = betweenKeys.endkey;
-        }
-      } else if (this._showByKeys) {
-        params.keys = this._byKeys.replace(/\r?\n/g, '');
+    if (this._showBetweenKeys) {
+      var betweenKeys = this._betweenKeys;
+      params.inclusive_end = betweenKeys.include;
+      if (betweenKeys.startkey && betweenKeys.startkey !== '') {
+        params.start_key = betweenKeys.startkey;
       }
-
-      if (this._limit !== 'none') {
-        params.limit = parseInt(this._limit, 10);
+      if (betweenKeys.endkey && betweenKeys.endkey !== '') {
+        params.end_key = betweenKeys.endkey;
       }
+    } else if (this._showByKeys) {
+      params.keys = this._byKeys.replace(/\r?\n/g, '');
+    }
 
-      if (this._skip) {
-        params.skip = parseInt(this._skip, 10);
-      }
+    if (this._limit !== 'none') {
+      params.limit = parseInt(this._limit, 10);
+    }
 
-      if (this._descending) {
-        params.descending = this._descending;
-      }
+    if (this._skip) {
+      params.skip = parseInt(this._skip, 10);
+    }
 
-      if (this._reduce) {
-        params.reduce = true;
+    if (this._descending) {
+      params.descending = this._descending;
+    }
 
-        if (this._groupLevel === 'exact') {
-          params.group = true;
-        } else {
-          params.group_level = this._groupLevel;
-        }
-      }
+    if (this._reduce) {
+      params.reduce = true;
 
-      return params;
-    },
-
-    getIncludeDocsEnabled: function () {
-      return this._includeDocs;
-    },
-
-    dispatch: function (action) {
-      switch (action.type) {
-        case ActionTypes.QUERY_RESET:
-          this.setQueryParams(action.params);
-        break;
-        case ActionTypes.QUERY_TOGGLE_INCLUDE_DOCS:
-          this._includeDocs = !this._includeDocs;
-        break;
-        case ActionTypes.QUERY_TOGGLE_DESCENDING:
-          this._descending = !this._descending;
-        break;
-        case ActionTypes.QUERY_TOGGLE_BY_KEYS:
-          this.toggleByKeys();
-        break;
-        case ActionTypes.QUERY_TOGGLE_BETWEEN_KEYS:
-          this.toggleBetweenKeys();
-        break;
-        case ActionTypes.QUERY_UPDATE_BETWEEN_KEYS:
-          this.updateBetweenKeys(action.betweenKeys);
-        break;
-        case ActionTypes.QUERY_UPDATE_BY_KEYS:
-          this.updateByKeys(action.byKeys);
-        break;
-        case ActionTypes.QUERY_UPDATE_SKIP:
-          this.updateSkip(action.skip);
-        break;
-        case ActionTypes.QUERY_UPDATE_LIMIT:
-          this.updateLimit(action.limit);
-        break;
-        case ActionTypes.QUERY_SHOW_REDUCE:
-          this._showReduce = true;
-        break;
-        case ActionTypes.QUERY_TOGGLE_REDUCE:
-          this._reduce = !this._reduce;
-        break;
-        case ActionTypes.QUERY_UPDATE_GROUP_LEVEL:
-          this.updateGroupLevel(action.groupLevel);
-        break;
-        case ActionTypes.QUERY_UPDATE_VISIBILITY:
-          this.setTrayVisible(action.options);
-        break;
-        default:
-        return;
-        // do nothing
+      if (this._groupLevel === 'exact') {
+        params.group = true;
+      } else {
+        params.group_level = this._groupLevel;
       }
-      this.triggerChange();
+    }
 
+    return params;
+  },
+
+  getIncludeDocsEnabled: function () {
+    return this._includeDocs;
+  },
+
+  dispatch: function (action) {
+    switch (action.type) {
+      case ActionTypes.QUERY_RESET:
+        this.setQueryParams(action.params);
+      break;
+      case ActionTypes.QUERY_TOGGLE_INCLUDE_DOCS:
+        this._includeDocs = !this._includeDocs;
+      break;
+      case ActionTypes.QUERY_TOGGLE_DESCENDING:
+        this._descending = !this._descending;
+      break;
+      case ActionTypes.QUERY_TOGGLE_BY_KEYS:
+        this.toggleByKeys();
+      break;
+      case ActionTypes.QUERY_TOGGLE_BETWEEN_KEYS:
+        this.toggleBetweenKeys();
+      break;
+      case ActionTypes.QUERY_UPDATE_BETWEEN_KEYS:
+        this.updateBetweenKeys(action.betweenKeys);
+      break;
+      case ActionTypes.QUERY_UPDATE_BY_KEYS:
+        this.updateByKeys(action.byKeys);
+      break;
+      case ActionTypes.QUERY_UPDATE_SKIP:
+        this.updateSkip(action.skip);
+      break;
+      case ActionTypes.QUERY_UPDATE_LIMIT:
+        this.updateLimit(action.limit);
+      break;
+      case ActionTypes.QUERY_SHOW_REDUCE:
+        this._showReduce = true;
+      break;
+      case ActionTypes.QUERY_TOGGLE_REDUCE:
+        this._reduce = !this._reduce;
+      break;
+      case ActionTypes.QUERY_UPDATE_GROUP_LEVEL:
+        this.updateGroupLevel(action.groupLevel);
+      break;
+      case ActionTypes.QUERY_UPDATE_VISIBILITY:
+        this.setTrayVisible(action.options);
+      break;
+      default:
+      return;
+      // do nothing
     }
-  });
+    this.triggerChange();
 
-  Stores.queryOptionsStore = new Stores.QueryOptionsStore();
-  Stores.queryOptionsStore.dispatchToken = FauxtonAPI.dispatcher.register(Stores.queryOptionsStore.dispatch);
+  }
+});
 
-  return Stores;
+Stores.queryOptionsStore = new Stores.QueryOptionsStore();
+Stores.queryOptionsStore.dispatchToken = FauxtonAPI.dispatcher.register(Stores.queryOptionsStore.dispatch);
 
-});
+export default Stores;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/documents/queryoptions/tests/queryoptions.componentsSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/queryoptions/tests/queryoptions.componentsSpec.react.jsx b/app/addons/documents/queryoptions/tests/queryoptions.componentsSpec.react.jsx
index 651c042..8860fab 100644
--- a/app/addons/documents/queryoptions/tests/queryoptions.componentsSpec.react.jsx
+++ b/app/addons/documents/queryoptions/tests/queryoptions.componentsSpec.react.jsx
@@ -9,188 +9,185 @@
 // 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([
-  '../../../../core/api',
-  '../queryoptions.react',
-  '../stores',
-  '../actions',
-  '../../resources',
-  '../../../../../test/mocha/testUtils',
-  "react",
-  'react-dom',
-  'react-addons-test-utils',
-  'sinon'
-], function (FauxtonAPI, Views, Stores, Actions, Documents, utils, React, ReactDOM, TestUtils, sinon) {
-  FauxtonAPI.router = new FauxtonAPI.Router([]);
-
-  var assert = utils.assert;
-  var restore = utils.restore;
-
-  describe('Query Options', function () {
-    var container, El;
-
-    beforeEach(function () {
-      container = document.createElement('div');
+import FauxtonAPI from "../../../../core/api";
+import Views from "../queryoptions.react";
+import Stores from "../stores";
+import Actions from "../actions";
+import Documents from "../../resources";
+import utils from "../../../../../test/mocha/testUtils";
+import React from "react";
+import ReactDOM from "react-dom";
+import TestUtils from "react-addons-test-utils";
+import sinon from "sinon";
+FauxtonAPI.router = new FauxtonAPI.Router([]);
+
+var assert = utils.assert;
+var restore = utils.restore;
+
+describe('Query Options', function () {
+  var container, El;
+
+  beforeEach(function () {
+    container = document.createElement('div');
+  });
+
+  afterEach(function () {
+    ReactDOM.unmountComponentAtNode(container);
+  });
+
+  describe('MainFieldsView', function () {
+    var mainFieldsEl;
+
+    it('returns null no reduce', function () {
+      mainFieldsEl = TestUtils.renderIntoDocument(<Views.MainFieldsView reduce={false} includeDocs={false} showReduce={false}/>, container);
+      assert.ok(_.isNull(mainFieldsEl.reduce()));
     });
 
-    afterEach(function () {
-      ReactDOM.unmountComponentAtNode(container);
+    it('shows reduce and group level', function () {
+      mainFieldsEl = TestUtils.renderIntoDocument(<Views.MainFieldsView reduce={true} includeDocs={false} showReduce={true}/>, container);
+      assert.ok(!_.isNull(mainFieldsEl.reduce()));
+      assert.ok(!_.isNull(mainFieldsEl.groupLevel()));
     });
 
-    describe('MainFieldsView', function () {
-      var mainFieldsEl;
-
-      it('returns null no reduce', function () {
-        mainFieldsEl = TestUtils.renderIntoDocument(<Views.MainFieldsView reduce={false} includeDocs={false} showReduce={false}/>, container);
-        assert.ok(_.isNull(mainFieldsEl.reduce()));
-      });
-
-      it('shows reduce and group level', function () {
-        mainFieldsEl = TestUtils.renderIntoDocument(<Views.MainFieldsView reduce={true} includeDocs={false} showReduce={true}/>, container);
-        assert.ok(!_.isNull(mainFieldsEl.reduce()));
-        assert.ok(!_.isNull(mainFieldsEl.groupLevel()));
-      });
-
-      it('updates group level', function () {
-        var spy = sinon.spy();
-        mainFieldsEl = TestUtils.renderIntoDocument(<Views.MainFieldsView updateGroupLevel={spy} reduce={true} includeDocs={false} showReduce={true}/>, container);
-        var el = $(ReactDOM.findDOMNode(mainFieldsEl)).find('#qoGroupLevel')[0];
-        TestUtils.Simulate.change(el, {target: {value: 'exact'}});
-
-        assert.ok(spy.calledOnce);
-      });
-
-      it('toggles include docs on change', function () {
-        var spy = sinon.spy();
-        mainFieldsEl = TestUtils.renderIntoDocument(<Views.MainFieldsView toggleIncludeDocs={spy} reduce={false} includeDocs={false} showReduce={false}/>, container);
-        var el = $(ReactDOM.findDOMNode(mainFieldsEl)).find('#qoIncludeDocs')[0];
-        TestUtils.Simulate.change(el);
-
-        assert.ok(spy.calledOnce);
-      });
-
-      it('uses overridden URL prop if defined', function () {
-        var customDocURL = 'http://whatever.com';
-        mainFieldsEl = TestUtils.renderIntoDocument(
-          <Views.MainFieldsView reduce={false} includeDocs={false} showReduce={false} docURL={customDocURL} />,
-          container);
-        assert.equal($(ReactDOM.findDOMNode(mainFieldsEl)).find('.help-link').attr('href'), customDocURL);
-      });
+    it('updates group level', function () {
+      var spy = sinon.spy();
+      mainFieldsEl = TestUtils.renderIntoDocument(<Views.MainFieldsView updateGroupLevel={spy} reduce={true} includeDocs={false} showReduce={true}/>, container);
+      var el = $(ReactDOM.findDOMNode(mainFieldsEl)).find('#qoGroupLevel')[0];
+      TestUtils.Simulate.change(el, {target: {value: 'exact'}});
 
+      assert.ok(spy.calledOnce);
     });
 
-    describe('KeySearchFields', function () {
-
-      it('toggles keys', function () {
-        var spy = sinon.spy();
-        var keysEl = TestUtils.renderIntoDocument(<Views.KeySearchFields
-          showByKeys={false}
-          showBetweenKeys={false}
-          betweenKeys={{}}
-          toggleByKeys={spy}
-          />, container);
-
-        var el = $(ReactDOM.findDOMNode(keysEl)).find('#byKeys')[0];
-        TestUtils.Simulate.click(el);
-        assert.ok(spy.calledOnce);
-      });
-
-      it('toggles between keys', function () {
-        var spy = sinon.spy();
-        var keysEl = TestUtils.renderIntoDocument(<Views.KeySearchFields
-          showByKeys={false}
-          showBetweenKeys={false}
-          toggleBetweenKeys={spy}
-          betweenKeys={{}}
-          />, container);
-
-        var el = $(ReactDOM.findDOMNode(keysEl)).find('#betweenKeys')[0];
-        TestUtils.Simulate.click(el);
-        assert.ok(spy.calledOnce);
-      });
-
-      it('updates byKeys', function () {
-        var spy = sinon.spy();
-        var keysEl = TestUtils.renderIntoDocument(<Views.KeySearchFields
-          showByKeys={false}
-          showBetweenKeys={false}
-          updateByKeys={spy}
-          betweenKeys={{}}
-          />, container);
-
-        var el = $(ReactDOM.findDOMNode(keysEl)).find('#keys-input')[0];
-        TestUtils.Simulate.change(el, {target: {value: 'boom'}});
-        assert.ok(spy.calledWith('boom'));
-      });
-
-      it('updates betweenKeys', function () {
-        var spy = sinon.spy();
-        var betweenKeys = {
-          startkey: '',
-          endkey: '',
-          inclusive_end: true
-        };
-        var keysEl = TestUtils.renderIntoDocument(<Views.KeySearchFields
-          showByKeys={false}
-          showBetweenKeys={false}
-          updateBetweenKeys={spy}
-          betweenKeys={betweenKeys}
-          />, container);
-
-        var el = $(ReactDOM.findDOMNode(keysEl)).find('#endkey')[0];
-        TestUtils.Simulate.change(el, {target: {value: 'boom'}});
-        assert.ok(spy.calledOnce);
-      });
+    it('toggles include docs on change', function () {
+      var spy = sinon.spy();
+      mainFieldsEl = TestUtils.renderIntoDocument(<Views.MainFieldsView toggleIncludeDocs={spy} reduce={false} includeDocs={false} showReduce={false}/>, container);
+      var el = $(ReactDOM.findDOMNode(mainFieldsEl)).find('#qoIncludeDocs')[0];
+      TestUtils.Simulate.change(el);
+
+      assert.ok(spy.calledOnce);
     });
 
-    describe('AdditionalParams', function () {
-      afterEach(function () {
-        restore(FauxtonAPI.addNotification);
-      });
-
-      it('only updates skip with numbers', function () {
-        var paramsEl = TestUtils.renderIntoDocument(<Views.AdditionalParams
-          updateSkip={function () {}}
-           />, container);
-
-        var spy = sinon.spy(FauxtonAPI, 'addNotification');
-        paramsEl.updateSkip({target: {value: 'b'}, preventDefault: function () {}});
-
-        assert.ok(spy.calledOnce);
-      });
-
-      it('updates skip if a number', function () {
-        var val = 0;
-        var paramsEl = TestUtils.renderIntoDocument(<Views.AdditionalParams
-          updateSkip={function (a) {
-            val = a;
-          }}
-           />, container);
-
-        paramsEl.updateSkip({target: {value: '3'}, preventDefault: function () {}});
-        assert.equal(val, '3');
-      });
+    it('uses overridden URL prop if defined', function () {
+      var customDocURL = 'http://whatever.com';
+      mainFieldsEl = TestUtils.renderIntoDocument(
+        <Views.MainFieldsView reduce={false} includeDocs={false} showReduce={false} docURL={customDocURL} />,
+        container);
+      assert.equal($(ReactDOM.findDOMNode(mainFieldsEl)).find('.help-link').attr('href'), customDocURL);
     });
 
   });
 
-  describe('QueryButtons', function () {
-    var container;
+  describe('KeySearchFields', function () {
 
-    beforeEach(function () {
-      container = document.createElement('div');
+    it('toggles keys', function () {
+      var spy = sinon.spy();
+      var keysEl = TestUtils.renderIntoDocument(<Views.KeySearchFields
+        showByKeys={false}
+        showBetweenKeys={false}
+        betweenKeys={{}}
+        toggleByKeys={spy}
+        />, container);
+
+      var el = $(ReactDOM.findDOMNode(keysEl)).find('#byKeys')[0];
+      TestUtils.Simulate.click(el);
+      assert.ok(spy.calledOnce);
     });
 
-    afterEach(function () {
-      ReactDOM.unmountComponentAtNode(container);
+    it('toggles between keys', function () {
+      var spy = sinon.spy();
+      var keysEl = TestUtils.renderIntoDocument(<Views.KeySearchFields
+        showByKeys={false}
+        showBetweenKeys={false}
+        toggleBetweenKeys={spy}
+        betweenKeys={{}}
+        />, container);
+
+      var el = $(ReactDOM.findDOMNode(keysEl)).find('#betweenKeys')[0];
+      TestUtils.Simulate.click(el);
+      assert.ok(spy.calledOnce);
     });
 
-    describe('cancel event fires', function () {
+    it('updates byKeys', function () {
       var spy = sinon.spy();
-      var component = TestUtils.renderIntoDocument(<Views.QueryButtons onCancel={spy} />, container);
-      TestUtils.Simulate.click($(ReactDOM.findDOMNode(component)).find('a')[0]);
+      var keysEl = TestUtils.renderIntoDocument(<Views.KeySearchFields
+        showByKeys={false}
+        showBetweenKeys={false}
+        updateByKeys={spy}
+        betweenKeys={{}}
+        />, container);
+
+      var el = $(ReactDOM.findDOMNode(keysEl)).find('#keys-input')[0];
+      TestUtils.Simulate.change(el, {target: {value: 'boom'}});
+      assert.ok(spy.calledWith('boom'));
+    });
+
+    it('updates betweenKeys', function () {
+      var spy = sinon.spy();
+      var betweenKeys = {
+        startkey: '',
+        endkey: '',
+        inclusive_end: true
+      };
+      var keysEl = TestUtils.renderIntoDocument(<Views.KeySearchFields
+        showByKeys={false}
+        showBetweenKeys={false}
+        updateBetweenKeys={spy}
+        betweenKeys={betweenKeys}
+        />, container);
+
+      var el = $(ReactDOM.findDOMNode(keysEl)).find('#endkey')[0];
+      TestUtils.Simulate.change(el, {target: {value: 'boom'}});
+      assert.ok(spy.calledOnce);
+    });
+  });
+
+  describe('AdditionalParams', function () {
+    afterEach(function () {
+      restore(FauxtonAPI.addNotification);
+    });
+
+    it('only updates skip with numbers', function () {
+      var paramsEl = TestUtils.renderIntoDocument(<Views.AdditionalParams
+        updateSkip={function () {}}
+         />, container);
+
+      var spy = sinon.spy(FauxtonAPI, 'addNotification');
+      paramsEl.updateSkip({target: {value: 'b'}, preventDefault: function () {}});
+
       assert.ok(spy.calledOnce);
     });
 
+    it('updates skip if a number', function () {
+      var val = 0;
+      var paramsEl = TestUtils.renderIntoDocument(<Views.AdditionalParams
+        updateSkip={function (a) {
+          val = a;
+        }}
+         />, container);
+
+      paramsEl.updateSkip({target: {value: '3'}, preventDefault: function () {}});
+      assert.equal(val, '3');
+    });
+  });
+
+});
+
+describe('QueryButtons', function () {
+  var container;
+
+  beforeEach(function () {
+    container = document.createElement('div');
   });
+
+  afterEach(function () {
+    ReactDOM.unmountComponentAtNode(container);
+  });
+
+  describe('cancel event fires', function () {
+    var spy = sinon.spy();
+    var component = TestUtils.renderIntoDocument(<Views.QueryButtons onCancel={spy} />, container);
+    TestUtils.Simulate.click($(ReactDOM.findDOMNode(component)).find('a')[0]);
+    assert.ok(spy.calledOnce);
+  });
+
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/documents/queryoptions/tests/queryoptions.storesSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/queryoptions/tests/queryoptions.storesSpec.js b/app/addons/documents/queryoptions/tests/queryoptions.storesSpec.js
index 25594c2..3966483 100644
--- a/app/addons/documents/queryoptions/tests/queryoptions.storesSpec.js
+++ b/app/addons/documents/queryoptions/tests/queryoptions.storesSpec.js
@@ -10,124 +10,121 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../../../core/api',
-  '../stores',
-  '../actiontypes',
-  '../../../../../test/mocha/testUtils',
-], function (FauxtonAPI, Stores, ActionTypes, testUtils) {
-  var assert = testUtils.assert;
-  var dispatchToken;
-  var store;
-  var opts;
-
-  describe('QueryOptions Store', function () {
-    beforeEach(function () {
-      store = new Stores.QueryOptionsStore();
-      dispatchToken = FauxtonAPI.dispatcher.register(store.dispatch);
-    });
+import FauxtonAPI from "../../../../core/api";
+import Stores from "../stores";
+import ActionTypes from "../actiontypes";
+import testUtils from "../../../../../test/mocha/testUtils";
+var assert = testUtils.assert;
+var dispatchToken;
+var store;
+var opts;
+
+describe('QueryOptions Store', function () {
+  beforeEach(function () {
+    store = new Stores.QueryOptionsStore();
+    dispatchToken = FauxtonAPI.dispatcher.register(store.dispatch);
+  });
 
-    afterEach(function () {
-      FauxtonAPI.dispatcher.unregister(dispatchToken);
-    });
+  afterEach(function () {
+    FauxtonAPI.dispatcher.unregister(dispatchToken);
+  });
 
-    describe('Toggle By Keys and Between Keys', function () {
+  describe('Toggle By Keys and Between Keys', function () {
 
-      it('toggling by keys sets by keys to true', function () {
+    it('toggling by keys sets by keys to true', function () {
 
-        store.toggleByKeys();
+      store.toggleByKeys();
 
-        assert.ok(store.showByKeys());
-      });
+      assert.ok(store.showByKeys());
+    });
 
-      it('toggling between keys sets between keys to true', function () {
+    it('toggling between keys sets between keys to true', function () {
 
-        store.toggleBetweenKeys();
-        assert.ok(store.showBetweenKeys());
-      });
+      store.toggleBetweenKeys();
+      assert.ok(store.showBetweenKeys());
+    });
 
-      it('toggling between keys sets by keys to false', function () {
-        store._showByKeys = true;
-        store.toggleBetweenKeys();
-        assert.notOk(store.showByKeys());
-      });
+    it('toggling between keys sets by keys to false', function () {
+      store._showByKeys = true;
+      store.toggleBetweenKeys();
+      assert.notOk(store.showByKeys());
+    });
 
-      it('toggling by keys sets between keys to false', function () {
-        store._showBetweenKeys = true;
-        store.toggleByKeys();
-        assert.notOk(store.showBetweenKeys());
-      });
+    it('toggling by keys sets between keys to false', function () {
+      store._showBetweenKeys = true;
+      store.toggleByKeys();
+      assert.notOk(store.showBetweenKeys());
+    });
 
+  });
+
+  describe('getQueryParams', function () {
+    it('returns params for default', function () {
+      assert.deepEqual(store.getQueryParams(), {});
     });
 
-    describe('getQueryParams', function () {
-      it('returns params for default', function () {
-        assert.deepEqual(store.getQueryParams(), {});
+    it('with betweenKeys', function () {
+      store.toggleBetweenKeys();
+      store.updateBetweenKeys({
+        startkey:"a",
+        endkey: "z",
+        include: true
       });
 
-      it('with betweenKeys', function () {
-        store.toggleBetweenKeys();
-        store.updateBetweenKeys({
-          startkey:"a",
-          endkey: "z",
-          include: true
-        });
-
-        assert.deepEqual(store.getQueryParams(), {
-          inclusive_end: true,
-          start_key: 'a',
-          end_key: 'z'
-        });
+      assert.deepEqual(store.getQueryParams(), {
+        inclusive_end: true,
+        start_key: 'a',
+        end_key: 'z'
       });
+    });
 
-      it('with byKeys', function () {
-        store.toggleByKeys();
-        store.updateByKeys("[1,2,3]");
+    it('with byKeys', function () {
+      store.toggleByKeys();
+      store.updateByKeys("[1,2,3]");
 
-        assert.deepEqual(store.getQueryParams(), {
-          keys: "[1,2,3]"
-        });
+      assert.deepEqual(store.getQueryParams(), {
+        keys: "[1,2,3]"
       });
     });
+  });
 
-    describe('setQueryParams', function () {
-
-      it('sets all store values from given params', function () {
+  describe('setQueryParams', function () {
 
-        store.setQueryParams({
-          include_docs: true,
-          limit: 10,
-          skip: 5,
-          descending: true
-        });
+    it('sets all store values from given params', function () {
 
-        assert.ok(store.includeDocs());
-        assert.ok(store.descending());
-        assert.equal(store.limit(), 10);
-        assert.equal(store.skip(), 5);
+      store.setQueryParams({
+        include_docs: true,
+        limit: 10,
+        skip: 5,
+        descending: true
       });
 
-      it('sets between keys', function () {
-        store.setQueryParams({
-          start_key: 1,
-          end_key: 5
-        });
+      assert.ok(store.includeDocs());
+      assert.ok(store.descending());
+      assert.equal(store.limit(), 10);
+      assert.equal(store.skip(), 5);
+    });
 
-        assert.equal(store.betweenKeys().startkey, 1);
-        assert.equal(store.betweenKeys().endkey, 5);
-        assert.ok(store.betweenKeys().include);
-        assert.ok(store.showBetweenKeys());
+    it('sets between keys', function () {
+      store.setQueryParams({
+        start_key: 1,
+        end_key: 5
       });
 
-      it('sets by keys', function () {
-        store.setQueryParams({
-          keys: [1, 2, 3]
-        });
+      assert.equal(store.betweenKeys().startkey, 1);
+      assert.equal(store.betweenKeys().endkey, 5);
+      assert.ok(store.betweenKeys().include);
+      assert.ok(store.showBetweenKeys());
+    });
 
-        assert.deepEqual(store.byKeys(), [1, 2, 3]);
-        assert.ok(store.showByKeys());
+    it('sets by keys', function () {
+      store.setQueryParams({
+        keys: [1, 2, 3]
       });
 
+      assert.deepEqual(store.byKeys(), [1, 2, 3]);
+      assert.ok(store.showByKeys());
     });
+
   });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/documents/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/resources.js b/app/addons/documents/resources.js
index 13610f5..b93dd3d 100644
--- a/app/addons/documents/resources.js
+++ b/app/addons/documents/resources.js
@@ -10,582 +10,577 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../app',
-  '../../core/api',
-  './shared-resources',
-  '../../../assets/js/plugins/cloudant.pagingcollection'
-],
-
-function (app, FauxtonAPI, Documents, PagingCollection) {
-  Documents.QueryParams = (function () {
-    var _eachParams = function (params, action) {
-      // clone to avoid in-place modification
-      var result = _.clone(params);
-
-      _.each(['startkey', 'endkey', 'key'], function (key) {
-        if (_.has(result, key)) {
-          result[key] = action(result[key]);
-        }
-      });
-
-      return result;
-    };
-
-    return {
-      parse: function (params) {
-        return _eachParams(params, JSON.parse);
-      },
-
-      stringify: function (params) {
-        return _eachParams(params, JSON.stringify);
+import app from "../../app";
+import FauxtonAPI from "../../core/api";
+import Documents from "./shared-resources";
+import PagingCollection from "../../../assets/js/plugins/cloudant.pagingcollection";
+Documents.QueryParams = (function () {
+  var _eachParams = function (params, action) {
+    // clone to avoid in-place modification
+    var result = _.clone(params);
+
+    _.each(['startkey', 'endkey', 'key'], function (key) {
+      if (_.has(result, key)) {
+        result[key] = action(result[key]);
       }
-    };
-  })();
+    });
 
+    return result;
+  };
 
-  Documents.DdocInfo = FauxtonAPI.Model.extend({
-    idAttribute: "_id",
-    documentation: function () {
-      return FauxtonAPI.constants.DOC_URLS.GENERAL;
-    },
-    initialize: function (_attrs, options) {
-      this.database = options.database;
+  return {
+    parse: function (params) {
+      return _eachParams(params, JSON.parse);
     },
 
-    url: function (context) {
-      if (!context) {
-        context = 'server';
-      }
-
-      return FauxtonAPI.urls('designDocs', context, this.database.safeID(), this.safeID());
-    },
-
-    // Need this to work around backbone router thinking _design/foo
-    // is a separate route. Alternatively, maybe these should be
-    // treated separately. For instance, we could default into the
-    // json editor for docs, or into a ddoc specific page.
-    safeID: function () {
-      var ddoc = this.id.replace(/^_design\//, "");
-      return "_design/" + app.utils.safeURLName(ddoc);
+    stringify: function (params) {
+      return _eachParams(params, JSON.stringify);
+    }
+  };
+})();
+
+
+Documents.DdocInfo = FauxtonAPI.Model.extend({
+  idAttribute: "_id",
+  documentation: function () {
+    return FauxtonAPI.constants.DOC_URLS.GENERAL;
+  },
+  initialize: function (_attrs, options) {
+    this.database = options.database;
+  },
+
+  url: function (context) {
+    if (!context) {
+      context = 'server';
     }
-  });
 
-  Documents.MangoIndex = Documents.Doc.extend({
-    idAttribute: 'ddoc',
+    return FauxtonAPI.urls('designDocs', context, this.database.safeID(), this.safeID());
+  },
+
+  // Need this to work around backbone router thinking _design/foo
+  // is a separate route. Alternatively, maybe these should be
+  // treated separately. For instance, we could default into the
+  // json editor for docs, or into a ddoc specific page.
+  safeID: function () {
+    var ddoc = this.id.replace(/^_design\//, "");
+    return "_design/" + app.utils.safeURLName(ddoc);
+  }
+});
 
-    getId: function () {
+Documents.MangoIndex = Documents.Doc.extend({
+  idAttribute: 'ddoc',
 
-      if (this.id) {
-        return this.id;
-      }
+  getId: function () {
 
+    if (this.id) {
+      return this.id;
+    }
 
-      return '_all_docs';
-    },
 
-    isNew: function () {
-      // never use put
-      return true;
-    },
+    return '_all_docs';
+  },
 
-    // @deprecated, see isJSONDocBulkDeletable
-    isDeletable: function () {
-      return this.get('type') !== 'special';
-    },
+  isNew: function () {
+    // never use put
+    return true;
+  },
 
-    // @deprecated, see isJSONDocBulkDeletable
-    isBulkDeletable: function () {
-      return this.isDeletable();
-    },
+  // @deprecated, see isJSONDocBulkDeletable
+  isDeletable: function () {
+    return this.get('type') !== 'special';
+  },
 
-    isFromView: function () {
-      return false;
-    },
+  // @deprecated, see isJSONDocBulkDeletable
+  isBulkDeletable: function () {
+    return this.isDeletable();
+  },
 
-    url: function () {
-      var database = this.database.safeID();
+  isFromView: function () {
+    return false;
+  },
 
-      return FauxtonAPI.urls('mango', 'index-server', database);
-    }
-  });
+  url: function () {
+    var database = this.database.safeID();
 
-  Documents.MangoIndexCollection = PagingCollection.extend({
-    model: Documents.MangoIndex,
-    initialize: function (_attr, options) {
-      var defaultLimit = FauxtonAPI.constants.MISC.DEFAULT_PAGE_SIZE;
+    return FauxtonAPI.urls('mango', 'index-server', database);
+  }
+});
 
-      this.database = options.database;
-      this.params = _.extend({limit: defaultLimit}, options.params);
-    },
+Documents.MangoIndexCollection = PagingCollection.extend({
+  model: Documents.MangoIndex,
+  initialize: function (_attr, options) {
+    var defaultLimit = FauxtonAPI.constants.MISC.DEFAULT_PAGE_SIZE;
 
-    collectionType: 'MangoIndex',
+    this.database = options.database;
+    this.params = _.extend({limit: defaultLimit}, options.params);
+  },
 
-    url: function () {
-      return this.urlRef.apply(this, arguments);
-    },
+  collectionType: 'MangoIndex',
 
-    updateSeq: function () {
-      return false;
-    },
+  url: function () {
+    return this.urlRef.apply(this, arguments);
+  },
 
-    //@deprecated, see isJSONDocEditable
-    isEditable: function () {
-      return false;
-    },
+  updateSeq: function () {
+    return false;
+  },
 
-    parse: function (res) {
-      return res.indexes;
-    },
+  //@deprecated, see isJSONDocEditable
+  isEditable: function () {
+    return false;
+  },
 
-    urlRef: function (context, params) {
-      var database = this.database.safeID(),
-          query = '';
+  parse: function (res) {
+    return res.indexes;
+  },
 
-      if (!context) {
-        context = 'index-server';
-      }
+  urlRef: function (context, params) {
+    var database = this.database.safeID(),
+        query = '';
 
-      return FauxtonAPI.urls('mango', context, database, query);
+    if (!context) {
+      context = 'index-server';
     }
-  });
 
-  // MANGO INDEX EDITOR
-  Documents.MangoDoc = Documents.Doc.extend({
-    isMangoDoc: function () {
-      return true;
-    }
-  });
+    return FauxtonAPI.urls('mango', context, database, query);
+  }
+});
 
-  Documents.MangoDocumentCollection = PagingCollection.extend({
-    model: Documents.MangoDoc,
+// MANGO INDEX EDITOR
+Documents.MangoDoc = Documents.Doc.extend({
+  isMangoDoc: function () {
+    return true;
+  }
+});
 
-    collectionType: 'MangoDocumentCollection',
+Documents.MangoDocumentCollection = PagingCollection.extend({
+  model: Documents.MangoDoc,
 
-    initialize: function (_attr, options) {
-      var defaultLimit = FauxtonAPI.constants.MISC.DEFAULT_PAGE_SIZE;
+  collectionType: 'MangoDocumentCollection',
 
-      this.database = options.database;
-      this.params = _.extend({limit: defaultLimit}, options.params);
+  initialize: function (_attr, options) {
+    var defaultLimit = FauxtonAPI.constants.MISC.DEFAULT_PAGE_SIZE;
 
-      this.paging = _.defaults((options.paging || {}), {
-        defaultParams: _.defaults({}, options.params),
-        hasNext: false,
-        hasPrevious: false,
-        params: {},
-        pageSize: FauxtonAPI.constants.MISC.DEFAULT_PAGE_SIZE,
-        direction: undefined
-      });
+    this.database = options.database;
+    this.params = _.extend({limit: defaultLimit}, options.params);
 
-      this.paging.params = _.clone(this.paging.defaultParams);
-    },
+    this.paging = _.defaults((options.paging || {}), {
+      defaultParams: _.defaults({}, options.params),
+      hasNext: false,
+      hasPrevious: false,
+      params: {},
+      pageSize: FauxtonAPI.constants.MISC.DEFAULT_PAGE_SIZE,
+      direction: undefined
+    });
 
-    url: function () {
-      return this.urlRef.apply(this, arguments);
-    },
+    this.paging.params = _.clone(this.paging.defaultParams);
+  },
 
-    updateSeq: function () {
-      return false;
-    },
-
-    isEditable: function () {
-      return true;
-    },
-
-    setQuery: function (query) {
-      this.query = query;
-      return this;
-    },
+  url: function () {
+    return this.urlRef.apply(this, arguments);
+  },
 
-    pageSizeReset: function (pageSize, opts) {
-      var options = _.defaults((opts || {}), {fetch: true});
-      this.paging.direction = undefined;
-      this.paging.pageSize = pageSize;
-      this.paging.params = this.paging.defaultParams;
-      this.paging.params.limit = pageSize;
+  updateSeq: function () {
+    return false;
+  },
 
-      if (options.fetch) {
-        return this.fetch();
-      }
-    },
+  isEditable: function () {
+    return true;
+  },
 
-    _iterate: function (offset, opts) {
-      var options = _.defaults((opts || {}), {fetch: true});
+  setQuery: function (query) {
+    this.query = query;
+    return this;
+  },
 
-      this.paging.params = this.calculateParams(this.paging.params, offset, this.paging.pageSize);
+  pageSizeReset: function (pageSize, opts) {
+    var options = _.defaults((opts || {}), {fetch: true});
+    this.paging.direction = undefined;
+    this.paging.pageSize = pageSize;
+    this.paging.params = this.paging.defaultParams;
+    this.paging.params.limit = pageSize;
 
+    if (options.fetch) {
       return this.fetch();
-    },
-
-    getPaginatedQuery: function () {
-      var paginatedQuery = JSON.parse(JSON.stringify(this.query));
-
-      if (!this.paging.direction && this.paging.params.limit > 0) {
-        this.paging.direction = 'fetch';
-        this.paging.params.limit = this.paging.params.limit + 1;
-      }
-
-      // just update if NOT provided by editor
-      if (!paginatedQuery.limit) {
-        paginatedQuery.limit = this.paging.params.limit;
-      }
-
-      if (!paginatedQuery.skip) {
-        paginatedQuery.skip = this.paging.params.skip;
-      }
-
-      return paginatedQuery;
-    },
-
-    fetch: function () {
-      var url = this.urlRef(),
-                promise = FauxtonAPI.Deferred(),
-                query = this.getPaginatedQuery();
-
-      $.ajax({
-        type: 'POST',
-        url: url,
-        contentType: 'application/json',
-        dataType: 'json',
-        data: JSON.stringify(query),
-      })
-      .then(function (res) {
-        this.handleResponse(res, promise);
-      }.bind(this))
-      .fail(function (res) {
-        promise.reject(res.responseJSON);
-      }.bind(this));
-
-      return promise;
-    },
-
-    parse: function (resp) {
-      var rows = resp.docs;
-
-      this.paging.hasNext = this.paging.hasPrevious = false;
-
-      this.viewMeta = {
-        total_rows: resp.total_rows,
-        offset: resp.offset,
-        update_seq: resp.update_seq
-      };
-
-      var skipLimit = this.paging.defaultParams.skip || 0;
-      if (this.paging.params.skip > skipLimit) {
-        this.paging.hasPrevious = true;
-      }
-
-      if (rows.length === this.paging.pageSize + 1) {
-        this.paging.hasNext = true;
+    }
+  },
 
-        // remove the next page marker result
-        rows.pop();
-        this.viewMeta.total_rows = this.viewMeta.total_rows - 1;
-      }
+  _iterate: function (offset, opts) {
+    var options = _.defaults((opts || {}), {fetch: true});
 
-      return rows;
-    },
+    this.paging.params = this.calculateParams(this.paging.params, offset, this.paging.pageSize);
 
-    handleResponse: function (res, promise) {
-      var models = this.parse(res);
+    return this.fetch();
+  },
 
-      this.reset(models);
-
-      promise.resolve();
-    },
+  getPaginatedQuery: function () {
+    var paginatedQuery = JSON.parse(JSON.stringify(this.query));
 
-    urlRef: function (context) {
-      var database = this.database.safeID(),
-          query = '';
-
-      if (!context) {
-        context = 'query-server';
-      }
+    if (!this.paging.direction && this.paging.params.limit > 0) {
+      this.paging.direction = 'fetch';
+      this.paging.params.limit = this.paging.params.limit + 1;
+    }
 
-      return FauxtonAPI.urls('mango', context, database, query);
+    // just update if NOT provided by editor
+    if (!paginatedQuery.limit) {
+      paginatedQuery.limit = this.paging.params.limit;
     }
-  });
 
-  Documents.NewDoc = Documents.Doc.extend({
-    fetch: function () {
-      var uuid = new FauxtonAPI.UUID();
-      var deferred = this.deferred = $.Deferred();
-      var that = this;
+    if (!paginatedQuery.skip) {
+      paginatedQuery.skip = this.paging.params.skip;
+    }
 
-      uuid.fetch().done(function () {
-        that.set("_id", uuid.next());
-        deferred.resolve();
-      });
+    return paginatedQuery;
+  },
+
+  fetch: function () {
+    var url = this.urlRef(),
+              promise = FauxtonAPI.Deferred(),
+              query = this.getPaginatedQuery();
+
+    $.ajax({
+      type: 'POST',
+      url: url,
+      contentType: 'application/json',
+      dataType: 'json',
+      data: JSON.stringify(query),
+    })
+    .then(function (res) {
+      this.handleResponse(res, promise);
+    }.bind(this))
+    .fail(function (res) {
+      promise.reject(res.responseJSON);
+    }.bind(this));
+
+    return promise;
+  },
+
+  parse: function (resp) {
+    var rows = resp.docs;
+
+    this.paging.hasNext = this.paging.hasPrevious = false;
+
+    this.viewMeta = {
+      total_rows: resp.total_rows,
+      offset: resp.offset,
+      update_seq: resp.update_seq
+    };
 
-      return deferred.promise();
+    var skipLimit = this.paging.defaultParams.skip || 0;
+    if (this.paging.params.skip > skipLimit) {
+      this.paging.hasPrevious = true;
     }
 
-  });
+    if (rows.length === this.paging.pageSize + 1) {
+      this.paging.hasNext = true;
 
-  Documents.BulkDeleteDoc = FauxtonAPI.Model.extend({
-    idAttribute: "_id"
-  });
+      // remove the next page marker result
+      rows.pop();
+      this.viewMeta.total_rows = this.viewMeta.total_rows - 1;
+    }
 
-  Documents.BulkDeleteDocCollection = FauxtonAPI.Collection.extend({
+    return rows;
+  },
 
-    model: Documents.BulkDeleteDoc,
+  handleResponse: function (res, promise) {
+    var models = this.parse(res);
 
-    sync: function () {
+    this.reset(models);
 
-    },
+    promise.resolve();
+  },
 
-    initialize: function (models, options) {
-      this.databaseId = options.databaseId;
-    },
+  urlRef: function (context) {
+    var database = this.database.safeID(),
+        query = '';
 
-    url: function () {
-      return app.host + '/' + this.databaseId + '/_bulk_docs';
-    },
+    if (!context) {
+      context = 'query-server';
+    }
 
-    bulkDelete: function () {
-      var payload = this.createPayload(this.toJSON()),
-          promise = FauxtonAPI.Deferred(),
-          that = this;
-
-      $.ajax({
-        type: 'POST',
-        url: this.url(),
-        contentType: 'application/json',
-        dataType: 'json',
-        data: JSON.stringify(payload),
-      })
-      .then(function (res) {
-        that.handleResponse(res, promise);
-      })
-      .fail(function () {
-        var ids = _.reduce(that.toArray(), function (acc, doc) {
-          acc.push(doc.id);
-          return acc;
-        }, []);
-        that.trigger('error', ids);
-        promise.reject(ids);
-      });
+    return FauxtonAPI.urls('mango', context, database, query);
+  }
+});
 
-      return promise;
-    },
+Documents.NewDoc = Documents.Doc.extend({
+  fetch: function () {
+    var uuid = new FauxtonAPI.UUID();
+    var deferred = this.deferred = $.Deferred();
+    var that = this;
 
-    handleResponse: function (res, promise) {
-      var ids = _.reduce(res, function (ids, doc) {
-        if (doc.error) {
-          ids.errorIds.push(doc.id);
-        }
+    uuid.fetch().done(function () {
+      that.set("_id", uuid.next());
+      deferred.resolve();
+    });
 
-        if (!doc.error) {
-          ids.successIds.push(doc.id);
-        }
+    return deferred.promise();
+  }
 
-        return ids;
-      }, {errorIds: [], successIds: []});
+});
 
-      this.removeDocuments(ids.successIds);
+Documents.BulkDeleteDoc = FauxtonAPI.Model.extend({
+  idAttribute: "_id"
+});
 
-      if (ids.errorIds.length) {
-        this.trigger('error', ids.errorIds);
+Documents.BulkDeleteDocCollection = FauxtonAPI.Collection.extend({
+
+  model: Documents.BulkDeleteDoc,
+
+  sync: function () {
+
+  },
+
+  initialize: function (models, options) {
+    this.databaseId = options.databaseId;
+  },
+
+  url: function () {
+    return app.host + '/' + this.databaseId + '/_bulk_docs';
+  },
+
+  bulkDelete: function () {
+    var payload = this.createPayload(this.toJSON()),
+        promise = FauxtonAPI.Deferred(),
+        that = this;
+
+    $.ajax({
+      type: 'POST',
+      url: this.url(),
+      contentType: 'application/json',
+      dataType: 'json',
+      data: JSON.stringify(payload),
+    })
+    .then(function (res) {
+      that.handleResponse(res, promise);
+    })
+    .fail(function () {
+      var ids = _.reduce(that.toArray(), function (acc, doc) {
+        acc.push(doc.id);
+        return acc;
+      }, []);
+      that.trigger('error', ids);
+      promise.reject(ids);
+    });
+
+    return promise;
+  },
+
+  handleResponse: function (res, promise) {
+    var ids = _.reduce(res, function (ids, doc) {
+      if (doc.error) {
+        ids.errorIds.push(doc.id);
       }
 
-      // This is kind of tricky. If there are no documents deleted then rejects
-      // otherwise resolve with list of successful and failed documents
-      if (!_.isEmpty(ids.successIds)) {
-        promise.resolve(ids);
-      } else {
-        promise.reject(ids.errorIds);
+      if (!doc.error) {
+        ids.successIds.push(doc.id);
       }
 
-      this.trigger('updated');
-    },
-
-    removeDocuments: function (ids) {
-      var reloadDesignDocs = false;
-      _.each(ids, function (id) {
-        if (/_design/.test(id)) {
-          reloadDesignDocs = true;
-        }
+      return ids;
+    }, {errorIds: [], successIds: []});
 
-        this.remove(this.get(id));
-      }, this);
-
-      if (reloadDesignDocs) {
-        FauxtonAPI.triggerRouteEvent('reloadDesignDocs');
-      }
+    this.removeDocuments(ids.successIds);
 
-      this.trigger('removed', ids);
-    },
-
-    createPayload: function (documents) {
-      var documentList = documents;
-
-      return {
-        docs: documentList
-      };
+    if (ids.errorIds.length) {
+      this.trigger('error', ids.errorIds);
     }
-  });
 
-  Documents.MangoBulkDeleteDocCollection = Documents.BulkDeleteDocCollection.extend({
-    url: function () {
-      return app.host + '/' + this.databaseId + '/_index/_bulk_delete';
-    },
-
-    createPayload: function (documents) {
-      var documentList = documents
-        .filter(function (doc) {
-          return doc._id !== '_all_docs';
-        })
-        .map(function (doc) {
-          return doc._id;
-        });
-
-      return {
-        docids: documentList
-      };
+    // This is kind of tricky. If there are no documents deleted then rejects
+    // otherwise resolve with list of successful and failed documents
+    if (!_.isEmpty(ids.successIds)) {
+      promise.resolve(ids);
+    } else {
+      promise.reject(ids.errorIds);
     }
 
-  });
+    this.trigger('updated');
+  },
 
-  Documents.IndexCollection = PagingCollection.extend({
-    model: Documents.Doc,
-    documentation: function () {
-      return FauxtonAPI.constants.DOC_URLS.GENERAL;
-    },
-    initialize: function (_models, options) {
-      this.database = options.database;
-      this.params = _.extend({limit: 20, reduce: false}, options.params);
+  removeDocuments: function (ids) {
+    var reloadDesignDocs = false;
+    _.each(ids, function (id) {
+      if (/_design/.test(id)) {
+        reloadDesignDocs = true;
+      }
 
-      this.idxType = "_view";
-      this.view = options.view;
-      this.design = options.design.replace('_design/', '');
-      this.perPageLimit = options.perPageLimit || 20;
+      this.remove(this.get(id));
+    }, this);
 
-      if (!this.params.limit) {
-        this.params.limit = this.perPageLimit;
-      }
-    },
+    if (reloadDesignDocs) {
+      FauxtonAPI.triggerRouteEvent('reloadDesignDocs');
+    }
 
-    isEditable: function () {
-      return !this.params.reduce;
-    },
+    this.trigger('removed', ids);
+  },
 
-    urlRef: function (context, params) {
-      var query = "";
-
-      if (params) {
-        if (!_.isEmpty(params)) {
-          query = "?" + $.param(params);
-        } else {
-          query = '';
-        }
-      } else if (this.params) {
-        var parsedParam = Documents.QueryParams.stringify(this.params);
-        query = "?" + $.param(parsedParam);
-      }
+  createPayload: function (documents) {
+    var documentList = documents;
 
-      if (!context) {
-        context = 'server';
-      }
+    return {
+      docs: documentList
+    };
+  }
+});
 
-      var database = this.database.safeID(),
-          design = app.utils.safeURLName(this.design),
-          view = app.utils.safeURLName(this.view),
-          url = FauxtonAPI.urls('view', context, database, design, view);
+Documents.MangoBulkDeleteDocCollection = Documents.BulkDeleteDocCollection.extend({
+  url: function () {
+    return app.host + '/' + this.databaseId + '/_index/_bulk_delete';
+  },
 
-      return url + query;
-    },
+  createPayload: function (documents) {
+    var documentList = documents
+      .filter(function (doc) {
+        return doc._id !== '_all_docs';
+      })
+      .map(function (doc) {
+        return doc._id;
+      });
 
-    url: function () {
-      return this.urlRef.apply(this, arguments);
-    },
+    return {
+      docids: documentList
+    };
+  }
 
-    totalRows: function () {
-      if (this.params.reduce) { return "unknown_reduce";}
+});
 
-      return this.viewMeta.total_rows || "unknown";
-    },
+Documents.IndexCollection = PagingCollection.extend({
+  model: Documents.Doc,
+  documentation: function () {
+    return FauxtonAPI.constants.DOC_URLS.GENERAL;
+  },
+  initialize: function (_models, options) {
+    this.database = options.database;
+    this.params = _.extend({limit: 20, reduce: false}, options.params);
+
+    this.idxType = "_view";
+    this.view = options.view;
+    this.design = options.design.replace('_design/', '');
+    this.perPageLimit = options.perPageLimit || 20;
+
+    if (!this.params.limit) {
+      this.params.limit = this.perPageLimit;
+    }
+  },
 
-    updateSeq: function () {
-      if (!this.viewMeta) {
-        return false;
-      }
+  isEditable: function () {
+    return !this.params.reduce;
+  },
 
-      return this.viewMeta.update_seq || false;
-    },
+  urlRef: function (context, params) {
+    var query = "";
 
-    simple: function () {
-      var docs = this.map(function (item) {
-        return {
-          _id: item.id,
-          key: item.get('key'),
-          value: item.get('value')
-        };
-      });
+    if (params) {
+      if (!_.isEmpty(params)) {
+        query = "?" + $.param(params);
+      } else {
+        query = '';
+      }
+    } else if (this.params) {
+      var parsedParam = Documents.QueryParams.stringify(this.params);
+      query = "?" + $.param(parsedParam);
+    }
 
-      return new Documents.IndexCollection(docs, {
-        database: this.database,
-        params: this.params,
-        view: this.view,
-        design: this.design
-      });
-    },
+    if (!context) {
+      context = 'server';
+    }
 
-    parse: function (resp) {
-      var rows = resp.rows;
-      this.endTime = new Date().getTime();
-      this.requestDuration = (this.endTime - this.startTime);
+    var database = this.database.safeID(),
+        design = app.utils.safeURLName(this.design),
+        view = app.utils.safeURLName(this.view),
+        url = FauxtonAPI.urls('view', context, database, design, view);
 
-      return PagingCollection.prototype.parse.apply(this, arguments);
-    },
+    return url + query;
+  },
 
-    buildAllDocs: function () {
-      this.fetch();
-    },
+  url: function () {
+    return this.urlRef.apply(this, arguments);
+  },
 
-    // We implement our own fetch to store the starttime so we that
-    // we can get the request duration
-    fetch: function () {
-      this.startTime = new Date().getTime();
-      return PagingCollection.prototype.fetch.call(this);
-    },
+  totalRows: function () {
+    if (this.params.reduce) { return "unknown_reduce";}
 
-    allDocs: function () {
-      return this.models;
-    },
+    return this.viewMeta.total_rows || "unknown";
+  },
 
-    // This is taken from futon.browse.js $.timeString
-    requestDurationInString: function () {
-      var ms, sec, min, h, timeString, milliseconds = this.requestDuration;
+  updateSeq: function () {
+    if (!this.viewMeta) {
+      return false;
+    }
 
-      sec = Math.floor(milliseconds / 1000.0);
-      min = Math.floor(sec / 60.0);
-      sec = (sec % 60.0).toString();
-      if (sec.length < 2) {
-        sec = "0" + sec;
-      }
+    return this.viewMeta.update_seq || false;
+  },
 
-      h = (Math.floor(min / 60.0)).toString();
-      if (h.length < 2) {
-        h = "0" + h;
-      }
+  simple: function () {
+    var docs = this.map(function (item) {
+      return {
+        _id: item.id,
+        key: item.get('key'),
+        value: item.get('value')
+      };
+    });
+
+    return new Documents.IndexCollection(docs, {
+      database: this.database,
+      params: this.params,
+      view: this.view,
+      design: this.design
+    });
+  },
+
+  parse: function (resp) {
+    var rows = resp.rows;
+    this.endTime = new Date().getTime();
+    this.requestDuration = (this.endTime - this.startTime);
+
+    return PagingCollection.prototype.parse.apply(this, arguments);
+  },
+
+  buildAllDocs: function () {
+    this.fetch();
+  },
+
+  // We implement our own fetch to store the starttime so we that
+  // we can get the request duration
+  fetch: function () {
+    this.startTime = new Date().getTime();
+    return PagingCollection.prototype.fetch.call(this);
+  },
+
+  allDocs: function () {
+    return this.models;
+  },
+
+  // This is taken from futon.browse.js $.timeString
+  requestDurationInString: function () {
+    var ms, sec, min, h, timeString, milliseconds = this.requestDuration;
+
+    sec = Math.floor(milliseconds / 1000.0);
+    min = Math.floor(sec / 60.0);
+    sec = (sec % 60.0).toString();
+    if (sec.length < 2) {
+      sec = "0" + sec;
+    }
 
-      min = (min % 60.0).toString();
-      if (min.length < 2) {
-        min = "0" + min;
-      }
+    h = (Math.floor(min / 60.0)).toString();
+    if (h.length < 2) {
+      h = "0" + h;
+    }
 
-      timeString = h + ":" + min + ":" + sec;
+    min = (min % 60.0).toString();
+    if (min.length < 2) {
+      min = "0" + min;
+    }
 
-      ms = (milliseconds % 1000.0).toString();
-      while (ms.length < 3) {
-        ms = "0" + ms;
-      }
-      timeString += "." + ms;
+    timeString = h + ":" + min + ":" + sec;
 
-      return timeString;
+    ms = (milliseconds % 1000.0).toString();
+    while (ms.length < 3) {
+      ms = "0" + ms;
     }
+    timeString += "." + ms;
 
-  });
+    return timeString;
+  }
 
-  return Documents;
 });
+
+export default Documents;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/documents/rev-browser/rev-browser.actions.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/rev-browser/rev-browser.actions.js b/app/addons/documents/rev-browser/rev-browser.actions.js
index 29c9b2b..794fa7b 100644
--- a/app/addons/documents/rev-browser/rev-browser.actions.js
+++ b/app/addons/documents/rev-browser/rev-browser.actions.js
@@ -12,157 +12,152 @@
 
 /* global FormData */
 
-define([
-  '../../../app',
-  '../../../core/api',
-  './rev-browser.actiontypes',
-  'visualizeRevTree/lib/getTree',
-  'pouchdb'
-],
-(app, FauxtonAPI, ActionTypes, getTree, PouchDB) => {
-
-  let db;
-
-  function initDiffEditor (dbName, docId) {
-    const url = FauxtonAPI.urls('databaseBaseURL', 'server', dbName);
-    db = PouchDB(url);
-
-    // XXX: we need spec compliant promise support and get rid of jQ "deferreds"
-    const d1 = $.Deferred();
-    const d2 = $.Deferred();
-    $.when(d1, d2).done((tree, doc) => {
-      const conflictingRevs = getConflictingRevs(tree.paths, tree.winner, Object.keys(tree.deleted));
-      const initialRev = conflictingRevs[0];
-
-      if (!initialRev) {
-        return dispatchData(tree, doc, conflictingRevs, null, dbName);
-      }
-
-      db.get(doc._id, {rev: initialRev})
-        .then((conflictDoc) => {
-          dispatchData(tree, doc, conflictingRevs, conflictDoc, dbName);
-        });
-    });
-
-    db.get(docId)
-      .then(d2.resolve);
-
-    getTree(db, docId)
-      .then(d1.resolve);
-  }
-
-  function getConflictingRevs (paths, winner, deleted) {
-
-    return paths.reduce((acc, el) => {
-      if (el[0] !== winner) {
-        acc.push(el[0]);
-      }
-
-      return acc;
-    }, [])
-    .filter((el) => {
-      return deleted.indexOf(el) === -1;
-    });
-  }
-
-  function dispatchData (tree, doc, conflictingRevs, conflictDoc, databaseName) {
-    FauxtonAPI.dispatch({
-      type: ActionTypes.REV_BROWSER_REV_TREE_LOADED,
-      options: {
-        tree: tree,
-        doc: doc,
-        conflictDoc: conflictDoc,
-        conflictingRevs: conflictingRevs,
-        databaseName: databaseName
-      }
-    });
-  }
-
-  function toggleDiffView (enableDiff) {
-    FauxtonAPI.dispatch({
-      type: ActionTypes.REV_BROWSER_DIFF_ENABLE_DIFF_VIEW,
-      options: {
-        enableDiff: enableDiff
-      }
-    });
-  }
-
-  function chooseLeaves (doc, revTheirs) {
-    db.get(doc._id, {rev: revTheirs})
-      .then((res) => {
-        dispatchDocsToDiff(doc, res);
+import app from "../../../app";
+import FauxtonAPI from "../../../core/api";
+import ActionTypes from "./rev-browser.actiontypes";
+import getTree from "visualizeRevTree/lib/getTree";
+import PouchDB from "pouchdb";
+
+let db;
+
+function initDiffEditor (dbName, docId) {
+  const url = FauxtonAPI.urls('databaseBaseURL', 'server', dbName);
+  db = PouchDB(url);
+
+  // XXX: we need spec compliant promise support and get rid of jQ "deferreds"
+  const d1 = $.Deferred();
+  const d2 = $.Deferred();
+  $.when(d1, d2).done((tree, doc) => {
+    const conflictingRevs = getConflictingRevs(tree.paths, tree.winner, Object.keys(tree.deleted));
+    const initialRev = conflictingRevs[0];
+
+    if (!initialRev) {
+      return dispatchData(tree, doc, conflictingRevs, null, dbName);
+    }
+
+    db.get(doc._id, {rev: initialRev})
+      .then((conflictDoc) => {
+        dispatchData(tree, doc, conflictingRevs, conflictDoc, dbName);
       });
-  }
-
-  function dispatchDocsToDiff (doc, theirs) {
-    FauxtonAPI.dispatch({
-      type: ActionTypes.REV_BROWSER_DIFF_DOCS_READY,
-      options: {
-        theirs: theirs,
-        ours: doc
-      }
-    });
-  }
-
-  function showConfirmModal (show, docToWin) {
-    FauxtonAPI.dispatch({
-      type: ActionTypes.REV_BROWSER_SHOW_CONFIRM_MODAL,
-      options: {
-        show: show,
-        docToWin: docToWin
-      }
-    });
-  }
-
-  function selectRevAsWinner (databaseName, docId, paths, revToWin) {
-    const revsToDelete = getConflictingRevs(paths, revToWin, []);
-    const payload = buildBulkDeletePayload(docId, revsToDelete);
-
-    $.ajax({
-      url: FauxtonAPI.urls('bulk_docs', 'server', databaseName, ''),
-      type: 'POST',
-      contentType: 'application/json; charset=UTF-8',
-      data: JSON.stringify(payload),
-      success: () => {
-        FauxtonAPI.addNotification({
-          msg: 'Conflicts successfully solved.',
-          clear: true
-        });
-        showConfirmModal(false, null);
-        FauxtonAPI.navigate(FauxtonAPI.urls('allDocs', 'app', databaseName, ''));
-      },
-      error: (resp) => {
-        FauxtonAPI.addNotification({
-          msg: 'Failed to delete clean up conflicts!',
-          type: 'error',
-          clear: true
-        });
-      }
+  });
+
+  db.get(docId)
+    .then(d2.resolve);
+
+  getTree(db, docId)
+    .then(d1.resolve);
+}
+
+function getConflictingRevs (paths, winner, deleted) {
+
+  return paths.reduce((acc, el) => {
+    if (el[0] !== winner) {
+      acc.push(el[0]);
+    }
+
+    return acc;
+  }, [])
+  .filter((el) => {
+    return deleted.indexOf(el) === -1;
+  });
+}
+
+function dispatchData (tree, doc, conflictingRevs, conflictDoc, databaseName) {
+  FauxtonAPI.dispatch({
+    type: ActionTypes.REV_BROWSER_REV_TREE_LOADED,
+    options: {
+      tree: tree,
+      doc: doc,
+      conflictDoc: conflictDoc,
+      conflictingRevs: conflictingRevs,
+      databaseName: databaseName
+    }
+  });
+}
+
+function toggleDiffView (enableDiff) {
+  FauxtonAPI.dispatch({
+    type: ActionTypes.REV_BROWSER_DIFF_ENABLE_DIFF_VIEW,
+    options: {
+      enableDiff: enableDiff
+    }
+  });
+}
+
+function chooseLeaves (doc, revTheirs) {
+  db.get(doc._id, {rev: revTheirs})
+    .then((res) => {
+      dispatchDocsToDiff(doc, res);
     });
-  }
-
-  function buildBulkDeletePayload (docId, revs) {
-    const list = revs.map((rev) => {
-      return {
-        "_id": docId,
-        "_rev": rev,
-        "_deleted": true
-      };
-    });
-
-    return { "docs": list };
-  }
-
-  return {
-    getConflictingRevs: getConflictingRevs,
-    selectRevAsWinner: selectRevAsWinner,
-    buildBulkDeletePayload: buildBulkDeletePayload,
-    chooseLeaves: chooseLeaves,
-    dispatchDocsToDiff: dispatchDocsToDiff,
-    initDiffEditor: initDiffEditor,
-    dispatchData: dispatchData,
-    toggleDiffView: toggleDiffView,
-    showConfirmModal: showConfirmModal
-  };
-
-});
+}
+
+function dispatchDocsToDiff (doc, theirs) {
+  FauxtonAPI.dispatch({
+    type: ActionTypes.REV_BROWSER_DIFF_DOCS_READY,
+    options: {
+      theirs: theirs,
+      ours: doc
+    }
+  });
+}
+
+function showConfirmModal (show, docToWin) {
+  FauxtonAPI.dispatch({
+    type: ActionTypes.REV_BROWSER_SHOW_CONFIRM_MODAL,
+    options: {
+      show: show,
+      docToWin: docToWin
+    }
+  });
+}
+
+function selectRevAsWinner (databaseName, docId, paths, revToWin) {
+  const revsToDelete = getConflictingRevs(paths, revToWin, []);
+  const payload = buildBulkDeletePayload(docId, revsToDelete);
+
+  $.ajax({
+    url: FauxtonAPI.urls('bulk_docs', 'server', databaseName, ''),
+    type: 'POST',
+    contentType: 'application/json; charset=UTF-8',
+    data: JSON.stringify(payload),
+    success: () => {
+      FauxtonAPI.addNotification({
+        msg: 'Conflicts successfully solved.',
+        clear: true
+      });
+      showConfirmModal(false, null);
+      FauxtonAPI.navigate(FauxtonAPI.urls('allDocs', 'app', databaseName, ''));
+    },
+    error: (resp) => {
+      FauxtonAPI.addNotification({
+        msg: 'Failed to delete clean up conflicts!',
+        type: 'error',
+        clear: true
+      });
+    }
+  });
+}
+
+function buildBulkDeletePayload (docId, revs) {
+  const list = revs.map((rev) => {
+    return {
+      "_id": docId,
+      "_rev": rev,
+      "_deleted": true
+    };
+  });
+
+  return { "docs": list };
+}
+
+export default {
+  getConflictingRevs: getConflictingRevs,
+  selectRevAsWinner: selectRevAsWinner,
+  buildBulkDeletePayload: buildBulkDeletePayload,
+  chooseLeaves: chooseLeaves,
+  dispatchDocsToDiff: dispatchDocsToDiff,
+  initDiffEditor: initDiffEditor,
+  dispatchData: dispatchData,
+  toggleDiffView: toggleDiffView,
+  showConfirmModal: showConfirmModal
+};

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/documents/rev-browser/rev-browser.actiontypes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/rev-browser/rev-browser.actiontypes.js b/app/addons/documents/rev-browser/rev-browser.actiontypes.js
index ddbba16..b54a609 100644
--- a/app/addons/documents/rev-browser/rev-browser.actiontypes.js
+++ b/app/addons/documents/rev-browser/rev-browser.actiontypes.js
@@ -10,11 +10,9 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([], () => {
-  return {
-    REV_BROWSER_REV_TREE_LOADED: 'REV_TREE_LOADED',
-    REV_BROWSER_DIFF_DOCS_READY: 'REV_BROWSER_DIFF_DOCS_READY',
-    REV_BROWSER_DIFF_ENABLE_DIFF_VIEW: 'REV_BROWSER_DIFF_ENABLE_DIFF_VIEW',
-    REV_BROWSER_SHOW_CONFIRM_MODAL: 'REV_BROWSER_SHOW_CONFIRM_MODAL'
-  };
-});
+export default {
+  REV_BROWSER_REV_TREE_LOADED: 'REV_TREE_LOADED',
+  REV_BROWSER_DIFF_DOCS_READY: 'REV_BROWSER_DIFF_DOCS_READY',
+  REV_BROWSER_DIFF_ENABLE_DIFF_VIEW: 'REV_BROWSER_DIFF_ENABLE_DIFF_VIEW',
+  REV_BROWSER_SHOW_CONFIRM_MODAL: 'REV_BROWSER_SHOW_CONFIRM_MODAL'
+};


Mime
View raw message