Commit b12f3c90 authored by yPhil's avatar yPhil
Browse files

squash! Somehow it works

parent 2e2c2dd9
Pipeline #411972 passed with stage
in 47 seconds
......@@ -237,12 +237,7 @@ PTL.dialog = {
$feedBody = $dataStore.parent().next('div.feedBody'),
allGroups = PTL.tab.list('all'),
$thisGroup = $feed.parent().parent(),
$groupMenu = $dialog.find('select#feedTabSelect'),
$spinner = $dialog.find('input#feedLimitSpinner').spinner({
classes: {
"ui-spinner": "shrink ui-corner-all"
}
});
$groupMenu = $dialog.find('select#feedTabSelect');
$('.help-rss').attr('href', 'https://' + PTL.language + '.wikipedia.org/wiki/RSS');
......@@ -355,7 +350,22 @@ PTL.dialog = {
oldUrl = $dataStore.data('url'),
oldName = $dataStore.data('name'),
oldType = $dataStore.data('type'),
oldLimit = $dataStore.data('limit');
oldLimit = $dataStore.data('limit'),
nbItems = $dataStore.data('nbitems'),
$feedLimitInput = $('input#feedLimit'),
$feedLimitSlider = $('div#feedLimitSlider'),
$feedLimitSpinner = $dialog.find('input#feedLimitSpinner').spinner({
classes: {
"ui-spinner": "shrink ui-corner-all"
}
}),
$feedNbItemsInput = $('input#feedNbItems'),
$feedNbItemsSlider = $('div#feedNbItemsSlider'),
$feedNbItemsSpinner = $dialog.find('input#feedNbItemsSpinner').spinner({
classes: {
"ui-spinner": "shrink ui-corner-all"
}
});
$feedGuessInput.on('keypress',function(e) {
if (e.which == 13) {
......@@ -429,20 +439,20 @@ PTL.dialog = {
$dialog.find('input#' + oldType || 'mixed').prop('checked', true)
.checkboxradio('refresh');
$spinner
$feedLimitSpinner
.spinner( 'value', oldLimit)
.on( 'spinstop', function() {
$dialog.find('div#feedLimit').slider( 'option', 'value', $(this).val());
$feedLimitSlider.slider( 'option', 'value', $(this).val());
$dialog.find('.ui-slider-handle').text($(this).val());
});
$dialog.find('div#feedLimit').slider({
$feedLimitSlider.slider({
value: oldLimit,
min: 1,
max: 600,
step: 1,
create: function() {
$('input#feedLimit').val(oldLimit);
$feedLimitInput.val(oldLimit);
$(this).find('.ui-slider-handle').text(oldLimit);
},
slide: function( event, ui ) {
......@@ -452,11 +462,39 @@ PTL.dialog = {
$('input#feedLimitSpinner').val(ui.value);
},
change: function( event, ui ) {
$('input#feedLimit').val(ui.value);
$feedLimitInput.val(ui.value);
$dataStore.data('limit', ui.value);
}
});
$feedNbItemsSpinner
.spinner( 'value', nbItems)
.on( 'spinstop', function() {
$feedNbItemsSlider.slider( 'option', 'value', $(this).val());
$dialog.find('.ui-slider-handle').text($(this).val());
});
$feedNbItemsSlider.slider({
value: nbItems,
min: 1,
max: 600,
step: 1,
create: function() {
$feedNbItemsInput.val(nbItems);
$(this).find('.ui-slider-handle').text(nbItems);
},
slide: function( event, ui ) {
$(this).val(ui.value);
$(this).find('.ui-slider-handle').text(ui.value);
// $feedBody.css('height', ui.value + 'px');
$('input#feedNbItemsSpinner').val(ui.value);
},
change: function( event, ui ) {
$feedNbItemsInput.val(ui.value);
// $dataStore.data('limit', ui.value);
}
});
}
});
......
......@@ -559,6 +559,8 @@ PTL.feed = {
if (saved) {
console.log('yep!: %s (%s)');
if ($feedBody.is(':empty')) {
$feedBody.append(saved);
}
......
......@@ -407,10 +407,19 @@ var PTL = (function() {
},
sideMenu: function(action) {
const $overlay = $('#overlay'),
const $overlay = $('div#overlay'),
$sideMenu = $('nav#sideMenu');
const $lPayAmount = $('a#lPayAmount'),
$lPayAmountImg = $('a#lPayAmountImg img'),
$lPayPatrons = $('a#lPayPatrons'),
$lPayPatronsImg = $('a#lPayPatrons img');
$lPayAmountImg.attr('src', 'https://img.shields.io/liberapay/receives/yPhil.svg?logo=liberapay');
$lPayPatronsImg.attr('src', 'https://img.shields.io/liberapay/patrons/yPhil.svg?logo=liberapay');
if (action == 'open') {
$overlay.removeClass('hidden');
$sideMenu.addClass('expanded');
} else if (action == 'close') {
......
This diff is collapsed.
......@@ -411,10 +411,10 @@
</div>
<fieldset>
<div class="flexBox" id="liberapay">
<a href="https://liberapay.com/yPhil/">
<a id="lPayAmount" href="https://liberapay.com/yPhil/">
<img width="156" height="20" alt="Support Pétrolette" class="b-lazy" src="https://img.shields.io/liberapay/receives/yPhil.svg?logo=liberapay" />
</a>
<a href="https://liberapay.com/yPhil/">
<a id="lPayPatrons" href="https://liberapay.com/yPhil/">
<img width="82" height="20" alt="Support Pétrolette" class="b-lazy" src="https://img.shields.io/liberapay/patrons/yPhil.svg?logo=liberapay">
</a>
</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