Mercurial > zeropaste
view app/assets/javascripts/zp.formatter.js @ 252:49410cc6ffd6
Whoops, doesn't work with multi-process setup.
author | edogawaconan <me@myconan.net> |
---|---|
date | Thu, 10 Oct 2013 04:50:40 +0000 |
parents | 22c4b5f90e24 |
children | c8757469da39 |
line wrap: on
line source
//= require config/marked //= require config/prettify (function($) { window.zp.formatter = { raw: function() { return $("#pl pre").text() }, links: function() { return $("#paste-mode a") }, current: function() { return this.links().filter(".active").attr("href").slice(1) }, markdown: function() { var area = $("#md div") area.html(marked(this.raw())) area.find("pre").addClass("prettyprint") area.find("a").prop("rel", "nofollow") }, highlight: function() { $("#hl pre").text(this.raw()) prettyPrint() }, init: function() { this.markdown() this.highlight() } } })(jQuery)