Skip to content

Instantly share code, notes, and snippets.

@EntranceJew
Created August 24, 2016 16:21
Show Gist options
  • Save EntranceJew/3b4a094edb03d098a0f829b8f4bd0a29 to your computer and use it in GitHub Desktop.
Save EntranceJew/3b4a094edb03d098a0f829b8f4bd0a29 to your computer and use it in GitHub Desktop.
show_all_scripts.js
(function(document){
var i, scripts = document.getElementsByTagName("script"),
attributes = new Map([
['fontFamily', 'Menlo,Monaco,Consolas,"Courier New",monospace'],
['overflow', 'auto'],
['display', 'block'],
['backgroundColor', '#f5f5f5'],
['border', '1px solid #cccccc'],
['borderRadius', '4px'],
['whiteSpace', 'pre']
]);
for (i = 0; i < scripts.length; i++) {
attributes.forEach( function(v,k){
scripts[i].style[k] = v;
});
}
})(document);
$( document ).ready(function(){
$( "script" ).each(function(k,v){
$( v ).css({
'font-family': 'Menlo,Monaco,Consolas,"Courier New",monospace',
'overflow': 'auto',
'display': 'block',
'background-color': '#f5f5f5',
'border': '1px solid #cccccc',
'border-radius': '4px',
'white-space': 'pre'
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment