Changeset 16507 for schedule/function
- Timestamp:
- 05/30/13 20:11:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/function/SplitDelete.php
r16422 r16507 26 26 button.setAttribute('id','btnAddTime'), 27 27 button.onclick=function(){ 28 if($('#Time1').val() != ""){ timeValue = $('#Time1').val(); meas = "disabled"; meas2 = true; split1(); }else{ alert("please enter value for time to add measurement"); } 28 if($('#Time1').val() != ""){ var splitting = $('#Time1').val().split(':'); var add = 01; 29 30 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; 31 32 function pad(number, length) { 33 34 var str = '' + number; 35 while (str.length < length) { 36 str = '0' + str; 37 } 38 39 return str; 40 41 } 42 43 meas = "name"; meas2 = "time"; split1(); }else{ alert("please enter value for time to add measurement"); } 29 44 30 45 … … 107 122 button.onclick= function() 108 123 { 109 meas = "name"; meas2 = "time"; 110 timeValue = ""; 111 split1(); 124 if($('#Time1').val() != ""){ var splitting = $('#Time1').val().split(':'); var add = 30; 125 126 timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2); 127 128 function pad(number, length) { 129 130 var str = '' + number; 131 while (str.length < length) { 132 str = '0' + str; 133 } 134 135 return str; 136 137 } 138 139 meas = "name"; meas2 = "time"; split1(); }else{ alert("please enter value for time to add measurement"); } 140 112 141 113 142 … … 156 185 button.setAttribute('id','btnAddTime'), 157 186 button.onclick=function(){ 158 if($('#Time2').val() != ""){ timeValue = $('#Time2').val(); meas = "disabled"; meas2 = true; split(); }else{ alert("please enter value for time to add measurement"); } 187 if($('#Time2').val() != ""){ var splitting = $('#Time2').val().split(':'); var add = 01; 188 189 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; 190 191 function pad(number, length) { 192 193 var str = '' + number; 194 while (str.length < length) { 195 str = '0' + str; 196 } 197 198 return str; 199 200 } meas = "name"; meas2 = "time"; split(); }else{ alert("please enter value for time to add measurement"); } 159 201 160 202 … … 233 275 button.onclick= function() 234 276 { 235 meas = "name"; meas2 = "time"; 236 timeValue = ""; 237 split(); 277 if($('#Time2').val() != ""){ var splitting = $('#Time2').val().split(':'); var add = 30; 278 279 timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2); 280 281 function pad(number, length) { 282 283 var str = '' + number; 284 while (str.length < length) { 285 str = '0' + str; 286 } 287 288 return str; 289 290 } 291 292 meas = "name"; meas2 = "time"; split(); }else{ alert("please enter value for time to add measurement"); } 238 293 239 294 } … … 294 349 button.setAttribute(meas,meas2), 295 350 button.onclick=function(){ 296 if($('#Time'+cnt).val() != ""){ timeValue = $('#Time'+cnt).val(); meas = "disabled"; meas2 = true; split1(); }else{ alert("please enter value for time to add measurement"); } 351 if($('#Time'+cnt).val() != ""){var splitting = $('#Time'+cnt).val().split(':'); var add = 01; 352 353 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; 354 355 function pad(number, length) { 356 357 var str = '' + number; 358 while (str.length < length) { 359 str = '0' + str; 360 } 361 362 return str; 363 364 } meas = "name"; meas2 = "time"; split1(); }else{ alert("please enter value for time to add measurement"); } 297 365 298 366 … … 373 441 button.setAttribute('value','Split'), 374 442 button.onclick=function(){ 375 timeValue = ""; 376 meas = "name"; meas2 = "time"; 377 split(); 443 if($('#Time'+cnt).val() != ""){ var splitting = $('#Time'+cnt).val().split(':'); var add = 30; 444 445 timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2); 446 447 function pad(number, length) { 448 449 var str = '' + number; 450 while (str.length < length) { 451 str = '0' + str; 452 } 453 454 return str; 455 456 } 457 458 meas = "name"; meas2 = "time"; split(); }else{ alert("please enter value for time to add measurement"); } 378 459 } 379 460 ); … … 435 516 button.setAttribute(meas,meas2), 436 517 button.onclick=function(){ 437 if($('#Time'+cnt).val() != ""){ timeValue = $('#Time'+cnt).val(); meas = "disabled"; meas2 = true; split1(); }else{ alert("please enter value for time to add measurement"); } 518 if($('#Time'+cnt).val() != ""){ var splitting = $('#Time'+cnt).val().split(':'); var add = 01; 519 520 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; 521 522 function pad(number, length) { 523 524 var str = '' + number; 525 while (str.length < length) { 526 str = '0' + str; 527 } 528 529 return str; 530 531 } meas = "name"; meas2 = "time"; split1(); }else{ alert("please enter value for time to add measurement"); } 438 532 439 533 … … 515 609 button.setAttribute('value','Split'), 516 610 button.onclick=function(){ 517 timeValue = ""; 518 meas = "name"; meas2 = "time"; 519 split1(); 611 if($('#Time'+cnt).val() != ""){ var splitting = $('#Time'+cnt).val().split(':'); var add = 30; 612 613 timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2); 614 615 function pad(number, length) { 616 617 var str = '' + number; 618 while (str.length < length) { 619 str = '0' + str; 620 } 621 622 return str; 623 624 } 625 626 meas = "name"; meas2 = "time"; split(); }else{ alert("please enter value for time to add measurement"); } 520 627 } 521 628 );
Note:
See TracChangeset
for help on using the changeset viewer.