1jQuery(document).ready(function () { 2 3 if (jQuery("#aio_time_clock").length > 0) { 4 employee = jQuery("#employee").val(); 5 jQuery.ajax({ 6 type: "post", 7 dataType: "json", 8 url: timeClockAjax.ajaxurl, 9 data: { 10 action: "aio_time_clock_lite_js", 11 clock_action: "check_shifts", 12 employee: employee, 13 nonce: timeClockAjax.Nonce 14 }, 15 success: function (response) { 16 var o_shift = response["open_shift_id"]; 17 var is_clocked_in = response["is_clocked_in"]; 18 var new_clock_action = ""; 19 if (is_clocked_in){ 20 new_clock_action = "clock_out"; 21 jQuery("#open_shift_id").val(o_shift); 22 jQuery("#clock_action").val(new_clock_action); 23 jQuery("#aio_clock_button").html(timeClockAjax.clockOut); 24 jQuery("#clockMessage").html( 25 '<i>' + timeClockAjax.isClockedIn + '</i><br /><strong>' + timeClockAjax.clockInTime + ':</strong> ' + response['employee_clock_in_time'] 26 ); 27 28 } 29 else{ 30 new_clock_action = "clock_in"; 31 jQuery("#clock_action").val(new_clock_action); 32 jQuery("#open_shift_id").val(""); 33 jQuery("#aio_clock_button").html(timeClockAjax.clockIn); 34 jQuery("#clockMessage").html(timeClockAjax.clockInMessage); 35 } 36 } 37 }); 38 } 39 40 if (jQuery("#aio_time_clock_widget").length > 0) { 41 if (!jQuery("#aio_time_clock").length) { 42 employee = jQuery("#employee").val(); 43 jQuery.ajax({ 44 type: "post", 45 dataType: "json", 46 url: timeClockAjax.ajaxurl, 47 data: { 48 action: "aio_time_clock_lite_js", 49 clock_action: "check_shifts", 50 employee: employee, 51 nonce: timeClockAjax.Nonce 52 }, 53 success: function (response) { 54 var o_shift = response["open_shift_id"]; 55 var is_clocked_in = response["is_clocked_in"]; 56 var new_clock_action = ""; 57 if (is_clocked_in){ 58 new_clock_action = "clock_out"; 59 jQuery("#open_shift_id").val(o_shift); 60 jQuery("#clock_action").val(new_clock_action); 61 jQuery("#aio_clock_button").html(timeClockAjax.clockOut); 62 jQuery("#clockMessage").html( 63 '<i>' + timeClockAjax.isClockedIn + '</i><br /><strong>' + timeClockAjax.clockInTime + ':</strong> ' + response['employee_clock_in_time'] 64 ); 65 66 } 67 else{ 68 new_clock_action = "clock_in"; 69 jQuery("#clock_action").val(new_clock_action); 70 jQuery("#open_shift_id").val(""); 71 jQuery("#aio_clock_button").html(timeClockAjax.clockIn); 72 jQuery("#clockMessage").html('<i>' + timeClockAjax.clockInMessage + '</i>'); 73 } 74 } 75 }); 76 } 77 else{ 78 jQuery("#aio_time_clock_widget").html(timeClockAjax.TimeClockDetected); 79 } 80 } 81 82 if( jQuery('#jsTimer').length ) { 83 var myTimerVar = setInterval(myTimer, 1000); 84 } 85 86 jQuery(".aioUserButton").click(function (e) { 87 e.preventDefault(); 88 var aio_link = jQuery(this).attr("href"); 89 window.location = aio_link; 90 }); 91 92 jQuery("#aio_clock_button").click(function (e) { 93 var now = new Date(); 94 e.preventDefault(); 95 jQuery("#aio_clock_button").html('<div class="aio-spinner"></div>'); 96 employee = jQuery(this).attr("data-employee"); 97 clock_action = jQuery("#clock_action").val(); 98 open_shift_id = jQuery("#open_shift_id").val(); 99 100 jQuery.ajax({ 101 type: "post", 102 dataType: "json", 103 url: timeClockAjax.ajaxurl, 104 data: { 105 action: "aio_time_clock_lite_js", 106 clock_action: clock_action, 107 open_shift_id: open_shift_id, 108 employee: employee, 109 device_time: now.toLocaleString(), 110 nonce: timeClockAjax.Nonce 111 }, 112 success: function (response) { 113 var open_shift_id = response["open_shift_id"]; 114 var is_clocked_in = response["is_clocked_in"]; 115 var new_clock_action = ""; 116 if (is_clocked_in){ 117 new_clock_action = "clock_out"; 118 jQuery("#open_shift_id").val(open_shift_id); 119 jQuery("#clock_action").val(new_clock_action); 120 jQuery("#aio_clock_button").html(timeClockAjax.clockOut); 121 jQuery("#clockMessage").html( 122 '<i>' + timeClockAjax.isClockedIn + '</i>' + '<br /><strong>' + timeClockAjax.clockInTime + ':</strong> ' + response['employee_clock_in_time'] 123 ); 124 125 } 126 else{ 127 new_clock_action = "clock_in"; 128 jQuery("#open_shift_id").val(""); 129 jQuery("#clock_action").val(new_clock_action); 130 jQuery("#aio_clock_button").html(timeClockAjax.clockIn); 131 jQuery("#clockMessage").html('<i>' + timeClockAjax.clockedOutMessage + '</i> <br /><strong>'+timeClockAjax.TotalShiftTime+':</strong> ' + response["time_total"]); 132 } 133 } 134 }); 135 }); 136}); 137 138function myTimer() { 139 var d = new Date(); 140 document.getElementById("jsTimer").innerHTML = "<strong>"+timeClockAjax.currentTime+":</strong> " + d.toLocaleTimeString(); 141} 142 143function employeProfileSearch() { 144 // Declare variables 145 var input, filter, table, tr, td, i; 146 input = document.getElementById("employeeProfileInput"); 147 filter = input.value.toUpperCase(); 148 table = document.getElementById("employeeProfileTable"); 149 tr = table.getElementsByTagName("tr"); 150 151 for (i = 0; i < tr.length; i++) { 152 td = tr[i].getElementsByTagName("td")[0]; 153 if (td) { 154 if (td.innerHTML.toUpperCase().indexOf(filter) > -1) { 155 tr[i].style.display = ""; 156 } else { 157 tr[i].style.display = "none"; 158 } 159 } 160 } 161}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.