History

Thanks DevDocs's sponsors

Thibaut committed 11 years ago

Commit 90a59031 parent 5716bd54 files · +23 −15Browse files

Unified · Split

4 files
  1. assets/javascripts/app/app.coffee +9 −3
  2. assets/javascripts/templates/notif_tmpl.coffee +9 −0
  3. assets/javascripts/views/misc/share.coffee +0 −12
  4. assets/stylesheets/components/_notif.scss +5 −0
assets/javascripts/app/app.coffee+9−3
@@ -84,12 +84,18 @@ · 83 unmodified lines
8484 @trigger 'ready'
8585 @router.start()
8686 @hideLoading()
87− unless @doc
88− new app.views.News()
89− new app.views.Share()
87+ @welcomeBack() unless @doc
88+
9089 @removeEvent 'ready bootError'
9190 return
9291
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+
9399 reload: ->
94100 @docs.clearCache()
95101 @disabledDocs.clearCache()
assets/javascripts/templates/notif_tmpl.coffee+9−0
@@ -27,3 +27,12 @@ app.templates.notifShare = -> · 26 unmodified lines
2727 """ Like DevDocs? Help us reach more developers by sharing the link with your friends, on
2828 <a href="/s/tw" target="_blank">Twitter</a>, <a href="/s/fb" target="_blank">Facebook</a>,
2929 <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 :) """
assets/javascripts/views/misc/share.coffee+0−12
@@ -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
assets/stylesheets/components/_notif.scss+5−0
@@ -86,3 +86,8 @@ · 85 unmodified lines
8686 border: 0;
8787 }
8888 }
89+
90+._notif-list {
91+ margin: .5em 0;
92+ padding-left: 1rem;
93+}