Commit 4d72e035 authored by yPhil's avatar yPhil

Merge branch 'feed-item'

parents 0730102b c99aadb4
...@@ -130,7 +130,7 @@ PTL.dialog = { ...@@ -130,7 +130,7 @@ PTL.dialog = {
.data('url', newUrl) .data('url', newUrl)
.data('type', newType); .data('type', newType);
if ($('input[name=killFeedChbox]:checked').val() === 'on') { if ($('input[name=kill-feed-check]:checked').val() === 'on') {
$feed.hide('fade', 1000, function() { $feed.hide('fade', 1000, function() {
$feed.remove(); $feed.remove();
...@@ -149,8 +149,6 @@ PTL.dialog = { ...@@ -149,8 +149,6 @@ PTL.dialog = {
], ],
open: function() { open: function() {
// $('.ui-dialog :button').focus();
$('.ui-widget-overlay, .ui-dialog-titlebar-close').on('click', function() { $('.ui-widget-overlay, .ui-dialog-titlebar-close').on('click', function() {
PTL.dialog.kill($dialog); PTL.dialog.kill($dialog);
if (isNewFeed) { if (isNewFeed) {
...@@ -196,16 +194,28 @@ PTL.dialog = { ...@@ -196,16 +194,28 @@ PTL.dialog = {
$guessSpinner = $dialog.find('button#feed-guess > i'), $guessSpinner = $dialog.find('button#feed-guess > i'),
$guessField = $dialog.find('input#feed-guess'), $guessField = $dialog.find('input#feed-guess'),
$okButton = $dialog.find('.ui-dialog-buttonpane'), $okButton = $dialog.find('.ui-dialog-buttonpane'),
$helpButton = $('<button type="button" class="ui-button ui-corner-all ui-widget ui-button-icon-only ui-dialog-titlebar-help" title="Help"><span class="ui-button-icon ui-icon ui-icon-help"></span><span class="ui-button-icon-space"> </span>Help</button>'); $killFeedFieldset = $('fieldset#kill-feed'),
$helpMiniButtonIcon,
$helpMiniButton,
// var $helpSpan = $('<span>').attr('class', 'ui-button-icon ui-icon ui-icon-help'); oldUrl = $dataStore.data('url'),
oldType = $dataStore.data('type'),
oldLimit = $dataStore.data('limit');
// var $helpButton = $('<button').attr('title', 'Help').append($helpSpan); $helpMiniButtonIcon = $('<span>')
.attr('class', 'ui-button-icon ui-icon ui-icon-help');
$('#killFeedChbox').button(); $helpMiniButton = $('<button>')
.attr('class', 'ui-button ui-corner-all ui-widget ui-button-icon-only ui-dialog-titlebar-help')
.attr('title', PTL.tr('How does it work?'))
.attr('type', 'button')
.append($helpMiniButtonIcon)
.on('click', function() {
PTL.util.help('dialog');
}).appendTo($dialog.parent().find('.ui-dialog-titlebar'));
$dialog.parent().find('.ui-dialog-titlebar').append($helpButton); if (isNewFeed) {
$killFeedFieldset.remove();
}
if (!PTL.util.isMobile()) { if (!PTL.util.isMobile()) {
$guessField.click(function() { $guessField.click(function() {
...@@ -213,16 +223,6 @@ PTL.dialog = { ...@@ -213,16 +223,6 @@ PTL.dialog = {
}); });
} }
$helpButton.on('click', function() {
PTL.util.help('dialog');
});
var oldUrl = $dataStore.data('url'),
oldType = $dataStore.data('type'),
oldLimit = $dataStore.data('limit');
$guessButton.click(function() { $guessButton.click(function() {
$guessSpinner $guessSpinner
...@@ -236,7 +236,6 @@ PTL.dialog = { ...@@ -236,7 +236,6 @@ PTL.dialog = {
timeout: 1200 timeout: 1200
}, function() { }, function() {
$guessSpinner.removeClass('spin icon-cog'); $guessSpinner.removeClass('spin icon-cog');
}).done(function(feed, status) { }).done(function(feed, status) {
$guessField.val(feed); $guessField.val(feed);
...@@ -251,7 +250,6 @@ PTL.dialog = { ...@@ -251,7 +250,6 @@ PTL.dialog = {
}).fail(function(feed, status) { }).fail(function(feed, status) {
guessError(); guessError();
}); });
}); });
...@@ -265,12 +263,12 @@ PTL.dialog = { ...@@ -265,12 +263,12 @@ PTL.dialog = {
$dialog.find('input#' + oldType || 'mixed').prop('checked', true) $dialog.find('input#' + oldType || 'mixed').prop('checked', true)
.checkboxradio('refresh'); .checkboxradio('refresh');
$spinner.on( 'spinstop', function() { $spinner
$dialog.find('div#feedLimit').slider( 'option', 'value', $(this).val()); .spinner( 'value', oldLimit)
$dialog.find('.ui-slider-handle').text($(this).val()); .on( 'spinstop', function() {
}); $dialog.find('div#feedLimit').slider( 'option', 'value', $(this).val());
$dialog.find('.ui-slider-handle').text($(this).val());
$spinner.spinner( 'value', oldLimit); });
$dialog.find('div#feedLimit').slider({ $dialog.find('div#feedLimit').slider({
value: oldLimit, value: oldLimit,
...@@ -294,15 +292,11 @@ PTL.dialog = { ...@@ -294,15 +292,11 @@ PTL.dialog = {
$dialog.on('submit', function () { $dialog.on('submit', function () {
PTL.feed.populate($feedRefresh); PTL.feed.populate($feedRefresh);
PTL.tab.saveTabs(); PTL.tab.saveTabs();
$(this).dialog('destroy'); $(this).dialog('destroy');
return false; return false;
}); });
// $dialog.find('#feed-guess').select();
} }
}); });
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
</fieldset> </fieldset>
<fieldset id="killFeed" class="prefsForm ui-widget ui-widget-content ui-corner-all"> <fieldset id="kill-feed" class="prefsForm ui-widget ui-widget-content ui-corner-all">
<legend data-title="Delete this feed" <legend data-title="Delete this feed"
data-content="Delete this feed" data-content="Delete this feed"
...@@ -96,10 +96,10 @@ ...@@ -96,10 +96,10 @@
<div id="feedDel" <div id="feedDel"
class="flex-box"> class="flex-box">
<input type="checkbox" name="killFeedChbox" id="killFeedChbox"> <input type="checkbox" name="kill-feed-check" id="kill-feed-check">
<label id="killFeed" <label id="kill-feed"
class="dangerous translate last" class="dangerous translate last"
for="killFeedChbox" for="kill-feed-check"
data-title="Delete feed" data-title="Delete feed"
title="Delete feed" title="Delete feed"
data-content="Delete feed"> data-content="Delete feed">
......
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