diff --git a/assets/javascripts/app/app.coffee b/assets/javascripts/app/app.coffee
index 09ea219c..7554869d 100644
--- a/assets/javascripts/app/app.coffee
+++ b/assets/javascripts/app/app.coffee
@@ -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()
diff --git a/assets/javascripts/templates/notif_tmpl.coffee b/assets/javascripts/templates/notif_tmpl.coffee
index baad3fd1..67eada0b 100644
--- a/assets/javascripts/templates/notif_tmpl.coffee
+++ b/assets/javascripts/templates/notif_tmpl.coffee
@@ -27,3 +27,12 @@ app.templates.notifShare = ->
""" Like DevDocs? Help us reach more developers by sharing the link with your friends, on
Twitter, Facebook,
Reddit, etc.
Thanks :) """
+
+app.templates.notifThanks = ->
+ textNotif """ Hi there! """,
+ """
Quick shout-out to our awesome sponsors: +
Have a great day :) """ diff --git a/assets/javascripts/views/misc/share.coffee b/assets/javascripts/views/misc/share.coffee deleted file mode 100644 index 3da15e0b..00000000 --- a/assets/javascripts/views/misc/share.coffee +++ /dev/null @@ -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 diff --git a/assets/stylesheets/components/_notif.scss b/assets/stylesheets/components/_notif.scss index 575fedf7..d9cf8cae 100644 --- a/assets/stylesheets/components/_notif.scss +++ b/assets/stylesheets/components/_notif.scss @@ -86,3 +86,8 @@ border: 0; } } + +._notif-list { + margin: .5em 0; + padding-left: 1rem; +}