mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Thanks DevDocs's sponsors
This commit is contained in:
parent
5716bd5468
commit
90a59030b8
4 changed files with 23 additions and 15 deletions
|
@ -84,12 +84,18 @@
|
|||
@trigger 'ready'
|
||||
@router.start()
|
||||
@hideLoading()
|
||||
unless @doc
|
||||
new app.views.News()
|
||||
new app.views.Share()
|
||||
@welcomeBack() unless @doc
|
||||
|
||||
@removeEvent 'ready bootError'
|
||||
return
|
||||
|
||||
welcomeBack: ->
|
||||
@visitCount = @store.get('count') or 0
|
||||
@store.set 'count', ++@visitCount
|
||||
new app.views.Notif 'Share', autoHide: null if @visitCount is 5
|
||||
new app.views.Notif 'Thanks', autoHide: null if @visitCount is 10
|
||||
new app.views.News()
|
||||
|
||||
reload: ->
|
||||
@docs.clearCache()
|
||||
@disabledDocs.clearCache()
|
||||
|
|
|
@ -27,3 +27,12 @@ app.templates.notifShare = ->
|
|||
""" Like DevDocs? Help us reach more developers by sharing the link with your friends, on
|
||||
<a href="/s/tw" target="_blank">Twitter</a>, <a href="/s/fb" target="_blank">Facebook</a>,
|
||||
<a href="/s/re" target="_blank">Reddit</a>, etc.<br>Thanks :) """
|
||||
|
||||
app.templates.notifThanks = ->
|
||||
textNotif """ Hi there! """,
|
||||
""" <p class="_notif-text">Quick shout-out to our awesome sponsors:
|
||||
<ul class="_notif-list">
|
||||
<li><a href="http://devdocs.io/s/maxcdn" target="_blank">MaxCDN</a> has been supporting DevDocs since day one. They provide CDN solutions that make DevDocs and countless other sites faster.</li>
|
||||
<li><a href="http://devdocs.io/s/shopify" target="_blank">Shopify</a> is where I spend my weekdays. Interested in working on one of the biggest commerce platform in the world, in a delightful work environment? We're hiring!
|
||||
</ul>
|
||||
<p class="_notif-text">Have a great day :) """
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
#= require views/misc/notif
|
||||
|
||||
class app.views.Share extends app.views.Notif
|
||||
@defautOptions:
|
||||
autoHide: null
|
||||
|
||||
init: ->
|
||||
@type = 'Share'
|
||||
@count = app.store.get('count') or 0
|
||||
app.store.set 'count', ++@count
|
||||
@show() if @count is 5
|
||||
return
|
|
@ -86,3 +86,8 @@
|
|||
border: 0;
|
||||
}
|
||||
}
|
||||
|
||||
._notif-list {
|
||||
margin: .5em 0;
|
||||
padding-left: 1rem;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue