You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2013/02/25 04:34:35 UTC
[3/7] git commit: add contribute addon
add contribute addon
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/9d04753f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/9d04753f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/9d04753f
Branch: refs/heads/fauxton
Commit: 9d04753f8a0b33ab372aa280e484617475153677
Parents: b969ddf
Author: Simon Metson <si...@cloudant.com>
Authored: Tue Feb 12 11:00:52 2013 +0000
Committer: Simon Metson <si...@cloudant.com>
Committed: Wed Feb 13 10:54:37 2013 +0000
----------------------------------------------------------------------
src/fauxton/app/addons/contribute/base.js | 17 +++++++++++++++++
src/fauxton/app/modules/databases/views.js | 11 ++++++++---
src/fauxton/app/modules/documents/views.js | 10 ++++++++--
src/fauxton/settings.json.default | 3 ++-
4 files changed, 35 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9d04753f/src/fauxton/app/addons/contribute/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/contribute/base.js b/src/fauxton/app/addons/contribute/base.js
new file mode 100644
index 0000000..50a12cb
--- /dev/null
+++ b/src/fauxton/app/addons/contribute/base.js
@@ -0,0 +1,17 @@
+define([
+ // Libraries.
+ "jquery",
+ "lodash"
+],
+function($, _){
+ $.contribute = function(message, file){
+ var JST = window.JST = window.JST || {};
+ var template = JST['app/addons/contribute/templates/modal.html'];
+ console.log(template);
+ var compiled = template({message: message, file: file});
+ console.log('contribute!contribute!monorail!contribute!');
+ console.log(compiled);
+ var elem = $(compiled);
+ elem.modal('show');
+ };
+});
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9d04753f/src/fauxton/app/modules/databases/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/databases/views.js b/src/fauxton/app/modules/databases/views.js
index 83c79ae..322cd5a 100644
--- a/src/fauxton/app/modules/databases/views.js
+++ b/src/fauxton/app/modules/databases/views.js
@@ -150,12 +150,17 @@ function(app, FauxtonAPI) {
},
showMine: function(){
- console.log('will show users databases and hide shared');
+ $.contribute(
+ 'Show unshared databases',
+ 'app/addons/databases/views.js'
+ );
},
showShared: function(){
- console.log('will show shared databases and hide the users');
- alert('Support for shared databases coming soon');
+ $.contribute(
+ 'Show shared databases (e.g. continuous replications to/from the database)',
+ 'app/addons/databases/views.js'
+ );
}
});
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9d04753f/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index c23530c..7bae3e9 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -817,12 +817,18 @@ function(app, FauxtonAPI, Codemirror, JSHint) {
newIndex: function(event){
event.preventDefault();
- alert('coming soon');
+ $.contribute(
+ 'Create a new view.',
+ 'app/addons/documents/views.js'
+ );
},
toggleView: function(event){
- alert('filter data by search/view/type');
event.preventDefault();
+ $.contribute(
+ 'Filter data by type or view',
+ 'app/addons/databases/views.js'
+ );
url = event.currentTarget.href.split('#')[1];
app.router.navigate(url);
},
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9d04753f/src/fauxton/settings.json.default
----------------------------------------------------------------------
diff --git a/src/fauxton/settings.json.default b/src/fauxton/settings.json.default
index 1063ea4..01c04a4 100644
--- a/src/fauxton/settings.json.default
+++ b/src/fauxton/settings.json.default
@@ -2,6 +2,7 @@
"deps": [
{ "name": "config" },
{ "name": "logs" },
- { "name": "stats" }
+ { "name": "stats" },
+ { "name": "contribute" }
]
}