{"size": 1979, "ext": "js", "max_stars_repo_path": "app/assets/javascripts/app/project.js", "max_stars_repo_name": "juntoscomvc/juntos.com.vc", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/assets/javascripts/app/project.js", "max_issues_repo_name": "juntoscomvc/juntos.com.vc", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/assets/javascripts/app/project.js", "max_forks_repo_name": "juntoscomvc/juntos.com.vc", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.3866666667, "max_line_length": 92, "alphanum_fraction": 0.6043456291}
App.addChild('Project', _.extend({
  el: '.content[data-action="show"][data-controller-name="projects"]',

  events: {
    'click #toggle_warning a' : 'toggleWarning',
    'click a#embed_link' : 'toggleEmbed'
  },

  activate: function(){
    this.$warning = this.$('#project_warning_text');
    this.$embed= this.$('#project_embed');
    this.route('about');
    this.route('page1');
    this.route('basics');
    this.route('dashboard_project');
    this.route('dashboard_project_plans');
    this.route('dashboard_rewards');
    this.route('dashboard_subgoals');
    this.route('posts');
    this.route('rewards');
    this.route('contributions');
    this.route('comments');
    this.route('edit');
    this.route('reports');
    this.route('project_metrics');
    this.route('project_reports');
    this.route('dashboard_project_documents');
  },

  toggleWarning: function(){
    this.$warning.slideToggle('slow');
    return false;
  },

  toggleEmbed: function(){
    this.loadEmbed();
    this.$embed.slideToggle('slow');
    return false;
  },

  followRoute: function(name){
    var $tab = this.$('nav a[href="' + window.location.hash + '"]');
    if($tab.length > 0){
      this.onTabClick({ currentTarget: $tab });

      var links = [
        'project_metrics_link',
        'project_reports_link',
        'basics_link',
        'dashboard_project_link',
        'dashboard_project_plans_link',
        'dashboard_rewards_link',
        'dashboard_subgoals_link',
        'dashboard_project_documents_link',
      ];

      $('[data-project-owner-sidebar]').toggle( ($.inArray($tab.prop('id'), links) == -1) );
    }
  },

  loadEmbed: function() {
    var that = this;

    if(this.$embed.find('.loader').length > 0) {
      $.get(this.$embed.data('path')).success(function(data){
        that.$embed.html(data);
      });
    }
  }
}, Skull.Tabs));

$(document).ready(function() {
  if ($('[data="select2"]').length > 0) { $('[data="select2"]').select2(); }
});
