mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 22:45:56 +00:00
feed editor: allow manual replacement of feed icons
This commit is contained in:
60
functions.js
60
functions.js
@@ -2248,18 +2248,59 @@ function feedArchiveRemove() {
|
||||
}
|
||||
}
|
||||
|
||||
function uploadIconHandler(iframe) {
|
||||
function uploadIconHandler(rc) {
|
||||
try {
|
||||
notify_info("Icon changed!");
|
||||
|
||||
alert("Icon changed, blah blah");
|
||||
|
||||
switch (rc) {
|
||||
case 0:
|
||||
notify_info("Upload complete.");
|
||||
if (inPreferences()) {
|
||||
updateFeedList();
|
||||
} else {
|
||||
setTimeout('updateFeedList(false, false)', 50);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
notify_error("Upload failed: icon is too big.");
|
||||
break;
|
||||
case 2:
|
||||
notify_error("Upload failed.");
|
||||
break;
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
exception_error("uploadIconHandler", e);
|
||||
}
|
||||
}
|
||||
|
||||
function removeFeedIcon(id) {
|
||||
|
||||
try {
|
||||
|
||||
if (confirm(__("Remove stored feed icon?"))) {
|
||||
var query = "backend.php?op=pref-feeds&subop=removeicon&feed_id=" + param_escape(id);
|
||||
|
||||
debug(query);
|
||||
|
||||
notify_progress("Removing feed icon...", true);
|
||||
|
||||
new Ajax.Request("backend.php", {
|
||||
parameters: query,
|
||||
onComplete: function(transport) {
|
||||
notify_info("Feed icon removed.");
|
||||
if (inPreferences()) {
|
||||
updateFeedList();
|
||||
} else {
|
||||
setTimeout('updateFeedList(false, false)', 50);
|
||||
}
|
||||
} });
|
||||
}
|
||||
|
||||
return false;
|
||||
} catch (e) {
|
||||
exception_error("uploadFeedIcon", e);
|
||||
}
|
||||
}
|
||||
|
||||
function uploadFeedIcon() {
|
||||
|
||||
try {
|
||||
@@ -2268,12 +2309,15 @@ function uploadFeedIcon() {
|
||||
|
||||
if (file.value.length == 0) {
|
||||
alert(__("Please select an image file to upload."));
|
||||
return false;
|
||||
} else {
|
||||
notify_progress("Uploading, please wait...", true);
|
||||
return true;
|
||||
if (confirm(__("Upload new icon for this feed?"))) {
|
||||
notify_progress("Uploading, please wait...", true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
} catch (e) {
|
||||
exception_error("uploadFeedIcon", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user