From: David ‘Bombe’ Roden Date: Thu, 21 Oct 2010 13:22:07 +0000 (+0200) Subject: Duplicate IDs are not allowed in HTML and do make problems. Use classes. X-Git-Tag: 0.1-RC1~113 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=63bd3117470b16325bd808b1b68d5d922a0fe156 Duplicate IDs are not allowed in HTML and do make problems. Use classes. --- diff --git a/src/main/resources/static/css/sone.css b/src/main/resources/static/css/sone.css index 1d426ed..da01622 100644 --- a/src/main/resources/static/css/sone.css +++ b/src/main/resources/static/css/sone.css @@ -239,6 +239,10 @@ textarea { padding: 0.5ex; } +#sone .sone .id { + display: none; +} + #sone .sone .profile-link { display: block; } diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 6420e5b..9c99bb2 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -93,13 +93,13 @@ function getSoneStatus(soneId) { * The date and time of the last update (formatted for display) */ function updateSoneStatus(soneId, status, modified, lastUpdated) { - $("#sone .sone#" + soneId). + $("#sone .sone." + soneId). toggleClass("unknown", status == "unknown"). toggleClass("idle", status == "idle"). toggleClass("inserting", status == "inserting"). toggleClass("downloading", status == "downloading"). toggleClass("modified", modified); - $("#sone .sone#" + soneId + " .last-update span.time").text(lastUpdated); + $("#sone .sone." + soneId + " .last-update span.time").text(lastUpdated); } var watchedSones = {}; diff --git a/src/main/resources/templates/include/head.html b/src/main/resources/templates/include/head.html index 7798af4..50cf77e 100644 --- a/src/main/resources/templates/include/head.html +++ b/src/main/resources/templates/include/head.html @@ -14,7 +14,7 @@ /* these functions are necessary for updating Sone statuses. */ $(document).ready(function() { $("#sone .sone").each(function() { - watchSone($(this).attr("id")); + watchSone($(this).find(".id").text()); }); }); diff --git a/src/main/resources/templates/include/viewSone.html b/src/main/resources/templates/include/viewSone.html index e7599bd..b12de4a 100644 --- a/src/main/resources/templates/include/viewSone.html +++ b/src/main/resources/templates/include/viewSone.html @@ -1,4 +1,5 @@ -
+
+
<% sone.id|html>
?
!
⬊