Skip to content
This repository has been archived by the owner on Oct 29, 2018. It is now read-only.

Commit

Permalink
Escaping single quotes in leftpane JS (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
raelgc committed Oct 15, 2015
1 parent 4d14786 commit 9b54dd0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions scudcloud-1.0/leftpane-src.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
var LeftPane = {
addTeam: function(id, name, url, icon, active){
var node = document.getElementById(id);
if(node == null){
if(node === null){
var ul = document.getElementById('teams');
li = document.createElement('li');
li.id = id;
li.setAttribute("onclick", "LeftPane.switchTo('"+id+"','"+url+"')")
li.setAttribute("title", name)
li.setAttribute("onclick", "LeftPane.switchTo('"+id.replace(/'/g, '"')+"','"+url.replace(/'/g, '"')+"')");
li.setAttribute("title", name);
li.innerHTML = name[0];
if( icon ){
li.style.backgroundImage = "url('"+ icon +"')";
li.innerHTML = ""
li.innerHTML = "";
}
ul.appendChild(li);
if(active) LeftPane.setActive(id);
if(active){
LeftPane.setActive(id);
}
LeftPane.switchTo(id, url);
}
},
Expand All @@ -33,7 +35,7 @@ var LeftPane = {
document.getElementById(team).classList.remove('alert');
},
switchTo: function(id, url){
leftPane.switchTo(url)
leftPane.switchTo(url);
LeftPane.setActive(id);
},
setActive: function(id){
Expand All @@ -57,10 +59,10 @@ var LeftPane = {
if (index >= list.length) {
index = 0;
} else if (index < 0) {
index = list.length - 1
index = list.length - 1;
}

LeftPane.click(index);
}
}
};

2 changes: 1 addition & 1 deletion scudcloud-1.0/resources/leftpane.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b54dd0

Please sign in to comment.