commit, weil ich wissen muss, obs an den cookies liegt, dass es nicht geht
This commit is contained in:
parent
bb60117dcf
commit
5223ceb1f6
2 changed files with 35 additions and 40 deletions
27
index.html
27
index.html
|
@ -32,11 +32,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
<option value="green">Grün</option>
|
||||
<option value="white">Weiss</option>
|
||||
</select>
|
||||
<select id="layoutswitcher">
|
||||
<option value="de_CH">Bärndütsch</option>
|
||||
<option value="de">Hochdeutsch</option>
|
||||
<option value="en">English</option>
|
||||
</select>
|
||||
<p id="disclaimer">Created by fritteli, inspired by <a href="http://www.qlocktwo.com/">QLOCKTWO</a>.
|
||||
<script type="text/javascript" src="uhr-de_CH.js"></script>
|
||||
<script type="text/javascript" src="uhr-de.js"></script>
|
||||
|
@ -47,34 +42,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
$('#themeswitcher').on('change', function() {
|
||||
uhr.setTheme(this.value);
|
||||
});
|
||||
$('#layoutswitcher').on('change', function() {
|
||||
uhr.setLayout(this.value);
|
||||
});
|
||||
$.cookie.defaults.expires = 365;
|
||||
$.cookie.defaults.path = '/';
|
||||
var theme = $.cookie('theme');
|
||||
var layout = $.cookie('layout');
|
||||
var status = $.cookie('status');
|
||||
if (theme === undefined || theme == 'undefined') {
|
||||
theme = 'black';
|
||||
}
|
||||
if(layout === undefined || layout == 'undefined') {
|
||||
layout = 'de_CH';
|
||||
}
|
||||
if (status === undefined || status == 'undefined') {
|
||||
status = 'on';
|
||||
}
|
||||
$('#themeswitcher').val(theme);
|
||||
uhr.setTheme(theme);
|
||||
$('#layoutswitcher').val(layout);
|
||||
uhr.setLayout(layout);
|
||||
if (status == 'on') {
|
||||
uhr.start();
|
||||
$('#onoffswitch').prop('checked', true);
|
||||
} else {
|
||||
uhr.stop();
|
||||
$('#onoffswitch').prop('checked', false);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue