couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From garrensmith <...@git.apache.org>
Subject [GitHub] couchdb-fauxton pull request: Secondary indexes: huge branch
Date Tue, 19 Aug 2014 10:34:56 GMT
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.
---

Mime
View raw message