changeset 614:40ab83736f6e

mod_admin_web: Correctly access items in NamedNodeMaps
author Florian Zeitz <florob@babelmonkeys.de>
date Tue, 14 Feb 2012 21:21:40 +0100
parents b5a8e8492570
children 4134d0e25242
files mod_admin_web/admin_web/www_files/js/main.js
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mod_admin_web/admin_web/www_files/js/main.js	Tue Feb 14 15:17:16 2012 +0000
+++ b/mod_admin_web/admin_web/www_files/js/main.js	Tue Feb 14 21:21:40 2012 +0100
@@ -29,8 +29,8 @@
     var items, entry, tmp, retract, id, jid;
     items = e.getElementsByTagName('item');
     for (i = 0; i < items.length; i++) {
-        id = items[i].attributes['id'].value;
-        jid = items[i].getElementsByTagName('session')[0].attributes['jid'].value;
+        id = items[i].attributes.getNamedItem('id').value;
+        jid = items[i].getElementsByTagName('session')[0].attributes.getNamedItem('jid').value;
 
         entry = $('<li id="' + id + '">' + jid + '</li>');
         if (tmp = items[i].getElementsByTagName('encrypted')[0]) {
@@ -52,7 +52,7 @@
     }
     retract = e.getElementsByTagName('retract')[0];
     if (retract) {
-        id = retract.attributes['id'].value;
+        id = retract.attributes.getNamedItem('id').value;
         $('#' + id).remove();
     }
     return true;
@@ -62,8 +62,8 @@
     var items, entry, retract, id, jid;
     items = e.getElementsByTagName('item');
     for (i = 0; i < items.length; i++) {
-        id = items[i].attributes['id'].value;
-        jid = items[i].getElementsByTagName('session')[0].attributes['jid'].value;
+        id = items[i].attributes.getNamedItem('id').value;
+        jid = items[i].getElementsByTagName('session')[0].attributes.getNamedItem('jid').value;
         entry = $('<li id="' + id + '">' + jid + '</li>');
         if (items[i].getElementsByTagName('encrypted')[0]) {
             entry.append('<img src="images/encrypted.png" title="encrypted" alt=" (encrypted)" />');
@@ -75,14 +75,14 @@
     }
     retract = e.getElementsByTagName('retract')[0];
     if (retract) {
-        id = retract.attributes['id'].value;
+        id = retract.attributes.getNamedItem('id').value;
         $('#' + id).remove();
     }
     return true;
 }
 
 function _cbAdminSub(e) {
-    var node = e.getElementsByTagName('items')[0].attributes['node'].value;
+    var node = e.getElementsByTagName('items')[0].attributes.getNamedItem('node').value;
     if (node == Strophe.NS.C2SSTREAM) {
         _cbNewC2S(e);
     } else if (node == Strophe.NS.S2SSTREAM) {