Thanks DevDocs's sponsors

pull/142/merge
Thibaut 10 years ago
parent 5716bd5468
commit 90a59030b8

@ -84,12 +84,18 @@
@trigger 'ready' @trigger 'ready'
@router.start() @router.start()
@hideLoading() @hideLoading()
unless @doc @welcomeBack() unless @doc
new app.views.News()
new app.views.Share()
@removeEvent 'ready bootError' @removeEvent 'ready bootError'
return 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: -> reload: ->
@docs.clearCache() @docs.clearCache()
@disabledDocs.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 """ 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/tw" target="_blank">Twitter</a>, <a href="/s/fb" target="_blank">Facebook</a>,
<a href="/s/re" target="_blank">Reddit</a>, etc.<br>Thanks :) """ <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; border: 0;
} }
} }
._notif-list {
margin: .5em 0;
padding-left: 1rem;
}

Loading…
Cancel
Save