- Timestamp:
- 05/14/12 15:54:35 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/shift/calendar.js
r13701 r13722 78 78 this.parEl = document.getElementById( id ); 79 79 this.show(); 80 this.show(); 80 81 81 82 if (!initDate) … … 593 594 } 594 595 596 var xmlReqAll = null; 595 597 function requestAll(yy, mm) 596 598 { 599 if (xmlReqAll) 600 xmlReqAll.abort(); 601 597 602 var uri = "calendar.php?y="+yy+"&m="+mm; 598 var xmlHttp = new XMLHttpRequest(); 599 xmlHttp.open('POST', uri, true); 600 xmlHttp.onload = function () 601 { 602 if (xmlHttp.status!=200) 603 { 604 alert("ERROR - HTTP request: "+xmlHttp.statusText+" ["+xmlHttp.status+"]"); 603 604 xmlReqAll = new XMLHttpRequest(); 605 xmlReqAll.open('POST', uri, true); 606 xmlReqAll.onload = function () 607 { 608 if (xmlReqAll.status!=200) 609 { 610 alert("ERROR - HTTP request: "+xmlReqAll.statusText+" ["+xmlReqAll.status+"]"); 605 611 return; 606 612 } 607 613 608 var lines = xml Http.responseText.split('\n');614 var lines = xmlReqAll.responseText.split('\n'); 609 615 if (lines.length==0) 610 616 return; … … 634 640 }; 635 641 636 xml Http.send();642 xmlReqAll.send(); 637 643 } 638 644 645 var xmlReqCom = null; 639 646 function requestAllComments(yy, mm) 640 647 { 648 if (xmlReqCom) 649 xmlReqCom.abort(); 650 641 651 var uri = "calendar.php?comment&y="+yy+"&m="+mm; 642 var xmlHttp= new XMLHttpRequest();643 xml Http.open('POST', uri, true);644 xml Http.onload = function ()645 { 646 if (xml Http.status!=200)647 { 648 alert("ERROR - HTTP request: "+xml Http.statusText+" ["+xmlHttp.status+"]");652 xmlReqCom = new XMLHttpRequest(); 653 xmlReqCom.open('POST', uri, true); 654 xmlReqCom.onload = function () 655 { 656 if (xmlReqCom.status!=200) 657 { 658 alert("ERROR - HTTP request: "+xmlReqCom.statusText+" ["+xmlReqCom.status+"]"); 649 659 return; 650 660 } 651 661 652 if (xml Http.responseText<4)662 if (xmlReqCom.responseText<4) 653 663 return; 654 664 655 665 var pos = 6; 656 666 657 while (pos<xml Http.responseText.length)658 { 659 var len = parseInt(xml Http.responseText.substr(pos-6, 4), 10);660 var dd = parseInt(xml Http.responseText.substr(pos-2, 2), 10);661 var com = xml Http.responseText.substr(pos, len);667 while (pos<xmlReqCom.responseText.length) 668 { 669 var len = parseInt(xmlReqCom.responseText.substr(pos-6, 4), 10); 670 var dd = parseInt(xmlReqCom.responseText.substr(pos-2, 2), 10); 671 var com = xmlReqCom.responseText.substr(pos, len); 662 672 pos += len+6; 663 673 … … 671 681 }; 672 682 673 xml Http.send();683 xmlReqCom.send(); 674 684 } 675 685
Note:
See TracChangeset
for help on using the changeset viewer.