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
//perform the same duty as children but includes free floating 'text' nodes | |
jQuery.fn.extend({ | |
offspring: function() { | |
return jQuery( | |
jQuery.map( this, function(n){ | |
return jQuery.grep(n.childNodes, function(n) { | |
return n.nodeType == 1 || n.nodeType == 3; | |
}); | |
}) | |
); |
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
var __setOption = $.ui.dialog.prototype._setOption; | |
$.extend($.ui.dialog.prototype, { | |
_setOption : function (key, value) { | |
var self = this, | |
uiDialog = self.uiDialog; | |
if (key === 'message') { | |
self.element.html("" + (value || ' ')); | |
} | |
__setOption.apply(self, 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
(function($) { | |
$.fn.extend($.ui.tabs.prototype, { | |
//use the same signature as add | |
activate : function(url, label, index) { | |
console.log(index) | |
var self = this, | |
index = index || self.anchors.length - 1; | |
//loop thru the tab.anchors collection and look for tab with a matching href | |
//If tab is local then compare the URL with the anchor or hash (eg #anchor5) | |
//If the tab is remote then compare the URL with .data('href.tabs') |
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
<% | |
REM: An excerpt from RSA Security site FAW "Is RSA patented?" | |
REM: http://www.rsasecurity.com/rsalabs/faq/6-3-1.html | |
REM: The patent for the RSA algorithm (U.S. Patent 4,405,829) was issued on September 20, 1983, | |
REM: exclusively licensed to RSA Security Inc. by the Massachusetts Institute of Technology, | |
REM: with an expiration date of September 20, 2000. RSA Security maintained a standard, | |
REM: royalty-based licensing policy that could be modified for special circumstances. | |
REM: In the U.S., a license has been needed to ëëmake, use or sellíí products that included | |
REM: the RSA algorithm. However, RSA Security has long allowed free non-commercial use of | |
REM: the RSA algorithm, with written permission, for academic or university research purposes. |
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
<body> | |
<div id="wrapper" class="great-grand-parent"> | |
<div class="grand-parent"> | |
<div class="parent"> | |
<button id="foo" class="button">foo (click)</button> | |
<button id="bar" class="button">bar (live click)</button> | |
<button id="baz" class="button">baz (#wrapper delegate)</button> | |
</div> |
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
//==== Fix flicker of background images in IE | |
//http://ajaxian.com/archives/no-more-ie6-background-flicker | |
//http://support.microsoft.com/?scid=kb;en-us;823727&spid=2073&sid=global | |
//http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=1&postId=1104 | |
//Executes proprietary command to force IE to cache all background images which prevents the browser from fetching the same image repeatedly when using CSS hover background repositioning | |
if($.browser.msie && parseInt($.browser.version) === 6) { | |
try { | |
document.execCommand("BackgroundImageCache",false,true); | |
} catch(e) { |
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
//implement shift and unshift on Array prototype | |
//http://www.javascriptkit.com/javatutors/oopjs2.shtml | |
if(!Array.prototype.shift) { // if this method does not exist.. | |
Array.prototype.shift = function(){ | |
firstElement = this[0]; | |
this.reverse(); | |
this.length = Math.max(this.length-1,0); | |
this.reverse(); |
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
//==== General Enhancements to Javascript =========================================================== | |
// Replace repeated spaces, newlines and tabs with a single space | |
String.prototype.normalize = function() {return this.replace(/^\s*|\s(?=\s)|\s*$/g, "");} | |
//http://www.somacon.com/p355.php | |
//Trim: Strip leading and trailing white-space | |
//NOTE: can also use jQuery.trim | |
String.prototype.trim = function() {return this.replace(/^\s+|\s+$/g,"");} | |
String.prototype.ltrim = function() {return this.replace(/^\s+/,"");} |
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() { | |
var arr = decodeURIComponent(window.location.search.substr(1)).replace(/\+/g," ").split('&'), p; | |
window.location.query = {}; | |
for (var i = 0; i < arr.length; i++) { | |
p = arr[i].split('='); | |
window.location.query[p[0]] = p[1]; | |
} | |
})(); |
NewerOlder