text: ;(function(a){$.ss.validation.overrideMessages=!0;var b=a.App=a.App||{},c=function(){};_.mixin({formData:function(a){var b={};return $(a).find("INPUT,TEXTAREA").each(function(){if(this.type=="button"||this.type=="submit")return;b[this.name]=$(this).val()}),b},xhrMessage:function(a){try{var b=JSON.parse(a.responseText);return b.responseStatus?b.responseStatus.message:null}catch(c){return null}},get:function(a,b,c,d){return _.isFunction(b)&&(c=b,d=c,b=undefined),_.ajax({type:"GET",url:a,data:b,success:c,error:d})},post:function(a){return _.ajax(a)},ajax:function(d){a.BASE_URL&&d.url.indexOf("://")===-1&&d.url.charAt(0)!=="/"&&(d.url=a.BASE_URL+d.url);var e=_.defaults(d,{type:"POST",loading:function(){$(document.body).add(d.form).addClass("loading")},finishedLoading:function(){$(document.body).add(d.form).removeClass("loading")},dataType:"json"});e.loading(),$.ajax({type:e.type,url:e.url,data:e.data,success:function(){e.finishedLoading(),$(e.form).clearErrors(),e.success&&e.success.apply(null,arguments)},error:function(a,d,f){e.finishedLoading();try{if(e.form){var g=JSON.parse(a.responseText);$(e.form).applyErrors(g&&g.responseStatus)}}catch(h){}(e.error||b.error||c).apply(null,arguments)},dataType:e.dataType||"json"})}}),b.BaseModel=Backbone.Model.extend({parse:function(a,b){return a?a.result||a.results||a:a},_super:function(a){return this.constructor.__super__[a].apply(this,_.rest(arguments))}}),b.BaseView=Backbone.View.extend({loading:function(){$(this.el).css({opacity:.5})},finishedLoading:function(){$(this.el).css({opacity:1})}})})(window)
  ;((function(){var a,b,c,d;c=function(a){return a*a*a},d=function(a){return a*a*a},a=function(){function a(a){this.name=a}return a.prototype.move=function(a){return alert(this.name+(" moved "+a+"m."))},a}(),b=function(){function a(a){this.name=a}return a.prototype.move=function(a){return alert(this.name+(" moved "+a+"m."))},a}()})).call(this)
  ;(function(a){var b=a.App;_.extend(b,{baseUrl:window.BASE_URL,UnAuthorized:401,initialize:function(){this.handleClicks()},handleClicks:function(){$(document.body).click(function(a){var c=$(a.srcElement).data("cmd");if(!c)return;var d=c.split(":"),e=d[0],f=d.length>1?d[1].split(","):[];b.sendCmd(e,f)})},navigate:function(a){this.routes.navigate(a)},route:function(a){var b=_.rest(arguments);console.log("route: "+a,b),this.sendCmd(a,b)},sendCmd:function(a,b){_.isFunction(this.routes[a])&&this.routes[a].apply(this.routes,b),_.each(this.models,function(c){_.isFunction(c[a])&&c[a].apply(c,b)}),_.each(this.views,function(c){_.isFunction(c[a])&&c[a].apply(c,b)})},error:function(a,b,c){console.log("App Error: ",arguments),this.trigger("error",arguments),a.status==this.UnAuthorized&&$.getJSON("api/userinfo",function(a){},function(a){a.status==this.UnAuthorized&&(location.href=location.href)})}}),_.extend(b,Backbone.Events),_.bindAll(b,"error","trigger","navigate","sendCmd");var c=new b.Login,d=new b.UserProfile({login:c}),e=new b.Twitter({profile:d});b.Routes=Backbone.Router.extend({routes:{tweets:"tweets",friends:"friends",followers:"followers",userTweets:":user/tweets",userFriends:":user/friends",userFollowers:":user/followers"},initialize:function(a){this.app=a.app},tweets:function(){this.app.route("twitterProfileChange",c.get("screenName"),"tweets")},friends:function(){this.app.route("twitterProfileChange",c.get("screenName"),"friends")},followers:function(){this.app.route("twitterProfileChange",c.get("screenName"),"followers")},userTweets:function(a){this.app.route("twitterProfileChange",a,"tweets")},userFriends:function(a){this.app.route("twitterProfileChange",a,"friends")},userFollowers:function(a){this.app.route("twitterProfileChange",a,"followers")}}),b.routes=new b.Routes({app:b}),console.log(c.attributes,d.attributes,e.attributes),b.models={login:c,userProfile:d,twitter:e},_.each(b.models,function(a){a.sendCmd=b.sendCmd,a.navigate=b.navigate}),b.views={login:new b.LoginView({el:"#login",model:c}),register:new b.RegisterView({el:"#register",model:c}),userProfile:new b.UserProfileView({el:"#user-profile",model:d}),twitter:new b.TwitterView({el:"#twitter",model:e})},b.initialize(),$(".tabs").tabs(),Backbone.history.start({pushState:!0}),$(function(){})})(window)
  