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
(function ($) { | |
$(function () { | |
if (!supportsInputAttribute('autofocus')) { | |
$('[autofocus=]').focus(); // http://bugs.jquery.com/ticket/5637 | |
} | |
}); | |
// detect support for input attirbute | |
function supportsInputAttribute (attr) { |
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
(function ($) { | |
$(function () { | |
if (!supportsInputAttribute('placeholder')) { | |
$('[placeholder]').each(function () { | |
var $this = $(this), | |
$form = $this.closest('form'), | |
placeholderText = $this.attr('placeholder'), | |
placeholderColor = 'GrayText', | |
defaultColor = $this.css('color'); |
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
// Moved to https://github.com/terkel/jquery-print-link-urls |
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
div { | |
border: 1px solid red; | |
*border-style: none; | |
} | |
div table { | |
border-style: hidden; | |
*border: 1px solid red; | |
} | |
div table th, | |
div table td { |
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
// http://twitter.com/padolsey/status/119790781417537536 | |
$.expr[':'].matches = (function (_) { | |
return function (el, i ,m) { | |
return !!_(m[3]||'*',[el])[0]; | |
}; | |
}($.find.matches)); |
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
// http://gihyo.jp/dev/serial/01/crossbrowser-javascript/0007 | |
var addEvent = (function () { | |
if (document.addEventListener) { | |
return function(node, type, handler) { | |
node.addEventListener(type, handler, false); | |
}; | |
} else if (document.attachEvent) { | |
return function(node, type, handler) { | |
node.attachEvent('on' + type, function (event) { | |
handler.call(node, event); |
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
// API docs: https://dev.twitter.com/docs/tweet-entities | |
// Inspired by: https://gist.github.com/442463 | |
function parseTweetEntities (tweet) { | |
var result = [], | |
entities = [], | |
lastIndex = 0, | |
key, | |
i, | |
len, | |
elem; |
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
/* http://hail2u.net/blog/webdesign/centering-floated-list.html */ | |
.centered { | |
position: relative; | |
overflow: hidden; | |
} | |
.centered ul { | |
position: relative; | |
left: 50%; | |
float: left; | |
} |
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
/*! | |
* CSS Reset 2011-12-25 | |
* https://gist.github.com/gists/1360380 | |
* | |
* Author: Takeru Suzuki, http://terkel.jp/ | |
* License: Public domain | |
* | |
* Inspired by Normalize.css: http://necolas.github.com/normalize.css/ | |
*/ |
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
// Including IE detection by James Padolsey: https://gist.github.com/527683 | |
(function (html) { | |
var ie = (function () { | |
var undef, | |
v = 3, | |
div = document.createElement('div'), | |
all = div.getElementsByTagName('i'); | |
while (div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->', all[0]); | |
return (v > 4)? v: undef; | |
}()); |