Fauxton: Remove dead code/view: database sidebar
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/e2104faf Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e2104faf Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e2104faf Branch: refs/heads/Update-Sidebar-Ui Commit: e2104faffc9437696f0a2e2cb420ed68508690d8 Parents: 23490c1 Author: Robert Kowalski <[email protected]> Authored: Wed Jun 4 18:23:32 2014 +0200 Committer: Robert Kowalski <[email protected]> Committed: Thu Jun 5 20:57:38 2014 +0200 ---------------------------------------------------------------------- src/Makefile.am | 1 - .../app/addons/databases/templates/sidebar.html | 31 --------- src/fauxton/app/addons/databases/views.js | 71 ++------------------ 3 files changed, 4 insertions(+), 99 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/e2104faf/src/Makefile.am ---------------------------------------------------------------------- diff --git a/src/Makefile.am b/src/Makefile.am index 7801c98..d7cea21 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -160,7 +160,6 @@ FAUXTON_FILES = \ fauxton/app/addons/databases/templates/item.html \ fauxton/app/addons/databases/templates/list.html \ fauxton/app/addons/databases/templates/newdatabase.html \ - fauxton/app/addons/databases/templates/sidebar.html \ fauxton/app/addons/documents/templates/advanced_options.html \ fauxton/app/addons/documents/templates/all_docs_item.html \ fauxton/app/addons/documents/templates/all_docs_layout.html \ http://git-wip-us.apache.org/repos/asf/couchdb/blob/e2104faf/src/fauxton/app/addons/databases/templates/sidebar.html ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/databases/templates/sidebar.html b/src/fauxton/app/addons/databases/templates/sidebar.html deleted file mode 100644 index a8bbd89..0000000 --- a/src/fauxton/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/blob/e2104faf/src/fauxton/app/addons/databases/views.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/databases/views.js b/src/fauxton/app/addons/databases/views.js index 0806b92..5629cb1 100644 --- a/src/fauxton/app/addons/databases/views.js +++ b/src/fauxton/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; });
