Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E59131016C for ; Wed, 12 Feb 2014 06:24:34 +0000 (UTC) Received: (qmail 2966 invoked by uid 500); 12 Feb 2014 06:20:44 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 2616 invoked by uid 500); 12 Feb 2014 06:20:32 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 1387 invoked by uid 99); 12 Feb 2014 06:19:58 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Feb 2014 06:19:58 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 85A455540F; Wed, 12 Feb 2014 06:19:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davisp@apache.org To: commits@couchdb.apache.org Date: Wed, 12 Feb 2014 06:20:29 -0000 Message-Id: <2680e87afb9a4318867872bdde98b377@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [35/52] [abbrv] fauxton commit: updated refs/heads/import-master to d11b90b Whitespace Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/ab1b2c1e Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/ab1b2c1e Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/ab1b2c1e Branch: refs/heads/import-master Commit: ab1b2c1e3d3ed5a467b5bfac0d0d8b7b68ce2077 Parents: 61e3478 Author: Simon Metson Authored: Sun Jan 26 19:05:22 2014 +0000 Committer: suelockwood Committed: Wed Jan 29 10:34:28 2014 -0500 ---------------------------------------------------------------------- app/addons/documents/views.js | 52 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/ab1b2c1e/app/addons/documents/views.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js index aeb5983..93fd0d4 100644 --- a/app/addons/documents/views.js +++ b/app/addons/documents/views.js @@ -136,7 +136,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum template: "addons/documents/templates/upload_modal", disableLoader: true, - + initialize: function (options) { _.bindAll(this); }, @@ -201,7 +201,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum this.$('.progress').addClass('hide'); this.clear_error_msg(); this.$('.modal').modal(); - // hack to get modal visible + // hack to get modal visible $('.modal-backdrop').css('z-index',1025); }, @@ -257,7 +257,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum this.$('.progress').addClass('hide'); this.clear_error_msg(); this.$('.modal').modal(); - // hack to get modal visible + // hack to get modal visible $('.modal-backdrop').css('z-index',1025); }, @@ -400,8 +400,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum }, destroy: function (event) { - event.preventDefault(); - + event.preventDefault(); + window.alert('Cannot delete a document generated from a view.'); }, @@ -453,7 +453,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum this.newView = options.newView || false; this.showNumbers = options.showNumbers; this.pagination = options.pagination; - + this.listenTo(this.collection, 'totalRows:decrement', this.render); }, @@ -667,7 +667,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum }); model.collection.remove(model.id); - if (!!model.id.match('_design')) { + if (!!model.id.match('_design')) { FauxtonAPI.triggerRouteEvent('reloadDesignDocs'); } that.$('.bulk-delete').addClass('disabled'); @@ -712,13 +712,13 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum return true; }, - + nextUrlfn: function () { return collection.urlNextPage(perPage()); } }); }, - + cleanup: function () { this.allDocsNumber.remove(); _.each(this.rows, function (row) {row.remove();}); @@ -869,12 +869,12 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum } deferred.reject(); }); - + return deferred; }, saveDoc: function(event) { - var json, notification, + var json, notification, that = this, editor = this.editor, validDoc = this.getDocFromEditor(); @@ -1357,7 +1357,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum ddoc.removeDdocView(viewName); if (ddoc.hasViews()) { - promise = ddoc.save(); + promise = ddoc.save(); } else { promise = ddoc.destroy(); } @@ -1377,7 +1377,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum $('#dashboard-content').scrollTop(0); //scroll up if (this.hasValidCode() && this.$('#new-ddoc:visible').val() !=="") { - var mapVal = this.mapEditor.getValue(), + var mapVal = this.mapEditor.getValue(), reduceVal = this.reduceVal(), viewName = this.$('#index-name').val(), ddoc = this.getCurrentDesignDoc(), @@ -1428,7 +1428,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum if (that.reduceFunStr !== reduceVal) { that.reduceFunStr = reduceVal; - that.advancedOptions.renderOnUpdatehasReduce(that.hasReduce()); + that.advancedOptions.renderOnUpdatehasReduce(that.hasReduce()); } FauxtonAPI.triggerRouteEvent('updateAllDocs', {ddoc: ddocName, view: viewName}); @@ -1454,15 +1454,15 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum updateView: function(event, paramInfo) { event.preventDefault(); - + if (this.newView) { return alert('Please save this new view before querying it.'); } - + var errorParams = paramInfo.errorParams, params = paramInfo.params; - + if (_.any(errorParams)) { _.map(errorParams, function(param) { - + // TODO: Where to add this error? // bootstrap wants the error on a control-group div, but we're not using that //$('form.view-query-update input[name='+param+'], form.view-query-update select[name='+param+']').addClass('error'); @@ -1479,14 +1479,14 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum selector: ".advanced-options .errors-container", clear: true }); - + return false; } - + var fragment = window.location.hash.replace(/\?.*$/, ''); fragment = fragment + '?' + $.param(params); FauxtonAPI.navigate(fragment, {trigger: false}); - + FauxtonAPI.triggerRouteEvent('updateAllDocs', {ddoc: this.ddocID, view: this.viewName}); }, @@ -1537,7 +1537,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum getCurrentDesignDoc: function () { return this.designDocSelector.getCurrentDesignDoc(); }, - + isCustomReduceEnabled: function() { return $("#reduce-function-selector").val() == "CUSTOM"; }, @@ -1570,7 +1570,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum var editor = this[editorName]; if (editorName === "reduceEditor" && ! this.isCustomReduceEnabled()) { return true; - } + } return editor.hadValidCode(); }, this); }, @@ -1657,7 +1657,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum ddocName: this.model.id, database: this.database })); - + this.advancedOptions = this.insertView('#query', new Views.AdvancedOptions({ updateViewFn: this.updateView, previewFn: this.previewView, @@ -1703,7 +1703,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum this.mapEditor.setValue(this.langTemplates[this.defaultLang].map); //Use a built in view by default //this.reduceEditor.setValue(this.langTemplates[this.defaultLang].reduce); - } + } this.mapEditor.editSaved(); this.reduceEditor && this.reduceEditor.editSaved(); @@ -1800,7 +1800,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum permissions_url: '#' + this.database.url('app') + '/permissions', db_url: '#' + this.database.url('index') + '?limit=' + Databases.DocLimit, database: this.collection.database, - database_url: '#' + this.database.url('app'), + database_url: '#' + this.database.url('app'), docLinks: docLinks, docLimit: Databases.DocLimit, addLinks: addLinks,