aboutsummaryrefslogtreecommitdiff
path: root/cli/onionshare_cli/resources/static
diff options
context:
space:
mode:
Diffstat (limited to 'cli/onionshare_cli/resources/static')
-rw-r--r--cli/onionshare_cli/resources/static/css/style.css12
-rw-r--r--cli/onionshare_cli/resources/static/js/chat.js2
-rw-r--r--cli/onionshare_cli/resources/static/js/send.js24
3 files changed, 21 insertions, 17 deletions
diff --git a/cli/onionshare_cli/resources/static/css/style.css b/cli/onionshare_cli/resources/static/css/style.css
index 7cec9738..79be31d0 100644
--- a/cli/onionshare_cli/resources/static/css/style.css
+++ b/cli/onionshare_cli/resources/static/css/style.css
@@ -320,15 +320,15 @@ div#uploads .upload .upload-status {
}
div#uploads .upload input.cancel {
- color: #d0011b;
+ color: #d0011b;
border: 0;
background: none;
box-shadow: none;
border-radius: 0px;
- cursor: pointer;
- font-family: sans-serif;
- font-size: 12px;
- text-decoration: none;
+ cursor: pointer;
+ font-family: sans-serif;
+ font-size: 12px;
+ text-decoration: none;
display: inline-block;
float:right;
}
@@ -398,4 +398,4 @@ a {
a:visited {
color: #601ca0;
-} \ No newline at end of file
+}
diff --git a/cli/onionshare_cli/resources/static/js/chat.js b/cli/onionshare_cli/resources/static/js/chat.js
index 21f00ca6..88abf4f4 100644
--- a/cli/onionshare_cli/resources/static/js/chat.js
+++ b/cli/onionshare_cli/resources/static/js/chat.js
@@ -154,7 +154,7 @@ var getScrollDiffBefore = function () {
var scrollBottomMaybe = function (scrollDiff) {
// Scrolls to bottom if the user is scrolled at bottom
- // if the user has scrolled upp, it wont scroll at bottom.
+ // if the user has scrolled up, it won't scroll at bottom.
// Note: when a user themselves send a message, it will still
// scroll to the bottom even if they had scrolled up before.
if (scrollDiff > 0) {
diff --git a/cli/onionshare_cli/resources/static/js/send.js b/cli/onionshare_cli/resources/static/js/send.js
index 43e9892d..22844ab9 100644
--- a/cli/onionshare_cli/resources/static/js/send.js
+++ b/cli/onionshare_cli/resources/static/js/send.js
@@ -11,7 +11,7 @@ function unhumanize(text) {
}
}
function sortTable(n) {
- var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;
+ var table, rows, switching, i, x, y, valX, valY, shouldSwitch, dir, switchcount = 0;
table = document.getElementById("file-list");
switching = true;
// Set the sorting direction to ascending:
@@ -21,7 +21,7 @@ function sortTable(n) {
while (switching) {
// Start by saying: no switching is done:
switching = false;
- rows = table.getElementsByTagName("TR");
+ rows = table.getElementsByClassName("row");
/* Loop through all table rows (except the
first, which contains table headers): */
for (i = 1; i < (rows.length - 1); i++) {
@@ -29,18 +29,22 @@ function sortTable(n) {
shouldSwitch = false;
/* Get the two elements you want to compare,
one from current row and one from the next: */
- x = rows[i].getElementsByTagName("TD")[n];
- y = rows[i + 1].getElementsByTagName("TD")[n];
+ x = rows[i].getElementsByClassName("cell-data")[n];
+ y = rows[i + 1].getElementsByClassName("cell-data")[n];
+
+ valX = x.classList.contains("size") ? unhumanize(x.innerHTML.toLowerCase()) : x.innerHTML;
+ valY = y.classList.contains("size") ? unhumanize(y.innerHTML.toLowerCase()) : y.innerHTML;
+
/* Check if the two rows should switch place,
based on the direction, asc or desc: */
if (dir == "asc") {
- if (unhumanize(x.innerHTML.toLowerCase()) > unhumanize(y.innerHTML.toLowerCase())) {
- // If so, mark as a switch and break the loop:
- shouldSwitch= true;
- break;
- }
+ if (valX > valY) {
+ // If so, mark as a switch and break the loop:
+ shouldSwitch= true;
+ break;
+ }
} else if (dir == "desc") {
- if (unhumanize(x.innerHTML.toLowerCase()) < unhumanize(y.innerHTML.toLowerCase())) {
+ if (valX < valY) {
// If so, mark as a switch and break the loop:
shouldSwitch= true;
break;