From: David ‘Bombe’ Roden Date: Wed, 17 Nov 2010 14:34:39 +0000 (+0100) Subject: Update the “locked” status of a Sone. X-Git-Tag: 0.3-RC1~23 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=fc7f06fc5b3e497bd9a576f212cc368e7fc2d701;p=Sone.git Update the “locked” status of a Sone. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index bbac57d..e4527af 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -130,7 +130,7 @@ function getTranslation(key, callback) { function getSoneStatus(soneId, local) { $.getJSON("ajax/getSoneStatus.ajax", {"sone": soneId}, function(data, textStatus) { if ((data != null) && data.success) { - updateSoneStatus(soneId, data.name, data.status, data.modified, data.lastUpdated); + updateSoneStatus(soneId, data.name, data.status, data.modified, data.locked, data.lastUpdated); } /* seconds! */ updateInterval = 60; @@ -166,16 +166,20 @@ function filterSoneId(soneId) { * “downloading”) * @param modified * Whether the Sone is modified + * @param locked + * Whether the Sone is locked * @param lastUpdated * The date and time of the last update (formatted for display) */ -function updateSoneStatus(soneId, name, status, modified, lastUpdated) { +function updateSoneStatus(soneId, name, status, modified, locked, lastUpdated) { $("#sone .sone." + filterSoneId(soneId)). toggleClass("unknown", status == "unknown"). toggleClass("idle", status == "idle"). toggleClass("inserting", status == "inserting"). toggleClass("downloading", status == "downloading"). toggleClass("modified", modified); + $("#sone .sone." + filterSoneId(soneId) + " .lock").toggleClass("hidden", locked); + $("#sone .sone." + filterSoneId(soneId) + " .unlock").toggleClass("hidden", !locked); $("#sone .sone." + filterSoneId(soneId) + " .last-update span.time").text(lastUpdated); $("#sone .sone." + filterSoneId(soneId) + " .profile-link a").text(name); }