Mercurial > zeropaste
diff app/assets/javascripts/zp.formatter.coffee @ 370:5a4d31e97937
Remove extra file extensions.
author | edogawaconan <me@myconan.net> |
---|---|
date | Tue, 14 Apr 2015 00:22:07 +0900 |
parents | app/assets/javascripts/zp.formatter.js.coffee@55287d8a5a04 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/assets/javascripts/zp.formatter.coffee Tue Apr 14 00:22:07 2015 +0900 @@ -0,0 +1,18 @@ +#= require config/marked +#= require config/prettify +window.zp.formatter = + raw: -> $("#pl pre").text() + links: -> $("#paste-mode a") + current: -> $("#paste-mode .active a").attr("href").slice(1) + markdown: -> + $("#md div") + .html(marked @raw()) + .find("pre").addClass "prettyprint" + .end() + .find("a").prop "rel", "nofollow" + highlight: -> + $("#hl pre").text @raw() + prettyPrint() + init: -> + @markdown() + @highlight()