Commit 01d8f273 authored by Thomas Citharel's avatar Thomas Citharel 🏃🏻
Browse files

ui improvements

parent 97892b97
Pipeline #13036 passed with stage
in 15 minutes and 5 seconds
......@@ -97,17 +97,18 @@ $(() => {
const width = $('#width').val();
if (!(width.endsWith('%') || width.endsWith('px'))) {
$('#width').addClass('has-error');
$('#width').parent().addClass('has-error');
} else {
$('#width').removeClass('has-error');
$('#width').parent().removeClass('has-error');
}
const height = $('#height').val();
if (!(height.endsWith('%') || height.endsWith('px'))) {
$('#height').addClass('has-error');
} else {
$('#height').removeClass('has-error');
console.log('here');
$('#height').parent().addClass('has-error');
return null;
}
$('#height').parent().removeClass('has-error');
return `<iframe width="${width}" height="${height}" src="${url}"></iframe>`;
};
......@@ -183,6 +184,7 @@ $(() => {
$('#autoplay').on('change', (evt) => {
if (evt.target.checked) {
$('.autoplay .range').show();
$('#range').val(10);
} else {
$('.autoplay .range').hide();
}
......@@ -194,7 +196,7 @@ $(() => {
updateURLAndEmbeed();
});
$('.dimensions').on('change', () => {
$('.dimensions').on('change keyup paste mouseup', () => {
updateEmbeed();
});
......
......@@ -35,12 +35,12 @@
<h4>{{ 'presentations.share.embeed.title' | trans }}</h4>
<p>{{ 'presentations.share.embeed.desc' | trans }}</p>
<form class="form-inline">
<div class="form-group">
<label class="sr-only" for="width">{{ 'presentations.share.embeed.width' | trans }}</label>
<div class="form-group form-group-sm">
<label for="width">{{ 'presentations.share.embeed.width' | trans }}</label>
<input type="text" class="form-control dimensions" id="width" placeholder="{{ 'presentations.share.embeed.width' | trans }}" autocomplete="off" value="600px" size="5">
</div>
<div class="form-group">
<label class="sr-only" for="height">{{ 'presentations.share.embeed.height' | trans }}</label>
<div class="form-group form-group-sm">
<label for="height">{{ 'presentations.share.embeed.height' | trans }}</label>
<input type="text" class="form-control dimensions" id="height" placeholder="{{ 'presentations.share.embeed.height' | trans }}" autocomplete="off" value="400px" size="5">
</div>
</form>
......@@ -58,7 +58,7 @@
</div>
<div class="form-group range">
<label for="range">{{ 'presentations.share.autoplay.time' | trans }}&nbsp;: <span id="timevalue">10</span></label>
<input type="range" class="form-control" id="range" value="10">
<input type="range" class="form-control" id="range" value="10" max="60">
</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