You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by de...@apache.org on 2014/08/04 17:57:42 UTC
fauxton commit: updated refs/heads/secondary-indexes to a9f3e26
Repository: couchdb-fauxton
Updated Branches:
refs/heads/secondary-indexes 9c09209ce -> a9f3e2646
Move Fauxton's apibar and breadcrumbs out into components
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/a9f3e264
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/a9f3e264
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/a9f3e264
Branch: refs/heads/secondary-indexes
Commit: a9f3e2646a53aff5dc08cdc6c79674c23f669ac4
Parents: 9c09209
Author: deathbearbrown <de...@gmail.com>
Authored: Mon Aug 4 11:57:41 2014 -0400
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 4 11:57:41 2014 -0400
----------------------------------------------------------------------
app/addons/fauxton/base.js | 76 ++-------------------
app/addons/fauxton/components.js | 76 +++++++++++++++++++++
app/addons/indexes/templates/index_header.html | 15 ++--
app/addons/indexes/templates/list_editor.html | 2 +-
4 files changed, 90 insertions(+), 79 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a9f3e264/app/addons/fauxton/base.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/base.js b/app/addons/fauxton/base.js
index 7a3ab8f..57530b9 100644
--- a/app/addons/fauxton/base.js
+++ b/app/addons/fauxton/base.js
@@ -14,10 +14,11 @@ define([
"app",
"api",
"addons/fauxton/resizeColumns",
+ "addons/fauxton/components",
"plugins/zeroclipboard/ZeroClipboard"
],
-function(app, FauxtonAPI, resizeColumns, ZeroClipboard) {
+function(app, FauxtonAPI, resizeColumns, Components, ZeroClipboard) {
var Fauxton = FauxtonAPI.addon();
FauxtonAPI.addNotification = function (options) {
@@ -50,7 +51,7 @@ function(app, FauxtonAPI, resizeColumns, ZeroClipboard) {
Fauxton.initialize = function () {
// app.footer = new Fauxton.Footer({el: "#footer-content"}),
app.navBar = new Fauxton.NavBar();
- app.apiBar = new Fauxton.ApiBar();
+ app.apiBar = new Components.ApiBar();
FauxtonAPI.when.apply(null, app.navBar.establish()).done(function() {
FauxtonAPI.masterLayout.setView("#primary-navbar", app.navBar, true);
@@ -76,7 +77,7 @@ function(app, FauxtonAPI, resizeColumns, ZeroClipboard) {
var crumbs = routeObject.get('crumbs');
if (crumbs.length) {
- FauxtonAPI.masterLayout.setView('#breadcrumbs', new Fauxton.Breadcrumbs({
+ FauxtonAPI.masterLayout.setView('#breadcrumbs', new Components.Breadcrumbs({
crumbs: crumbs
}), true).render();
}
@@ -92,20 +93,7 @@ function(app, FauxtonAPI, resizeColumns, ZeroClipboard) {
});
};
- Fauxton.Breadcrumbs = FauxtonAPI.View.extend({
- template: "addons/fauxton/templates/breadcrumbs",
- serialize: function() {
- var crumbs = _.clone(this.crumbs);
- return {
- crumbs: crumbs
- };
- },
-
- initialize: function(options) {
- this.crumbs = options.crumbs;
- }
- });
Fauxton.VersionInfo = Backbone.Model.extend({
url: function () {
@@ -258,62 +246,6 @@ function(app, FauxtonAPI, resizeColumns, ZeroClipboard) {
// TODO: ADD ACTIVE CLASS
});
- Fauxton.ApiBar = FauxtonAPI.View.extend({
- template: "addons/fauxton/templates/api_bar",
- endpoint: '_all_docs',
-
- documentation: 'docs',
-
- events: {
- "click .api-url-btn" : "toggleAPIbar"
- },
-
- toggleAPIbar: function(e){
- var $currentTarget = $(e.currentTarget).find('span');
- if ($currentTarget.hasClass("fonticon-plus")){
- $currentTarget.removeClass("fonticon-plus").addClass("fonticon-minus");
- }else{
- $currentTarget.removeClass("fonticon-minus").addClass("fonticon-plus");
- }
- $('.api-navbar').toggle();
- },
-
- serialize: function() {
- return {
- endpoint: this.endpoint,
- documentation: this.documentation
- };
- },
-
- hide: function(){
- this.$el.addClass('hide');
- },
- show: function(){
- this.$el.removeClass('hide');
- },
- update: function(endpoint) {
- this.show();
- this.endpoint = endpoint[0];
- this.documentation = endpoint[1];
- this.render();
- },
- afterRender: function(){
- ZeroClipboard.config({ moviePath: "/assets/js/plugins/zeroclipboard/ZeroClipboard.swf" });
- var client = new ZeroClipboard(this.$(".copy-url"));
- client.on("load", function(e){
- var $apiInput = $('#api-navbar input');
- var copyURLTimer;
- client.on("mouseup", function(e){
- $apiInput.css("background-color","#aaa");
- window.clearTimeout(copyURLTimer);
- copyURLTimer = setInterval(function () {
- $apiInput.css("background-color","#fff");
- }, 200);
- });
- });
- }
-
- });
Fauxton.Notification = FauxtonAPI.View.extend({
fadeTimer: 5000,
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a9f3e264/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index 8ec5d01..9899c39 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -31,6 +31,82 @@ define([
function(app, FauxtonAPI, ace, spin) {
var Components = FauxtonAPI.addon();
+
+ Components.Breadcrumbs = FauxtonAPI.View.extend({
+ template: "addons/fauxton/templates/breadcrumbs",
+
+ serialize: function() {
+ var crumbs = _.clone(this.crumbs);
+ return {
+ crumbs: crumbs
+ };
+ },
+
+ initialize: function(options) {
+ this.crumbs = options.crumbs;
+ }
+ });
+
+ Components.ApiBar = FauxtonAPI.View.extend({
+ template: "addons/fauxton/templates/api_bar",
+ endpoint: '_all_docs',
+
+ documentation: 'docs',
+
+ events: {
+ "click .api-url-btn" : "toggleAPIbar"
+ },
+
+ toggleAPIbar: function(e){
+ var $currentTarget = $(e.currentTarget).find('span');
+ if ($currentTarget.hasClass("fonticon-plus")){
+ $currentTarget.removeClass("fonticon-plus").addClass("fonticon-minus");
+ }else{
+ $currentTarget.removeClass("fonticon-minus").addClass("fonticon-plus");
+ }
+ $('.api-navbar').toggle();
+ },
+
+ serialize: function() {
+ return {
+ endpoint: this.endpoint,
+ documentation: this.documentation
+ };
+ },
+
+ hide: function(){
+ this.$el.addClass('hide');
+ },
+ show: function(){
+ this.$el.removeClass('hide');
+ },
+ update: function(endpoint) {
+ this.show();
+ this.endpoint = endpoint[0];
+ this.documentation = endpoint[1];
+ this.render();
+ },
+ afterRender: function(){
+ ZeroClipboard.config({ moviePath: "/assets/js/plugins/zeroclipboard/ZeroClipboard.swf" });
+ var client = new ZeroClipboard(this.$(".copy-url"));
+ client.on("load", function(e){
+ var $apiInput = $('#api-navbar input');
+ var copyURLTimer;
+ client.on("mouseup", function(e){
+ $apiInput.css("background-color","#aaa");
+ window.clearTimeout(copyURLTimer);
+ copyURLTimer = setInterval(function () {
+ $apiInput.css("background-color","#fff");
+ }, 200);
+ });
+ });
+ }
+
+ });
+
+
+
+
Components.Pagination = FauxtonAPI.View.extend({
template: "addons/fauxton/templates/pagination",
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a9f3e264/app/addons/indexes/templates/index_header.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/index_header.html b/app/addons/indexes/templates/index_header.html
index 662f3ea..342d628 100644
--- a/app/addons/indexes/templates/index_header.html
+++ b/app/addons/indexes/templates/index_header.html
@@ -12,19 +12,22 @@ License for the specific language governing permissions and limitations under
the License.
-->
-<div class="header-left">
+<div class="header-left windowresize">
-<!--back arrow-->
-<span class="icon "
+ <!--back arrow-->
+ <a href=""><span class="icon "></span></a>
+ <!--title-->
+ <h2> <%-title%> </h2>
-<!--title-->
-<!-- Menu gear-->
+
+ <!-- Menu gear-->
+ <div class="header-menu"></div>
</div>
-<div class="header-right">
+<div class="header-right window-resizeable">
<!-- Query Options-->
<!--right margin for api bar-->
</div>
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a9f3e264/app/addons/indexes/templates/list_editor.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/list_editor.html b/app/addons/indexes/templates/list_editor.html
index d36004c..9eaa420 100644
--- a/app/addons/indexes/templates/list_editor.html
+++ b/app/addons/indexes/templates/list_editor.html
@@ -36,4 +36,4 @@ the License.
</div>
<div class="clearfix"></div>
</form>
-</div>=
+</div>