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
$.expr[":"].visible = function (a) { | |
return !(jQuery(a).is(':hidden') || jQuery(a).parents(':hidden').length); | |
}; |
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
$.expr[":"].contains = $.expr.createPseudo(function (arg) { | |
return function (elem) { | |
return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0; | |
}; | |
}); |
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.outerHTML = function () { | |
return $('<div>').append($(this).clone()).html(); | |
} |
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.tag = function (i) { | |
if (arguments.length === 0) { | |
return $(this)[0].tagName; | |
} | |
var $this = $(this); | |
var newnode = $('<' + i + '></' + i '>').html($this.html()); | |
var attributes = $.map(this.attributes, function (item) { | |
return item.name | |
}) |
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
$.title = function (input) { | |
if (arguments.length == 0) { | |
return $("title").html(); | |
} | |
$("title").html(input); | |
return this; | |
} |
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.id = function (i) { | |
if (i === undefined) { | |
return $(this)[0].id; | |
} | |
if (arguments.length == 0) { | |
return $(this).attr("id"); | |
} | |
if (i === "") { | |
$(this).removeAttr("id"); | |
return this; |
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.shuffle = function () { | |
return this.each(function () { | |
var items = $(this).children(); | |
return (items.length) ? $(this).html($.shuffle(items)) : this; | |
}) | |
} |
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
if (Array.prototype.nativeFilter) { | |
Array.prototype.filter = Array.prototype.nativeFilter; | |
delete Array.prototype.nativeFilter | |
} | |
Array.prototype.define("nativeFilter", Array.prototype.filter); | |
Array.prototype.filter = function() { | |
if (arguments.length === 0) { |
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 i, len, methods = Object.getOwnPropertyNames(Array.prototype); | |
for (i = 0, len = methods.length; i < len; i += 1) { | |
if (arguments.constructor.prototype.hasOwnProperty(methods[i]) === false) { | |
arguments.constructor.prototype.define(methods[i], Array.prototype[methods[i]]); | |
} | |
if (NodeList.prototype.hasOwnProperty(methods[i]) === false) { | |
NodeList.prototype.define(methods[i], Array.prototype[methods[i]]); | |
} | |
} |
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 selectionDisabled = { | |
"-webkit-touch-callout": "none", | |
"-webkit-user-select": "none", | |
"-khtml-user-select": "none", | |
"-moz-user-select": "none", | |
"-ms-user-select": "none", | |
"user-select": "none" | |
}; |