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
window.onerror = function(a,b,c) { | |
alert(a + "; " + b + "; " + c); | |
} |
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 isAndroid(){ | |
return navigator.userAgent.toLowerCase().indexOf("android") > -1; | |
} | |
isAndroid(); | |
function isIOS(){ | |
return navigator.userAgent.match(/(iPad|iPhone|iPod)/i) != null; | |
} | |
isIOS(); |
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
<body ontouchstart=""> |
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 zQ(selector){return document.querySelector(selector);} | |
function zQA(selector){return document.querySelectorAll(selector);} | |
function zAddClass(el,className){ | |
if(el === null) { return; } | |
if(!((' '+el.className+' ').indexOf(' '+className+' ')>-1)){el.className+=' '+className;} | |
} | |
function zHasClass(el,className){ | |
//if((' '+el.className+' ').indexOf(' '+className+' ')>-1){return true;} | |
//else{return false;} | |
return new RegExp(' '+className+' ').test(' '+el.className+' '); |
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 zAddMulilineEllipsis(el,container,maxHeight){ | |
var tag,tagHeight,tagContentHeight; | |
tag=el; | |
tagContentHeight=tag.scrollHeight; | |
if(maxHeight===undefined){tagHeight=tag.offsetHeight;}else{tagHeight=maxHeight;} | |
if(tagContentHeight>tagHeight){ | |
if(container=='parent'){zAddClass(tag.parentNode,'applyEllipsis');} | |
else if(container=='self'){zAddClass(tag,'applyEllipsis');} | |
} | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder