Add share notification

pull/142/head
Thibaut 10 years ago
parent 240700dfb4
commit b0071e2e64

@ -84,7 +84,9 @@
@trigger 'ready'
@router.start()
@hideLoading()
new app.views.News() unless @doc
unless @doc
new app.views.News()
new app.views.Share()
@removeEvent 'ready bootError'
return

@ -21,3 +21,11 @@ app.templates.notifInvalidLocation = ->
app.templates.notifNews = (news) ->
notif 'Changelog', app.templates.newsList(news)
app.templates.notifShare = ->
textNotif """ Hi there! """,
""" Like DevDocs? Help us reach more developers by sharing the link with your friends, on
<a href="https://twitter.com/intent/tweet?url=http%3A%2F%2Fdevdocs.io&via=DevDocs&text=All-in-one%2C%20quickly%20searchable%20API%20docs%3A" target="_blank">Twitter</a>,
<a href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fdevdocs.io" target="_blank">Facebook</a>,
<a href="http://www.reddit.com/submit?url=http%3A%2F%2Fdevdocs.io&title=All-in-one%2C%20quickly%20searchable%20API%20docs&resubmit=true" target="_blank">Reddit</a>,
etc.<br>Thanks :)"""

@ -0,0 +1,12 @@
#= 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
Loading…
Cancel
Save