|
|
@ -41,6 +41,7 @@ page.show = (path, state) ->
|
|
|
|
currentState = context.state
|
|
|
|
currentState = context.state
|
|
|
|
page.dispatch(context)
|
|
|
|
page.dispatch(context)
|
|
|
|
context.pushState()
|
|
|
|
context.pushState()
|
|
|
|
|
|
|
|
updateCanonicalLink()
|
|
|
|
track()
|
|
|
|
track()
|
|
|
|
context
|
|
|
|
context
|
|
|
|
|
|
|
|
|
|
|
@ -50,6 +51,7 @@ page.replace = (path, state, skipDispatch, init) ->
|
|
|
|
currentState = context.state
|
|
|
|
currentState = context.state
|
|
|
|
page.dispatch(context) unless skipDispatch
|
|
|
|
page.dispatch(context) unless skipDispatch
|
|
|
|
context.replaceState()
|
|
|
|
context.replaceState()
|
|
|
|
|
|
|
|
updateCanonicalLink()
|
|
|
|
track() unless init or skipDispatch
|
|
|
|
track() unless init or skipDispatch
|
|
|
|
context
|
|
|
|
context
|
|
|
|
|
|
|
|
|
|
|
@ -177,6 +179,10 @@ onclick = (event) ->
|
|
|
|
isSameOrigin = (url) ->
|
|
|
|
isSameOrigin = (url) ->
|
|
|
|
url.indexOf("#{location.protocol}//#{location.hostname}") is 0
|
|
|
|
url.indexOf("#{location.protocol}//#{location.hostname}") is 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateCanonicalLink = ->
|
|
|
|
|
|
|
|
@canonicalLink ||= document.head.querySelector('link[rel="canonical"]')
|
|
|
|
|
|
|
|
@canonicalLink.setAttribute('href', "http://#{location.host}#{location.pathname}")
|
|
|
|
|
|
|
|
|
|
|
|
track = ->
|
|
|
|
track = ->
|
|
|
|
ga?('send', 'pageview', location.pathname + location.search + location.hash)
|
|
|
|
ga?('send', 'pageview', location.pathname + location.search + location.hash)
|
|
|
|
_gauges?.push(['track'])
|
|
|
|
_gauges?.push(['track'])
|
|
|
|