update notify_* calls to use Notify

This commit is contained in:
Andrew Dolgov 2018-12-02 20:56:30 +03:00
parent 495248dd97
commit 526389b2d3
28 changed files with 134 additions and 146 deletions

View File

@ -183,7 +183,7 @@ class Pref_Prefs extends Handler_Protected {
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
evt.preventDefault();
if (this.validate()) {
notify_progress('Saving data...', true);
Notify.progress('Saving data...', true);
new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()),
@ -249,12 +249,12 @@ class Pref_Prefs extends Handler_Protected {
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
evt.preventDefault();
if (this.validate()) {
notify_progress('Changing password...', true);
Notify.progress('Changing password...', true);
new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) {
notify('');
Notify.close();
if (transport.responseText.indexOf('ERROR: ') == 0) {
$('pwd_change_infobox').innerHTML =
@ -316,14 +316,14 @@ class Pref_Prefs extends Handler_Protected {
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
evt.preventDefault();
if (this.validate()) {
notify_progress('Disabling OTP', true);
Notify.progress('Disabling OTP', true);
new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) {
notify('');
Notify.close();
if (transport.responseText.indexOf('ERROR: ') == 0) {
notify_error(transport.responseText.replace('ERROR: ', ''));
Notify.error(transport.responseText.replace('ERROR: ', ''));
} else {
window.location.reload();
}
@ -367,14 +367,14 @@ class Pref_Prefs extends Handler_Protected {
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
evt.preventDefault();
if (this.validate()) {
notify_progress('Saving data...', true);
Notify.progress('Saving data...', true);
new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) {
notify('');
Notify.close();
if (transport.responseText.indexOf('ERROR:') == 0) {
notify_error(transport.responseText.replace('ERROR:', ''));
Notify.error(transport.responseText.replace('ERROR:', ''));
} else {
window.location.reload();
}
@ -441,7 +441,7 @@ class Pref_Prefs extends Handler_Protected {
if (msg == 'PREFS_NEED_RELOAD') {
window.location.reload();
} else {
notify_info(msg);
Notify.info(msg);
}
}
} });
@ -689,12 +689,12 @@ class Pref_Prefs extends Handler_Protected {
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
evt.preventDefault();
if (this.validate()) {
notify_progress('Saving data...', true);
Notify.progress('Saving data...', true);
new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) {
notify('');
Notify.close();
if (confirm(__('Selected plugins have been enabled. Reload?'))) {
window.location.reload();
}

View File

@ -165,7 +165,7 @@ define(["dojo/_base/declare"], function (declare) {
//const unread_in_buffer = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length;
//request_counters(unread_in_buffer == 0);
notify("");
Notify.close();
} catch (e) {
exception_error(e);
@ -187,11 +187,11 @@ define(["dojo/_base/declare"], function (declare) {
style: "width: 600px",
execute: function () {
if (this.validate()) {
notify_progress("Saving article tags...", true);
Notify.progress("Saving article tags...", true);
xhrPost("backend.php", this.attr('value'), (transport) => {
try {
notify('');
Notify.close();
dialog.hide();
const data = JSON.parse(transport.responseText);

View File

@ -8,12 +8,12 @@ define(["dojo/_base/declare"], function (declare) {
},
removeFeedIcon: function(id) {
if (confirm(__("Remove stored feed icon?"))) {
notify_progress("Removing feed icon...", true);
Notify.progress("Removing feed icon...", true);
const query = {op: "pref-feeds", method: "removeicon", feed_id: id};
xhrPost("backend.php", query, () => {
notify_info("Feed icon removed.");
Notify.info("Feed icon removed.");
if (App.isPrefs()) {
Feeds.reload();
} else {
@ -30,7 +30,7 @@ define(["dojo/_base/declare"], function (declare) {
if (file.value.length == 0) {
alert(__("Please select an image file to upload."));
} else if (confirm(__("Upload new icon for this feed?"))) {
notify_progress("Uploading, please wait...", true);
Notify.progress("Uploading, please wait...", true);
return true;
}
@ -79,7 +79,7 @@ define(["dojo/_base/declare"], function (declare) {
const rc = reply['result'];
notify('');
Notify.close();
Element.hide("feed_add_spinner");
console.log(rc);
@ -87,7 +87,7 @@ define(["dojo/_base/declare"], function (declare) {
switch (parseInt(rc['code'])) {
case 1:
dialog.hide();
notify_info(__("Subscribed to %s").replace("%s", feed_url));
Notify.info(__("Subscribed to %s").replace("%s", feed_url));
Feeds.reload();
break;
@ -161,7 +161,7 @@ define(["dojo/_base/declare"], function (declare) {
if (sel_rows.length > 0) {
if (confirm(__("Remove selected feeds?"))) {
notify_progress("Removing selected feeds...", true);
Notify.progress("Removing selected feeds...", true);
const query = {
op: "pref-feeds", method: "remove",
@ -169,7 +169,7 @@ define(["dojo/_base/declare"], function (declare) {
};
xhrPost("backend.php", query, () => {
notify('');
Notify.close();
dialog.hide();
Feeds.reload();
});
@ -244,7 +244,7 @@ define(["dojo/_base/declare"], function (declare) {
if (selected.length > 0) {
dijit.byId("feedBrowserDlg").hide();
notify_progress("Loading, please wait...", true);
Notify.progress("Loading, please wait...", true);
const query = {
op: "rpc", method: "massSubscribe",
@ -252,7 +252,7 @@ define(["dojo/_base/declare"], function (declare) {
};
xhrPost("backend.php", query, () => {
notify('');
Notify.close();
Feeds.reload();
});
@ -265,7 +265,7 @@ define(["dojo/_base/declare"], function (declare) {
Element.show('feed_browser_spinner');
xhrPost("backend.php", dialog.attr("value"), (transport) => {
notify('');
Notify.close();
Element.hide('feed_browser_spinner');
@ -320,7 +320,7 @@ define(["dojo/_base/declare"], function (declare) {
if (select)
Object.extend(query, {output: "select"});
notify_progress("Loading, please wait...", true);
Notify.progress("Loading, please wait...", true);
xhrPost("backend.php", query, (transport) => {
if (callback) {
@ -338,7 +338,7 @@ define(["dojo/_base/declare"], function (declare) {
const msg = __("Unsubscribe from %s?").replace("%s", title);
if (title == undefined || confirm(msg)) {
notify_progress("Removing feed...");
Notify.progress("Removing feed...");
const query = {op: "pref-feeds", quiet: 1, method: "remove", ids: feed_id};
@ -381,11 +381,11 @@ define(["dojo/_base/declare"], function (declare) {
style: "width: 600px",
execute: function () {
if (this.validate()) {
notify_progress("Saving data...", true);
Notify.progress("Saving data...", true);
xhrPost("backend.php", dialog.attr('value'), () => {
dialog.hide();
notify('');
Notify.close();
Feeds.reload();
});
}
@ -398,7 +398,7 @@ define(["dojo/_base/declare"], function (declare) {
genUrlChangeKey: function(feed, is_cat) {
if (confirm(__("Generate new syndication address for this feed?"))) {
notify_progress("Trying to change address...", true);
Notify.progress("Trying to change address...", true);
const query = {op: "pref-feeds", method: "regenFeedKey", id: feed, is_cat: is_cat};
@ -415,10 +415,10 @@ define(["dojo/_base/declare"], function (declare) {
new Effect.Highlight(e);
notify('');
Notify.close();
} else {
notify_error("Could not change feed URL.");
Notify.error("Could not change feed URL.");
}
});
}

View File

@ -232,7 +232,7 @@ define(["dojo/_base/declare"], function (declare) {
Element.hide("prefFilterLoadingIndicator");
notify_error("Error while trying to get filter test results.");
Notify.error("Error while trying to get filter test results.");
} else {
console.log("getTestResults: dialog closed, bailing out.");

View File

@ -357,7 +357,7 @@ define(["dojo/_base/declare"], function (declare) {
if (!delayed)
if (!this.setExpando(feed, is_cat,
(is_cat) ? 'images/indicator_tiny.gif' : 'images/indicator_white.gif'))
notify_progress("Loading, please wait...", true);
Notify.progress("Loading, please wait...", true);
query.cat = is_cat;
@ -391,7 +391,7 @@ define(["dojo/_base/declare"], function (declare) {
if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
notify_progress("Marking all feeds as read...");
Notify.progress("Marking all feeds as read...");
xhrPost("backend.php", {op: "feeds", method: "catchupAll"}, () => {
this.requestCounters(true);
@ -458,7 +458,7 @@ define(["dojo/_base/declare"], function (declare) {
search_lang: this.last_search_query[1]
};
notify_progress("Loading, please wait...", true);
Notify.progress("Loading, please wait...", true);
xhrPost("backend.php", catchup_query, (transport) => {
Utils.handleRpcJson(transport);
@ -475,7 +475,7 @@ define(["dojo/_base/declare"], function (declare) {
this.reloadCurrent();
}
notify("");
Notify.close();
});
},
catchupCurrent: function(mode) {
@ -517,7 +517,7 @@ define(["dojo/_base/declare"], function (declare) {
Headlines.updateFloatingTitle(true);
}
notify_progress("Loading, please wait...", true);
Notify.progress("Loading, please wait...", true);
xhrPost("backend.php", {op: "rpc", method: "catchupFeed", feed_id: id, is_cat: false}, (transport) => {
Utils.handleRpcJson(transport);

View File

@ -381,7 +381,7 @@ define(["dojo/_base/declare"], function (declare) {
// unpack visible articles, fill buffer more, etc
this.scrollHandler();
notify("");
Notify.close();
},
reverse: function() {
const toolbar = document.forms["main_toolbar_form"];
@ -435,7 +435,7 @@ define(["dojo/_base/declare"], function (declare) {
cmode: cmode, ids: ids.toString()
};
notify_progress("Loading, please wait...");
Notify.progress("Loading, please wait...");
xhrPost("backend.php", query, (transport) => {
Utils.handleRpcJson(transport);

View File

@ -88,7 +88,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
xhrPost("backend.php", { op: "pref-feeds", search: search }, (transport) => {
dijit.byId('feedConfigTab').attr('content', transport.responseText);
notify("");
Notify.close();
});
},
checkItemAcceptance: function(target, source, position) {
@ -119,14 +119,14 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
}
},
resetFeedOrder: function() {
notify_progress("Loading, please wait...");
Notify.progress("Loading, please wait...");
xhrPost("backend.php", {op: "pref-feeds", method: "feedsortreset"}, () => {
this.reload();
});
},
resetCatOrder: function() {
notify_progress("Loading, please wait...");
Notify.progress("Loading, please wait...");
xhrPost("backend.php", {op: "pref-feeds", method: "catsortreset"}, () => {
this.reload();
@ -134,10 +134,10 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
},
removeCategory: function(id, item) {
if (confirm(__("Remove category %s? Any nested feeds would be placed into Uncategorized.").replace("%s", item.name))) {
notify_progress("Removing category...");
Notify.progress("Removing category...");
xhrPost("backend.php", {op: "pref-feeds", method: "removeCat", ids: id}, () => {
notify('');
Notify.close();
this.reload();
});
}
@ -148,7 +148,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
if (sel_rows.length > 0) {
if (confirm(__("Unsubscribe from selected feeds?"))) {
notify_progress("Unsubscribing from selected feeds...", true);
Notify.progress("Unsubscribing from selected feeds...", true);
const query = {
op: "pref-feeds", method: "remove",
@ -190,7 +190,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
if (sel_rows.length > 0) {
if (confirm(__("Remove selected categories?"))) {
notify_progress("Removing selected categories...");
Notify.progress("Removing selected categories...");
const query = {
op: "pref-feeds", method: "removeCat",
@ -227,7 +227,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
return;
}
notify("");
Notify.close();
if (rows.length > 1) {
return this.editMultiple();
@ -243,13 +243,13 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
return;
}
notify_progress("Loading, please wait...");
Notify.progress("Loading, please wait...");
if (dijit.byId("feedEditDlg"))
dijit.byId("feedEditDlg").destroyRecursive();
xhrPost("backend.php", {op: "pref-feeds", method: "editfeeds", ids: rows.toString()}, (transport) => {
notify("");
Notify.close();
const dialog = new dijit.Dialog({
id: "feedEditDlg",
@ -289,7 +289,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
query[key] = ["off"];
});
notify_progress("Saving data...", true);
Notify.progress("Saving data...", true);
xhrPost("backend.php", query, () => {
dialog.hide();
@ -312,7 +312,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
if (new_name && new_name != item.name) {
notify_progress("Loading, please wait...");
Notify.progress("Loading, please wait...");
xhrPost("backend.php", { op: 'pref-feeds', method: 'renamecat', id: id, title: new_name }, () => {
this.reload();
@ -323,10 +323,10 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
const title = prompt(__("Category title:"));
if (title) {
notify_progress("Creating category...");
Notify.progress("Creating category...");
xhrPost("backend.php", {op: "pref-feeds", method: "addCat", cat: title}, () => {
notify('');
Notify.close();
this.reload();
});
}
@ -344,10 +344,10 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
style: "width: 600px",
execute: function () {
if (this.validate()) {
notify_progress(__("Subscribing to feeds..."), true);
Notify.progress(__("Subscribing to feeds..."), true);
xhrPost("backend.php", this.attr('value'), () => {
notify("");
Notify.close();
dijit.byId("feedTree").reload();
dialog.hide();
});
@ -376,7 +376,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
if (sel_rows.length > 0) {
if (confirm(__("Remove selected feeds?"))) {
notify_progress("Removing selected feeds...", true);
Notify.progress("Removing selected feeds...", true);
const query = {
op: "pref-feeds", method: "remove",
@ -384,7 +384,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
};
xhrPost("backend.php", query, () => {
notify('');
Notify.close();
dijit.byId("feedTree").reload();
dialog.hide();
});

View File

@ -93,11 +93,11 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
xhrPost("backend.php", { op: "pref-filters", search: search }, (transport) => {
dijit.byId('filterConfigTab').attr('content', transport.responseText);
notify("");
Notify.close();
});
},
resetFilterOrder: function() {
notify_progress("Loading, please wait...");
Notify.progress("Loading, please wait...");
xhrPost("backend.php", {op: "pref-filters", method: "filtersortreset"}, () => {
this.reload();
@ -112,7 +112,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
}
if (confirm(__("Combine selected filters?"))) {
notify_progress("Joining filters...");
Notify.progress("Joining filters...");
xhrPost("backend.php", {op: "pref-filters", method: "join", ids: rows.toString()}, () => {
this.reload();
@ -132,7 +132,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
return;
}
notify("");
Notify.close();
this.editFilter(rows[0]);
},
@ -192,7 +192,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
if (confirm(msg)) {
this.hide();
notify_progress("Removing filter...");
Notify.progress("Removing filter...");
const query = {op: "pref-filters", method: "remove", ids: this.attr('value').id};
@ -220,7 +220,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
execute: function () {
if (this.validate()) {
notify_progress("Saving data...", true);
Notify.progress("Saving data...", true);
xhrPost("backend.php", dojo.formToObject("filter_edit_form"), () => {
dialog.hide();
@ -238,7 +238,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
if (sel_rows.length > 0) {
if (confirm(__("Remove selected filters?"))) {
notify_progress("Removing selected filters...");
Notify.progress("Removing selected filters...");
const query = {
op: "pref-filters", method: "remove",

View File

@ -2,10 +2,10 @@ define(["dojo/_base/declare"], function (declare) {
return declare("fox.PrefHelpers", null, {
clearFeedAccessKeys: function() {
if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) {
notify_progress("Clearing URLs...");
Notify.progress("Clearing URLs...");
xhrPost("backend.php", {op: "pref-feeds", method: "clearKeys"}, () => {
notify_info("Generated URLs cleared.");
Notify.info("Generated URLs cleared.");
});
}
@ -14,13 +14,13 @@ define(["dojo/_base/declare"], function (declare) {
updateEventLog: function() {
xhrPost("backend.php", { op: "pref-system" }, (transport) => {
dijit.byId('systemConfigTab').attr('content', transport.responseText);
notify("");
Notify.close();
});
},
clearEventLog: function() {
if (confirm(__("Clear event log?"))) {
notify_progress("Loading, please wait...");
Notify.progress("Loading, please wait...");
xhrPost("backend.php", {op: "pref-system", method: "clearLog"}, () => {
this.updateEventLog();
@ -47,7 +47,7 @@ define(["dojo/_base/declare"], function (declare) {
if (sel_rows.length > 0) {
if (confirm(__("Remove selected profiles? Active and default profiles will not be removed."))) {
notify_progress("Removing selected profiles...", true);
Notify.progress("Removing selected profiles...", true);
const query = {
op: "rpc", method: "remprofiles",
@ -55,7 +55,7 @@ define(["dojo/_base/declare"], function (declare) {
};
xhrPost("backend.php", query, () => {
notify('');
Notify.close();
Prefs.editProfiles();
});
}
@ -69,7 +69,7 @@ define(["dojo/_base/declare"], function (declare) {
if (sel_rows.length == 1) {
if (confirm(__("Activate selected profile?"))) {
notify_progress("Loading, please wait...");
Notify.progress("Loading, please wait...");
xhrPost("backend.php", {op: "rpc", method: "setprofile", id: sel_rows.toString()}, () => {
window.location.reload();
@ -82,12 +82,12 @@ define(["dojo/_base/declare"], function (declare) {
},
addProfile: function () {
if (this.validate()) {
notify_progress("Creating profile...", true);
Notify.progress("Creating profile...", true);
const query = {op: "rpc", method: "addprofile", title: dialog.attr('value').newprofile};
xhrPost("backend.php", query, () => {
notify('');
Notify.close();
Prefs.editProfiles();
});
@ -113,7 +113,7 @@ define(["dojo/_base/declare"], function (declare) {
title: __("Customize stylesheet"),
style: "width: 600px",
execute: function () {
notify_progress('Saving data...', true);
Notify.progress('Saving data...', true);
xhrPost("backend.php", this.attr('value'), () => {
window.location.reload();
@ -129,13 +129,13 @@ define(["dojo/_base/declare"], function (declare) {
if (confirm(__("Reset to defaults?"))) {
xhrPost("backend.php", {op: "pref-prefs", method: "resetconfig"}, (transport) => {
Prefs.refresh();
notify_info(transport.responseText);
Notify.info(transport.responseText);
});
}
},
clearPluginData: function(name) {
if (confirm(__("Clear stored data for this plugin?"))) {
notify_progress("Loading, please wait...");
Notify.progress("Loading, please wait...");
xhrPost("backend.php", {op: "pref-prefs", method: "clearplugindata", name: name}, () => {
Prefs.refresh();
@ -145,7 +145,7 @@ define(["dojo/_base/declare"], function (declare) {
refresh: function() {
xhrPost("backend.php", { op: "pref-prefs" }, (transport) => {
dijit.byId('genConfigTab').attr('content', transport.responseText);
notify("");
Notify.close();
});
}
});

View File

@ -51,7 +51,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f
reload: function() {
xhrPost("backend.php", { op: "pref-labels" }, (transport) => {
dijit.byId('labelConfigTab').attr('content', transport.responseText);
notify("");
Notify.close();
});
},
editLabel: function(id) {
@ -142,7 +142,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f
if (sel_rows.length > 0) {
if (confirm(__("Remove selected labels?"))) {
notify_progress("Removing selected labels...");
Notify.progress("Removing selected labels...");
const query = {
op: "pref-labels", method: "remove",

View File

@ -9,14 +9,14 @@ define(["dojo/_base/declare"], function (declare) {
xhrPost("backend.php", { op: "pref-users", sort: sort, search: search }, (transport) => {
dijit.byId('userConfigTab').attr('content', transport.responseText);
notify("");
Notify.close();
});
},
add: function() {
const login = prompt(__("Please enter username:"), "");
if (login) {
notify_progress("Adding user...");
Notify.progress("Adding user...");
xhrPost("backend.php", {op: "pref-users", method: "add", login: login}, (transport) => {
alert(transport.responseText);
@ -38,7 +38,7 @@ define(["dojo/_base/declare"], function (declare) {
style: "width: 600px",
execute: function () {
if (this.validate()) {
notify_progress("Saving data...", true);
Notify.progress("Saving data...", true);
xhrPost("backend.php", dojo.formToObject("user_edit_form"), (transport) => {
dialog.hide();
@ -65,12 +65,12 @@ define(["dojo/_base/declare"], function (declare) {
}
if (confirm(__("Reset password of selected user?"))) {
notify_progress("Resetting password for selected user...");
Notify.progress("Resetting password for selected user...");
const id = rows[0];
xhrPost("backend.php", {op: "pref-users", method: "resetPass", id: id}, (transport) => {
notify('');
Notify.close();
alert(transport.responseText);
});
@ -81,7 +81,7 @@ define(["dojo/_base/declare"], function (declare) {
if (sel_rows.length > 0) {
if (confirm(__("Remove selected users? Neither default admin nor your account will be removed."))) {
notify_progress("Removing selected users...");
Notify.progress("Removing selected users...");
const query = {
op: "pref-users", method: "remove",

View File

@ -110,7 +110,7 @@ define(["dojo/_base/declare"], function (declare) {
dialog.show();
},
displayDlg: function(title, id, param, callback) {
notify_progress("Loading, please wait...", true);
Notify.progress("Loading, please wait...", true);
const query = {op: "dlg", method: id, param: param};
@ -143,7 +143,7 @@ define(["dojo/_base/declare"], function (declare) {
dialog.show();
notify("");
Notify.close();
if (callback) callback(transport);
} catch (e) {
@ -213,14 +213,14 @@ define(["dojo/_base/declare"], function (declare) {
if (netalert)
netalert.show();
else
notify_error("Communication problem with server.");
Notify.error("Communication problem with server.");
}
} catch (e) {
if (netalert)
netalert.show();
else
notify_error("Communication problem with server.");
Notify.error("Communication problem with server.");
console.error(e);
}
@ -238,7 +238,7 @@ define(["dojo/_base/declare"], function (declare) {
console.log("RI:", k, "=>", v);
if (k == "daemon_is_running" && v != 1) {
notify_error("<span onclick=\"Utils.explainError(1)\">Update daemon is not running.</span>", true);
Notify.error("<span onclick=\"Utils.explainError(1)\">Update daemon is not running.</span>", true);
return;
}
@ -253,7 +253,7 @@ define(["dojo/_base/declare"], function (declare) {
}
if (k == "daemon_stamp_ok" && v != 1) {
notify_error("<span onclick=\"Utils.explainError(3)\">Update daemon is not updating feeds.</span>", true);
Notify.error("<span onclick=\"Utils.explainError(3)\">Update daemon is not updating feeds.</span>", true);
return;
}

View File

@ -217,6 +217,8 @@ const Notify = {
},
msg: function(msg, keep, kind) {
kind = kind || this.KIND_GENERIC;
keep = keep || false;
const notify = $("notify");
window.clearTimeout(this.timeout);
@ -232,7 +234,7 @@ const Notify = {
notify.className = "notify";
console.log('notify', msg, kind);
console.warn('notify', msg, kind);
switch (kind) {
case this.KIND_INFO:
@ -252,7 +254,7 @@ const Notify = {
if (icon) msgfmt = "<span><img src=\"%s\"></span>".replace("%s", icon) + msgfmt;
msgfmt += (" <span><img src=\"%s\" class='close' title=\"" +
__("Click to close") + "\" onclick=\"notify('')\"></span>")
__("Click to close") + "\" onclick=\"Notify.close()\"></span>")
.replace("%s", getInitParam("icon_cross"));
notify.innerHTML = msgfmt;
@ -265,33 +267,19 @@ const Notify = {
},
info: function(msg, keep) {
keep = keep || false;
this.msg(msg, keep, this.KIND_INFO);
},
progress: function(msg, keep) {
keep = keep || true;
this.msg(msg, keep, this.KIND_PROGRESS);
},
error: function(msg) {
this.msg(msg, true, this.KIND_ERROR);
error: function(msg, keep) {
keep = keep || true;
this.msg(msg, keep, this.KIND_ERROR);
}
};
function notify(msg, no_hide) {
notify_real(msg, no_hide, 1);
}
function notify_progress(msg, no_hide) {
notify_real(msg, no_hide, 2);
}
function notify_error(msg, no_hide) {
notify_real(msg, no_hide, 3);
}
function notify_info(msg, no_hide) {
notify_real(msg, no_hide, 4);
}
// noinspection JSUnusedGlobalSymbols
function displayIfChecked(checkbox, elemId) {
if (checkbox.checked) {
@ -359,7 +347,7 @@ function fatalError(code, msg, ext_info) {
function uploadIconHandler(rc) {
switch (rc) {
case 0:
notify_info("Upload complete.");
Notify.info("Upload complete.");
if (App.isPrefs()) {
Feeds.reload();
} else {
@ -367,10 +355,10 @@ function uploadIconHandler(rc) {
}
break;
case 1:
notify_error("Upload failed: icon is too big.");
Notify.error("Upload failed: icon is too big.");
break;
case 2:
notify_error("Upload failed.");
Notify.error("Upload failed.");
break;
}
}

View File

@ -85,7 +85,7 @@ const App = {
initSecondStage: function() {
document.onkeydown = () => { App.hotkeyHandler(event) };
Utils.setLoadingProgress(50);
notify("");
Notify.close();
let tab = Utils.urlParam('tab');
@ -154,7 +154,7 @@ function opmlImportComplete(iframe) {
Element.show(iframe);
notify('');
Notify.close();
if (dijit.byId('opmlImportDlg'))
dijit.byId('opmlImportDlg').destroyRecursive();
@ -185,7 +185,7 @@ function opmlImport() {
alert(__("Please choose an OPML file first."));
return false;
} else {
notify_progress("Importing, please wait...", true);
Notify.progress("Importing, please wait...", true);
Element.show("upload_iframe");
@ -195,7 +195,7 @@ function opmlImport() {
function opmlRegenKey() {
if (confirm(__("Replace current OPML publishing address with a new one?"))) {
notify_progress("Trying to change address...", true);
Notify.progress("Trying to change address...", true);
xhrJson("backend.php", { op: "pref-feeds", method: "regenOPMLKey" }, (reply) => {
if (reply) {
@ -208,10 +208,10 @@ function opmlRegenKey() {
new Effect.Highlight(e);
notify('');
Notify.close();
} else {
notify_error("Could not change feed URL.");
Notify.error("Could not change feed URL.");
}
}
});

View File

@ -478,7 +478,7 @@ const App = {
Utils.helpDialog("main");
};
this.hotkey_actions["toggle_combined_mode"] = function () {
notify_progress("Loading, please wait...");
Notify.progress("Loading, please wait...");
const value = App.isCombinedMode() ? "false" : "true";
@ -491,7 +491,7 @@ const App = {
})
};
this.hotkey_actions["toggle_cdm_expanded"] = function () {
notify_progress("Loading, please wait...");
Notify.progress("Loading, please wait...");
const value = getInitParam("cdm_expanded") ? "false" : "true";

View File

@ -150,7 +150,7 @@ class Af_Psql_Trgm extends Plugin {
new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) {
notify_info(transport.responseText);
Notify.info(transport.responseText);
}
});
//this.reset();

View File

@ -61,7 +61,7 @@ class Af_Readability extends Plugin {
new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) {
notify_info(transport.responseText);
Notify.info(transport.responseText);
}
});
//this.reset();

View File

@ -45,7 +45,7 @@ class Af_RedditImgur extends Plugin {
new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) {
notify_info(transport.responseText);
Notify.info(transport.responseText);
}
});
//this.reset();

View File

@ -216,7 +216,7 @@ class Af_Zz_ImgProxy extends Plugin {
new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) {
notify_info(transport.responseText);
Notify.info(transport.responseText);
}
});
//this.reset();

View File

@ -14,7 +14,7 @@ function exportData() {
style: "width: 600px",
prepare: function() {
notify_progress("Loading, please wait...");
Notify.progress("Loading, please wait...");
new Ajax.Request("backend.php", {
parameters: "op=pluginhandler&plugin=import_export&method=exportrun&offset=" + exported,
@ -53,7 +53,7 @@ function exportData() {
exception_error("exportData", e, transport.responseText);
}
notify('');
Notify.close();
} });
@ -81,7 +81,7 @@ function dataImportComplete(iframe) {
Element.hide(iframe);
notify('');
Notify.close();
if (dijit.byId('dataImportDlg'))
dijit.byId('dataImportDlg').destroyRecursive();
@ -112,7 +112,7 @@ function importData() {
alert(__("Please choose the file first."));
return false;
} else {
notify_progress("Importing, please wait...", true);
Notify.progress("Importing, please wait...", true);
Element.show("data_upload_iframe");

View File

@ -45,7 +45,7 @@ class Mail extends Plugin {
new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) {
notify_info(transport.responseText);
Notify.info(transport.responseText);
}
});
//this.reset();

View File

@ -29,7 +29,7 @@ function emailArticle(id) {
if (error) {
alert(__('Error sending email:') + ' ' + error);
} else {
notify_info('Your message has been sent.');
Notify.info('Your message has been sent.');
dialog.hide();
}

View File

@ -12,10 +12,10 @@ function editArticleNote(id) {
style: "width: 600px",
execute: function() {
if (this.validate()) {
notify_progress("Saving article note...", true);
Notify.progress("Saving article note...", true);
xhrJson("backend.php", this.attr('value'), (reply) => {
notify('');
Notify.close();
dialog.hide();
if (reply) {

View File

@ -63,7 +63,7 @@ class NSFW extends Plugin {
new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) {
notify_info(transport.responseText);
Notify.info(transport.responseText);
}
});
//this.reset();

View File

@ -12,7 +12,7 @@ function shareArticle(id) {
newurl: function() {
if (confirm(__("Generate new share URL for this article?"))) {
notify_progress("Trying to change URL...", true);
Notify.progress("Trying to change URL...", true);
const query = { op: "pluginhandler", plugin: "share", method: "newkey", id: id };
@ -34,10 +34,10 @@ function shareArticle(id) {
const img = $("SHARE-IMG-" + id);
if (img) img.src = img.src.replace("notshared.png", "share.png");
notify('');
Notify.close();
} else {
notify_error("Could not change URL.");
Notify.error("Could not change URL.");
}
}
});
@ -47,7 +47,7 @@ function shareArticle(id) {
unshare: function() {
if (confirm(__("Remove sharing for this article?"))) {
notify_progress("Trying to unshare...", true);
Notify.progress("Trying to unshare...", true);
const query = { op: "pluginhandler", plugin: "share", method: "unshare", id: id };

View File

@ -1,11 +1,11 @@
function clearArticleAccessKeys() {
if (confirm(__("This will invalidate all previously shared article URLs. Continue?"))) {
notify_progress("Clearing URLs...");
Notify.progress("Clearing URLs...");
const query = { op: "pluginhandler", plugin: "share", method: "clearArticleKeys" };
xhrPost("backend.php", query, () => {
notify_info("Shared URLs cleared.");
Notify.info("Shared URLs cleared.");
});
}

View File

@ -5,7 +5,7 @@ use strict;
while (<STDIN>) {
chomp;
if (/(__|notify_progress|notify|notify_info|notify_error)\(['"](.*?)['"]\)/) {
if (/(__|Notify.progress|Notify.msg|Notify.info|Notify.error)\(['"](.*?)['"]\)/) {
my $msg = $2;
$msg =~ s/\"/\\\"/g;

View File

@ -3,9 +3,9 @@ TEMPLATE=messages.pot
xgettext -kT_js_decl -kT_sprintf -k_ngettext:1,2 -kT_ngettext:1,2 -k__ -L PHP -o $TEMPLATE *.php include/*.php `find classes -iname '*.php'` `find plugins -iname '*.php'`
xgettext --from-code utf-8 -k__ -knotify_info -knotify_progress -kngettext -L Perl -j -o $TEMPLATE js/*.js `find plugins -iname '*.js'`
xgettext --from-code utf-8 -k__ -kNotify.info -kNotify.error -kNotify.progress -kngettext -L Perl -j -o $TEMPLATE js/*.js `find plugins -iname '*.js'`
xgettext --from-code utf-8 -k__ -knotify_info -knotify_progress -kngettext -L Java -j -o $TEMPLATE js/*.js `find plugins -iname '*.js'`
xgettext --from-code utf-8 -k__ -kNotify.info -kNotify.error -kNotify.progress -kngettext -L Java -j -o $TEMPLATE js/*.js `find plugins -iname '*.js'`
update_lang() {
if [ -f $1.po ]; then