1
0
Fork 0
forked from mirror/pixelfed

Update labs settings

This commit is contained in:
Daniel Supernault 2019-05-08 21:19:48 -06:00
parent b4e18ec9e1
commit 710ca246f2
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -172,6 +172,11 @@
</label>
<p class="text-muted small help-text">Collapses captions/comments more than 3 lines.</p>
</div>
<div class="form-check pb-3">
<input class="form-check-input" type="checkbox" id="distraction_free">
<label class="form-check-label font-weight-bold">Simple Mode (Timelines only)</label>
<p class="text-muted small help-text">An experimental content-first timeline layout</p>
</div>
<div class="py-3">
<p class="font-weight-bold text-muted text-center">Discovery</p>
<hr>
@ -199,6 +204,7 @@
$(document).ready(function() {
let showSuggestions = localStorage.getItem('pf_metro_ui.exp.rec') == 'false' ? false : true;
let showReadMore = localStorage.getItem('pf_metro_ui.exp.rm') == 'false' ? false : true;
let distractionFree = localStorage.getItem('pf_metro_ui.exp.df') == 'true' ? true : false;
if(showSuggestions == true) {
$('#show_suggestions').attr('checked', true);
@ -208,6 +214,10 @@ $(document).ready(function() {
$('#show_readmore').attr('checked', true);
}
if(distractionFree == true) {
$('#distraction_free').attr('checked', true);
}
$('#show_suggestions').on('change', function(e) {
if(e.target.checked) {
localStorage.removeItem('pf_metro_ui.exp.rec');
@ -223,6 +233,14 @@ $(document).ready(function() {
localStorage.setItem('pf_metro_ui.exp.rm', false);
}
});
$('#distraction_free').on('change', function(e) {
if(e.target.checked) {
localStorage.setItem('pf_metro_ui.exp.df', true);
} else {
localStorage.removeItem('pf_metro_ui.exp.df');
}
});
});
</script>
@endpush