*
* @param soneId
* The ID of the Sone
+ * @param local
+ * <code>true</code> if the Sone is local, <code>false</code>
+ * otherwise
*/
-function getSoneStatus(soneId) {
+function getSoneStatus(soneId, local) {
$.getJSON("ajax/getSoneStatus.ajax", {"sone": soneId}, function(data, textStatus) {
updateSoneStatus(soneId, data.name, data.status, data.modified, data.lastUpdated);
/* seconds! */
updateInterval = 60;
- if (data.modified || (data.status == "downloading") || (data.status == "inserting")) {
+ if (local || data.modified || (data.status == "downloading") || (data.status == "inserting")) {
updateInterval = 5;
}
setTimeout(function() {
- getSoneStatus(soneId);
+ getSoneStatus(soneId, local);
}, updateInterval * 1000);
});
}
*
* @param soneId
* The ID of the Sone to watch
+ * @param local
+ * <code>true</code> if the Sone is local, <code>false</code>
+ * otherwise
*/
-function watchSone(soneId) {
+function watchSone(soneId, local) {
if (watchedSones[soneId]) {
return;
}
watchedSones[soneId] = true;
(function(soneId) {
setTimeout(function() {
- getSoneStatus(soneId);
+ getSoneStatus(soneId, local);
}, 5000);
})(soneId);
}
/* these functions are necessary for updating Sone statuses. */
$(document).ready(function() {
$("#sone .sone").each(function() {
- watchSone($(this).find(".id").text());
+ watchSone($(this).find(".id").text(), $(this).hasClass("local"));
});
});
</script>