Skip to content

Commit

Permalink
html cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
penfold42 committed Jan 6, 2019
1 parent 8531ed4 commit cfc97d4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
27 changes: 13 additions & 14 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,28 +154,27 @@
<label class="control-label col-sm-2" for="p_count">Physical Pixels</label>
<div class="col-sm-10"><input type="text" class="form-control" id="p_count" name="p_count" placeholder="Enter number of pixels" onchange="refreshPixel()"></div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="p_groupMode">Output Grouping</label>
<div class="col-sm-10">
<select class="form-control" id="p_groupMode" name="p_groupMode"></select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="p_groupsize">Group Size</label>
<div class="col-sm-10"><input type="text" class="form-control" id="p_groupsize" name="p_groupsize" placeholder="Group size of pixels" onchange="refreshPixel()"></div>
</div>

<div class="form-group">
<label class="control-label col-sm-2" for="p_type">Pixel Type</label>
<div class="col-sm-10">
<div class="col-sm-3">
<select class="form-control" id="p_type" name="p_type" onclick="refreshPixel()"></select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="p_color">Color Order</label>
<div class="col-sm-10">
<div class="col-sm-3">
<select class="form-control" id="p_color" name="p_color"></select>
</div>
</div>

<div class="form-group" id="o_grouping">
<label class="control-label col-sm-2" for="p_groupMode">Output Grouping</label>
<div class="col-sm-3">
<select class="form-control" id="p_groupMode" name="p_groupMode"></select>
</div>
<label class="control-label col-sm-2" for="p_groupSize">Group Size</label>
<div class="col-sm-3"><input type="text" class="form-control" id="p_groupSize" name="p_groupSize" placeholder="Group size of pixels" onchange="refreshPixel()"></div>
</div>

<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox"><label><input type="checkbox" id="p_gamma" name="p_gamma"> Gamma Correction</label></div>
Expand Down
19 changes: 15 additions & 4 deletions html/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,23 @@ $(function() {
}
});

// Group type toggles
$('#p_groupMode').change(function() {
if ($('select[name=p_groupMode]').val() == '0')
$('#p_groupSize').prop('disabled', true);
else
$('#p_groupSize').prop('disabled', false);
});

// Pixel type toggles
$('#p_type').change(function() {
if ($('select[name_type]').val() == '1')
if ($('select[name=p_type]').val() == '1') {
$('#p_color').prop('disabled', true);
else
$('#o_grouping').addClass('hidden');
} else {
$('#p_color').prop('disabled', false);
$('#o_grouping').removeClass('hidden');
}
});

// Serial protocol toggles
Expand Down Expand Up @@ -527,10 +538,10 @@ function getConfig(data) {
mode = 'pixel';
$('#o_pixel').removeClass('hidden');
$('#p_count').val(config.e131.channel_count / 3);
$('#p_groupsize').val(config.pixel.groupSize);
$('#p_type').val(config.pixel.type);
$('#p_color').val(config.pixel.color);
$('#p_groupMode').val(config.pixel.groupMode);
$('#p_groupSize').val(config.pixel.groupSize);
$('#p_gamma').prop('checked', config.pixel.gamma);
$('#p_gammaVal').val(config.pixel.gammaVal);
$('#p_briteVal').val(config.pixel.briteVal);
Expand Down Expand Up @@ -725,8 +736,8 @@ function submitConfig() {
'pixel': {
'type': parseInt($('#p_type').val()),
'color': parseInt($('#p_color').val()),
'groupSize': parseInt($('#p_groupsize').val()),
'groupMode': parseInt($('#p_groupMode').val()),
'groupSize': parseInt($('#p_groupSize').val()),
'gamma': $('#p_gamma').prop('checked'),
'gammaVal': parseFloat($('#p_gammaVal').val()),
'briteVal': parseFloat($('#p_briteVal').val())
Expand Down

0 comments on commit cfc97d4

Please sign in to comment.