mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Fixed not found page
This commit is contained in:
parent
a9eeb7723b
commit
6ac3ea9f5f
5 changed files with 7 additions and 19 deletions
|
@ -1,8 +1,6 @@
|
|||
gplusClientID = '800329290710-j9sivplv2gpcdgkrsis9rff3o417mlfa.apps.googleusercontent.com'
|
||||
# TODO: Move to GPlusHandler
|
||||
|
||||
NotFoundView = require('views/core/NotFoundView')
|
||||
|
||||
go = (path) -> -> @routeDirectly path, arguments
|
||||
|
||||
module.exports = class CocoRouter extends Backbone.Router
|
||||
|
@ -118,7 +116,7 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
#'user/:slugOrID/profile': go('user/JobProfileView')
|
||||
'user/:slugOrID/profile': go('EmployersView') # Show the not-recruiting-now screen
|
||||
|
||||
'*name': 'showNotFoundView'
|
||||
'*name': go('NotFoundView')
|
||||
|
||||
routeToServer: (e) ->
|
||||
window.location.href = window.location.href
|
||||
|
@ -142,13 +140,6 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
if error.toString().search('Cannot find module "' + path + '" from') is -1
|
||||
throw error
|
||||
|
||||
showNotFoundView: ->
|
||||
@openView @notFoundView()
|
||||
|
||||
notFoundView: ->
|
||||
view = new NotFoundView()
|
||||
view.render()
|
||||
|
||||
openView: (view) ->
|
||||
@closeCurrentView()
|
||||
$('#page-container').empty().append view.el
|
||||
|
|
|
@ -7,4 +7,3 @@ block content
|
|||
- var num = Math.floor(Math.random() * 3) + 1;
|
||||
|
||||
img(src="/images/pages/not_found/404_#{num}.png" class="not-found-image")
|
||||
|
||||
|
|
6
app/views/NotFoundView.coffee
Normal file
6
app/views/NotFoundView.coffee
Normal file
|
@ -0,0 +1,6 @@
|
|||
RootView = require 'views/core/RootView'
|
||||
template = require 'templates/core/not-found'
|
||||
|
||||
module.exports = class NotFoundView extends RootView
|
||||
id: 'not-found-view'
|
||||
template: template
|
|
@ -4,10 +4,3 @@ template = require 'templates/core/not-found'
|
|||
module.exports = class NotFoundView extends RootView
|
||||
id: 'not-found-view'
|
||||
template: template
|
||||
|
||||
# For some reason, it wasn't really rendering the top bar or doing i18n, so I hacked around it. (#2068.)
|
||||
afterRender: ->
|
||||
unless @renderedOnce
|
||||
_.delay (=> @render?()), 1000
|
||||
@renderedOnce = true
|
||||
super()
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
"dependencies": {
|
||||
"JASON": "~0.1.3",
|
||||
"JQDeferred": "~2.1.0",
|
||||
"aether": "~0.3.0",
|
||||
"async": "0.2.x",
|
||||
"aws-sdk": "~2.0.0",
|
||||
"bayesian-battle": "0.0.x",
|
||||
|
|
Loading…
Reference in a new issue