forked from leftypol/leftypol
Enable winter snow
This commit is contained in:
parent
a09180ed05
commit
4efe45fe23
1 changed files with 26 additions and 0 deletions
26
js/winter-snow.js
Normal file
26
js/winter-snow.js
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
// hacky enabling of snowstorm, probably a better way
|
||||||
|
$(document).ready(function(){
|
||||||
|
var snow = localStorage['snow'] ? false : true;
|
||||||
|
|
||||||
|
if (window.Options && Options.get_tab('general')) {
|
||||||
|
selector = '#add-snow>input';
|
||||||
|
event = 'change';
|
||||||
|
Options.extend_tab("general", "<label id='add-snow'><input type='checkbox' />"+_('Snow! (requires refresh)')+"</label>");
|
||||||
|
}
|
||||||
|
|
||||||
|
$(selector)
|
||||||
|
.on(event, function() {
|
||||||
|
snow = !snow;
|
||||||
|
if (snow) {
|
||||||
|
delete localStorage.snow;
|
||||||
|
} else {
|
||||||
|
localStorage.snow = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (snow) {
|
||||||
|
if (window.Options && Options.get_tab('general')) {
|
||||||
|
$('#add-snow>input').prop('checked', true);
|
||||||
|
}
|
||||||
|
$.getScript( "/js/snowstorm.js", function() {snowStorm.snowCharacter="•";snowStorm.start();});
|
||||||
|
}
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue