You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2020/01/15 13:21:57 UTC

[cxf] branch master updated: Fixing some minor javascript issues

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new 2709289  Fixing some minor javascript issues
2709289 is described below

commit 27092895f73a6611190634a6d04a1e83e6c6fdd5
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Wed Jan 15 13:21:34 2020 +0000

    Fixing some minor javascript issues
---
 .../search/src/main/resources/browser/index.html      |  2 +-
 .../resources/org/apache/cxf/javascript/cxf-utils.js  | 19 +++++--------------
 2 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/distribution/src/main/release/samples/jax_rs/search/src/main/resources/browser/index.html b/distribution/src/main/release/samples/jax_rs/search/src/main/resources/browser/index.html
index 63ce56b..ab67a07 100644
--- a/distribution/src/main/release/samples/jax_rs/search/src/main/resources/browser/index.html
+++ b/distribution/src/main/release/samples/jax_rs/search/src/main/resources/browser/index.html
@@ -118,7 +118,7 @@
     			}
     			
     			var encodedWildcardsQuery = encodeURIComponent( wildcardsQuery.trim() );
-    			var filter = contentQuery + wildcardsQuery;
+    			var filter = contentQuery + encodedWildcardsQuery;
 
 	    		$.ajax({
 	    			url: $(this).attr("action") + "?$filter=" + filter,
diff --git a/rt/javascript/javascript-rt/src/main/resources/org/apache/cxf/javascript/cxf-utils.js b/rt/javascript/javascript-rt/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
index 00b0c41..e5aa233 100644
--- a/rt/javascript/javascript-rt/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
+++ b/rt/javascript/javascript-rt/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
@@ -75,10 +75,8 @@ function org_apache_cxf_findNamespace(elementNode, namespacePrefix) {
 	if ((attributes != null) && (attributes.length > 0)) {
 		for (var x = 0;x < attributes.length; x++) {
 			var attributeNodeName = attributes.item(x).nodeName;
-			var attributeNamespacePrefix = org_apache_cxf_getPrefix(attributes
-					.item(x).nodeName);
-			var attributeNamespaceSuffix = org_apache_cxf_getLocalName(attributes
-					.item(x).nodeName);
+			var attributeNamespacePrefix = org_apache_cxf_getPrefix(attributeNodeName);
+			var attributeNamespaceSuffix = org_apache_cxf_getLocalName(attributeNodeName);
 
 			if ((namespacePrefix == null) && (attributeNamespacePrefix == null)
 					&& (attributeNamespaceSuffix == "xmlns"))
@@ -163,8 +161,6 @@ function org_apache_cxf_getLocalName(tagName) {
 function org_apache_cxf_element_name_for_trace(node) {
 	if (node == null)
 		return "Null";
-	else if (node == undefined)
-		return "Undefined";
 	else {
 		var n = '';
 		if (node.namespaceURI != null && node.namespaceURI != '') {
@@ -177,7 +173,7 @@ function org_apache_cxf_element_name_for_trace(node) {
 CxfApacheOrgUtil.prototype.traceElementName = org_apache_cxf_element_name_for_trace;
 
 function org_apache_cxf_escapeXmlEntities(val) {
-	if (val == null || val == undefined)
+	if (val == null)
 		return "";
 	else {
 		val = String(val);
@@ -221,8 +217,6 @@ function org_apache_cxf_getFirstElementChild(node) {
 CxfApacheOrgUtil.prototype.getFirstElementChild = org_apache_cxf_getFirstElementChild;
 
 function org_apache_cxf_getNextElementSibling(node) {
-	if (node == undefined)
-		throw "undefined node to getNextElementSibling";
 	if (node == null)
 		throw "null node to getNextElementSibling";
 	var n;
@@ -446,7 +440,6 @@ function org_apache_cxf_base64_decode64Unicode(input) {
 function org_apache_cxf_base64_decode64UTF8(input) {
 	var utftext = org_apache_cxf_base64_decode64array(input);
 	var plaintext = "";
-	var cRay = new Array();
 	var i = 0;
 	var c;
 	var c2;
@@ -1001,10 +994,8 @@ function org_apache_cxf_get_xsi_type(elementNode) {
 	if ((attributes != null) && (attributes.length > 0)) {
 		for (var x = 0;x < attributes.length; x++) {
 			var attributeNodeName = attributes.item(x).nodeName;
-			var attributeNamespacePrefix = org_apache_cxf_getPrefix(attributes
-					.item(x).nodeName);
-			var attributeNamespaceSuffix = org_apache_cxf_getLocalName(attributes
-					.item(x).nodeName);
+			var attributeNamespacePrefix = org_apache_cxf_getPrefix(attributeNodeName);
+			var attributeNamespaceSuffix = org_apache_cxf_getLocalName(attributeNodeName);
 			if (attributeNamespaceSuffix == 'type') {
 				// perhaps this is ours
 				var ns = org_apache_cxf_getNamespaceURI(elementNode,