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
$(":contains(Trump),:contains(TRUMP),:contains(trump)").filter(function(){return $(this).clone().children().remove().end().text().toLowerCase().indexOf("trump")!=-1;}).remove(); |
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
jQuery.fn.selectTimeZone = function() { | |
var $el = $(this[0]); // our element | |
var offsetFromGMT = String(- new Date('1/1/2009').getTimezoneOffset() / 60); // using 1/1/2009 so we know DST isn't tripping us up | |
if (offsetFromGMT[0] != '-') { | |
offsetFromGMT = '+' + offsetFromGMT; // if it's not negative, prepend a + | |
} | |
if (offsetFromGMT.length < 3) { | |
offsetFromGMT = offsetFromGMT.substr(0, 1) + '0' + offsetFromGMT.substr(1); // add a leading zero if we need it | |
} | |
var regEx = new RegExp(offsetFromGMT); // create a RegExp object with our pattern |