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
// Rough implementation, untested, etc | |
// Will obviously fail when non-overridden methods are used to change the DOM | |
(function($){ | |
$.fn.isAncestorOf = function( elem ) { | |
// If parent and child element are the same, return false | |
if (this[0] == elem[0]) return false; | |
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 domchanged(methods, type) { | |
$.each( methods.split(' '), function( i, method ) { | |
// Store a reference to the original method. | |
var orig = $.fn[ method ]; | |
// Override the original method. | |
$.fn[ method ] = function(){ | |
var args = arguments, |
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
$.fn.fadeSwap = function(content, callback) { | |
// Return each ... | |
return this.each( function() { | |
// Save reference to this | |
var $this = $(this); | |
// Fade to 0 | |
$this.animate({ |
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
// Opacity fixes for IE | |
var alphaRegex = /^alpha\(opacity=(\d+)\)$/i; | |
$.each(['fadeIn', 'fadeOut'], function(i, method){ | |
var _fn = $.fn[method]; | |
$.fn[method] = function(easing, callback) { | |
alert('here'); | |
if ( $.browser.msie && ( ! this[0].style.filter || alphaRegex.test( this[0].style.filter ))) { |
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 FBReady( func ) { | |
// If facebook is already loaded, | |
// just call the function | |
if ( FBReady.done ) return func(); | |
// If the stack already exists, | |
// push the function onto it, | |
// otherwise, initialize a stack | |
// of functions |
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( $ ){ | |
$.fn.placeholder = function() { | |
var id = 0; | |
return this.data('placeholder') ? this : this.each(function(){ | |
// Create label | |
var $this = $(this) | |
, label = (function( props ) { |
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
// Bind functions to dom ready before jQuery has been loaded | |
// This only works if line 83 from jQuery 143 is changed from | |
// readyList = [], | |
// to | |
// readyList = window.jQuery.readyList || [], | |
(function(){ | |
jQuery = $ = function( fn ) { | |
return typeof fn === "function" ? | |
jQuery.readyList.push( fn ) : |
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
Modernizr | |
.addTest('iframe', function() { | |
return window.top.location != window.location; | |
}) | |
.addTest('facebook', function() { | |
return !! ~ location.href.indexOf( 'fb_sig_in_iframe=1' ); | |
}); |
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
/** | |
* Yepnope JS | |
* | |
* Version 0.2.6pre | |
* | |
* by Alex Sexton - AlexSexton@gmail.com | |
* | |
* Tri-Licensed WTFPL, BSD, & MIT | |
*/ | |
(function(window, doc, undef) { |
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
DropboxClient.prototype.putFile = function(file, path, optargs, cb) { | |
if (typeof optargs == 'function') cb = optargs, optargs = {}; | |
var boundary = 'sAxIqse3tPlHqUIUI9ofVlHvtdt3tpaG', | |
content_type = 'multipart/form-data; boundary=' + boundary, | |
self = this; | |
require('fs').readFile(file, function (err, data) { | |
if (err) return cb(err); | |
// Build request body. | |
path = escapePath(path); |
OlderNewer