Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add grunt to automate minification and add bookmarlet to the README
- Loading branch information
Showing
7 changed files
with
58 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
prettyprint-bookmarklet | ||
======================= | ||
Prettify Bookmarklet | ||
==================== | ||
|
||
A small bookmarklet to apply google-code-prettify to any in-browser raw code | ||
|
||
<a href='javascript:(function a(){var a,b;Array.prototype.forEach.call(document.querySelectorAll("pre"),function(a){a.className="prettyprint"}),a=document.createElement("script"),a.onload=function(){prettyPrint()},a.src="http://cdnjs.cloudflare.com/ajax/libs/prettify/188.0.0/prettify.js",document.body.appendChild(a),b=document.createElement("link"),b.href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css",b.setAttribute("rel","stylesheet"),document.body.appendChild(b)})();'>Prettify</a> | ||
|
||
A small bookmarklet to apply google-code-prettify to any in-browser raw code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
/*! PrettyPrinter Bookmarklet - v0.1.0 - 2012-06-16 | ||
/*! PrettyPrinter Bookmarklet - v0.1.0 - 2012-06-17 | ||
* http://github.com/dharFr/prettyprint-bookmarklet | ||
* Copyright (c) 2012 Olivier Audard; Licensed MIT */ | ||
|
||
javascript: | ||
|
||
(function prettyprinter(){ | ||
var s, l; | ||
var scriptNode, cssNode; | ||
|
||
// Adding 'prettyprint' class to any 'pre' element | ||
Array.prototype.forEach.call(document.querySelectorAll('pre'), function(n){ | ||
n.className = 'prettyprint'; | ||
}); | ||
|
||
// Loading google's prettyfy.js | ||
s=document.createElement('script'); | ||
s.onload=function(){ | ||
scriptNode = document.createElement('script'); | ||
scriptNode.onload = function(){ | ||
/*global prettyPrint:true */ | ||
prettyPrint(); | ||
}; | ||
s.src='http://cdnjs.cloudflare.com/ajax/libs/prettify/188.0.0/prettify.js'; | ||
document.body.appendChild(s); | ||
scriptNode.src='http://cdnjs.cloudflare.com/ajax/libs/prettify/188.0.0/prettify.js'; | ||
document.body.appendChild(scriptNode); | ||
|
||
// Loading google's prettyfy.css | ||
l=document.createElement('link'); | ||
l.href='http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css'; | ||
l.setAttribute('rel', "stylesheet"); | ||
document.body.appendChild(l); | ||
cssNode=document.createElement('link'); | ||
cssNode.href='http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css'; | ||
cssNode.setAttribute('rel', 'stylesheet'); | ||
document.body.appendChild(cssNode); | ||
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Prettify Bookmarklet | ||
==================== | ||
|
||
A small bookmarklet to apply google-code-prettify to any in-browser raw code | ||
|
||
<a href='@@bookmarklet'>Prettify</a> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(function prettyprinter(){ | ||
var scriptNode, cssNode; | ||
|
||
// Adding 'prettyprint' class to any 'pre' element | ||
Array.prototype.forEach.call(document.querySelectorAll('pre'), function(n){ | ||
n.className = 'prettyprint'; | ||
}); | ||
|
||
// Loading google's prettyfy.js | ||
scriptNode = document.createElement('script'); | ||
scriptNode.onload = function(){ | ||
/*global prettyPrint:true */ | ||
prettyPrint(); | ||
}; | ||
scriptNode.src='http://cdnjs.cloudflare.com/ajax/libs/prettify/188.0.0/prettify.js'; | ||
document.body.appendChild(scriptNode); | ||
|
||
// Loading google's prettyfy.css | ||
cssNode=document.createElement('link'); | ||
cssNode.href='http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css'; | ||
cssNode.setAttribute('rel', 'stylesheet'); | ||
document.body.appendChild(cssNode); | ||
}()); |