Thibaut пре 11 година
родитељ
комит
b0071e2e64

+ 3 - 1
assets/javascripts/app/app.coffee

@@ -84,7 +84,9 @@
     @trigger 'ready'
     @router.start()
     @hideLoading()
-    new app.views.News() unless @doc
+    unless @doc
+      new app.views.News()
+      new app.views.Share()
     @removeEvent 'ready bootError'
     return
 

+ 8 - 0
assets/javascripts/templates/notif_tmpl.coffee

@@ -21,3 +21,11 @@ app.templates.notifInvalidLocation = ->
 
 app.templates.notifNews = (news) ->
   notif 'Changelog', app.templates.newsList(news)
+
+app.templates.notifShare = ->
+  textNotif """ Hi there! """,
+            """ Like DevDocs? Help us reach more developers by sharing the link with your friends, on
+                <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>,
+                <a href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fdevdocs.io" target="_blank">Facebook</a>,
+                <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>,
+                etc.<br>Thanks :)"""

+ 12 - 0
assets/javascripts/views/misc/share.coffee

@@ -0,0 +1,12 @@
+#= 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