Skip to content

Instantly share code, notes, and snippets.

@artlawry
artlawry / radio-control ie7 ie8 shim.js
Last active August 29, 2015 14:04
Adds a checked class to all checked radio buttons for
(function () {
var labels, label, inputs, input, type, i, ilen;
if (!document.addEventListener) {
labels = document.getElementsByTagName('label');
inputs = document.getElementsByTagName('input');
function inputClick() {
clicked = window.event.srcElement;
(function(){var c,label,inputs,input,type,i,ilen;if(!document.addEventListener){c=document.getElementsByTagName('label');inputs=document.getElementsByTagName('input');function inputClick(){clicked=window.event.srcElement;inputChange(clicked)};function inputChange(a){var b,input,i,ilen,removeChecked,type,redrawElement;a=a||window.event.srcElement;b=document.getElementsByName(a.getAttribute('name'));classRegex=/(^|\s+)checked(\s+|$)/g;type=a.getAttribute('type');if(type==='radio'){for(i=0,ilen=b.length;i<ilen;i++){input=b[i];input.className=input.className.replace(classRegex,' ');if(input===a){input.className+=' checked'}}}else{if(classRegex.test(a.className)){a.className=a.className.replace(classRegex,' ')}else{a.className+=' checked'}}redrawElement=a.parentNode||document.body;redrawElement.className+=' redraw';redrawElement.className=redrawElement.className.replace(/ redraw$/,'')};for(i=0,ilen=c.length;i<ilen;i++){label=c[i];inputId=label.getAttribute('for')||label.getAttribute('htmlFor');if(inputId){input=do
/* -------------------------------------------------
MINIMAL TWITTER FOR FLUID / USERSTYLES
Special thanks to:
Max Fenton (@maxfenton) for kicking this off
------------------------------------------------- */
.trends, .bird-topbar-etched, .wtf-module, .site-footer, .topics {
@artlawry
artlawry / minmal_twitter.css
Last active December 20, 2015 03:38 — forked from cmod/minmal_twitter.css
Browser styles to be applied via your favorite in-browser CSS mod plugin akin to Stylish for Chrome.
/* -------------------------------------------------
MINIMAL TWITTER FOR FLUID / USERSTYLES
Special thanks to:
Max Fenton (@maxfenton) for kicking this off
------------------------------------------------- */
.trends, .bird-topbar-etched, .wtf-module, .site-footer, .topics {