diff --git a/webui/src/main/js/advancedSharing.js b/webui/src/main/js/advancedSharing.js index 445503ba..d527bbf0 100644 --- a/webui/src/main/js/advancedSharing.js +++ b/webui/src/main/js/advancedSharing.js @@ -81,7 +81,7 @@ function refreshDirs() { if (listOfDirs.length > 0) dirsDiv.innerHTML = table.render() else - dirsDiv.innerHTML = "" + dirsDiv.textContent = "" } } var sortParam = "&key=" + sortKey + "&order=" + sortOrder @@ -131,7 +131,7 @@ function configure(path) { function cancelConfig() { var tableDiv = document.getElementById("dirConfig") - tableDiv.innerHTML = "" + tableDiv.textContent = "" } function sync(path) { diff --git a/webui/src/main/js/browse.js b/webui/src/main/js/browse.js index fbe84cdd..d70d87af 100644 --- a/webui/src/main/js/browse.js +++ b/webui/src/main/js/browse.js @@ -91,7 +91,7 @@ function showCertificates(hostB64, infoHash) { hideLinkSpan.innerHTML = hideLink var certSpan = document.getElementById("certificates-" + fetch.divId) - certSpan.innerHTML = _t("Fetching Certificates") + certSpan.textContent = _t("Fetching Certificates") } } xmlhttp.open("POST", "/MuWire/Certificate", true) @@ -104,7 +104,7 @@ function hideCertificates(hostB64, infoHash) { certificateFetches.delete(id) var certSpan = document.getElementById("certificates-" + id) - certSpan.innerHTML = "" + certSpan.textContent = "" var result = resultsByInfoHash.get(infoHash) var showLinkText @@ -172,14 +172,14 @@ function refreshActive() { if (activeBrowses.length > 0) tableDiv.innerHTML = table.render() else - tableDiv.innerHTML = "" + tableDiv.textContent = "" if (currentBrowse != null) { var newBrowse = browsesByHost.get(currentHost) if (newBrowse == null || currentBrowse.revision < newBrowse.revision) showResults(currentHost, currentBrowse.key, currentBrowse.descending) } else { - document.getElementById("resultsTable").innerHTML = "" + document.getElementById("resultsTable").textContent = "" } } } @@ -255,7 +255,7 @@ function showResults(host, key, descending) { if (resultsByInfoHash.size > 0) tableDiv.innerHTML = table.render() else - tableDiv.innerHTML = "" + tableDiv.textContent = "" } } var paramString = "/MuWire/Browse?section=results&host=" + browse.hostB64 @@ -316,7 +316,7 @@ function hideComment(infoHash) { linkSpan.innerHTML = getShowCommentLink(infoHash) var commentSpan = document.getElementById("comment-"+infoHash) - commentSpan.innerHTML = "" + commentSpan.textContent = "" } document.addEventListener("DOMContentLoaded", function() { diff --git a/webui/src/main/js/certificates.js b/webui/src/main/js/certificates.js index dac6f42b..c021b49f 100644 --- a/webui/src/main/js/certificates.js +++ b/webui/src/main/js/certificates.js @@ -195,7 +195,7 @@ function hideCertificateComment(divId, base64) { linkDiv.innerHTML = link var commentDiv = document.getElementById("certificate-comment-" + divId + "_" + base64) - commentDiv.innerHTML = "" + commentDiv.textContent = "" } function refreshCertificates() { diff --git a/webui/src/main/js/conncount.js b/webui/src/main/js/conncount.js index 0a263cb9..4d456bdb 100644 --- a/webui/src/main/js/conncount.js +++ b/webui/src/main/js/conncount.js @@ -16,8 +16,8 @@ function refreshConnectionsCount() { image = "NotStarted.png"; connectionIcon.innerHTML = "\"\""; } else { - connectionCountSpan.innerHTML = _t("Down"); - connectionIcon.innerHTML = ""; + connectionCountSpan.textContent = _t("Down"); + connectionIcon.textContent = ""; } } } diff --git a/webui/src/main/js/download.js b/webui/src/main/js/download.js index a1a4f442..ce654cd1 100644 --- a/webui/src/main/js/download.js +++ b/webui/src/main/js/download.js @@ -89,7 +89,7 @@ function cancelDownload(infoHash) { xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { var downloadSpan = document.getElementById("download-"+infoHash); - downloadSpan.innerHTML = ""; + downloadSpan.textContent = ""; refreshDownloader(); } } @@ -179,11 +179,11 @@ function refreshDownloader() { var clearLink = new Link(_t("Clear Finished"), "clear", ["ignored"]) clearDiv.innerHTML = clearLink.render() } else { - downloadsDiv.innerHTML = "" - clearDiv.innerHTML = "" + downloadsDiv.textContent = "" + clearDiv.textContent = "" downloader = null var downloadDetailsDiv = document.getElementById("downloadDetails"); - downloadDetailsDiv.innerHTML = "" + downloadDetailsDiv.textContent = "" } if (downloader != null) updateDownloader(downloader); diff --git a/webui/src/main/js/feeds.js b/webui/src/main/js/feeds.js index ba7c4d52..8fc42fd5 100644 --- a/webui/src/main/js/feeds.js +++ b/webui/src/main/js/feeds.js @@ -164,18 +164,18 @@ function refreshFeeds() { if (listOfFeeds.length > 0) feedsDiv.innerHTML = table.render() else - feedsDiv.innerHTML = "" + feedsDiv.textContent = "" if (currentFeed != null) { var updatedFeed = feeds.get(currentFeed) if (updatedFeed == null) { currentFeed = null - document.getElementById("itemsTable").innerHTML = "" + document.getElementById("itemsTable").textContent = "" cancelConfig() } else if (updatedFeed.revision > currentFeed.revision) displayFeed(currentFeed) } else - document.getElementById("itemsTable").innerHTML = "" + document.getElementById("itemsTable").textContent = "" } } @@ -215,7 +215,7 @@ function displayFeed(feed) { if (items.length > 0) itemsDiv.innerHTML = table.render() else - itemsDiv.innerHTML = "" + itemsDiv.textContent = "" } } var sortParam = "&key=" + itemsSortKey + "&order=" + itemsSortOrder @@ -307,7 +307,7 @@ function configure(publisher) { function cancelConfig() { var tableDiv = document.getElementById("feedConfig") - tableDiv.innerHTML = "" + tableDiv.textContent = "" } function showComment(infoHash) { @@ -328,7 +328,7 @@ function hideComment(infoHash) { expandedComments.delete(infoHash) var commentDiv = document.getElementById("comment-" + infoHash); - commentDiv.innerHTML = "" + commentDiv.textContent = "" var showLink = new Link(_t("Show Comment"), "showComment", [infoHash]) var linkSpan = document.getElementById("comment-link-" + infoHash); @@ -347,7 +347,7 @@ function showCertificates(hostB64, infoHash) { hideLinkSpan.innerHTML = hideLink.render() var certSpan = document.getElementById("certificates-" + fetch.divId) - certSpan.innerHTML = _t("Fetching Certificates") + certSpan.textContent = _t("Fetching Certificates") } } xmlhttp.open("POST", "/MuWire/Certificate", true) @@ -360,7 +360,7 @@ function hideCertificates(hostB64, infoHash) { certificateFetches.delete(id) var certSpan = document.getElementById("certificates-" + id) - certSpan.innerHTML = "" + certSpan.textContent = "" var item = itemsByInfoHash.get(infoHash) var showLinkText diff --git a/webui/src/main/js/fileDetails.js b/webui/src/main/js/fileDetails.js index 6f2575a8..26620b1f 100644 --- a/webui/src/main/js/fileDetails.js +++ b/webui/src/main/js/fileDetails.js @@ -104,7 +104,7 @@ function refreshSearchers() { if (searchNodes.length > 0) hitsDiv.innerHTML = table.render() else - hitsDiv.innerHTML = "" + hitsDiv.textContent = "" } } var sortParam = "&key=" + searchersSortKey + "&order=" + searchersSortOrder @@ -138,7 +138,7 @@ function refreshDownloaders() { if (downloaders.length > 0) downloadersDiv.innerHTML = table.render() else - downloadersDiv.innerHTML = "" + downloadersDiv.textContent = "" } } var sortParam = "&key=" + downloadersSortKey + "&order=" + downloadersSortOrder @@ -175,7 +175,7 @@ function refreshCertificates() { if (certificates.length > 0) certsDiv.innerHTML = table.render() else - certsDiv.innerHTML = "" + certsDiv.textContent = "" } } var sortParam = "&key=" + certificatesSortKey + "&order=" + certificatesSortOrder @@ -223,7 +223,7 @@ function hideComment(id) { commentLinkDiv.innerHTML = showLink.render() var commentDiv = document.getElementById("comment-" + id) - commentDiv.innerHTML = "" + commentDiv.textContent = "" } var path = null diff --git a/webui/src/main/js/files.js b/webui/src/main/js/files.js index 17f9579f..ce7d685b 100644 --- a/webui/src/main/js/files.js +++ b/webui/src/main/js/files.js @@ -113,14 +113,14 @@ function refreshStatus(noRefresh) { var count = xmlDoc.getElementsByTagName("Count")[0].childNodes[0].nodeValue var countSpan = document.getElementById("count") - countSpan.innerHTML = count + countSpan.textContent = count var hashingSpan = document.getElementById("hashing") var hashing = xmlDoc.getElementsByTagName("Hashing") if (hashing != null && hashing.length == 1) { - hashingSpan.innerHTML = "Hashing "+hashing[0].childNodes[0].nodeValue + hashingSpan.textContent = "Hashing "+hashing[0].childNodes[0].nodeValue } else - hashingSpan.innerHTML = ""; + hashingSpan.textContent = ""; var newRevision = parseInt(xmlDoc.getElementsByTagName("Revision")[0].childNodes[0].nodeValue) if (newRevision > treeRevision) { @@ -264,7 +264,7 @@ function unshare(nodeId) { function showCommentForm(nodeId) { var linkSpan = document.getElementById("comment-link-"+nodeId) - linkSpan.innerHTML="" + linkSpan.textContent="" var commentDiv = document.getElementById("comment-"+nodeId) var node = nodesById.get(nodeId) @@ -281,7 +281,7 @@ function showCommentForm(nodeId) { function cancelComment(nodeId) { var commentDiv = document.getElementById("comment-"+nodeId) - commentDiv.innerHTML = "" + commentDiv.textContent = "" var node = nodesById.get(nodeId) node.updateDiv() diff --git a/webui/src/main/js/filesTable.js b/webui/src/main/js/filesTable.js index b853c3d9..1189bc6f 100644 --- a/webui/src/main/js/filesTable.js +++ b/webui/src/main/js/filesTable.js @@ -60,14 +60,14 @@ function refreshStatus() { var count = xmlDoc.getElementsByTagName("Count")[0].childNodes[0].nodeValue var countSpan = document.getElementById("count") - countSpan.innerHTML = count + countSpan.textContent = count var hashingSpan = document.getElementById("hashing") var hashing = xmlDoc.getElementsByTagName("Hashing") if (hashing != null && hashing.length == 1) { - hashingSpan.innerHTML = _t("Hashing") + " " +hashing[0].childNodes[0].nodeValue + hashingSpan.textContent = _t("Hashing") + " " +hashing[0].childNodes[0].nodeValue } else - hashingSpan.innerHTML = ""; + hashingSpan.textContent = ""; var newRevision = parseInt(xmlDoc.getElementsByTagName("Revision")[0].childNodes[0].nodeValue) if (newRevision > tableRevision) { @@ -133,7 +133,7 @@ function refreshTable() { if (filesList.length > 0 ) tableDiv.innerHTML = table.render() else - tableDiv.innerHTML = "" + tableDiv.textContent = "" } } var sortParam = "&key=" + sortKey + "&order=" + sortOrder @@ -164,7 +164,7 @@ function unshare(fileId) { function showCommentForm(nodeId) { var linkSpan = document.getElementById("comment-link-"+nodeId) - linkSpan.innerHTML="" + linkSpan.textContent="" var commentDiv = document.getElementById("comment-"+nodeId) var node = filesByPath.get(nodeId) @@ -181,7 +181,7 @@ function showCommentForm(nodeId) { function cancelComment(nodeId) { var commentDiv = document.getElementById("comment-"+nodeId) - commentDiv.innerHTML = "" + commentDiv.textContent = "" var commentLink = new Link(_t("Comment"), "showCommentForm", [nodeId]) diff --git a/webui/src/main/js/search.js b/webui/src/main/js/search.js index 48d95831..d8b0edd1 100644 --- a/webui/src/main/js/search.js +++ b/webui/src/main/js/search.js @@ -537,7 +537,7 @@ function hideComment(id) { expandedComments.delete(id) var commentDiv = document.getElementById("comment-" + id); - commentDiv.innerHTML = "" + commentDiv.textContent = "" var showLink = "" + _t("Show Comment") + ""; var linkSpan = document.getElementById("comment-link-"+id); @@ -559,7 +559,7 @@ function download(resultInfoHash) { function markTrusted(host) { var linkSpan = document.getElementById("trusted-link-"+host) - linkSpan.innerHTML = "" + linkSpan.textContent = "" var textAreaSpan = document.getElementById("trusted-"+host) @@ -578,7 +578,7 @@ function markNeutral(host) { function markDistrusted(host) { var linkSpan = document.getElementById("distrusted-link-"+host) - linkSpan.innerHTML = "" + linkSpan.textContent = "" var textAreaSpan = document.getElementById("distrusted-"+host) @@ -603,7 +603,7 @@ function submitDistrust(host) { function cancelTrust(host) { var textAreaSpan = document.getElementById("trusted-" + host) - textAreaSpan.innerHTML = "" + textAreaSpan.textContent = "" var linkSpan = document.getElementById("trusted-link-"+host) var html = "" + _t("Mark Trusted") + "" @@ -612,7 +612,7 @@ function cancelTrust(host) { function cancelDistrust(host) { var textAreaSpan = document.getElementById("distrusted-" + host) - textAreaSpan.innerHTML = "" + textAreaSpan.textContent = "" var linkSpan = document.getElementById("distrusted-link-"+host) var html = "" + _t("Mark Distrusted") + "" @@ -672,7 +672,7 @@ function viewCertificatesByFile(fileSenderB64, count) { linkSpan.innerHTML = hideLink var fetchSpan = document.getElementById("certificates-" + fetch.divId) - fetchSpan.innerHTML = _t("Fetching Certificates") + fetchSpan.textContent = _t("Fetching Certificates") } } xmlhttp.open("POST", "/MuWire/Certificate", true) @@ -685,7 +685,7 @@ function hideCertificatesByFile(fileSenderB64, count) { certificateFetches.delete(id) // TODO: propagate cancel to core var fetchSpan = document.getElementById("certificates-" + id) - fetchSpan.innerHTML = "" + fetchSpan.textContent = "" var linkSpan = document.getElementById("certificates-link-" + id) var linkText @@ -711,7 +711,7 @@ function viewCertificatesBySender(fileInfoHash, count) { linkSpan.innerHTML = hideLink var fetchSpan = document.getElementById("certificates-" + fetch.divId) - fetchSpan.innerHTML = _t("Fetching Certificates") + fetchSpan.textContent = _t("Fetching Certificates") } } @@ -726,7 +726,7 @@ function hideCertificatesBySender(fileInfoHash, count) { certificateFetches.delete(id) // TODO: propagate cancel to core var fetchSpan = document.getElementById("certificates-" + id) - fetchSpan.innerHTML = "" + fetchSpan.textContent = "" var linkSpan = document.getElementById("certificates-link-" + id) var linkText = _t("View {0} Certificates", count) @@ -848,7 +848,7 @@ function refreshStatus() { if (statuses.length > 0) activeDiv.innerHTML = table.render() else - activeDiv.innerHTML = "" + activeDiv.textContent = "" if (uuid != null) { var newStatus = statusByUUID.get(uuid) @@ -875,9 +875,9 @@ function stopSearch(searchUUID) { if (searchUUID == uuid) { uuid = null var element = document.getElementById("topTable" + refreshType) - element.innerHTML = "" + element.textContent = "" element = document.getElementById("bottomTable" + refreshType) - element.innerHTML = "" + element.textContent = "" } refreshStatus() } diff --git a/webui/src/main/js/status.js b/webui/src/main/js/status.js index df7d46f4..df22a01f 100644 --- a/webui/src/main/js/status.js +++ b/webui/src/main/js/status.js @@ -9,12 +9,12 @@ function refreshStatus() { var hopelessHosts = this.responseXML.getElementsByTagName("HopelessHosts")[0].childNodes[0].nodeValue var timesBrowsed = this.responseXML.getElementsByTagName("TimesBrowsed")[0].childNodes[0].nodeValue - document.getElementById("incoming-connections").innerHTML = incomingConnections - document.getElementById("outgoing-connections").innerHTML = outgoingConnections - document.getElementById("known-hosts").innerHTML = knownHosts - document.getElementById("failing-hosts").innerHTML = failingHosts - document.getElementById("hopeless-hosts").innerHTML = hopelessHosts - document.getElementById("times-browsed").innerHTML = timesBrowsed + document.getElementById("incoming-connections").textContent = incomingConnections + document.getElementById("outgoing-connections").textContent = outgoingConnections + document.getElementById("known-hosts").textContent = knownHosts + document.getElementById("failing-hosts").textContent = failingHosts + document.getElementById("hopeless-hosts").textContent = hopelessHosts + document.getElementById("times-browsed").textContent = timesBrowsed } } xmlhttp.open("GET", "/MuWire/Status", true); diff --git a/webui/src/main/js/trustLists.js b/webui/src/main/js/trustLists.js index 0d500288..51fd6371 100644 --- a/webui/src/main/js/trustLists.js +++ b/webui/src/main/js/trustLists.js @@ -110,7 +110,7 @@ var distrustedSortOrder = "descending" function markTrusted(user) { var linkSpan = document.getElementById("trusted-link-" + user) - linkSpan.innerHTML = "" + linkSpan.textContent = "" var textAreaSpan = document.getElementById("trusted-" + user) @@ -130,7 +130,7 @@ function submitTrust(user) { function cancelTrust(user) { var textAreaSpan = document.getElementById("trusted-" + user) - textAreaSpan.innerHTML = "" + textAreaSpan.textContent = "" var linkSpan = document.getElementById("trusted-link-" + user) var html = "" + _t("Mark Trusted") + "" @@ -143,7 +143,7 @@ function markNeutral(user) { function markDistrusted(user) { var linkSpan = document.getElementById("distrusted-link-" + user) - linkSpan.innerHTML = "" + linkSpan.textContent = "" var textAreaSpan = document.getElementById("distrusted-" + user) @@ -163,7 +163,7 @@ function submitDistrust(user) { function cancelDistrust(user) { var textAreaSpan = document.getElementById("distrusted-" + user) - textAreaSpan.innerHTML = "" + textAreaSpan.textContent = "" var linkSpan = document.getElementById("distrusted-link-" + user) var html = "" + _t("Mark Distrusted") + "" @@ -254,7 +254,7 @@ function displayTrustedList(user) { if (trusted.length > 0) trustedDiv.innerHTML = table.render() else - trustedDiv.innerHTML = "" + trustedDiv.textContent = "" } } var sortParam = "&key=" + trustedSortKey + "&order=" + trustedSortOrder @@ -286,7 +286,7 @@ function displayDistrustedList(user) { if (distrusted.length > 0) distrustedDiv.innerHTML = table.render() else - distrustedDiv.innerHTML = "" + distrustedDiv.textContent = "" } } var sortParam = "&key=" + distrustedSortKey + "&order=" + distrustedSortOrder @@ -336,13 +336,13 @@ function refreshLists() { if (listOfLists.length > 0) trustListsDiv.innerHTML = table.render() else - trustListsDiv.innerHTML = "" + trustListsDiv.textContent = "" if (currentUser != null) displayList(currentUser) else { - document.getElementById("trusted").innerHTML = "" - document.getElementById("distrusted").innerHTML = "" + document.getElementById("trusted").textContent = "" + document.getElementById("distrusted").textContent = "" } } } diff --git a/webui/src/main/js/trustUsers.js b/webui/src/main/js/trustUsers.js index cd62b568..751caeee 100644 --- a/webui/src/main/js/trustUsers.js +++ b/webui/src/main/js/trustUsers.js @@ -87,7 +87,7 @@ function subscribe(host) { function markTrusted(host) { var linkSpan = document.getElementById("trusted-link-"+host) - linkSpan.innerHTML = "" + linkSpan.textContent = "" var textAreaSpan = document.getElementById("trusted-"+host) @@ -106,7 +106,7 @@ function markNeutral(host) { function markDistrusted(host) { var linkSpan = document.getElementById("distrusted-link-"+host) - linkSpan.innerHTML = "" + linkSpan.textContent = "" var textAreaSpan = document.getElementById("distrusted-"+host) @@ -144,7 +144,7 @@ function publishTrust(host, reason, trust) { function cancelTrust(host) { var textAreaSpan = document.getElementById("trusted-" + host) - textAreaSpan.innerHTML = "" + textAreaSpan.textContent = "" var linkSpan = document.getElementById("trusted-link-"+host) var html = "" + _t("Mark Trusted") + "" @@ -153,7 +153,7 @@ function cancelTrust(host) { function cancelDistrust(host) { var textAreaSpan = document.getElementById("distrusted-" + host) - textAreaSpan.innerHTML = "" + textAreaSpan.textContent = "" var linkSpan = document.getElementById("distrusted-link-"+host) var html = "" + _t("Mark Distrusted") + "" @@ -202,7 +202,7 @@ function refreshDistrustedUsers() { if (distrustedList.length > 0) tableDiv.innerHTML = table.render() else - tableDiv.innerHTML = "" + tableDiv.textContent = "" } } var sortParam = "&key=" + distrustedUsersSortKey + "&order=" + distrustedUsersSortOrder @@ -240,7 +240,7 @@ function refreshTrustedUsers() { if (trustedList.length > 0) tableDiv.innerHTML = table.render() else - tableDiv.innerHTML = "" + tableDiv.textContent = "" } } var sortParam = "&key=" + trustedUsersSortKey + "&order=" + trustedUsersSortOrder diff --git a/webui/src/main/js/upload.js b/webui/src/main/js/upload.js index 84c5d3ba..9abdb9ca 100644 --- a/webui/src/main/js/upload.js +++ b/webui/src/main/js/upload.js @@ -50,8 +50,8 @@ function refreshUploads() { var clearLink = new Link(_t("Clear Finished"), "clear", ["ignored"]) clearDiv.innerHTML = clearLink.render() } else { - uploadsDiv.innerHTML = "" - clearDiv.innerHTML = "" + uploadsDiv.textContent = "" + clearDiv.textContent = "" } } }