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
html, body{ min-height:100%; } | |
body{ | |
font:14px Arial; margin:0; | |
background-image : linear-gradient(to left, #F3F3F3 100%, transparent 0%); | |
background-repeat : no-repeat; | |
background-size : 50% 1000%; | |
overflow-x:hidden; | |
} /* display:flex; flex-flow: column nowrap; align-items:center; justify-content:center; */ | |
.forkLink{ position:fixed; z-index:100; border:0; top:0; width:70px; right:0; opacity:.8; transition:.15s ease-out; } |
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
/** | |
* remove class by wild-card | |
* http://stackoverflow.com/a/10835425/104380 | |
*/ | |
$.fn.removeClassPrefix = function(prefix){ | |
this.each(function(){ | |
var c = this.getAttribute('class'), | |
regex = new RegExp("(^|\\s)" + prefix + "\\S+", 'g'); |
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(){ | |
$._oldAjax = $.ajax; // save reference to the "real" ajax method | |
// override the method with a wrapper | |
$.ajax = function(){ | |
var def = new $.Deferred(), | |
delay = typeof $.ajax.delay == 'undefined' ? 500 : $.ajax.delay, | |
delayTimeout, | |
args = arguments[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
// enhance the original "$.ajax" with a retry mechanism | |
$.ajax = (($oldAjax) => { | |
// on fail, retry by creating a new Ajax deferred | |
function check(a,b,c){ | |
var shouldRetry = b != 'success' && b != 'parsererror'; | |
if( shouldRetry && --this.retries > 0 ) | |
setTimeout(() => { $.ajax(this) }, this.retryInterval || 100); | |
} | |
return settings => $oldAjax(settings).always(check) |
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
console.json = console.json || function(argument){ | |
for(var arg = 0; arg < arguments.length; ++ arg) | |
console.log( JSON.stringify(arguments[arg], null, 4) ); | |
} |
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
// http://stackoverflow.com/a/29823718/104380 | |
jQuery.fn.findClosest = function (selector) { | |
// If we have a :this selector | |
var output = $(), | |
down = this.find(selector), | |
siblings, | |
recSearch, | |
foundCount = 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
jQuery.event.special.clickLimit = { | |
delegateType: "mousedown", | |
bindType: "mousedown", | |
handle: function( event ) { | |
var handleObj = event.handleObj, | |
startTime = new Date().getTime(), | |
threshold = event.data.threshold || 500; | |
$(this) | |
.unbind('mouseup.clickLimit') |
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
/** | |
* By - Yair Even-Or (2017) MIT license | |
* loads, using jQuery, dependency files. | |
* @param {Object} settings [files (Array), baseDir (String), sync (Boolean)] | |
* @return {Object} [promise] | |
*/ | |
window.dependencies = { | |
/** | |
* @param {Object/Array} settings [either a "settings" object or a simple Array of files to load] | |
* @return {Object} [jQuery AJAX (promise)] |
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
_.mixin({ | |
"formatBytes" : function(kiloBytes, decimals){ | |
if(kiloBytes == 0) return ['0', 'KB']; | |
var k = 1024, | |
dm = decimals + 1 || 1, | |
sizes = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], | |
i = Math.floor(Math.log(kiloBytes) / Math.log(k)); | |
return [parseFloat((kiloBytes / Math.pow(k, i)).toFixed(dm)).toLocaleString() , sizes[i]]; // parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + |
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.addTempClass = function(tempClass, duration){ | |
if( !tempClass ) | |
return this; | |
return this.each(function(){ | |
var $elm = $(this), | |
timer; | |
$elm.addClass(tempClass); |