[Slim-Checkins] r33825 - in /7.7/trunk/platforms/readynas/addon_template: SQUEEZEBOX.html SQUEEZEBOX.js language/en-us/SQUEEZEBOX.str
[email protected] Mon, 13 Feb 2012 14:44:32 -0000
| Newsgroups | gmane.music.equipment.slimdevices.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: mherger
Date: Mon Feb 13 06:44:31 2012
New Revision: 33825
URL: http://svn.slimdevices.com/slim?rev=33825&view=rev
Log:
Bug: n/a
Description: enabled/disable cleanup options in case server is running
Modified:
7.7/trunk/platforms/readynas/addon_template/SQUEEZEBOX.html
7.7/trunk/platforms/readynas/addon_template/SQUEEZEBOX.js
7.7/trunk/platforms/readynas/addon_template/language/en-us/SQUEEZEBOX.str
Modified: 7.7/trunk/platforms/readynas/addon_template/SQUEEZEBOX.html
URL: http://svn.slimdevices.com/slim/7.7/trunk/platforms/readynas/addon_template/SQUEEZEBOX.html?rev=33825&r1=33824&r2=33825&view=diff
==============================================================================
--- 7.7/trunk/platforms/readynas/addon_template/SQUEEZEBOX.html (original)
+++ 7.7/trunk/platforms/readynas/addon_template/SQUEEZEBOX.html Mon Feb 13 06:44:31 2012
@@ -6,5 +6,6 @@
<form name="squeezebox_cleanup">
<div><input type="checkbox" name="cleanup_prefs"> <span id="LABEL_CLEANUP_PREFS" /></div>
<div style="margin-bottom:5px"><input type="checkbox" name="cleanup_cache"> <span id="LABEL_CLEANUP_CACHE" /></div>
- <input type="button" id="BUTTON_CLEANUP_DO" onclick="SQUEEZEBOX_cleanup()" />
+ <input type="button" name="cleanup_do" id="BUTTON_CLEANUP_DO" onclick="SQUEEZEBOX_cleanup()" />
+ <span id="LABEL_CLEANUP_PLEASE_STOP_SC" style="font-style:italic" />
</form>
Modified: 7.7/trunk/platforms/readynas/addon_template/SQUEEZEBOX.js
URL: http://svn.slimdevices.com/slim/7.7/trunk/platforms/readynas/addon_template/SQUEEZEBOX.js?rev=33825&r1=33824&r2=33825&view=diff
==============================================================================
--- 7.7/trunk/platforms/readynas/addon_template/SQUEEZEBOX.js (original)
+++ 7.7/trunk/platforms/readynas/addon_template/SQUEEZEBOX.js Mon Feb 13 06:44:31 2012
@@ -7,6 +7,8 @@
// set a link to the Logitech Media Server web UI
// TODO: read the port from the server's configuration
$('#sbwebui').html('<a href="http://' + window.location.hostname + ':9000" target="_blank">Free Your Music!</a>');
+
+ toggleCleanupOptions();
}
self.SQUEEZEBOX_enable = function()
@@ -162,12 +164,20 @@
{
NasState.otherAddOnHash['SQUEEZEBOX'].Status = 'on';
NasState.otherAddOnHash['SQUEEZEBOX'].RunStatus = 'OK';
+
+ // enable/disable cleanup options
+ toggleCleanupOptions(false);
+
refresh_applicable_pages();
}
else
{
NasState.otherAddOnHash['SQUEEZEBOX'].Status = 'off';
NasState.otherAddOnHash['SQUEEZEBOX'].RunStatus = 'not_present';
+
+ // enable/disable cleanup options
+ toggleCleanupOptions(true);
+
refresh_applicable_pages();
}
}
@@ -251,10 +261,28 @@
showProgressBar('wait');
$.ajax({
- url: '/addons/SQUEEZEBOX/SQUEEZEBOX_HANDLER.pl?OPERATION=cleanup&command=' + (prefs ? 'prefs|' : '') + (cache ? 'cache|' : ''),
+ url: NasState.otherAddOnHash['SQUEEZEBOX'].DisplayAtom.set_url + '?OPERATION=cleanup&command=' + (prefs ? 'prefs|' : '') + (cache ? 'cache|' : ''),
cache: false,
complete: function(jqXHR, textStatus) {
+ document.forms.squeezebox_cleanup.cleanup_prefs.checked = false;
+ document.forms.squeezebox_cleanup.cleanup_cache.checked = false;
+
showProgressBar('default');
}
});
+}
+
+function toggleCleanupOptions(enable)
+{
+ if (enable == undefined)
+ enable = NasState.otherAddOnHash['SQUEEZEBOX'].Status != 'on';
+
+ document.forms.squeezebox_cleanup.cleanup_prefs.disabled = !enable;
+ document.forms.squeezebox_cleanup.cleanup_cache.disabled = !enable;
+ document.forms.squeezebox_cleanup.cleanup_do.disabled = !enable;
+
+ if (enable)
+ $('#LABEL_CLEANUP_PLEASE_STOP_SC').hide();
+ else
+ $('#LABEL_CLEANUP_PLEASE_STOP_SC').show();
}
Modified: 7.7/trunk/platforms/readynas/addon_template/language/en-us/SQUEEZEBOX.str
URL: http://svn.slimdevices.com/slim/7.7/trunk/platforms/readynas/addon_template/language/en-us/SQUEEZEBOX.str?rev=33825&r1=33824&r2=33825&view=diff
==============================================================================
--- 7.7/trunk/platforms/readynas/addon_template/language/en-us/SQUEEZEBOX.str (original)
+++ 7.7/trunk/platforms/readynas/addon_template/language/en-us/SQUEEZEBOX.str Mon Feb 13 06:44:31 2012
@@ -2,4 +2,5 @@
LABEL_ACCESS_LMS::::Access Logitech Media Server
BUTTON_CLEANUP_DO::::Run Cleanup
LABEL_CLEANUP_CACHE::::Clean cache folder, including media library database, artwork cache etc.
-LABEL_CLEANUP_PREFS::::Delete preference files
+LABEL_CLEANUP_PREFS::::Delete preference files
+LABEL_CLEANUP_PLEASE_STOP_SC::::Please Stop Logitech Media Server before running the cleanup.