Skip to content

Commit

Permalink
Merge pull request apache#763 from winne42/fix_encoding_error
Browse files Browse the repository at this point in the history
fix encoding error in chat.js
  • Loading branch information
jbonofre authored Apr 18, 2022
2 parents 9f1d996 + 3a07632 commit d4ef7d3
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion activemq-web-console/src/main/webapp/js/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ var css = {
removeClassFromElement: function(el, classString) {
var classArray = this.privateGetClassArray(el);

for (x in classArray) {
for (let x in classArray) {
if (classString == classArray[x]) {
classArray[x] = '';
break;
Expand Down
4 changes: 2 additions & 2 deletions activemq-web-console/src/main/webapp/js/plotkit/SVG.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ PlotKit.SVGRenderer.prototype._renderPieAxis = function() {
}
else {
var label = this.createSVGElement("text", svgattrib);
label.appendChild(this.document.createTextNode(this.layout.xticks[i][1]))
label.appendChild(this.document.createTextNode(this.layout.xticks[i][1]));
this.root.appendChild(label);
}
}
Expand Down Expand Up @@ -668,7 +668,7 @@ PlotKit.SVGRenderer.isSupported = function() {
*/

if (operaVersion && (operaVersion[1] > 8.9))
return true
return true;

if (mozillaVersion && (mozillaVersion > 1.7))
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ try {
}
}
catch (e) {
throw "SweetCanvas depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Layout, Canvas}"
throw "SweetCanvas depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Layout, Canvas}";
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ try {
}
}
catch (e) {
throw "SweetSVG depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Layout, SVG}"
throw "SweetSVG depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Layout, SVG}";
}


Expand Down
2 changes: 1 addition & 1 deletion activemq-web-demo/src/main/webapp/js/amq.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ org.activemq.Amq = function() {
// we need to ensure that messages which set headers are sent by themselves.
// if 2 'listen' messages were sent together, and a 'selector' header were added to one of them,
// AMQ would add the selector to both 'listen' commands.
for(i=0;i<messageQueue.length;i++) {
for (let i=0; i < messageQueue.length; i++) {
// a message with headers should always be sent by itself. if other messages have been added, send this one later.
if ( messageQueue[ i ].headers && messagesToSend.length == 0 ) {
messagesToSend[ messagesToSend.length ] = messageQueue[ i ].message;
Expand Down
2 changes: 1 addition & 1 deletion activemq-web-demo/src/main/webapp/js/amq_jquery_adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ org.activemq.AmqAdapter = {

if( headers ) {
request.beforeSend = function(xhr) {
for( h in headers ) {
for( let h in headers ) {
xhr.setRequestHeader( h, headers[ h ] );
}
}
Expand Down
4 changes: 2 additions & 2 deletions activemq-web-demo/src/main/webapp/js/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ org.activemq.Chat = function() {
chat: function(text) {
if (text != null && text.length > 0) {
// TODO more encoding?
text = text.replace('<', '&lt;');
text = text.replace('>', '&gt;');
text = text.replace(/</g, '&lt;');
text = text.replace(/>/g, '&gt;');

amq.sendMessage(chatTopic, '<message type="chat" from="' + user + '">' + text + '</message>');
}
Expand Down
2 changes: 1 addition & 1 deletion activemq-web-demo/src/main/webapp/mqtt/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ $(document).ready(function(){
$('#send_form').submit(function() {
var text = $('#send_form_input').val();
if (text) {
message = new Messaging.Message(text);
let message = new Messaging.Message(text);
message.destinationName = destination;
client.send(message);
$('#send_form_input').val("");
Expand Down
2 changes: 1 addition & 1 deletion activemq-web-demo/src/main/webapp/portfolio/portfolio.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function fixedDigits(t, digits) {
* Find direct child of an element, by id.
*/
function find(t, id) {
for (i = 0; i < t.childNodes.length; i++) {
for (let i = 0; i < t.childNodes.length; i++) {
var child = t.childNodes[i]
if (child.id == id) {
return child
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ var Behaviour = {
},

apply : function(){
for (var h=0;sheet=Behaviour.list[h];h++){
for (selector in sheet){
list = document.getElementsBySelector(selector);
for (let h = 0; sheet = Behaviour.list[h]; h++) {
for (let selector in sheet) {
let list = document.getElementsBySelector(selector);

if (!list){
if (!list) {
continue;
}

for (var i=0;element=list[i];i++){
for (let i = 0; element = list[i]; i++) {
sheet[selector](element);
}
}
Expand Down Expand Up @@ -119,7 +119,7 @@ document.getElementsBySelector = function(selector) {
var tokens = selector.split(' ');
var currentContext = new Array(document);
for (var i = 0; i < tokens.length; i++) {
token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');;
let token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');
if (token.indexOf('#') > -1) {
// Token is an ID selector
var bits = token.split('#');
Expand Down
2 changes: 1 addition & 1 deletion assembly/src/release/examples/conf/camel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->
<!--
Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker
Let's deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker
For more information, see:
http://camel.apache.org
Expand Down
2 changes: 1 addition & 1 deletion assembly/src/release/examples/mqtt/websocket/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h1>Get a new Web Browser!</h1>\
$('#send_form').submit(function() {
var text = $('#send_form_input').val();
if (text) {
message = new Messaging.Message(text);
let message = new Messaging.Message(text);
message.destinationName = destination;
client.send(message);
$('#send_form_input').val("");
Expand Down

0 comments on commit d4ef7d3

Please sign in to comment.