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
/* | |
Remove inline style="..." | |
Preserve hidden content. | |
Call the function like this: | |
var all = document.getElementsByTagName('*'); | |
remove_style(all); |
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
/* | |
This will change: | |
"rgba(255, 255, 255)" or "#fff" | |
Into: | |
#FFFFFF | |
*/ |
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
// JS Module Pattern: | |
// http://j.mp/module-pattern | |
// Redefine: $, window, document, undefined. | |
var APP = (function($, window, document, undefined) { | |
// Automatically calls all functions in APP.init | |
$(document).ready(function() { | |
APP.go(); | |
}); |
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
/* `XHTML, HTML4, HTML5 Reset | |
----------------------------------------------------------------------------------------------------*/ | |
a, | |
abbr, | |
acronym, | |
address, | |
applet, | |
article, | |
aside, |
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
// | |
// While TinyMCE can strip out <script> tags, | |
// it does not remove inline JS event handlers. | |
// | |
// Example: onmouseover, onclick, etc. | |
// | |
// This should be included at the bottom of a page, | |
// contained inside an <iframe> to sandbox user-created | |
// content. The reason it is contained in an <iframe> | |
// is to prevent user-created CSS from affecting |
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
Check if a site it running PHP by appending this query string... | |
?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000 | |
Example: | |
http://php.net/?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000 |
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
$('select.jump_list').change(function() { | |
if (!this.value) { | |
return; | |
} | |
var url, url_len, last_char; | |
if (this.value.match('://')) { | |
window.top.location = this.value; | |
} |
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
// | |
// Forces equal heights on a jQuery array. | |
// | |
equalize: function(jq_arr, min_height) { | |
if (!jq_arr.length) { | |
return; | |
} | |
function do_equalize() { | |
var tallest = min_height || 0; |
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
/* | |
Utility helper classes, to | |
be sprinkled in as needed. | |
Mmm... sprinkles! | |
*/ | |
/* `Text Align + Vertical Align | |
----------------------------------------------------------------------------------------------------*/ |
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
// Example of how to cache the result of an external jQuery Template. | |
// Inspired by this post... | |
// http://encosia.com/2010/10/05/using-external-templates-with-jquery-templates/ | |
var person = {name: 'Dave'}; | |
var person_tmpl; | |
$.get('_template.tpl.html', function(template) { | |
// Use converted string from remote file. |
OlderNewer