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[':'].containsInsensitive = function (elem, index, match) { | |
return $(elem).text().toLowerCase().indexOf(match[3].toLowerCase()) > -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
$.expr[':'].closest = function (elem, index, match) { | |
return $(elem).closest(match[3]).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
(function ($) { | |
var ids = [], | |
sorted = [], | |
repeated = []; | |
$('[id]').each(function () { | |
ids.push(this.id); | |
}); | |
var sorted = ids.sort(); |
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
wait = function (data) { | |
var check, context, fail, freq, isResetFunction, reset, resetAllTimers, success, timers, waitInner; | |
timers = {}; | |
resetAllTimers = function () { | |
clearTimeout(timers.timer); | |
return clearTimeout(timers.resetTimer); | |
}; | |
check = data.check || null; | |
freq = data.frequency || data.freq || 0; | |
reset = data.reset || null; |
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 scrollDiv = document.createElement("div"); | |
scrollDiv.style.width = "100px"; | |
scrollDiv.style.height = "100px"; | |
scrollDiv.style.position = "absolute"; | |
scrollDiv.style.top = "-9999px"; | |
scrollDiv.style.overflow= "scroll"; | |
document.body.appendChild(scrollDiv); |
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 (global) { | |
var script = document.createElement('script'); | |
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
script.onload = function () { | |
global.myQuery = global.jQuery.noConflict(); | |
console.log('jQuery has been loaded'); | |
}; | |
global.document.getElementsByTagName('head')[0].appendChild(script); | |
})(window); |
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 bindNativeEvent = function (domElement, eventType, callback) { | |
if (!domElement || !eventType) { | |
return; | |
} | |
var eventMethod = window.addEventListener ? | |
['addEventListener', ''] : | |
['attachEvent', 'on']; | |
domElement[eventMethod[0]](eventMethod[1] + eventType, function (event) { |
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
type = (function(global) { | |
var re = /\s([a-z|A-Z]+)/; | |
return function(obj) { | |
if (obj === global) { | |
return 'global'; | |
} | |
return Object.prototype.toString.call(obj).match(re)[1].toLowerCase(); | |
} | |
})(window); |
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
/** | |
* An easy way to realise event delegation jQuery in version-agnotic way | |
*/ | |
var easyEvents = (function () { | |
var easyEvents = function (bindings, jQuery) { | |
easyEvents._jq = window.jQuery || jQuery; | |
if (!easyEvents._jq) { | |
window.mmcore || (window.mmcore = {}); | |
window.mmcore.waitFor || (window.mmcore.waitFor = function () { return {then: function () {}}; }); | |
window.mmcore.waitFor(function () { |
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 extend = (function () { | |
var own = function (parent, child) { | |
return Object.prototype.hasOwnProperty.call(parent, child); | |
}; | |
return function (out) { | |
out = out || {}; | |
for (var i = 1, len = arguments.length; i < len; i++) { | |
if (!arguments[i]) { |
OlderNewer