mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 23:15:55 +00:00
uploadIconHandler -> CommonDialogs
This commit is contained in:
@@ -492,7 +492,7 @@ class Pref_Feeds extends Handler_Protected {
|
|||||||
@unlink($icon_file);
|
@unlink($icon_file);
|
||||||
|
|
||||||
print "<script type=\"text/javascript\">";
|
print "<script type=\"text/javascript\">";
|
||||||
print "parent.uploadIconHandler($rc);";
|
print "parent.CommonDialogs.uploadIconHandler($rc);";
|
||||||
print "</script>";
|
print "</script>";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,30 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
/* global __, ngettext */
|
/* global __, ngettext */
|
||||||
define(["dojo/_base/declare"], function (declare) {
|
define(["dojo/_base/declare"], function (declare) {
|
||||||
|
// noinspection JSUnusedGlobalSymbols
|
||||||
return declare("fox.CommonDialogs", null, {
|
return declare("fox.CommonDialogs", null, {
|
||||||
closeInfoBox: function() {
|
closeInfoBox: function() {
|
||||||
const dialog = dijit.byId("infoBox");
|
const dialog = dijit.byId("infoBox");
|
||||||
if (dialog) dialog.hide();
|
if (dialog) dialog.hide();
|
||||||
},
|
},
|
||||||
|
uploadIconHandler: function(rc) {
|
||||||
|
switch (rc) {
|
||||||
|
case 0:
|
||||||
|
Notify.info("Upload complete.");
|
||||||
|
if (App.isPrefs()) {
|
||||||
|
Feeds.reload();
|
||||||
|
} else {
|
||||||
|
setTimeout('Feeds.reload(false, false)', 50);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
Notify.error("Upload failed: icon is too big.");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
Notify.error("Upload failed.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
removeFeedIcon: function(id) {
|
removeFeedIcon: function(id) {
|
||||||
if (confirm(__("Remove stored feed icon?"))) {
|
if (confirm(__("Remove stored feed icon?"))) {
|
||||||
Notify.progress("Removing feed icon...", true);
|
Notify.progress("Removing feed icon...", true);
|
||||||
|
|||||||
21
js/common.js
21
js/common.js
@@ -343,27 +343,6 @@ function fatalError(code, msg, ext_info) {
|
|||||||
return s.replace(/<\/?[^>]+(>|$)/g, "");
|
return s.replace(/<\/?[^>]+(>|$)/g, "");
|
||||||
} */
|
} */
|
||||||
|
|
||||||
// noinspection JSUnusedGlobalSymbols
|
|
||||||
function uploadIconHandler(rc) {
|
|
||||||
switch (rc) {
|
|
||||||
case 0:
|
|
||||||
Notify.info("Upload complete.");
|
|
||||||
if (App.isPrefs()) {
|
|
||||||
Feeds.reload();
|
|
||||||
} else {
|
|
||||||
setTimeout('Feeds.reload(false, false)', 50);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
Notify.error("Upload failed: icon is too big.");
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
Notify.error("Upload failed.");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// noinspection JSUnusedGlobalSymbols
|
// noinspection JSUnusedGlobalSymbols
|
||||||
function label_to_feed_id(label) {
|
function label_to_feed_id(label) {
|
||||||
return _label_base_index - 1 - Math.abs(label);
|
return _label_base_index - 1 - Math.abs(label);
|
||||||
|
|||||||
Reference in New Issue
Block a user