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
84 @trigger 'ready'84 @trigger 'ready'
85 @router.start()85 @router.start()
86 @hideLoading()86 @hideLoading()
87 unless @doc87 @welcomeBack() unless @doc
88 new app.views.News()88
89 new app.views.Share()
90 @removeEvent 'ready bootError'89 @removeEvent 'ready bootError'
91 return90 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 reload: ->99 reload: ->
94 @docs.clearCache()100 @docs.clearCache()
95 @disabledDocs.clearCache()101 @disabledDocs.clearCache()
assets/javascripts/templates/notif_tmpl.coffee+9−0
@@ -27,3 +27,12 @@ app.templates.notifShare = -> · 26 unmodified lines
27 """ Like DevDocs? Help us reach more developers by sharing the link with your friends, on27 """ Like DevDocs? Help us reach more developers by sharing the link with your friends, on
28 <a href="/s/tw" target="_blank">Twitter</a>, <a href="/s/fb" target="_blank">Facebook</a>,28 <a href="/s/tw" target="_blank">Twitter</a>, <a href="/s/fb" target="_blank">Facebook</a>,
29 <a href="/s/re" target="_blank">Reddit</a>, etc.<br>Thanks :) """29 <a href="/s/re" target="_blank">Reddit</a>, etc.<br>Thanks :) """
30
31app.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
3class 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
86 border: 0;86 border: 0;
87 }87 }
88}88}
89
90._notif-list {
91 margin: .5em 0;
92 padding-left: 1rem;
93}