Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8A5CB11CAF for ; Tue, 19 Aug 2014 10:34:57 +0000 (UTC) Received: (qmail 37916 invoked by uid 500); 19 Aug 2014 10:34:57 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 37856 invoked by uid 500); 19 Aug 2014 10:34:57 -0000 Mailing-List: contact dev-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 dev@couchdb.apache.org Received: (qmail 37842 invoked by uid 99); 19 Aug 2014 10:34:56 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Aug 2014 10:34:56 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 8CFBC93DA2A; Tue, 19 Aug 2014 10:34:56 +0000 (UTC) From: garrensmith To: dev@couchdb.apache.org Reply-To: dev@couchdb.apache.org References: In-Reply-To: Subject: [GitHub] couchdb-fauxton pull request: Secondary indexes: huge branch Content-Type: text/plain Message-Id: <20140819103456.8CFBC93DA2A@tyr.zones.apache.org> Date: Tue, 19 Aug 2014 10:34:56 +0000 (UTC) Github user garrensmith commented on a diff in the pull request: https://github.com/apache/couchdb-fauxton/pull/33#discussion_r16407007 --- Diff: app/addons/fauxton/components.js --- @@ -34,7 +34,135 @@ define([ function(app, FauxtonAPI, ace, spin, ZeroClipboard) { var Components = FauxtonAPI.addon(); + + //setting up the left header with the backbutton used in Views and All docs + Components.LeftHeader = FauxtonAPI.View.extend({ + className: "header-left", + template: "addons/fauxton/templates/header_left", + initialize:function(options){ + this.dropdownEvents = options.dropdownEvents; + this.dropdownMenuLinks = options.dropdownMenu; + this.crumbs = options.crumbs || []; + }, + updateCrumbs: function(crumbs){ + this.breadcrumbs && this.breadcrumbs.update(crumbs); + }, + updateDropdown: function(menuLinks){ + this.dropdown && this.dropdown.update(menuLinks); + }, + beforeRender: function(){ + this.setUpCrumbs(); + this.setUpDropDownMenu(); + }, + setUpCrumbs: function(){ + this.breadcrumbs = this.insertView("#header-breadcrumbs", new Components.Breadcrumbs({ + crumbs: this.crumbs + })); + }, + setUpDropDownMenu: function(){ + if (this.dropdownMenuLinks){ + this.dropdown = this.insertView("#header-dropdown-menu", new Components.MenuDropDown({ + icon: 'fonticon-cog', + links: this.dropdownMenuLinks, + events: this.dropdownEvents + })); + } + } + }); + + + Components.Breadcrumbs = FauxtonAPI.View.extend({ + className: "breadcrumb pull-left", + tagName: "ul", + template: "addons/fauxton/templates/breadcrumbs", + serialize: function() { + var crumbs = _.clone(this.crumbs); + return { + crumbs: crumbs + }; + }, + update: function(crumbs) { + this.crumbs = crumbs; + this.render(); + }, + initialize: function(options) { + this.crumbs = options.crumbs; + } + }); + + Components.ApiBar = FauxtonAPI.View.extend({ + template: "addons/fauxton/templates/api_bar", + events: { + "click .api-url-btn" : "toggleAPIbar" + }, + + initialize: function(options){ + FauxtonAPI.Events.on('APIbar:closeTray', this.closeTray); + var _options = options || {}; + this.endpoint = _options.endpoint || '_all_docs'; + this.documentation = _options.documentation || 'docs'; + }, + + 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"); + } + FauxtonAPI.Events.trigger('AdvancedOptions:closeTray'); + this.$('.api-navbar').toggle(); + }, + + serialize: function() { + return { + endpoint: this.endpoint, + documentation: this.documentation + }; + }, + + hide: function(){ + this.$el.addClass('hide'); + }, + + show: function(){ + this.$el.removeClass('hide'); + }, + + closeTray: function(){ + $('.api-navbar').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" }); --- End diff -- You will have to rebase from master. I've written a backbone.view for the zeroclipboard. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---