This is now an actual repo:
var SITE = SITE || {}; | |
SITE.fileInputs = function() { | |
var $this = $(this), | |
$val = $this.val(), | |
valArray = $val.split('\\'), | |
newVal = valArray[valArray.length-1], | |
$button = $this.siblings('.button'), | |
$fakeFile = $this.siblings('.file-holder'); | |
if(newVal !== '') { |
/* | |
* emToPx: convert a global em-based value to pixels | |
* Copyright 2011, Scott Jehl, scottjehl.com | |
* MIT License | |
* Usage: emToPx function accepts a single number/float argument, returns a number | |
*/ | |
var emToPx = (function( win ){ | |
var doc = win.document, | |
body = doc.body, | |
prop = "fontSize", |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
/* | |
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/ | |
* Better handling of scripts without supplied ids. | |
* | |
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function. | |
*/ | |
(function(doc, script) { | |
var js, | |
fjs = doc.getElementsByTagName(script)[0], |
#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)
Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.
(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)
##Option 1: Using jQuery 1.7's $.Callbacks() feature:
// `Default font for form elements. | |
//---------------------------------------------------------------------------------------------------- | |
$form-font-stack: Arial, "Liberation Sans", FreeSans, sans-serif !default; | |
$form-font-size: 13px !default; | |
// `Form Element Reset. | |
//---------------------------------------------------------------------------------------------------- | |
input::ms-clear, |
//Extend Date to have a few extra fatures | |
Date.dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; | |
Date.monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; | |
Date.prototype.dayNames = Date.dayNames; | |
Date.prototype.monthNames = Date.monthNames; | |
Date.prototype.getDayName = function() { | |
return this.dayNames[this.getDay()]; | |
}; | |
Date.prototype.getDayNameAbbr = function() { |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>Ring Pulsers</title> | |
<style type="text/css" media="screen"> | |
.marker { | |
left: 150px; | |
height: 100px; | |
position: absolute; |