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.fn.hasBind = function(type, _fn) | |
| { | |
| var data, eventsMap, events; | |
| if(!((data = this._data()) && (eventsMap = data.events) && (events = eventsMap[type]))) | |
| return false; | |
| var event, i = -1; while((event = events[++i]) && event.handler !== _fn) | |
| ; | |
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() | |
| { | |
| var _fnMap = {}; | |
| $.fn.addClass = function(classes) | |
| { | |
| var vs = this; | |
| if(!(classes > '') || vs.length == 0) | |
| return this; |
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
| if(!console) | |
| console = {}; | |
| if(!console.log) | |
| console.log = $jb._log; | |
| console.time = $jb._timerBegin; | |
| console.timeEnd = $jb._timerEnd; | |
| var i, n = 3000000; |
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
| window._bounce1 = function(p){ | |
| var value; | |
| for (var a = 0, b = 1; 1; a += b, b /= 2){ | |
| if (p >= (7 - 4 * a) / 11){ | |
| value = b * b - Math.pow((11 - 6 * a - 11 * p) / 4, 2); | |
| break; | |
| } | |
| } | |
| console.log('n = ', Math.log(b)/Math.log(0.5), 'a = ', a, 'b = ', b); |
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
| /* No regexp. indexOf only */ | |
| window._queryToJSON = function(query) | |
| { | |
| if(query == null || query.length < 2) | |
| return {}; | |
| var p = 0; | |
| if(query.charAt(p) == '?') | |
| ++p; |
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
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
| "http://www.w3.org/TR/html4/loose.dtd"> | |
| <!-- code has grubbed from http://msdn.microsoft.com/en-us/library/ms532990(VS.85).aspx --> | |
| <html> | |
| <head> | |
| <title></title> | |
| <meta content="text/html; charset=utf-8" http-equiv="content-type"> | |
| <SCRIPT> |
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
| /** | |
| @fn call function with <this> = <that> and <arguments> matched from <argMap> by names | |
| @param that {Any} <this> for function call | |
| @param argMap {Object} map argName -> argValue | |
| @example | |
| var _fn = function(a, b, c) | |
| { | |
| console.log('a = ', a, 'b = ', b, 'с = ', c); | |
| }; |
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
| window._gzip = (function() | |
| { | |
| var _matchCount = function(s, word) | |
| { | |
| var n = 0, wordLen = word.length, p = -wordLen; | |
| while((p = s.indexOf(word, p + wordLen)) > -1) | |
| ++n; | |
| return n; |
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
| window.onunload = function() | |
| { | |
| var _check = function(lbl) | |
| { | |
| var a; | |
| if(window.document && document.body) | |
| a = 'body'; | |
| else if(window.document && document.documentElement) | |
| a = 'documentElement'; |
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
| /** | |
| @file | |
| @author Fyodorov "bga" Alexander <bga.email@gmail.com> | |
| @section LICENSE | |
| Copyright (c) 2009-2010, Fyodorov "Bga" Alexander <bga.email@gmail.com> | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without |