mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 23:53:13 +09:00
Split up into multiple packages with Lerna
Split up codebase into the packages @clsterio/lib, @clusterio/master, @clusterio/slave, and @clusterio/ctl using lerna to manage them. This will allow deployment to use only the parts needed reducing install size, and better separate the code into shared library, master, slave and control.
This commit is contained in:
1 parent
198d5c344b
commit
bf5a4a8a9c
133 files changed
+367
-259
No files matched your search
@@ -0,0 +1,35 @@
|
||||
|
||||
if(localStorage.settings) {
|
||||
let settings = JSON.parse(localStorage.settings);
|
||||
|
||||
let HTML = "";
|
||||
|
||||
for(let key in settings) {
|
||||
HTML += drawSetting(key, settings[key]);
|
||||
}
|
||||
document.querySelector("#body").innerHTML = document.querySelector("#body").innerHTML + HTML;
|
||||
}
|
||||
|
||||
window.onload = function(){
|
||||
// loop through all settings and add onclick events for them
|
||||
let sliders = document.querySelectorAll(".settings-box .switch .slider");
|
||||
for(let i = 0; i < sliders.length; i++) {
|
||||
sliders[i].onclick = function() {
|
||||
let settings = JSON.parse(localStorage.settings);
|
||||
let selectedSliderParent = $(this.parentElement.parentElement);
|
||||
// walk through DOM structure created by drawSetting and update localstorage from that
|
||||
console.log(selectedSliderParent.find('.settings-text').html() + " = " + (selectedSliderParent.find("label input").val() === 'on'));
|
||||
settings[selectedSliderParent.find('.settings-text').html()] = (selectedSliderParent.find("label input").val() === 'on');
|
||||
|
||||
localStorage.settings = JSON.stringify(settings);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function drawSetting(settingText, checked) {
|
||||
|
||||
let HTML = '<div class="settings-box">' +
|
||||
'<label class="switch"><input type="checkbox" checked="' + checked + '"' +
|
||||
'><div class="slider round"></div></label><span class="settings-text ml-3 align-middle">' + settingText + '</span></div>';
|
||||
return HTML;
|
||||
}
|
||||
Reference in new issue
Block a user