Unified · Split
| @@ -84,12 +84,18 @@ · 83 unmodified lines | ||
| 84 | 84 | @trigger 'ready' |
| 85 | 85 | @router.start() |
| 86 | 86 | @hideLoading() |
| 87 | − unless @doc | |
| 88 | − new app.views.News() | |
| 89 | − new app.views.Share() | |
| 87 | + @welcomeBack() unless @doc | |
| 88 | + | |
| 90 | 89 | @removeEvent 'ready bootError' |
| 91 | 90 | return |
| 92 | 91 | |
| 92 | + welcomeBack: -> | |
| 93 | + @visitCount = @store.get('count') or 0 | |
| 94 | + @store.set 'count', ++@visitCount | |
| 95 | + new app.views.Notif 'Share', autoHide: null if @visitCount is 5 | |
| 96 | + new app.views.Notif 'Thanks', autoHide: null if @visitCount is 10 | |
| 97 | + new app.views.News() | |
| 98 | + | |
| 93 | 99 | reload: -> |
| 94 | 100 | @docs.clearCache() |
| 95 | 101 | @disabledDocs.clearCache() |
| @@ -27,3 +27,12 @@ app.templates.notifShare = -> · 26 unmodified lines | ||
| 27 | 27 | """ Like DevDocs? Help us reach more developers by sharing the link with your friends, on |
| 28 | 28 | <a href="/s/tw" target="_blank">Twitter</a>, <a href="/s/fb" target="_blank">Facebook</a>, |
| 29 | 29 | <a href="/s/re" target="_blank">Reddit</a>, etc.<br>Thanks :) """ |
| 30 | + | |
| 31 | +app.templates.notifThanks = -> | |
| 32 | + textNotif """ Hi there! """, | |
| 33 | + """ <p class="_notif-text">Quick shout-out to our awesome sponsors: | |
| 34 | + <ul class="_notif-list"> | |
| 35 | + <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> | |
| 36 | + <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! | |
| 37 | + </ul> | |
| 38 | + <p class="_notif-text">Have a great day :) """ | |
| @@ -1,12 +0,0 @@ | ||
| 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 | |
| @@ -86,3 +86,8 @@ · 85 unmodified lines | ||
| 86 | 86 | border: 0; |
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | + | |
| 90 | +._notif-list { | |
| 91 | + margin: .5em 0; | |
| 92 | + padding-left: 1rem; | |
| 93 | +} | |