You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2014/06/07 23:04:37 UTC
[13/15] fauxton commit: updated refs/heads/import-master to 8cb432c
Fauxton: Remove dead code/view: database sidebar
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/61b481a3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/61b481a3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/61b481a3
Branch: refs/heads/import-master
Commit: 61b481a3a4edfe32c7960e57477c79ef4f88e2bc
Parents: 6bd6988
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Wed Jun 4 18:23:32 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Thu Jun 5 20:57:38 2014 +0200
----------------------------------------------------------------------
app/addons/databases/templates/sidebar.html | 31 -----------
app/addons/databases/views.js | 71 ++----------------------
2 files changed, 4 insertions(+), 98 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/61b481a3/app/addons/databases/templates/sidebar.html
----------------------------------------------------------------------
diff --git a/app/addons/databases/templates/sidebar.html b/app/addons/databases/templates/sidebar.html
deleted file mode 100644
index a8bbd89..0000000
--- a/app/addons/databases/templates/sidebar.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations under
-the License.
--->
-
-<div class="row-fluid">
- <a href="http://couchdb.org" target="_blank"><img src="img/couchdblogo.png"/></a>
- <br/>
-</div>
-<hr>
-<ul class="nav nav-list">
- <!-- <li class="nav-header">Database types</li> -->
- <li class="active"><a class="toggle-view" id="owned">Your databases</a></li>
- <li><a class="btn new" id="new"><i class="icon-plus"></i> New database</a></li>
-</ul>
-<hr>
-
-<div>
- <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/CouchDB" data-widget-id="314360971646869505">Tweets by @CouchDB</a>
-<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
-
-</div>
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/61b481a3/app/addons/databases/views.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/views.js b/app/addons/databases/views.js
index 0806b92..5629cb1 100644
--- a/app/addons/databases/views.js
+++ b/app/addons/databases/views.js
@@ -12,7 +12,7 @@
define([
"app",
-
+
"addons/fauxton/components",
"api",
"addons/databases/resources"
@@ -28,7 +28,7 @@ function(app, Components, FauxtonAPI, Databases) {
return [this.model.fetch()];
},
serialize: function() {
-
+
return {
encoded: app.utils.safeURLName(this.model.get("name")),
database: this.model
@@ -125,8 +125,8 @@ function(app, Components, FauxtonAPI, Databases) {
afterRender: function() {
var that = this,
- AllDBsArray = _.map(this.collection.toJSON(), function(item, key){
- return item.name;
+ AllDBsArray = _.map(this.collection.toJSON(), function(item, key){
+ return item.name;
});
this.dbSearchTypeahead = new Components.Typeahead({
@@ -192,68 +192,5 @@ function(app, Components, FauxtonAPI, Databases) {
}
});
- Views.Sidebar = FauxtonAPI.View.extend({
- template: "addons/databases/templates/sidebar",
- events: {
- "click a#new": "newDatabase",
- "click a#owned": "showMine",
- "click a#shared": "showShared"
- },
-
- newDatabase: function() {
- var notification;
- var db;
- // TODO: use a modal here instead of the prompt
- var name = prompt('Name of database', 'newdatabase');
- if (name === null) {
- return;
- } else if (name.length === 0) {
- notification = FauxtonAPI.addNotification({
- msg: "Please enter a valid database name",
- type: "error",
- clear: true
- });
- return;
- }
- db = new this.collection.model({
- id: encodeURIComponent(name),
- name: name
- });
- notification = FauxtonAPI.addNotification({msg: "Creating database."});
- db.save().done(function() {
- notification = FauxtonAPI.addNotification({
- msg: "Database created successfully",
- type: "success",
- clear: true
- });
- var route = "#/database/" + name + "/_all_docs?limit=" + Databases.DocLimit;
- app.router.navigate(route, { trigger: true });
- }
- ).error(function(xhr) {
- var responseText = JSON.parse(xhr.responseText).reason;
- notification = FauxtonAPI.addNotification({
- msg: "Create database failed: " + responseText,
- type: "error",
- clear: true
- });
- }
- );
- },
-
- showMine: function(){
- $.contribute(
- 'Show unshared databases',
- 'app/addons/databases/views.js'
- );
- },
-
- showShared: function(){
- $.contribute(
- 'Show shared databases (e.g. continuous replications to/from the database)',
- 'app/addons/databases/views.js'
- );
- }
- });
-
return Views;
});