View convert-seconds.js
new Date(seconds * 1000).toISOString().substr(11, 8) |
View detectBottom-scroll.js
window.onscroll = function(ev) { | |
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) { | |
alert("you're at the bottom of the page"); | |
} | |
}; |
View CORDOVA - MAC EMULATE
CORDOVA - MAC EMULATE | |
Android | |
- Install JDK | |
- Install Android Studio & SDK | |
- Install emulator | |
- Install Brew cli | |
- Install Gradle from Brew |
View kp_new.js
function getdata(index,itemArr,cat,type){ | |
$.ajax({ | |
url:url, | |
method:'POST', | |
data : "itemIds="+itemArr, | |
success:function(res){ | |
var food1 = eval(res); | |
if(type=="NORMAL" || type==undefined){ | |
for(var i=0;i < food1.length;i++){ |
View kp.js
function getItemKp(itemdIds, callback, loadMoreOptions){ | |
if(itemdIds.length > 0){ | |
$.ajax({ | |
type : "POST", url : baseUrl + "/kp/itemCache", data : "itemIds="+itemdIds , timeout: 5000, success : function(data) { | |
/** list Property | |
* | |
* data.id item Id | |
* data.title item name |
View gist:b255a3c37a9a677d457a672ee40947a8
var obj = document.getElementById('partitioned'); | |
obj.addEventListener("keydown", stopCarret); | |
obj.addEventListener("keyup", stopCarret); | |
function stopCarret() { | |
if (obj.value.length > 3){ | |
setCaretPosition(obj, 3); | |
} | |
} |
View otp_input.js
var obj = document.getElementById('partitioned'); | |
obj.addEventListener("keydown", stopCarret); | |
obj.addEventListener("keyup", stopCarret); | |
function stopCarret() { | |
if (obj.value.length > 3){ | |
setCaretPosition(obj, 3); | |
} | |
} |
View getURLParam.js
var getUrlParameter = function getUrlParameter(sParam) { | |
var sPageURL = decodeURIComponent(window.location.search.substring(1)), | |
sURLVariables = sPageURL.split('&'), | |
sParameterName, | |
i; | |
for (i = 0; i < sURLVariables.length; i++) { | |
sParameterName = sURLVariables[i].split('='); | |
if (sParameterName[0] === sParam) { |
View cordova-plugin-camera-index.html
<!DOCTYPE html> | |
<!-- Aysad Kozanoglu --> | |
<html> | |
<head> | |
<title>foto cek</title> | |
<style> | |
html { | |
-webkit-user-select: none; | |
} | |
</style> |