You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2014/01/21 13:10:48 UTC
couchdb commit: updated refs/heads/fauxton-file-reorder to eb0e679
Updated Branches:
refs/heads/fauxton-file-reorder 35d2ec190 -> eb0e67970
Fixes
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/eb0e6797
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/eb0e6797
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/eb0e6797
Branch: refs/heads/fauxton-file-reorder
Commit: eb0e6797016d849d2769c0d4584ebdfd8f661092
Parents: 35d2ec1
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Jan 21 14:10:30 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Tue Jan 21 14:10:30 2014 +0200
----------------------------------------------------------------------
src/Makefile.am | 22 ++++++++++++++--------
src/fauxton/app/addons/auth/base.js | 1 +
src/fauxton/app/addons/documents/resources.js | 17 ++++++++++++++++-
src/fauxton/app/addons/documents/views.js | 8 ++++----
src/fauxton/app/addons/fauxton/components.js | 11 +++++++----
src/fauxton/app/core/couchdbSession.js | 19 -------------------
6 files changed, 42 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb0e6797/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 73e48b3..3d47e9d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -111,14 +111,22 @@ FAUXTON_FILES = \
fauxton/app/addons/verifyinstall/routes.js \
fauxton/app/addons/verifyinstall/templates/main.html \
fauxton/app/addons/verifyinstall/assets/less/verifyinstall.less \
- fauxton/app/api.js \
+ fauxton/app/core/api.js \
+ fauxton/app/core/auth.js \
+ fauxton/app/core/base.js \
+ fauxton/app/core/couchdbSession.js \
+ fauxton/app/core/layout.js \
+ fauxton/app/core/routeObject.js \
+ fauxton/app/core/router.js \
+ fauxton/app/core/utils.js \
+ fauxton/app/core/tests/layoutSpec.js \
+ fauxton/app/core/tests/routeObjectSpec.js \
fauxton/app/app.js \
fauxton/app/config.js \
fauxton/app/helpers.js \
fauxton/app/initialize.js.underscore \
fauxton/app/load_addons.js.underscore \
fauxton/app/main.js \
- fauxton/app/utils.js \
fauxton/app/addons/databases/base.js \
fauxton/app/addons/databases/resources.js \
fauxton/app/addons/databases/routes.js \
@@ -131,11 +139,13 @@ FAUXTON_FILES = \
fauxton/app/addons/fauxton/base.js \
fauxton/app/addons/fauxton/components.js \
fauxton/app/addons/fauxton/layout.js \
+ fauxton/app/addons/fauxton/resizeColumns.js \
+ fauxton/app/addons/fauxton/tests/baseSpec.js \
+ fauxton/app/addons/fauxton/tests/navbarSpec.js \
+ fauxton/app/addons/fauxton/tests/paginateSpec.js \
fauxton/app/addons/pouchdb/base.js \
fauxton/app/addons/pouchdb/pouch.collate.js \
fauxton/app/addons/pouchdb/pouchdb.mapreduce.js \
- fauxton/app/resizeColumns.js \
- fauxton/app/router.js \
fauxton/app/addons/databases/templates/item.html \
fauxton/app/addons/databases/templates/list.html \
fauxton/app/addons/databases/templates/newdatabase.html \
@@ -308,10 +318,6 @@ FAUXTON_FILES = \
fauxton/tasks/couchserver.js \
fauxton/tasks/fauxton.js \
fauxton/tasks/helper.js \
- fauxton/test/core/layoutSpec.js \
- fauxton/test/core/navbarSpec.js \
- fauxton/test/core/paginateSpec.js \
- fauxton/test/core/routeObjectSpec.js \
fauxton/test/mocha/chai.js \
fauxton/test/mocha/mocha.css \
fauxton/test/mocha/mocha.js \
http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb0e6797/src/fauxton/app/addons/auth/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/base.js b/src/fauxton/app/addons/auth/base.js
index 9f9a332..7f69a7f 100644
--- a/src/fauxton/app/addons/auth/base.js
+++ b/src/fauxton/app/addons/auth/base.js
@@ -20,6 +20,7 @@ function(app, FauxtonAPI, Auth) {
Auth.session = new Auth.Session();
FauxtonAPI.setSession(Auth.session);
+ app.session = Auth.session;
Auth.initialize = function() {
Auth.navLink = new Auth.NavLink({model: Auth.session});
http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb0e6797/src/fauxton/app/addons/documents/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/resources.js b/src/fauxton/app/addons/documents/resources.js
index 831d5e3..75cd541 100644
--- a/src/fauxton/app/addons/documents/resources.js
+++ b/src/fauxton/app/addons/documents/resources.js
@@ -18,6 +18,21 @@ define([
function(app, FauxtonAPI) {
var Documents = FauxtonAPI.addon();
+ Documents.UUID = FauxtonAPI.Model.extend({
+ initialize: function(options) {
+ options = _.extend({count: 1}, options);
+ this.count = options.count;
+ },
+
+ url: function() {
+ return "/_uuids?count=" + this.count;
+ },
+
+ next: function() {
+ return this.get("uuids").pop();
+ }
+ });
+
Documents.Doc = Backbone.Model.extend({
idAttribute: "_id",
documentation: function(){
@@ -258,7 +273,7 @@ function(app, FauxtonAPI) {
Documents.NewDoc = Documents.Doc.extend({
fetch: function() {
- var uuid = new FauxtonAPI.UUID();
+ var uuid = new Documents.UUID();
var deferred = this.deferred = $.Deferred();
var that = this;
http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb0e6797/src/fauxton/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js
index c8f1233..92ed5db 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -262,7 +262,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
showModal: function () {
var showModal = this._showModal,
setDefaultIdValue = this.setDefaultIdValue,
- uuid = new FauxtonAPI.UUID();
+ uuid = new Documents.UUID();
uuid.fetch().then(function () {
setDefaultIdValue(uuid.next());
@@ -718,11 +718,11 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
},
cleanup: function () {
- //if (!this.pagination) { return; }
- this.pagination.remove();
- //this.pagination = null;
this.allDocsNumber.remove();
_.each(this.rows, function (row) {row.remove();});
+
+ if (!this.pagination) { return; }
+ this.pagination.remove();
},
beforeRender: function() {
http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb0e6797/src/fauxton/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/fauxton/components.js b/src/fauxton/app/addons/fauxton/components.js
index cafd69f..952074b 100644
--- a/src/fauxton/app/addons/fauxton/components.js
+++ b/src/fauxton/app/addons/fauxton/components.js
@@ -125,7 +125,7 @@ function(app, FauxtonAPI, ace, spin) {
pageEnd: function () {
if (this.collection.length < this.pageLimit()) {
- return this.collection.length;
+ return (this.previousParams.length * this.pageLimit()) + this.collection.length;
}
return (this.previousParams.length * this.pageLimit()) + this.pageLimit();
@@ -236,6 +236,8 @@ function(app, FauxtonAPI, ace, spin) {
this.theme = options.theme || 'crimson_editor';
this.couchJSHINT = options.couchJSHINT;
this.edited = false;
+
+ _.bindAll(this);
},
afterRender: function () {
@@ -292,13 +294,14 @@ function(app, FauxtonAPI, ace, spin) {
},
removeIncorrectAnnotations: function () {
- var editor = this.editor;
+ var editor = this.editor,
+ isIgnorableError = this.isIgnorableError;
- this.editor.getSession().on("changeAnnotation", function(){
+ this.editor.getSession().on("changeAnnotation", function () {
var annotations = editor.getSession().getAnnotations();
var newAnnotations = _.reduce(annotations, function (annotations, error) {
- if (!this.isIgnorableError(error.raw)) {
+ if (!isIgnorableError(error.raw)) {
annotations.push(error);
}
return annotations;
http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb0e6797/src/fauxton/app/core/couchdbSession.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/core/couchdbSession.js b/src/fauxton/app/core/couchdbSession.js
index 6f13677..93bfd8a 100644
--- a/src/fauxton/app/core/couchdbSession.js
+++ b/src/fauxton/app/core/couchdbSession.js
@@ -13,21 +13,6 @@ define([
],
function (FauxtonAPI) {
var CouchdbSession = {
- UUID: FauxtonAPI.Model.extend({
- initialize: function(options) {
- options = _.extend({count: 1}, options);
- this.count = options.count;
- },
-
- url: function() {
- return "/_uuids?count=" + this.count;
- },
-
- next: function() {
- return this.get("uuids").pop();
- }
- }),
-
Session: FauxtonAPI.Model.extend({
url: '/_session',
@@ -65,9 +50,5 @@ function (FauxtonAPI) {
})
};
-
- //set default session
- //FauxtonAPI.setSession(new FauxtonAPI.Session());
-
return CouchdbSession;
});