Commit 2f29daa6 authored by Ziassan's avatar Ziassan

Solving #373 : sending '0' instead of empty string for number settings

Shouldn't have empty string as numbers in the first place but eh, at least it stop this spam of errors
parent 8dbd6070
Pipeline #5288 passed with stages
in 23 minutes and 38 seconds
......@@ -491,7 +491,10 @@ var mouseDown; // Boolean : capture if the mouse is pressed
$('#settings').promise().then(function () {
settingsArray = {};
formArray = $('#settings').serializeArray()
numberArray = $('#settings [type="number"]').map(function () {
return { name: this.name, value: this.value ? this.value : '0' };
}).get();
formArray = numberArray.concat($('#settings [type!="number"]').serializeArray())
.concat($('#settings input[type=checkbox]:not(:checked)')
.map(function () {
return { name: this.name, value: '0' };
......
......@@ -370,7 +370,7 @@
<div class="form-group">
<label for="PlayerPIPPositionX" class="col-xs-4 control-label">{{i18n "VIDEO_POSITION_X"}}</label>
<div class="col-xs-6">
<select type="number" class="form-control" name="PlayerPIPPositionX">
<select class="form-control" name="PlayerPIPPositionX">
<option value="Left" > {{i18n "LEFT"}} </option>
<option value="Center" default> {{i18n "CENTER"}} </option>
<option value="Right" > {{i18n "RIGHT"}} </option>
......@@ -381,7 +381,7 @@
<div class="form-group">
<label for="PlayerPIPPositionY" class="col-xs-4 control-label">{{i18n "VIDEO_POSITION_Y"}}</label>
<div class="col-xs-6">
<select type="number" class="form-control" name="PlayerPIPPositionY">
<select class="form-control" name="PlayerPIPPositionY">
<option value="Bottom" > {{i18n "BOTTOM"}} </option>
<option value="Center" default> {{i18n "CENTER"}} </option>
<option value="Top" > {{i18n "TOP"}} </option>
......@@ -461,13 +461,13 @@
<div class="form-group">
<label class="col-xs-4 control-label" for="EngineFreeUpvotesRequiredMin">{{i18n "ENGINEFREEUPVOTESREQUIREDMIN"}}</label>
<div class="col-xs-6">
<input class="form-control" name="EngineFreeUpvotesRequiredMin">
<input class="form-control" type="number" name="EngineFreeUpvotesRequiredMin">
</div>
</div>
<div class="form-group">
<label for="EngineFreeUpvotesRequiredPercent" class="col-xs-4 control-label">{{i18n "ENGINEFREEUPVOTESREQUIREDPERCENT"}}</label>
<div class="col-xs-6">
<input class="form-control" name="EngineFreeUpvotesRequiredPercent">
<input class="form-control" type="number" name="EngineFreeUpvotesRequiredPercent">
</div>
</div>
</div>
......@@ -475,13 +475,13 @@
<div class="form-group">
<label class="col-xs-4 control-label" for="EngineSongPollChoices">{{i18n "ENGINESONGPOLLCHOICES"}}</label>
<div class="col-xs-6">
<input class="form-control" name="EngineSongPollChoices">
<input class="form-control" type="number" name="EngineSongPollChoices">
</div>
</div>
<div class="form-group">
<label for="EngineSongPollTimeout" class="col-xs-4 control-label">{{i18n "ENGINESONGPOLLTIMEOUT"}}</label>
<div class="col-xs-6">
<input class="form-control" name="EngineSongPollTimeout">
<input class="form-control" type="number" name="EngineSongPollTimeout">
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment