diff --git a/assets/scripts/app/app.coffee b/assets/scripts/app/app.coffee index 21d003f2..c0375c53 100644 --- a/assets/scripts/app/app.coffee +++ b/assets/scripts/app/app.coffee @@ -1,4 +1,3 @@ -require 'travis' # hrm. require 'auth' require 'controllers' require 'helpers' @@ -56,4 +55,3 @@ Travis.reopen element = $('') $('#repository').append(element) Em.run.later (-> element.remove()), 10 - diff --git a/assets/scripts/app/routes.coffee b/assets/scripts/app/routes.coffee index 205dfe2f..a99b2c9c 100644 --- a/assets/scripts/app/routes.coffee +++ b/assets/scripts/app/routes.coffee @@ -1,6 +1,6 @@ Travis.Router = Ember.Router.extend location: 'history' - enableLogging: true + enableLogging: false initialState: 'loading' goToRoot: Ember.Route.transitionTo('root.home.show') diff --git a/assets/scripts/lib/travis/ajax.coffee b/assets/scripts/lib/travis/ajax.coffee index 9c629dff..763d0f22 100644 --- a/assets/scripts/lib/travis/ajax.coffee +++ b/assets/scripts/lib/travis/ajax.coffee @@ -27,14 +27,7 @@ jQuery.support.cors = true $.ajax($.extend(options, @DEFAULT_OPTIONS)) -@Travis.Ajax.instance = Em.Object.create(@Travis.Ajax) - -$.extend @Travis, +@Travis.ajax = Em.Object.create @Travis.Ajax, get: (url, callback) -> @ajax(url, 'get', success: callback) - post: (url, data, callback) -> - @Ajax.instance.post(url, data, callback) - - ajax: (url, method, options) -> - @Ajax.instance.ajax(url, method, options) diff --git a/assets/scripts/travis.coffee b/assets/scripts/travis.coffee index 3133d15f..7793507d 100644 --- a/assets/scripts/travis.coffee +++ b/assets/scripts/travis.coffee @@ -34,26 +34,27 @@ require 'ext/ember/namespace' INTERVALS: { sponsors: -1, times: -1, updateTimes: 1000 } run: (attrs) -> - $ => - @redirectOnHashbang() - @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 = app - @store = app.store - - app.initialize() - - redirectOnHashbang: -> 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 = app + @store = app.store + + $ => + app.initialize() + loadConfig: (callback) -> - @get '/config', (data) => + @ajax.get '/config', (data) => $.extend @config, data.config console.log "Connecting to #{data.config.api_endpoint}" callback(data.config) + +require 'travis/ajax' +require 'app' diff --git a/lib/rake-pipeline/travis/filters.rb b/lib/rake-pipeline/travis/filters.rb index d2eb6e16..de5c7e7f 100644 --- a/lib/rake-pipeline/travis/filters.rb +++ b/lib/rake-pipeline/travis/filters.rb @@ -40,7 +40,7 @@ module Travis end def name(path) - path.sub(%r(^app/templates/), '').sub(/\.hbs$/, '') + path.gsub(%r(app/|templates/|.hbs), '') end end diff --git a/public/index.html b/public/index.html index 9583c404..3fb08040 100644 --- a/public/index.html +++ b/public/index.html @@ -7,9 +7,9 @@ Travis CI - Distributed Continuous Integration Platform for the Open Source Community - + diff --git a/public/scripts/app.js b/public/scripts/app.js index 37e5b171..703933d7 100644 --- a/public/scripts/app.js +++ b/public/scripts/app.js @@ -30146,4 +30146,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('travis');\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 store: this.store,\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('showAuthenticated');\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 $('#repository').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: $('