From fc7f06fc5b3e497bd9a576f212cc368e7fc2d701 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 17 Nov 2010 15:34:39 +0100 Subject: [PATCH] =?utf8?q?Update=20the=20=E2=80=9Clocked=E2=80=9D=20status?= =?utf8?q?=20of=20a=20Sone.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/javascript/sone.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); } -- 2.7.4