Skip to content

Commit b0071e2

Browse files
committed
Add share notification
1 parent 240700d commit b0071e2

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

‎assets/javascripts/app/app.coffee‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@
8484
@trigger 'ready'
8585
@router.start()
8686
@hideLoading()
87-
new app.views.News() unless @doc
87+
unless @doc
88+
new app.views.News()
89+
new app.views.Share()
8890
@removeEvent 'ready bootError'
8991
return
9092

‎assets/javascripts/templates/notif_tmpl.coffee‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@ app.templates.notifInvalidLocation = ->
2121

2222
app.templates.notifNews = (news) ->
2323
notif 'Changelog', app.templates.newsList(news)
24+
25+
app.templates.notifShare = ->
26+
textNotif """ Hi there! """,
27+
""" Like DevDocs? Help us reach more developers by sharing the link with your friends, on
28+
<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>,
29+
<a href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fdevdocs.io" target="_blank">Facebook</a>,
30+
<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>,
31+
etc.<br>Thanks :)"""
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#= require views/misc/notif
2+
3+
class app.views.Share extends app.views.Notif
4+
@defautOptions:
5+
autoHide: null
6+
7+
init: ->
8+
@type = 'Share'
9+
@count = app.store.get('count') or 0
10+
app.store.set 'count', ++@count
11+
@show() if @count is 5
12+
return

0 commit comments

Comments
 (0)