[Pkg-mozext-commits] [wot] 46/226: Use value instead of nodeValue for attributes. Fixes #17

David Prévot taffit at moszumanska.debian.org
Fri May 1 00:35:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository wot.

commit c7e1d65d1307c685530baa34c923dae5f119fa52
Author: Sami Tolvanen <sami at mywot.com>
Date:   Thu Sep 20 11:57:13 2012 +0300

    Use value instead of nodeValue for attributes. Fixes #17
---
 content/api.js    | 90 +++++++++++++++++++++++++++----------------------------
 content/cache.js  | 44 +++++++++++++--------------
 content/popup.js  |  4 +--
 content/shared.js |  8 ++---
 4 files changed, 73 insertions(+), 73 deletions(-)

diff --git a/content/api.js b/content/api.js
index ff5158f..b9eb339 100644
--- a/content/api.js
+++ b/content/api.js
@@ -313,39 +313,39 @@ var wot_api_query =
 				than    = m.attributes.getNamedItem(WOT_SERVICE_XML_QUERY_MSG_THAN);
 
 				/* Must have mandatory fields */
-				if (msgid && msgid.nodeValue && type && type.nodeValue &&
-					target && target.nodeValue &&
+				if (msgid && msgid.value && type && type.value &&
+					target && target.value &&
 					m.firstChild && m.firstChild.nodeValue &&
-						(target.nodeValue == WOT_SERVICE_XML_QUERY_MSG_TARGET_ALL ||
-							target.nodeValue == WOT_PLATFORM)) {
+						(target.value == WOT_SERVICE_XML_QUERY_MSG_TARGET_ALL ||
+							target.value == WOT_PLATFORM)) {
 					/* A message targeted to our platform */
-					if (version && version.nodeValue && than && than.nodeValue) {
+					if (version && version.value && than && than.value) {
 						/* A versioned message */
-						if ((version.nodeValue ==
+						if ((version.value ==
 									WOT_SERVICE_XML_QUERY_MSG_VERSION_EQ &&
-								Number(WOT_VERSION) == Number(than.nodeValue)) ||
-							(version.nodeValue ==
+								Number(WOT_VERSION) == Number(than.value)) ||
+							(version.value ==
 									WOT_SERVICE_XML_QUERY_MSG_VERSION_LE &&
-								Number(WOT_VERSION) <= Number(than.nodeValue)) ||
-							(version.nodeValue ==
+								Number(WOT_VERSION) <= Number(than.value)) ||
+							(version.value ==
 									WOT_SERVICE_XML_QUERY_MSG_VERSION_GE &&
-								Number(WOT_VERSION) >= Number(than.nodeValue))) {
+								Number(WOT_VERSION) >= Number(than.value))) {
 							/* Targeted to us */
-							this.message_id = msgid.nodeValue;
-							this.message_type = type.nodeValue;
+							this.message_id = msgid.value;
+							this.message_type = type.value;
 							this.message = m.firstChild.nodeValue;
-							if (url && url.nodeValue) {
-								this.message_url = url.nodeValue;
+							if (url && url.value) {
+								this.message_url = url.value;
 							}
 							break;
 						}
 					} else {
 						/* Targeted to us */
-						this.message_id = msgid.nodeValue;
-						this.message_type = type.nodeValue;
+						this.message_id = msgid.value;
+						this.message_type = type.value;
 						this.message = m.firstChild.nodeValue;
-						if (url && url.nodeValue) {
-							this.message_url = url.nodeValue;
+						if (url && url.value) {
+							this.message_url = url.value;
 						}
 						break;
 					}
@@ -375,44 +375,44 @@ var wot_api_query =
 				var item = {};
 				a = u.attributes.getNamedItem(WOT_SERVICE_XML_QUERY_USER_ICON);
 
-				if (a && a.nodeValue) {
-					item.icon = a.nodeValue;
+				if (a && a.value) {
+					item.icon = a.value;
 				}
 
 				a = u.attributes.getNamedItem(WOT_SERVICE_XML_QUERY_USER_BAR);
 
-				if (a && a.nodeValue) {
-					item.bar = a.nodeValue;
+				if (a && a.value) {
+					item.bar = a.value;
 				}
 
 				a = u.attributes.getNamedItem(WOT_SERVICE_XML_QUERY_USER_LENGTH);
 
-				if (a && a.nodeValue) {
-					item.length = a.nodeValue;
+				if (a && a.value) {
+					item.length = a.value;
 				}
 
 				a = u.attributes.getNamedItem(WOT_SERVICE_XML_QUERY_USER_LABEL);
 
-				if (a && a.nodeValue) {
-					item.label = a.nodeValue;
+				if (a && a.value) {
+					item.label = a.value;
 				}
 
 				a = u.attributes.getNamedItem(WOT_SERVICE_XML_QUERY_USER_URL);
 
-				if (a && a.nodeValue) {
-					item.url = a.nodeValue;
+				if (a && a.value) {
+					item.url = a.value;
 				}
 
 				a = u.attributes.getNamedItem(WOT_SERVICE_XML_QUERY_USER_TEXT);
 
-				if (a && a.nodeValue) {
-					item.text = a.nodeValue;
+				if (a && a.value) {
+					item.text = a.value;
 				}
 
 				a = u.attributes.getNamedItem(WOT_SERVICE_XML_QUERY_USER_NOTICE);
 
-				if (a && a.nodeValue) {
-					item.notice = a.nodeValue;
+				if (a && a.value) {
+					item.notice = a.value;
 				}
 
 				if (item.text && (!item.bar ||
@@ -444,8 +444,8 @@ var wot_api_query =
 
 			var l = s.attributes.getNamedItem(WOT_SERVICE_XML_QUERY_STATUS_LEVEL);
 
-			if (l && l.nodeValue) {
-				wot_prefs.setChar("status_level", l.nodeValue);
+			if (l && l.value) {
+				wot_prefs.setChar("status_level", l.value);
 			}
 
 		} catch (e) {
@@ -562,15 +562,15 @@ var wot_api_register =
 			var id  = reg.attributes.getNamedItem(WOT_SERVICE_XML_REGISTER_ID);
 			var key = reg.attributes.getNamedItem(WOT_SERVICE_XML_REGISTER_KEY);
 
-			if (!id || !id.nodeValue || !key || !key.nodeValue ||
-				id.nodeValue.length  != WOT_LENGTH_WITNESS_ID ||
-				key.nodeValue.length != WOT_LENGTH_WITNESS_KEY) {
+			if (!id || !id.value || !key || !key.value ||
+				id.value.length  != WOT_LENGTH_WITNESS_ID ||
+				key.value.length != WOT_LENGTH_WITNESS_KEY) {
 				wot_api_register.error();
 				return
 			}
 
-			if (!wot_prefs.setChar("witness_id", id.nodeValue) ||
-				!wot_prefs.setChar("witness_key", key.nodeValue)) {
+			if (!wot_prefs.setChar("witness_id", id.value) ||
+				!wot_prefs.setChar("witness_key", key.value)) {
 				wot_api_register.error();
 				return;
 			}
@@ -672,15 +672,15 @@ var wot_api_reload =
 			var key = reload.attributes.getNamedItem(
 							WOT_SERVICE_XML_RELOAD_KEY);
 
-			if (!id || !id.nodeValue || !key || !key.nodeValue ||
-				id.nodeValue.length  != WOT_LENGTH_WITNESS_ID ||
-				key.nodeValue.length != WOT_LENGTH_WITNESS_KEY) {
+			if (!id || !id.value || !key || !key.value ||
+				id.value.length  != WOT_LENGTH_WITNESS_ID ||
+				key.value.length != WOT_LENGTH_WITNESS_KEY) {
 				wot_api_reload.error();
 				return;
 			}
 
-			if (!wot_prefs.setChar("witness_id", id.nodeValue) ||
-				!wot_prefs.setChar("witness_key", key.nodeValue)) {
+			if (!wot_prefs.setChar("witness_id", id.value) ||
+				!wot_prefs.setChar("witness_key", key.value)) {
 				wot_api_reload.error();
 				return;
 			}
diff --git a/content/cache.js b/content/cache.js
index 8eddd95..9bd9012 100644
--- a/content/cache.js
+++ b/content/cache.js
@@ -303,8 +303,8 @@ var wot_cache =
 			var index = target.attributes.getNamedItem(
 							WOT_SERVICE_XML_QUERY_TARGET_INDEX);
 
-			if (index && index.nodeValue != null) {
-				nonce += "-" + index.nodeValue;
+			if (index && index.value != null) {
+				nonce += "-" + index.value;
 			}
 
 			var name = this.resolve_nonce(nonce);
@@ -351,28 +351,28 @@ var wot_cache =
 					t = child.attributes.getNamedItem(
 							WOT_SERVICE_XML_QUERY_APPLICATION_T);
 
-					if (a && a.nodeValue) {
-						if (r && r.nodeValue && c && c.nodeValue) {
-							this.set(name, "reputation_" + a.nodeValue,
-								Number(r.nodeValue));
-							this.set(name, "confidence_" + a.nodeValue,
-								Number(c.nodeValue));
+					if (a && a.value) {
+						if (r && r.value && c && c.value) {
+							this.set(name, "reputation_" + a.value,
+								Number(r.value));
+							this.set(name, "confidence_" + a.value,
+								Number(c.value));
 						}
-						if (i && i.nodeValue) {
-							this.set(name, "inherited_" + a.nodeValue,
-								Number(i.nodeValue));
+						if (i && i.value) {
+							this.set(name, "inherited_" + a.value,
+								Number(i.value));
 						}
-						if (l && l.nodeValue) {
-							this.set(name, "lowered_" + a.nodeValue,
-								Number(l.nodeValue));
+						if (l && l.value) {
+							this.set(name, "lowered_" + a.value,
+								Number(l.value));
 						}
-						if (x && x.nodeValue) {
-							this.set(name, "excluded_" + a.nodeValue,
-								Number(x.nodeValue));
+						if (x && x.value) {
+							this.set(name, "excluded_" + a.value,
+								Number(x.value));
 						}
-						if (t && t.nodeValue) {
-							this.set(name, "testimony_" + a.nodeValue,
-								Number(t.nodeValue));
+						if (t && t.value) {
+							this.set(name, "testimony_" + a.value,
+								Number(t.value));
 						}
 					} else {
 						dump("wot_cache.add_target: application name missing\n");
@@ -404,7 +404,7 @@ var wot_cache =
 			var nonce =
 				q.attributes.getNamedItem(WOT_SERVICE_XML_QUERY_NONCE);
 
-			if (!nonce || !nonce.nodeValue) {
+			if (!nonce || !nonce.value) {
 				dump("wot_cache.add_query: nonce attribute missing\n");
 				return;
 			}
@@ -418,7 +418,7 @@ var wot_cache =
 			var t = targets.item(0);
 
 			while (t) {
-				this.add_target(nonce.nodeValue, t, islink);
+				this.add_target(nonce.value, t, islink);
 				t = targets.item(++i);
 			}
 		} catch (e) {
diff --git a/content/popup.js b/content/popup.js
index 074da6d..542d8e0 100644
--- a/content/popup.js
+++ b/content/popup.js
@@ -296,7 +296,7 @@ var wot_popup =
 			while (elem) {
 				if (elem.attributes) {
 					attr = elem.attributes.getNamedItem(wot_search.attribute);
-					if (attr && attr.nodeValue) {
+					if (attr && attr.value) {
 						break;
 					}
 					attr = null;
@@ -354,7 +354,7 @@ var wot_popup =
 
 			var attr = wot_popup.target.attributes.getNamedItem(
 							wot_search.attribute);
-			var target = attr.nodeValue;
+			var target = attr.value;
 
 			if (layer.style.display == "block" &&
 					layer.getAttribute("target") == target) {
diff --git a/content/shared.js b/content/shared.js
index 7d525cc..48c2ce1 100644
--- a/content/shared.js
+++ b/content/shared.js
@@ -44,11 +44,11 @@ var wot_shared =
 				var attr = shared[i].attributes.getNamedItem(
 								WOT_SERVICE_XML_UPDATE_SHARED_LEVEL);
 
-				if (!attr || !attr.nodeValue) {
+				if (!attr || !attr.value) {
 					return;
 				}
 
-				var level = Number(attr.nodeValue);
+				var level = Number(attr.value);
 
 				if (level < 1) {
 					return;
@@ -57,7 +57,7 @@ var wot_shared =
 				var attr = shared[i].attributes.getNamedItem(
 								WOT_SERVICE_XML_UPDATE_SHARED_DOMAINS);
 
-				if (!attr || !attr.nodeValue) {
+				if (!attr || !attr.value) {
 					return;
 				}
 
@@ -65,7 +65,7 @@ var wot_shared =
 					data[level] = [];
 				}
 
-				data[level] = data[level].concat(attr.nodeValue.split(","));
+				data[level] = data[level].concat(attr.value.split(","));
 			}
 
 			for (i in data) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/wot.git



More information about the Pkg-mozext-commits mailing list