Rev 23834 | Rev 24072 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed
$(function() {$(".punch-in-outs").live('click', function() {loadPunchInOuts("main-content");});$("#punch-in-outs-paginated .next").live('click', function() {loadPaginatedNextItems('/getPaginatedPunchInOuts', null, 'punch-in-outs-paginated', 'punch-in-outs-table', null);$(this).blur();});$("#punch-in-outs-paginated .previous").live('click', function() {loadPaginatedPreviousItems('/getPaginatedPunchInOuts', null, 'punch-in-outs-paginated', 'punch-in-outs-table', null);$(this).blur();});});function createPunchInOut(inOut) {if(confirm("Are you sure you want to do punch "+inOut)){distance = undefined;if (navigator.geolocation) {navigator.geolocation.getCurrentPosition(showPosition);} else {alert("Location cant be tracked. Please enable location");}if(distance == undefined){alert("Unable to fetch your device location");return;}if(distance < 500){doPostAjaxRequestWithParamsHandler(context+"/createPunchInOut", {}, function(response){$('#main-content').html(response);alert("Punch "+inOut+" done successfully");});}else{alert("Punch "+inOut+" can only be done from store.");}}}function loadPunchInOuts(domId){doGetAjaxRequestHandler(context+"/getPunchInOuts", function(response){$('#' + domId).html(response);});}