This file contains hidden or 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.recurse = function(closure, options) { | |
var self = this, settings = $.extend({}, $.fn.recurse.defaults, options); | |
self.queue(settings.queue, function(next){ | |
if (!closure.apply(self, [self])) { | |
self.delay(settings.delay, settings.queue).queue(settings.queue, arguments.callee).trigger('queue').dequeue(settings.queue); | |
} else { | |
self.trigger('complete'); | |
} | |
}); |
This file contains hidden or 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($){ | |
$.pubsub = (function(){ | |
var mule = $({}); | |
return { | |
subscribe:function(key, fn){ | |
//Normalise | |
mule.bind(key, function(e, data){ | |
fn.apply(null, [data]); | |
}); |
This file contains hidden or 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
//For use on the jquery functions that except selectors | |
jQuery.fn.atLeastOne = function(prop, selectorsArr) { | |
var ret = 0, self = this, | |
testSelector = function(value){ | |
return self[prop].apply(self, [value]).size() > 0; | |
}; | |
$.each(selectorsArr, function(i, value){ | |
ret = testSelector(value); | |
// break loop if found | |
if(ret) { return false } |
This file contains hidden or 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 Tiny Pub/Sub - v0.3pre - 11/4/2010 | |
* http://benalman.com/ | |
* | |
* Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ | |
(function($){ |
This file contains hidden or 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 Tiny Pub/Sub - v0.3pre - 11/4/2010 | |
* http://benalman.com/ | |
* | |
* Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ | |
(function($){ |
This file contains hidden or 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
/* View documents with Google Docs ... | |
* because my laptop can't handle Word and Chrome at the same time. */ | |
$(document).ready(function(){ | |
// I'm sure there's a more efficient selector for this. | |
$('a[href$=doc], a[href$=docx], a[href$=pdf], a[href$=rtf]').attr( | |
'href', | |
function(){ | |
return 'http://docs.google.com/viewer?url=' + this.href; | |
} |
NewerOlder