mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 19:06:59 -05:00
Redirect 2014 HoC link to 2015 HoC link
https://app.asana.com/0/54276215890539/65805646890763
This commit is contained in:
parent
12523dd247
commit
c7118d69e5
2 changed files with 2 additions and 29 deletions
|
@ -34,14 +34,3 @@ block outer_content
|
||||||
strong(data-i18n="home.old_browser") Uh oh, your browser is too old to run CodeCombat. Sorry!
|
strong(data-i18n="home.old_browser") Uh oh, your browser is too old to run CodeCombat. Sorry!
|
||||||
br
|
br
|
||||||
span(data-i18n="home.old_browser_suffix") You can try anyway, but it probably won't work.
|
span(data-i18n="home.old_browser_suffix") You can try anyway, but it probably won't work.
|
||||||
|
|
||||||
|
|
||||||
block extra_footer_content
|
|
||||||
if view.explainsHourOfCode
|
|
||||||
// Does not show up unless lang is en-US.
|
|
||||||
div.hour-of-code-explanation
|
|
||||||
| The 'Hour of Code' is a nationwide initiative by
|
|
||||||
a(href="http://csedweek.org") Computer Science Education Week
|
|
||||||
| and
|
|
||||||
a(href="http://code.org") Code.org
|
|
||||||
| to introduce millions of students to one hour of computer science and computer programming.
|
|
||||||
|
|
|
@ -11,12 +11,8 @@ module.exports = class HomeView extends RootView
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super()
|
super()
|
||||||
window.tracker?.trackEvent 'Homepage Loaded', category: 'Homepage'
|
window.tracker?.trackEvent 'Homepage Loaded', category: 'Homepage'
|
||||||
if not me.get('hourOfCode') and @getQueryVariable 'hour_of_code'
|
if @getQueryVariable 'hour_of_code'
|
||||||
@setUpHourOfCode()
|
application.router.navigate "/hoc", trigger: true
|
||||||
elapsed = (new Date() - new Date(me.get('dateCreated')))
|
|
||||||
if me.get('hourOfCode') and elapsed < 86400 * 1000 and me.get('preferredLanguage', true) is 'en-US'
|
|
||||||
# Show the Hour of Code footer explanation in English until it's been more than a day
|
|
||||||
@explainsHourOfCode = true
|
|
||||||
|
|
||||||
onClickPlayButton: (e) ->
|
onClickPlayButton: (e) ->
|
||||||
@playSound 'menu-button-click'
|
@playSound 'menu-button-click'
|
||||||
|
@ -27,7 +23,6 @@ module.exports = class HomeView extends RootView
|
||||||
|
|
||||||
afterInsert: ->
|
afterInsert: ->
|
||||||
super(arguments...)
|
super(arguments...)
|
||||||
@$el.addClass 'hour-of-code' if @explainsHourOfCode
|
|
||||||
|
|
||||||
isOldBrowser: ->
|
isOldBrowser: ->
|
||||||
if $.browser
|
if $.browser
|
||||||
|
@ -38,14 +33,3 @@ module.exports = class HomeView extends RootView
|
||||||
else
|
else
|
||||||
console.warn 'no more jquery browser version...'
|
console.warn 'no more jquery browser version...'
|
||||||
return false
|
return false
|
||||||
|
|
||||||
setUpHourOfCode: ->
|
|
||||||
# All this HoC stuff is for the 2014-2015 year. 2015-2016 year lands at /hoc instead (the courses view).
|
|
||||||
# TODO: get rid of all this sometime in November 2015 when code.org/learn updates to the new version for Hour of Code tutorials.
|
|
||||||
elapsed = (new Date() - new Date(me.get('dateCreated')))
|
|
||||||
if elapsed < 5 * 60 * 1000
|
|
||||||
me.set 'hourOfCode', true
|
|
||||||
me.patch()
|
|
||||||
# We may also insert the tracking pixel for everyone on the CampaignView so as to count directly-linked visitors.
|
|
||||||
$('body').append($('<img src="https://code.org/api/hour/begin_codecombat.png" style="visibility: hidden;">'))
|
|
||||||
application.tracker?.trackEvent 'Hour of Code Begin'
|
|
||||||
|
|
Loading…
Reference in a new issue