summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMark Macdonald2012-10-18 17:36:20 (EDT)
committer skaegi2012-10-18 20:55:36 (EDT)
commit455acf66132d5f994d7044b536859835c7fbf340 (patch)
tree8dee831cc5c49b1eb76fea8431479872c66b90ad
parent697d1930e416f65f2379b626aa404cbcbb8a8d76 (diff)
downloadorg.eclipse.orion.client-455acf66132d5f994d7044b536859835c7fbf340.zip
org.eclipse.orion.client-455acf66132d5f994d7044b536859835c7fbf340.tar.gz
org.eclipse.orion.client-455acf66132d5f994d7044b536859835c7fbf340.tar.bz2
Bug 392386 - innerHTML is being used from dojo.create()
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/commands.js2
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/compare/compareTreeExplorer.js9
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/sites/siteMappingsTable.js18
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/widgets/OperationsDialog.js10
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/widgets/UserMenu.js11
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/widgets/maker/ScrollingContainer.js8
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/widgets/settings/SettingsContainer.js16
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/widgets/settings/SplitSelectionLayout.js8
8 files changed, 52 insertions, 30 deletions
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/commands.js b/bundles/org.eclipse.orion.client.core/web/orion/commands.js
index 226c70f..4d51b4f 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/commands.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/commands.js
@@ -891,11 +891,11 @@ define(['i18n!orion/nls/messages', 'require', 'dojo', 'dijit', 'orion/uiUtils',
style: "display: none;" //$NON-NLS-0$
});
menuButton = new dijit.form.DropDownButton({
- label: group.title === "*" ? messages["Actions"] : group.title, //TODO undocumented hack, even mode dangerous when we have globalization //$NON-NLS-0$
showLabel: group.title !== "*", //$NON-NLS-0$
style: "visibility: hidden;", //$NON-NLS-0$
dropDown: newMenu
});
+ menuButton.containerNode.textContent = group.title === "*" ? messages["Actions"] : group.title; //TODO undocumented hack, even mode dangerous when we have globalization //$NON-NLS-0$
dojo.addClass(menuButton.domNode, "commandMenu"); //$NON-NLS-0$
if(domNodeWrapperList){
//we need to add the menuButton as the optional widget param
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/compare/compareTreeExplorer.js b/bundles/org.eclipse.orion.client.core/web/orion/compare/compareTreeExplorer.js
index ce93e6c..64a0177 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/compare/compareTreeExplorer.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/compare/compareTreeExplorer.js
@@ -38,12 +38,17 @@ define(['i18n!orion/compare/nls/messages', 'require', 'dojo', 'dijit','orion/exp
CompareTreeExplorerRenderer.prototype = new mExplorer.SelectionRenderer();
CompareTreeExplorerRenderer.prototype.getCellHeaderElement = function(col_no){
+ var col, h2;
switch(col_no){
case 0:
- return dojo.create("th", {style: "padding-left: 5px; padding-right: 5px", innerHTML: "<h2>"+ this.explorer._compareResults.length + " of " + this.explorer._totalFiles + messages["files changed"]+"</h2>"}); //$NON-NLS-4$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ col = dojo.create("th", {style: "padding-left: 5px; padding-right: 5px"}); //$NON-NLS-1$ //$NON-NLS-0$
+ h2 = dojo.create("h2", col); //$NON-NLS-0$
+ h2.textContent = this.explorer._compareResults.length + " of " + this.explorer._totalFiles + messages["files changed"]; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
break;
case 1:
- return dojo.create("th", {style: "padding-left: 5px; padding-right: 5px", innerHTML: "<h2>"+ messages["Location"]+"</h2>"}); //$NON-NLS-4$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ col = dojo.create("th", {style: "padding-left: 5px; padding-right: 5px"}); //$NON-NLS-4$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ h2 = dojo.create("h2", col); //$NON-NLS-0$
+ h2.textContent = messages["Location"];
break;
}
};
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/sites/siteMappingsTable.js b/bundles/org.eclipse.orion.client.core/web/orion/sites/siteMappingsTable.js
index 7e58b1f..07662f4 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/sites/siteMappingsTable.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/sites/siteMappingsTable.js
@@ -66,12 +66,22 @@ mSiteMappingsTable.Renderer = (function() {
var col;
switch(col_no){
case 0:
- col = dojo.create("th", {innerHTML: " "}); //$NON-NLS-1$ //$NON-NLS-0$
+ col = dojo.create("th"); //$NON-NLS-1$ //$NON-NLS-0$
+ col.textContent = " "; //$NON-NLS-0$
dojo.addClass(col, "isValidColumn"); //$NON-NLS-0$
return col;
- case 1: return dojo.create("th", {innerHTML: messages["Path"]}); //$NON-NLS-0$
- case 2: return dojo.create("th", {innerHTML: messages["Mount at (server path)"]}); //$NON-NLS-0$
- case 3: return dojo.create("th", {innerHTML: messages["Actions"]}); //$NON-NLS-0$
+ case 1:
+ col = dojo.create("th"); //$NON-NLS-0$
+ col.textContent = messages["Path"];
+ return col;
+ case 2:
+ col = dojo.create("th"); //$NON-NLS-0$
+ col.textContent = messages["Mount at (server path)"];
+ return col;
+ case 3:
+ col = dojo.create("th"); //$NON-NLS-0$
+ col.textContent = messages["Actions"];
+ return col;
}
},
getCellElement: function(/**Number*/ col_no, /**Object*/ item, /**HTMLTableRowElement*/ tableRow) {
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/widgets/OperationsDialog.js b/bundles/org.eclipse.orion.client.core/web/orion/widgets/OperationsDialog.js
index 9c68a2c..c7ac4c3 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/widgets/OperationsDialog.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/widgets/OperationsDialog.js
@@ -72,9 +72,11 @@ define(['i18n!orion/operations/nls/messages', 'require', 'dojo', 'dijit', 'dijit
for(var i=0; i<operations.length; i++){
var operation = operations[i];
var tr = dojo.create("tr"); //$NON-NLS-0$
- var col = dojo.create("td", {style: "padding-left: 5px; padding-right: 5px", innerHTML: operation.Name}, tr); //$NON-NLS-1$ //$NON-NLS-0$
+ var col = dojo.create("td", {style: "padding-left: 5px; padding-right: 5px"}, tr); //$NON-NLS-1$ //$NON-NLS-0$
+ col.textContent = operation.Name;
var div = dojo.create("div", null, col, "only"); //$NON-NLS-1$ //$NON-NLS-0$
- var link = dojo.create("span", {innerHTML: operation.Name, className: "primaryColumn"}, div, "last"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ var link = dojo.create("span", {className: "primaryColumn"}, div, "last"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ link.textContent = operation.Name;
dojo.place(document.createTextNode(operation.Name), link, "only"); //$NON-NLS-0$
@@ -117,8 +119,8 @@ define(['i18n!orion/operations/nls/messages', 'require', 'dojo', 'dijit', 'dijit
if(result.DetailedMessage && result.DetailedMessage!=="")
message += ": " + result.DetailedMessage; //$NON-NLS-0$
dojo.create("br", null, div, "last"); //$NON-NLS-1$ //$NON-NLS-0$
- dojo.create("span", {className: "secondaryColumn", style: "margin-left: 18px;", innerHTML: message}, div, "last"); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
-
+ var span = dojo.create("span", {className: "secondaryColumn", style: "margin-left: 18px;"}, div, "last"); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ span.textContent = message;
}
dojo.place(tr, operationsTable, "last"); //$NON-NLS-0$
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/widgets/UserMenu.js b/bundles/org.eclipse.orion.client.core/web/orion/widgets/UserMenu.js
index ae9ab80..2a9db46 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/widgets/UserMenu.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/widgets/UserMenu.js
@@ -234,11 +234,12 @@ define(['i18n!orion/widgets/nls/messages', 'require', 'dojo', 'dijit', 'orion/co
var displayName = userName;
if(displayName.length > 40)
displayName = displayName.substring(0, 30) + "..."; //$NON-NLS-0$
- var profileLink = dojo.create("a", {innerHTML: displayName, //$NON-NLS-0$
+ var profileLink = dojo.create("a", { //$NON-NLS-0$
href: require.toUrl("profile/user-profile.html") + "#" + jsonData.Location, //$NON-NLS-1$ //$NON-NLS-0$
- "aria-label": messages["View profile of "] + userName, //$NON-NLS-0$
style: "margin-right: 0px" //$NON-NLS-0$
}, dojo.byId('userInfo'), "only"); //$NON-NLS-1$ //$NON-NLS-0$
+ profileLink.textContent = displayName;
+ profileLink.setAttribute("aria-label", messages["View profile of "] + userName); //$NON-NLS-0$
new mCommands.CommandTooltip({
connectId: [profileLink],
label: messages['View profile of '] + userName,
@@ -253,17 +254,19 @@ define(['i18n!orion/widgets/nls/messages', 'require', 'dojo', 'dijit', 'orion/co
}else{
loginForm+= "&redirect=" + eclipse.globalCommandUtils.notifyAuthenticationSite + "?key=" + key; //$NON-NLS-1$ //$NON-NLS-0$
}
- dojo.create("a", {innerHTML: messages['Sign In'], //$NON-NLS-0$
+ var link = dojo.create("a", { //$NON-NLS-0$
href: loginForm,
style: "margin-right: 0px", //$NON-NLS-0$
target: "_blank" //$NON-NLS-0$
}, dojo.byId('userInfo'), "only"); //$NON-NLS-1$ //$NON-NLS-0$
+ link.textContent = messages['Sign In'];
});
})(key);
}else if(authService.login){
- var a = dojo.create("a", {innerHTML: messages['Sign In'], //$NON-NLS-0$
+ var a = dojo.create("a", { //$NON-NLS-0$
style: "margin-right: 0px" //$NON-NLS-0$
}, dojo.byId('userInfo'), "only"); //$NON-NLS-1$ //$NON-NLS-0$
+ a.textContent = messages['Sign In'];
dojo.connect(a, "onmouseover", a, function() { //$NON-NLS-0$
a.style.cursor = "pointer"; //$NON-NLS-0$
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/widgets/maker/ScrollingContainer.js b/bundles/org.eclipse.orion.client.core/web/orion/widgets/maker/ScrollingContainer.js
index 5c052a8..afc5661 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/widgets/maker/ScrollingContainer.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/widgets/maker/ScrollingContainer.js
@@ -165,8 +165,9 @@ define(['require', 'dojo', 'dijit', 'orion/fileClient','dijit/TooltipDialog', 'd
var content = { 'class':'scrollmenuitem', //$NON-NLS-1$ //$NON-NLS-0$
'href': '#' + name, //$NON-NLS-1$ //$NON-NLS-0$
'data-dojo-attach-point':name, //$NON-NLS-0$
- 'onclick': dojo.hitch( this, 'scrollTo' ), //$NON-NLS-1$ //$NON-NLS-0$
- 'innerHTML': name }; //$NON-NLS-0$
+ 'onclick': dojo.hitch( this, 'scrollTo' ) //$NON-NLS-1$ //$NON-NLS-0$
+ };
+ content.textContent = name;
var menuItem = dojo.create( 'a', content ); //$NON-NLS-0$
@@ -179,7 +180,8 @@ define(['require', 'dojo', 'dijit', 'orion/fileClient','dijit/TooltipDialog', 'd
listItem.appendChild( menuItem );
- var counter = dojo.create( 'div', { innerHTML: count, 'class':'itemcount' }, listItem ); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ var counter = dojo.create( 'div', { 'class':'itemcount' }, listItem ); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ counter.textContent = count;
var actions = dojo.byId( 'pageActions' ); //$NON-NLS-0$
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/widgets/settings/SettingsContainer.js b/bundles/org.eclipse.orion.client.core/web/orion/widgets/settings/SettingsContainer.js
index 01980fd..b64e694 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/widgets/settings/SettingsContainer.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/widgets/settings/SettingsContainer.js
@@ -100,11 +100,11 @@ define(['i18n!orion/settings/nls/messages', 'require', 'dojo', 'dijit', 'orion/g
var sectionWrapper = dojo.create('div', { 'class':'sectionWrapper sectionWrapperAux toolComposite' }, this.table );
- dojo.create('div', { //$NON-NLS-0$
+ var div = dojo.create('div', { //$NON-NLS-0$
id: category,
- innerHTML: category,
'class':'sectionAnchor'
}, sectionWrapper);
+ div.textContent = category;
// <div class="sectionWrapper sectionWrapperAux toolComposite"><div class="sectionAnchor">User Profile</div></div>
@@ -119,11 +119,11 @@ define(['i18n!orion/settings/nls/messages', 'require', 'dojo', 'dijit', 'orion/g
className: 'setting-row'
}, this.table);
- dojo.create("h3", { //$NON-NLS-0$
+ var h3 = dojo.create("h3", { //$NON-NLS-0$
id: subcategory[sub].label.replace(/ /g,"") + "-header", //$NON-NLS-0$
- className: 'setting-header',
- innerHTML: subcategory[sub].ui
+ className: 'setting-header'
}, section);
+ h3.textContent = subcategory[sub].ui;
var outer = dojo.create("div", {className: 'setting-content'}, section); //$NON-NLS-0$
@@ -131,10 +131,10 @@ define(['i18n!orion/settings/nls/messages', 'require', 'dojo', 'dijit', 'orion/g
var inner = dojo.create("div", {className: 'setting-property'}, outer); //$NON-NLS-0$
var label = dojo.create("label", null, inner); //$NON-NLS-0$
- dojo.create("span", { //$NON-NLS-0$
- className: 'setting-label',
- innerHTML: subcategory[sub].items[item].label + ":" //$NON-NLS-0$
+ var span = dojo.create("span", { //$NON-NLS-0$
+ className: 'setting-label'
}, label);
+ span.textContent = subcategory[sub].items[item].label + ":"; //$NON-NLS-0$
this.inputBuilder.processInputType(category, subcategory[sub].label, subcategory[sub].items[item], label, subcategory[sub].ui);
}
}
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/widgets/settings/SplitSelectionLayout.js b/bundles/org.eclipse.orion.client.core/web/orion/widgets/settings/SplitSelectionLayout.js
index b4b4a77..8c4a742 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/widgets/settings/SplitSelectionLayout.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/widgets/settings/SplitSelectionLayout.js
@@ -69,10 +69,10 @@ define(['i18n!orion/settings/nls/messages', 'require', 'dojo', 'dijit', 'dijit/T
var category = this.initialSettings[settingsIndex].category;
- dojo.create("h1", { //$NON-NLS-0$
- id: category,
- innerHTML: category
+ var h1 = dojo.create("h1", { //$NON-NLS-0$
+ id: category
}, this.table);
+ h1.textContent = category;
// Extend here for adding section pages of your choice
},
@@ -117,7 +117,6 @@ define(['i18n!orion/settings/nls/messages', 'require', 'dojo', 'dijit', 'dijit/T
for (var count = 0; count < settings.length; count++) {
var itemId = settings[count].category.replace(/\s/g, "").toLowerCase();
var item = {
- innerHTML: settings[count].category,
id: itemId,
"class": 'navbar-item', //$NON-NLS-1$ //$NON-NLS-0$
role: "tab", //$NON-NLS-0$
@@ -125,6 +124,7 @@ define(['i18n!orion/settings/nls/messages', 'require', 'dojo', 'dijit', 'dijit/T
"aria-selected": "false", //$NON-NLS-1$ //$NON-NLS-0$
onclick: dojo.hitch( this, "showSettings", itemId ) //$NON-NLS-0$
};
+ item.textContent = settings[count].category;
this.addCategory(item, count);
}