Skip to content
Extraits de code Groupes Projets
app.js 889 octets
Newer Older
  • Learn to ignore specific revisions
  • var app = {
      collections: {},
      models: {},
    
      views: {},
    
      user: function(user) {
        if(user) { return this._user = user; }
    
    
        return this._user || {current_user : false};
    
      },
    
      initialize: function() {
    
          app.header = new app.views.Header;
          $("body").prepend(app.header.el);
          app.header.render();
    
        Backbone.history.start({pushState: true});
    
    
        // there's probably a better way to do this...
        $("a[rel=backbone]").bind("click", function(evt){
          evt.preventDefault();
          var link = $(this);
    
          $(".stream_title").text(link.text())
          app.router.navigate(link.attr("href").substring(1) ,true)
        })
    
    $(function() { 
      Handlebars.registerHelper('t', function(){
        return Diaspora.I18n.t(arguments[0], jQuery.parseJSON(arguments[1]))
      })
      app.initialize();
    });