diff --git a/assets/scripts/travis.coffee b/assets/scripts/travis.coffee index 7d742eae..fa0fee76 100644 --- a/assets/scripts/travis.coffee +++ b/assets/scripts/travis.coffee @@ -4,6 +4,7 @@ require 'ext/ember/namespace' @Travis = Em.Namespace.create config: api_endpoint: $('meta[rel="travis.api_endpoint"]').attr('href') + pusher_key: $('meta[name="travis.pusher_key"]').attr('value') CONFIG_KEYS: ['rvm', 'gemfile', 'env', 'jdk', 'otp_release', 'php', 'node_js', 'perl', 'python', 'scala'] @@ -36,24 +37,16 @@ require 'ext/ember/namespace' run: (attrs) -> location.href = location.href.replace('#!/', '') if location.hash.slice(0, 2) == '#!' - @loadConfig (config) => - app = Travis.App.create(attrs || {}) - # TODO: router expects the classes for controllers on main namespace, so - # if we want to keep app at Travis.app, we need to copy that, it would - # be ideal to send a patch to ember and get rid of this - $.each Travis, (key, value) -> - app[key] = value if value && value.isClass && key != 'constructor' + app = Travis.App.create(attrs || {}) + # TODO: router expects the classes for controllers on main namespace, so + # if we want to keep app at Travis.app, we need to copy that, it would + # be ideal to send a patch to ember and get rid of this + $.each Travis, (key, value) -> + app[key] = value if value && value.isClass && key != 'constructor' - @app = app - @store = app.store - - $ => - app.initialize() - - loadConfig: (callback) -> - @ajax.get '/config', (data) => - $.extend @config, data.config - callback(data.config) + @app = app + @store = app.store + $ => app.initialize() require 'travis/ajax' require 'app' diff --git a/public/scripts/app.js b/public/scripts/app.js index 19b3cd75..840b23b5 100644 --- a/public/scripts/app.js +++ b/public/scripts/app.js @@ -29619,4 +29619,4 @@ var _require=function(){function c(a,c){document.addEventListener?a.addEventList ++g&&setTimeout(c,0)})}}(); (function(){!window.WebSocket&&window.MozWebSocket&&(window.WebSocket=window.MozWebSocket);if(window.WebSocket)Pusher.Transport=window.WebSocket,Pusher.TransportType="native";var c=(document.location.protocol=="http:"?Pusher.cdn_http:Pusher.cdn_https)+Pusher.VERSION,a=[];window.JSON||a.push(c+"/json2"+Pusher.dependency_suffix+".js");if(!window.WebSocket)window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION=!0,a.push(c+"/flashfallback"+Pusher.dependency_suffix+".js");var b=function(){return window.WebSocket?function(){Pusher.ready()}: function(){window.WebSocket?(Pusher.Transport=window.WebSocket,Pusher.TransportType="flash",window.WEB_SOCKET_SWF_LOCATION=c+"/WebSocketMain.swf",WebSocket.__addTask(function(){Pusher.ready()}),WebSocket.__initialize()):(Pusher.Transport=null,Pusher.TransportType="none",Pusher.ready())}}(),e=function(a){var b=function(){document.body?a():setTimeout(b,0)};b()},g=function(){e(b)};a.length>0?_require(a,g):g()})(); -;minispade.register('app', "(function() {(function() {\nminispade.require('auth');\nminispade.require('controllers');\nminispade.require('helpers');\nminispade.require('models');\nminispade.require('pusher');\nminispade.require('routes');\nminispade.require('slider');\nminispade.require('store');\nminispade.require('tailing');\nminispade.require('templates');\nminispade.require('views');\nminispade.require('config/locales');\nminispade.require('data/sponsors');\n\n Travis.reopen({\n App: Em.Application.extend({\n autoinit: false,\n currentUserBinding: 'auth.user',\n authStateBinding: 'auth.state',\n init: function() {\n this._super.apply(this, arguments);\n this.store = Travis.Store.create();\n this.store.loadMany(Travis.Sponsor, Travis.SPONSORS);\n this.set('auth', Travis.Auth.create({\n app: this,\n endpoint: Travis.config.api_endpoint\n }));\n this.slider = new Travis.Slider();\n this.pusher = new Travis.Pusher(Travis.config.pusher);\n return this.tailing = new Travis.Tailing();\n },\n signIn: function() {\n return this.get('auth').signIn();\n },\n signOut: function() {\n this.get('auth').signOut();\n return this.get('router').send('showRoot');\n },\n receive: function() {\n return this.store.receive.apply(this.store, arguments);\n },\n toggleSidebar: function() {\n var element;\n $('body').toggleClass('maximized');\n element = $('');\n $('#top .profile').append(element);\n Em.run.later((function() {\n return element.remove();\n }), 10);\n element = $('');\n $('#repo').append(element);\n return Em.run.later((function() {\n return element.remove();\n }), 10);\n }\n })\n });\n\n}).call(this);\n\n})();\n//@ sourceURL=app");minispade.register('auth', "(function() {(function() {\n\n this.Travis.Auth = Ember.Object.extend({\n iframe: $('