rework feed-prefs ops toolbar
This commit is contained in:
parent
ebb87f43d5
commit
c4a36709cd
|
@ -1716,3 +1716,5 @@ function getSelectedArticleIds2() {
|
|||
|
||||
return ids;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -984,15 +984,34 @@
|
|||
|
||||
print "<p><span id=\"feedOpToolbar\">";
|
||||
|
||||
print "<input type=\"submit\" class=\"button\" disabled=\"true\"
|
||||
onclick=\"javascript:editSelectedFeed()\" value=\"".__('Edit')."\">
|
||||
<input type=\"submit\" class=\"button\" disabled=\"true\"
|
||||
onclick=\"javascript:removeSelectedFeeds()\"
|
||||
value=\"".__('Unsubscribe')."\">";
|
||||
print "<select id=\"feedActionChooser\" onchange=\"feedActionChange()\">
|
||||
<option value=\"facDefault\" selected>".__('Actions...')."</option>
|
||||
<option disabled>--------</option>
|
||||
<option style=\"color : #5050aa\" disabled>".__('Selection:')."</option>
|
||||
<option value=\"facEdit\"> ".__('Edit')."</option>
|
||||
<option value=\"facPurge\"> ".__('Purge')."</option>
|
||||
<option value=\"facClear\"> ".__('Clear feed data')."</option>
|
||||
<option value=\"facUnsubscribe\"> ".__('Unsubscribe')."</option>";
|
||||
|
||||
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
||||
|
||||
print " | ";
|
||||
print "<option disabled>--------</option>
|
||||
<option style=\"color : #5050aa\" disabled>".__('Other:')."</option>
|
||||
<option value=\"facEditCats\"> ".__('Edit categories')."
|
||||
</option>";
|
||||
}
|
||||
|
||||
print "</select>";
|
||||
|
||||
/* print "<input type=\"submit\" class=\"button\" disabled=\"true\"
|
||||
onclick=\"javascript:editSelectedFeed()\" value=\"".__('Edit')."\">
|
||||
<input type=\"submit\" class=\"button\" disabled=\"true\"
|
||||
onclick=\"javascript:removeSelectedFeeds()\"
|
||||
value=\"".__('Unsubscribe')."\">"; */
|
||||
|
||||
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
||||
|
||||
print " | " . __('Selection:');
|
||||
|
||||
print_feed_cat_select($link, "sfeed_set_fcat", "", "disabled");
|
||||
|
||||
|
@ -1005,9 +1024,9 @@
|
|||
|
||||
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
||||
|
||||
print " <input type=\"submit\" class=\"button\"
|
||||
/* print " <input type=\"submit\" class=\"button\"
|
||||
onclick=\"javascript:editFeedCats()\" value=\"".
|
||||
__("Edit categories")."\">";
|
||||
__("Edit categories")."\">"; */
|
||||
|
||||
# print " | ";
|
||||
|
||||
|
|
84
prefs.js
84
prefs.js
|
@ -668,6 +668,38 @@ function removeSelectedFeeds() {
|
|||
return false;
|
||||
}
|
||||
|
||||
function clearSelectedFeeds() {
|
||||
|
||||
if (!xmlhttp_ready(xmlhttp)) {
|
||||
printLockingError();
|
||||
return
|
||||
}
|
||||
|
||||
var sel_rows = getSelectedFeeds();
|
||||
|
||||
if (sel_rows.length > 1) {
|
||||
alert(__("Please select only one feed."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (sel_rows.length > 0) {
|
||||
|
||||
var ok = confirm(__("Erase all non-starred articles in selected feed?"));
|
||||
|
||||
if (ok) {
|
||||
notify_progress("Clearing selected feed...");
|
||||
clearFeedArticles(sel_rows[0]);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
alert(__("No feeds are selected."));
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function removeSelectedFeedCats() {
|
||||
|
||||
if (!xmlhttp_ready(xmlhttp)) {
|
||||
|
@ -1781,3 +1813,55 @@ function validatePrefsSave() {
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
function feedActionChange() {
|
||||
try {
|
||||
var chooser = document.getElementById("feedActionChooser");
|
||||
var opid = chooser[chooser.selectedIndex].value;
|
||||
|
||||
chooser.selectedIndex = 0;
|
||||
feedActionGo(opid);
|
||||
} catch (e) {
|
||||
exception_error("feedActionChange", e);
|
||||
}
|
||||
}
|
||||
|
||||
function feedActionGo(op) {
|
||||
try {
|
||||
if (op == "facEdit") {
|
||||
editSelectedFeed();
|
||||
}
|
||||
|
||||
if (op == "facClear") {
|
||||
clearSelectedFeeds();
|
||||
}
|
||||
|
||||
if (op == "facPurge") {
|
||||
purgeSelectedFeeds();
|
||||
}
|
||||
|
||||
if (op == "facUnsubscribe") {
|
||||
removeSelectedFeeds();
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
exception_error("feedActionGo", e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function clearFeedArticles(feed_id) {
|
||||
|
||||
notify_progress("Clearing feed...");
|
||||
|
||||
var query = "backend.php?op=pref-feeds&quiet=1&subop=clear&id=" + feed_id;
|
||||
|
||||
new Ajax.Request(query, {
|
||||
onComplete: function(transport) {
|
||||
notify('');
|
||||
} });
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
29
tt-rss.js
29
tt-rss.js
|
@ -525,20 +525,6 @@ function unsubscribeFeed(feed_id) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function clearFeedArticles(feed_id) {
|
||||
|
||||
notify_progress("Clearing feed...");
|
||||
|
||||
var query = "backend.php?op=pref-feeds&quiet=1&subop=clear&id=" + feed_id;
|
||||
|
||||
new Ajax.Request(query, {
|
||||
onComplete: function(transport) {
|
||||
dlg_frefresh_callback(transport, feed_id);
|
||||
} });
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function updateFeedTitle(t) {
|
||||
active_title_text = t;
|
||||
|
@ -729,3 +715,18 @@ function labelEditSave() {
|
|||
|
||||
}
|
||||
|
||||
function clearFeedArticles(feed_id) {
|
||||
|
||||
notify_progress("Clearing feed...");
|
||||
|
||||
var query = "backend.php?op=pref-feeds&quiet=1&subop=clear&id=" + feed_id;
|
||||
|
||||
new Ajax.Request(query, {
|
||||
onComplete: function(transport) {
|
||||
dlg_frefresh_callback(transport, feed_id);
|
||||
} });
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ window.onload = init;
|
|||
<option style="color : #5050aa" disabled><?php echo __('Feed actions:') ?></option>
|
||||
<option value="qmcAddFeed"><?php echo __(' Subscribe to feed') ?></option>
|
||||
<option value="qmcEditFeed"><?php echo __(' Edit this feed') ?></option>
|
||||
<option value="qmcClearFeed"><?php echo __(' Clear articles') ?></option>
|
||||
<!-- <option value="qmcClearFeed"><?php echo __(' Clear articles') ?></option> -->
|
||||
<option value="qmcRemoveFeed"><?php echo __(' Unsubscribe') ?></option>
|
||||
<option disabled>--------</option>
|
||||
<option style="color : #5050aa" disabled><?php echo __('All feeds:') ?></option>
|
||||
|
|
Loading…
Reference in New Issue