includes/clientside/static/ajax.js
changeset 344 be6c5fdd9203
parent 343 eefe9ab7fe7c
child 407 35d94240a197
equal deleted inserted replaced
341:1e3b55a591d1 344:be6c5fdd9203
  1225             }
  1225             }
  1226             else if ( enanotag.childNodes[i].tagName == 'latest' )
  1226             else if ( enanotag.childNodes[i].tagName == 'latest' )
  1227             {
  1227             {
  1228               // got <latest>
  1228               // got <latest>
  1229               var latesttag = enanotag.childNodes[i];
  1229               var latesttag = enanotag.childNodes[i];
  1230               for ( var i = 0; i < latesttag.childNodes.length; i++ )
  1230               for ( var j = 0; j < latesttag.childNodes.length; j++ )
  1231               {
  1231               {
  1232                 var node = latesttag.childNodes[i];
  1232                 var node = latesttag.childNodes[j];
  1233                 if ( node.tagName == 'release' )
  1233                 if ( node.tagName == 'release' )
  1234                 {
  1234                 {
  1235                   var releasedata = new Object();
  1235                   var releasedata = new Object();
  1236                   for ( var i = 0; i < node.attributes.length; i++ )
  1236                   for ( var k = 0; k < node.attributes.length; k++ )
  1237                   {
  1237                   {
  1238                     releasedata[node.attributes[i].nodeName] = node.attributes[i].nodeValue;
  1238                     releasedata[node.attributes[k].nodeName] = node.attributes[k].nodeValue;
  1239                   }
  1239                   }
  1240                   releases.push(releasedata);
  1240                   releases.push(releasedata);
  1241                 }
  1241                 }
  1242                 else if ( node.tagName == 'haveupdates' )
  1242                 else if ( node.tagName == 'haveupdates' )
  1243                 {
  1243                 {
  1248             }
  1248             }
  1249           }
  1249           }
  1250         }
  1250         }
  1251         else
  1251         else
  1252         {
  1252         {
  1253           if ( window.console )
       
  1254             window.console.error('Invalid XML response');
       
  1255           return false;
  1253           return false;
  1256         }
  1254         }
  1257         var thediv = document.getElementById(targetelement);
  1255         var thediv = document.getElementById(targetelement);
  1258         thediv.innerHTML = '';
  1256         thediv.innerHTML = '';
  1259         if ( !thediv )
  1257         if ( !thediv )
  1260         {
  1258         {
  1261           if ( window.console )
       
  1262             window.console.error('Can\'t get the div');
       
  1263           return false;
  1259           return false;
  1264         }
  1260         }
  1265         if ( releases.length > 0 )
  1261         if ( releases.length > 0 )
  1266         {
  1262         {
  1267           thediv.className = 'tblholder';
  1263           thediv.className = 'tblholder';
  1282             infobox.style.borderWidth = '0';
  1278             infobox.style.borderWidth = '0';
  1283             infobox.style.margin = '0 0 0 0';
  1279             infobox.style.margin = '0 0 0 0';
  1284             thediv.appendChild(infobox);
  1280             thediv.appendChild(infobox);
  1285           }
  1281           }
  1286           var table = document.createElement('table');
  1282           var table = document.createElement('table');
  1287           table.border = '0';
  1283           table.setAttribute('border', '0');
  1288           table.cellspacing = '1';
  1284           table.setAttribute('cellspacing', '1');
  1289           table.cellpadding = '4';
  1285           table.setAttribute('cellpadding', '4');
  1290           
  1286           
  1291           var tr = document.createElement('tr');
  1287           var tr = document.createElement('tr');
  1292           
  1288           
  1293           var td1 = document.createElement('th');
  1289           var td1 = document.createElement('th');
  1294           var td2 = document.createElement('th');
  1290           var td2 = document.createElement('th');
  1319               cls = 'row1_green';
  1315               cls = 'row1_green';
  1320             else
  1316             else
  1321               cls = ( cls == 'row1' ) ? 'row2' : 'row1';
  1317               cls = ( cls == 'row1' ) ? 'row2' : 'row1';
  1322             var release = releases[i];
  1318             var release = releases[i];
  1323             var tr = document.createElement('tr');
  1319             var tr = document.createElement('tr');
  1324             window.console.debug(release);
       
  1325             
  1320             
  1326             var td1 = document.createElement('td');
  1321             var td1 = document.createElement('td');
  1327             var td2 = document.createElement('td');
  1322             var td2 = document.createElement('td');
  1328             var td3 = document.createElement('td');
  1323             var td3 = document.createElement('td');
  1329             var td4 = document.createElement('td');
  1324             var td4 = document.createElement('td');