1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 4 <head> 5 <title>TestWidget 1.3</title> 6 <script type="text/javascript"> 7 var mainDiv; 8 var widgetID = "12345678"; 9 10 function init() { 11 mainDiv = document.getElementById( "main" ); 12 13 if ( window.widget ) { 14 widget.setCloseBoxOffset( 304, 16 ); 15 window.resizeTo( 640, 480 ); 16 //widgetID = widget.identifier; 17 } 18 } 19 20 function getLocalMailIDList() { 21 var storedLocalMailIDList = new Array(); 22 var xmlHttp = new XMLHttpRequest(); 23 xmlHttp.open("GET", "MessageUidsAlreadyDownloaded2", false); 24 xmlHttp.send(null); 25 26 if (xmlHttp.readyState == 4) { 27 var items = xmlHttp.responseXML; 28 var counter = 0; 29 30 for ( var i = 0; i < items.childNodes.length; i++ ) { 31 counter++; 32 33 if ( items.childNodes[i].nodeName == "plist" ) { 34 counter++; 35 //alert( items.childNodes[i].nodeName ); 36 37 for ( var j = 0; j < items.childNodes[i].childNodes.length; j++) { 38 counter++; 39 40 if ( items.childNodes[i].childNodes[j].nodeName == "dict" ) { 41 counter++; 42 //alert( items.childNodes[i].childNodes[j].nodeName ); 43 44 for ( var k = 0; k < items.childNodes[i].childNodes[j].childNodes.length; k++) { 45 counter++; 46 47 if ( items.childNodes[i].childNodes[j].childNodes[k].nodeName == "key" ) { 48 counter++; 49 //alert( items.childNodes[i].childNodes[j].childNodes[k].nodeName ); 50 //alert( items.childNodes[i].childNodes[j].childNodes[k].firstChild.nodeValue ); 51 storedLocalMailIDList.push( items.childNodes[i].childNodes[j].childNodes[k].firstChild.nodeValue ); 52 } 53 } 54 } 55 } 56 } 57 } 58 59 /* 60 for ( var i = 0; i < storedLocalMailIDList.length; i++ ) { 61 counter++; 62 mainDiv.innerText = storedLocalMailIDList[i]; 63 } 64 */ 65 //alert(storedLocalMailIDList.length); 66 67 68 //storedLocalMailIDList.sort(); 69 70 alert(counter); 71 } 72 } 73 74 function getLocalMailIDList2() { 75 var storedLocalMailIDList = new Array(); 76 var xmlHttp = new XMLHttpRequest(); 77 xmlHttp.open("GET", "MessageUidsAlreadyDownloaded2", false); 78 xmlHttp.send(null); 79 80 81 if (xmlHttp.readyState == 4) { 82 var items = xmlHttp.responseXML; //.getElementsByTagName("key"); 83 84 /* 85 //alert(items.length); 86 87 for ( var i = 0; i < items.length; i+= 2 ) { 88 //alert( items[i].firstChild.nodeValue ); 89 //storedLocalMailIDList.push( items[i].firstChild.nodeValue ); 90 } 91 92 //for ( var i = 0; i < storedLocalMailIDList.length; i++ ) { 93 // mainDiv.innerText = storedLocalMailIDList[i]; 94 //} 95 96 //alert(storedLocalMailIDList.length); 97 98 //storedLocalMailIDList.sort(); 99 */ 100 } 101 } 102 103 function clear() { 104 mainDiv.innerText = "C:\\>"; 105 } 106 107 function fillMyRam() { 108 getLocalMailIDList2(); 109 setTimeout( "fillMyRam();", 500 ); 110 } 111 </script> 112 </head> 113 114 <body onLoad="init();"> 115 <div><a href="javascript:fillMyRam();">fillMyRam</a></div> 116 </body> 117 </html> 118