Skip to content

Instantly share code, notes, and snippets.

@rainyear
Last active November 15, 2015 05:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rainyear/2506071a6f4cfac25559 to your computer and use it in GitHub Desktop.
Save rainyear/2506071a6f4cfac25559 to your computer and use it in GitHub Desktop.
http://blog.rainy.im is using ghost, {{ghost_foot}} injection was used to append donate button to every article.
<script type='tmpl' class='donation'>
<pre>
<code class="language-javascript">
if(post.content.isHelpful){
$("button#donate").click();
};
</code>
</pre>
<button
type="button"
height=20
class="am-btn am-btn-secondary am-btn-block am-radius am-btn-xs"
data-am-modal="{target: '#donate-modal', closeViaDimmer: 1, width: 450}">
<i class='am-icon-btc'/>
BUY ME A CUP OF COFFEE
</button>
</script>
<div class="am-modal am-modal-alert" tabindex="-1" id="donate-modal">
<div class="am-modal-dialog" >
<div class="am-modal-hd">
</div>
<div class="am-modal-bd">
<div>
<img src='http://7xiijd.com1.z0.glb.clouddn.com/tenpay.png'
style="float:left" width=200 />
<img src='http://7xiijd.com1.z0.glb.clouddn.com/alipay.png'
style="float:right" width=200/>
<div class="clear" style="clear:both"></div>
</div>
</div>
<div class="am-modal-footer">
<span class="am-modal-btn">NO, THANKS!</span>
</div>
</div>
</div>
<script>
(function(){
$(".am-article > .entry-content").append($('.donation').html());
$("p").has("img").css("text-align", "center");
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment