Per Device Font Size Setting

This commit is contained in:
Squidly271
2019-02-23 08:24:26 -05:00
parent 99cda59df1
commit 620d6260b2
2 changed files with 13 additions and 5 deletions

View File

@@ -59,6 +59,11 @@ function presetRefresh(form) {
function presetPassive(index) {
if (index==0) $('#passive').hide(); else $('#passive').show();
}
function saveFontSize() {
$.cookie('fontSize',$('#font option:selected').val(),{path:'/',expires:3650});
}
$(function() {
var dropbox = $('#dropbox');
// attach the drag-n-drop feature to the 'dropbox' element
@@ -118,18 +123,21 @@ $(function() {
>
> You can experiment with these settings as desired, they only affect visual properties.
<form markdown="1" name="display_settings" method="POST" action="/update.php" target="progressFrame" onsubmit="upload()">
<form markdown="1" name="display_settings" method="POST" action="/update.php" target="progressFrame" onsubmit="saveFontSize();upload();">
<input type="hidden" name="#file" value="dynamix/dynamix.cfg">
<input type="hidden" name="#section" value="display">
Font size:
: <select name="font" size="1">
: <select name="font" id='font' size="1">
<?=mk_option($display['font'], "50%", "Very small")?>
<?=mk_option($display['font'], "56.25%", "Small")?>
<?=mk_option($display['font'], "", "Normal")?>
<?=mk_option($display['font'], "68.75%", "Large")?>
<?=mk_option($display['font'], "75%", "Very large")?>
<?=mk_option($display['font'],"80%","Huge")?>
</select>
> This is a per device setting
Date format:
: <select name="date" size="1" onchange="presetTime(this.form)">
<?=mk_option($display['date'], "%c", "System Setting")?>

View File

@@ -11,7 +11,7 @@
*/
?>
<?
$font = $display['font'];
$display['font'] = $_COOKIE['fontSize'];
$theme = $display['theme'];
$header = $display['header'];
$backgnd = $display['background'];
@@ -37,8 +37,8 @@ $themes2 = in_array($theme,['gray','azure']);
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/dynamix-{$display['theme']}.css")?>">
<style>
<?if ($font):?>
html{font-size:<?=$font?>}
<?if ($display['font']):?>
html{font-size:<?=$display['font']?>}
<?endif;?>
<?if ($header):?>
#header,#header .logo,#header .text-right a{color:#<?=$header?>}