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.hasAttr=function(a){var b=$(this).attr(a);return void 0!==typeof b&&b!==!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
Date.valid = function(str){ | |
var d = new Date(str); | |
return (Object.prototype.toString.call(d) === "[object Date]" && !isNaN(d.getTime())); | |
} |
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.attrs = function(){ | |
var attributes = {}; | |
if(this.length){ | |
$.each( this[0].attributes, function( index, attr ) { | |
attributes[ attr.name ] = attr.value; | |
}); | |
} | |
return attributes; | |
}; |
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
const stringToDOM = str => new DOMParser().parseFromString(str, 'text/html').body.childNodes[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.animateTransform = function(/* [start,] end [, duration] [, callback] */){ | |
var start = null, end = null, duration = 400, callback = function(){}; | |
for(var i=0; i<arguments.length; i++){ | |
if(typeof(arguments[i]) == "string"){ | |
if(!start) start = arguments[i]; | |
else end = arguments[i]; | |
} else if(typeof(arguments[i]) == "number"){ | |
duration = arguments[i]; | |
} else if(typeof(arguments[i]) == "function"){ | |
callback = arguments[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
var $_GET = (function(){ | |
var params = {}; | |
if(location.href.indexOf("?") > -1){ | |
var string = location.href.split("?")[1]; | |
if(string.indexOf("#") > -1){ | |
string = string.split("#")[0]; | |
} | |
var kvp = string.split("&"); | |
for(var i=0; i<kvp.length; i++){ | |
var k = kvp[i].split("=")[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 validColor(color){ | |
if(color=="")return false; | |
var $div = $("<div>"); | |
$div.css("border", "1px solid "+color); | |
return ($div.css("border-color")!="") | |
} |
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
String.prototype.extract = function(start, finish){ | |
var s = this.indexOf(start); | |
if(s == -1) return ""; | |
var e = this.indexOf(finish, s + start.length); | |
if(e == -1) return ""; | |
return this.substring(s + start.length, 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
jQuery.fn.selectText = function(){ | |
var doc = document; | |
var element = this[0]; | |
if (doc.body.createTextRange) { | |
var range = document.body.createTextRange(); | |
range.moveToElementText(element); | |
range.select(); | |
} else if (window.getSelection) { | |
var selection = window.getSelection(); | |
var range = document.createRange(); |
NewerOlder