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\"> print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
evt.preventDefault(); evt.preventDefault();
if (this.validate()) { if (this.validate()) {
notify_progress('Saving data...', true); Notify.progress('Saving data...', true);
new Ajax.Request('backend.php', { new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()), parameters: dojo.objectToQuery(this.getValues()),
@ -249,12 +249,12 @@ class Pref_Prefs extends Handler_Protected {
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\"> print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
evt.preventDefault(); evt.preventDefault();
if (this.validate()) { if (this.validate()) {
notify_progress('Changing password...', true); Notify.progress('Changing password...', true);
new Ajax.Request('backend.php', { new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()), parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) { onComplete: function(transport) {
notify(''); Notify.close();
if (transport.responseText.indexOf('ERROR: ') == 0) { if (transport.responseText.indexOf('ERROR: ') == 0) {
$('pwd_change_infobox').innerHTML = $('pwd_change_infobox').innerHTML =
@ -316,14 +316,14 @@ class Pref_Prefs extends Handler_Protected {
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\"> print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
evt.preventDefault(); evt.preventDefault();
if (this.validate()) { if (this.validate()) {
notify_progress('Disabling OTP', true); Notify.progress('Disabling OTP', true);
new Ajax.Request('backend.php', { new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()), parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) { onComplete: function(transport) {
notify(''); Notify.close();
if (transport.responseText.indexOf('ERROR: ') == 0) { if (transport.responseText.indexOf('ERROR: ') == 0) {
notify_error(transport.responseText.replace('ERROR: ', '')); Notify.error(transport.responseText.replace('ERROR: ', ''));
} else { } else {
window.location.reload(); window.location.reload();
} }
@ -367,14 +367,14 @@ class Pref_Prefs extends Handler_Protected {
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\"> print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
evt.preventDefault(); evt.preventDefault();
if (this.validate()) { if (this.validate()) {
notify_progress('Saving data...', true); Notify.progress('Saving data...', true);
new Ajax.Request('backend.php', { new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()), parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) { onComplete: function(transport) {
notify(''); Notify.close();
if (transport.responseText.indexOf('ERROR:') == 0) { if (transport.responseText.indexOf('ERROR:') == 0) {
notify_error(transport.responseText.replace('ERROR:', '')); Notify.error(transport.responseText.replace('ERROR:', ''));
} else { } else {
window.location.reload(); window.location.reload();
} }
@ -441,7 +441,7 @@ class Pref_Prefs extends Handler_Protected {
if (msg == 'PREFS_NEED_RELOAD') { if (msg == 'PREFS_NEED_RELOAD') {
window.location.reload(); window.location.reload();
} else { } 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\"> print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
evt.preventDefault(); evt.preventDefault();
if (this.validate()) { if (this.validate()) {
notify_progress('Saving data...', true); Notify.progress('Saving data...', true);
new Ajax.Request('backend.php', { new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()), parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) { onComplete: function(transport) {
notify(''); Notify.close();
if (confirm(__('Selected plugins have been enabled. Reload?'))) { if (confirm(__('Selected plugins have been enabled. Reload?'))) {
window.location.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; //const unread_in_buffer = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length;
//request_counters(unread_in_buffer == 0); //request_counters(unread_in_buffer == 0);
notify(""); Notify.close();
} catch (e) { } catch (e) {
exception_error(e); exception_error(e);
@ -187,11 +187,11 @@ define(["dojo/_base/declare"], function (declare) {
style: "width: 600px", style: "width: 600px",
execute: function () { execute: function () {
if (this.validate()) { if (this.validate()) {
notify_progress("Saving article tags...", true); Notify.progress("Saving article tags...", true);
xhrPost("backend.php", this.attr('value'), (transport) => { xhrPost("backend.php", this.attr('value'), (transport) => {
try { try {
notify(''); Notify.close();
dialog.hide(); dialog.hide();
const data = JSON.parse(transport.responseText); const data = JSON.parse(transport.responseText);

View File

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

View File

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

View File

@ -381,7 +381,7 @@ define(["dojo/_base/declare"], function (declare) {
// unpack visible articles, fill buffer more, etc // unpack visible articles, fill buffer more, etc
this.scrollHandler(); this.scrollHandler();
notify(""); Notify.close();
}, },
reverse: function() { reverse: function() {
const toolbar = document.forms["main_toolbar_form"]; const toolbar = document.forms["main_toolbar_form"];
@ -435,7 +435,7 @@ define(["dojo/_base/declare"], function (declare) {
cmode: cmode, ids: ids.toString() cmode: cmode, ids: ids.toString()
}; };
notify_progress("Loading, please wait..."); Notify.progress("Loading, please wait...");
xhrPost("backend.php", query, (transport) => { xhrPost("backend.php", query, (transport) => {
Utils.handleRpcJson(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) => { xhrPost("backend.php", { op: "pref-feeds", search: search }, (transport) => {
dijit.byId('feedConfigTab').attr('content', transport.responseText); dijit.byId('feedConfigTab').attr('content', transport.responseText);
notify(""); Notify.close();
}); });
}, },
checkItemAcceptance: function(target, source, position) { checkItemAcceptance: function(target, source, position) {
@ -119,14 +119,14 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
} }
}, },
resetFeedOrder: function() { resetFeedOrder: function() {
notify_progress("Loading, please wait..."); Notify.progress("Loading, please wait...");
xhrPost("backend.php", {op: "pref-feeds", method: "feedsortreset"}, () => { xhrPost("backend.php", {op: "pref-feeds", method: "feedsortreset"}, () => {
this.reload(); this.reload();
}); });
}, },
resetCatOrder: function() { resetCatOrder: function() {
notify_progress("Loading, please wait..."); Notify.progress("Loading, please wait...");
xhrPost("backend.php", {op: "pref-feeds", method: "catsortreset"}, () => { xhrPost("backend.php", {op: "pref-feeds", method: "catsortreset"}, () => {
this.reload(); this.reload();
@ -134,10 +134,10 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
}, },
removeCategory: function(id, item) { removeCategory: function(id, item) {
if (confirm(__("Remove category %s? Any nested feeds would be placed into Uncategorized.").replace("%s", item.name))) { 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}, () => { xhrPost("backend.php", {op: "pref-feeds", method: "removeCat", ids: id}, () => {
notify(''); Notify.close();
this.reload(); this.reload();
}); });
} }
@ -148,7 +148,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
if (sel_rows.length > 0) { if (sel_rows.length > 0) {
if (confirm(__("Unsubscribe from selected feeds?"))) { if (confirm(__("Unsubscribe from selected feeds?"))) {
notify_progress("Unsubscribing from selected feeds...", true); Notify.progress("Unsubscribing from selected feeds...", true);
const query = { const query = {
op: "pref-feeds", method: "remove", 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 (sel_rows.length > 0) {
if (confirm(__("Remove selected categories?"))) { if (confirm(__("Remove selected categories?"))) {
notify_progress("Removing selected categories..."); Notify.progress("Removing selected categories...");
const query = { const query = {
op: "pref-feeds", method: "removeCat", op: "pref-feeds", method: "removeCat",
@ -227,7 +227,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
return; return;
} }
notify(""); Notify.close();
if (rows.length > 1) { if (rows.length > 1) {
return this.editMultiple(); return this.editMultiple();
@ -243,13 +243,13 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
return; return;
} }
notify_progress("Loading, please wait..."); Notify.progress("Loading, please wait...");
if (dijit.byId("feedEditDlg")) if (dijit.byId("feedEditDlg"))
dijit.byId("feedEditDlg").destroyRecursive(); dijit.byId("feedEditDlg").destroyRecursive();
xhrPost("backend.php", {op: "pref-feeds", method: "editfeeds", ids: rows.toString()}, (transport) => { xhrPost("backend.php", {op: "pref-feeds", method: "editfeeds", ids: rows.toString()}, (transport) => {
notify(""); Notify.close();
const dialog = new dijit.Dialog({ const dialog = new dijit.Dialog({
id: "feedEditDlg", id: "feedEditDlg",
@ -289,7 +289,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
query[key] = ["off"]; query[key] = ["off"];
}); });
notify_progress("Saving data...", true); Notify.progress("Saving data...", true);
xhrPost("backend.php", query, () => { xhrPost("backend.php", query, () => {
dialog.hide(); dialog.hide();
@ -312,7 +312,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
if (new_name && new_name != item.name) { 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 }, () => { xhrPost("backend.php", { op: 'pref-feeds', method: 'renamecat', id: id, title: new_name }, () => {
this.reload(); this.reload();
@ -323,10 +323,10 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
const title = prompt(__("Category title:")); const title = prompt(__("Category title:"));
if (title) { if (title) {
notify_progress("Creating category..."); Notify.progress("Creating category...");
xhrPost("backend.php", {op: "pref-feeds", method: "addCat", cat: title}, () => { xhrPost("backend.php", {op: "pref-feeds", method: "addCat", cat: title}, () => {
notify(''); Notify.close();
this.reload(); this.reload();
}); });
} }
@ -344,10 +344,10 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
style: "width: 600px", style: "width: 600px",
execute: function () { execute: function () {
if (this.validate()) { if (this.validate()) {
notify_progress(__("Subscribing to feeds..."), true); Notify.progress(__("Subscribing to feeds..."), true);
xhrPost("backend.php", this.attr('value'), () => { xhrPost("backend.php", this.attr('value'), () => {
notify(""); Notify.close();
dijit.byId("feedTree").reload(); dijit.byId("feedTree").reload();
dialog.hide(); dialog.hide();
}); });
@ -376,7 +376,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
if (sel_rows.length > 0) { if (sel_rows.length > 0) {
if (confirm(__("Remove selected feeds?"))) { if (confirm(__("Remove selected feeds?"))) {
notify_progress("Removing selected feeds...", true); Notify.progress("Removing selected feeds...", true);
const query = { const query = {
op: "pref-feeds", method: "remove", op: "pref-feeds", method: "remove",
@ -384,7 +384,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
}; };
xhrPost("backend.php", query, () => { xhrPost("backend.php", query, () => {
notify(''); Notify.close();
dijit.byId("feedTree").reload(); dijit.byId("feedTree").reload();
dialog.hide(); 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) => { xhrPost("backend.php", { op: "pref-filters", search: search }, (transport) => {
dijit.byId('filterConfigTab').attr('content', transport.responseText); dijit.byId('filterConfigTab').attr('content', transport.responseText);
notify(""); Notify.close();
}); });
}, },
resetFilterOrder: function() { resetFilterOrder: function() {
notify_progress("Loading, please wait..."); Notify.progress("Loading, please wait...");
xhrPost("backend.php", {op: "pref-filters", method: "filtersortreset"}, () => { xhrPost("backend.php", {op: "pref-filters", method: "filtersortreset"}, () => {
this.reload(); this.reload();
@ -112,7 +112,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
} }
if (confirm(__("Combine selected filters?"))) { if (confirm(__("Combine selected filters?"))) {
notify_progress("Joining filters..."); Notify.progress("Joining filters...");
xhrPost("backend.php", {op: "pref-filters", method: "join", ids: rows.toString()}, () => { xhrPost("backend.php", {op: "pref-filters", method: "join", ids: rows.toString()}, () => {
this.reload(); this.reload();
@ -132,7 +132,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
return; return;
} }
notify(""); Notify.close();
this.editFilter(rows[0]); this.editFilter(rows[0]);
}, },
@ -192,7 +192,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
if (confirm(msg)) { if (confirm(msg)) {
this.hide(); this.hide();
notify_progress("Removing filter..."); Notify.progress("Removing filter...");
const query = {op: "pref-filters", method: "remove", ids: this.attr('value').id}; 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 () { execute: function () {
if (this.validate()) { if (this.validate()) {
notify_progress("Saving data...", true); Notify.progress("Saving data...", true);
xhrPost("backend.php", dojo.formToObject("filter_edit_form"), () => { xhrPost("backend.php", dojo.formToObject("filter_edit_form"), () => {
dialog.hide(); dialog.hide();
@ -238,7 +238,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
if (sel_rows.length > 0) { if (sel_rows.length > 0) {
if (confirm(__("Remove selected filters?"))) { if (confirm(__("Remove selected filters?"))) {
notify_progress("Removing selected filters..."); Notify.progress("Removing selected filters...");
const query = { const query = {
op: "pref-filters", method: "remove", op: "pref-filters", method: "remove",

View File

@ -2,10 +2,10 @@ define(["dojo/_base/declare"], function (declare) {
return declare("fox.PrefHelpers", null, { return declare("fox.PrefHelpers", null, {
clearFeedAccessKeys: function() { clearFeedAccessKeys: function() {
if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) { 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"}, () => { 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() { updateEventLog: function() {
xhrPost("backend.php", { op: "pref-system" }, (transport) => { xhrPost("backend.php", { op: "pref-system" }, (transport) => {
dijit.byId('systemConfigTab').attr('content', transport.responseText); dijit.byId('systemConfigTab').attr('content', transport.responseText);
notify(""); Notify.close();
}); });
}, },
clearEventLog: function() { clearEventLog: function() {
if (confirm(__("Clear event log?"))) { if (confirm(__("Clear event log?"))) {
notify_progress("Loading, please wait..."); Notify.progress("Loading, please wait...");
xhrPost("backend.php", {op: "pref-system", method: "clearLog"}, () => { xhrPost("backend.php", {op: "pref-system", method: "clearLog"}, () => {
this.updateEventLog(); this.updateEventLog();
@ -47,7 +47,7 @@ define(["dojo/_base/declare"], function (declare) {
if (sel_rows.length > 0) { if (sel_rows.length > 0) {
if (confirm(__("Remove selected profiles? Active and default profiles will not be removed."))) { 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 = { const query = {
op: "rpc", method: "remprofiles", op: "rpc", method: "remprofiles",
@ -55,7 +55,7 @@ define(["dojo/_base/declare"], function (declare) {
}; };
xhrPost("backend.php", query, () => { xhrPost("backend.php", query, () => {
notify(''); Notify.close();
Prefs.editProfiles(); Prefs.editProfiles();
}); });
} }
@ -69,7 +69,7 @@ define(["dojo/_base/declare"], function (declare) {
if (sel_rows.length == 1) { if (sel_rows.length == 1) {
if (confirm(__("Activate selected profile?"))) { 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()}, () => { xhrPost("backend.php", {op: "rpc", method: "setprofile", id: sel_rows.toString()}, () => {
window.location.reload(); window.location.reload();
@ -82,12 +82,12 @@ define(["dojo/_base/declare"], function (declare) {
}, },
addProfile: function () { addProfile: function () {
if (this.validate()) { if (this.validate()) {
notify_progress("Creating profile...", true); Notify.progress("Creating profile...", true);
const query = {op: "rpc", method: "addprofile", title: dialog.attr('value').newprofile}; const query = {op: "rpc", method: "addprofile", title: dialog.attr('value').newprofile};
xhrPost("backend.php", query, () => { xhrPost("backend.php", query, () => {
notify(''); Notify.close();
Prefs.editProfiles(); Prefs.editProfiles();
}); });
@ -113,7 +113,7 @@ define(["dojo/_base/declare"], function (declare) {
title: __("Customize stylesheet"), title: __("Customize stylesheet"),
style: "width: 600px", style: "width: 600px",
execute: function () { execute: function () {
notify_progress('Saving data...', true); Notify.progress('Saving data...', true);
xhrPost("backend.php", this.attr('value'), () => { xhrPost("backend.php", this.attr('value'), () => {
window.location.reload(); window.location.reload();
@ -129,13 +129,13 @@ define(["dojo/_base/declare"], function (declare) {
if (confirm(__("Reset to defaults?"))) { if (confirm(__("Reset to defaults?"))) {
xhrPost("backend.php", {op: "pref-prefs", method: "resetconfig"}, (transport) => { xhrPost("backend.php", {op: "pref-prefs", method: "resetconfig"}, (transport) => {
Prefs.refresh(); Prefs.refresh();
notify_info(transport.responseText); Notify.info(transport.responseText);
}); });
} }
}, },
clearPluginData: function(name) { clearPluginData: function(name) {
if (confirm(__("Clear stored data for this plugin?"))) { 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}, () => { xhrPost("backend.php", {op: "pref-prefs", method: "clearplugindata", name: name}, () => {
Prefs.refresh(); Prefs.refresh();
@ -145,7 +145,7 @@ define(["dojo/_base/declare"], function (declare) {
refresh: function() { refresh: function() {
xhrPost("backend.php", { op: "pref-prefs" }, (transport) => { xhrPost("backend.php", { op: "pref-prefs" }, (transport) => {
dijit.byId('genConfigTab').attr('content', transport.responseText); 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() { reload: function() {
xhrPost("backend.php", { op: "pref-labels" }, (transport) => { xhrPost("backend.php", { op: "pref-labels" }, (transport) => {
dijit.byId('labelConfigTab').attr('content', transport.responseText); dijit.byId('labelConfigTab').attr('content', transport.responseText);
notify(""); Notify.close();
}); });
}, },
editLabel: function(id) { editLabel: function(id) {
@ -142,7 +142,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f
if (sel_rows.length > 0) { if (sel_rows.length > 0) {
if (confirm(__("Remove selected labels?"))) { if (confirm(__("Remove selected labels?"))) {
notify_progress("Removing selected labels..."); Notify.progress("Removing selected labels...");
const query = { const query = {
op: "pref-labels", method: "remove", 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) => { xhrPost("backend.php", { op: "pref-users", sort: sort, search: search }, (transport) => {
dijit.byId('userConfigTab').attr('content', transport.responseText); dijit.byId('userConfigTab').attr('content', transport.responseText);
notify(""); Notify.close();
}); });
}, },
add: function() { add: function() {
const login = prompt(__("Please enter username:"), ""); const login = prompt(__("Please enter username:"), "");
if (login) { if (login) {
notify_progress("Adding user..."); Notify.progress("Adding user...");
xhrPost("backend.php", {op: "pref-users", method: "add", login: login}, (transport) => { xhrPost("backend.php", {op: "pref-users", method: "add", login: login}, (transport) => {
alert(transport.responseText); alert(transport.responseText);
@ -38,7 +38,7 @@ define(["dojo/_base/declare"], function (declare) {
style: "width: 600px", style: "width: 600px",
execute: function () { execute: function () {
if (this.validate()) { if (this.validate()) {
notify_progress("Saving data...", true); Notify.progress("Saving data...", true);
xhrPost("backend.php", dojo.formToObject("user_edit_form"), (transport) => { xhrPost("backend.php", dojo.formToObject("user_edit_form"), (transport) => {
dialog.hide(); dialog.hide();
@ -65,12 +65,12 @@ define(["dojo/_base/declare"], function (declare) {
} }
if (confirm(__("Reset password of selected user?"))) { 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]; const id = rows[0];
xhrPost("backend.php", {op: "pref-users", method: "resetPass", id: id}, (transport) => { xhrPost("backend.php", {op: "pref-users", method: "resetPass", id: id}, (transport) => {
notify(''); Notify.close();
alert(transport.responseText); alert(transport.responseText);
}); });
@ -81,7 +81,7 @@ define(["dojo/_base/declare"], function (declare) {
if (sel_rows.length > 0) { if (sel_rows.length > 0) {
if (confirm(__("Remove selected users? Neither default admin nor your account will be removed."))) { 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 = { const query = {
op: "pref-users", method: "remove", op: "pref-users", method: "remove",

View File

@ -110,7 +110,7 @@ define(["dojo/_base/declare"], function (declare) {
dialog.show(); dialog.show();
}, },
displayDlg: function(title, id, param, callback) { 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}; const query = {op: "dlg", method: id, param: param};
@ -143,7 +143,7 @@ define(["dojo/_base/declare"], function (declare) {
dialog.show(); dialog.show();
notify(""); Notify.close();
if (callback) callback(transport); if (callback) callback(transport);
} catch (e) { } catch (e) {
@ -213,14 +213,14 @@ define(["dojo/_base/declare"], function (declare) {
if (netalert) if (netalert)
netalert.show(); netalert.show();
else else
notify_error("Communication problem with server."); Notify.error("Communication problem with server.");
} }
} catch (e) { } catch (e) {
if (netalert) if (netalert)
netalert.show(); netalert.show();
else else
notify_error("Communication problem with server."); Notify.error("Communication problem with server.");
console.error(e); console.error(e);
} }
@ -238,7 +238,7 @@ define(["dojo/_base/declare"], function (declare) {
console.log("RI:", k, "=>", v); console.log("RI:", k, "=>", v);
if (k == "daemon_is_running" && v != 1) { 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; return;
} }
@ -253,7 +253,7 @@ define(["dojo/_base/declare"], function (declare) {
} }
if (k == "daemon_stamp_ok" && v != 1) { 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; return;
} }

View File

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

View File

@ -85,7 +85,7 @@ const App = {
initSecondStage: function() { initSecondStage: function() {
document.onkeydown = () => { App.hotkeyHandler(event) }; document.onkeydown = () => { App.hotkeyHandler(event) };
Utils.setLoadingProgress(50); Utils.setLoadingProgress(50);
notify(""); Notify.close();
let tab = Utils.urlParam('tab'); let tab = Utils.urlParam('tab');
@ -154,7 +154,7 @@ function opmlImportComplete(iframe) {
Element.show(iframe); Element.show(iframe);
notify(''); Notify.close();
if (dijit.byId('opmlImportDlg')) if (dijit.byId('opmlImportDlg'))
dijit.byId('opmlImportDlg').destroyRecursive(); dijit.byId('opmlImportDlg').destroyRecursive();
@ -185,7 +185,7 @@ function opmlImport() {
alert(__("Please choose an OPML file first.")); alert(__("Please choose an OPML file first."));
return false; return false;
} else { } else {
notify_progress("Importing, please wait...", true); Notify.progress("Importing, please wait...", true);
Element.show("upload_iframe"); Element.show("upload_iframe");
@ -195,7 +195,7 @@ function opmlImport() {
function opmlRegenKey() { function opmlRegenKey() {
if (confirm(__("Replace current OPML publishing address with a new one?"))) { 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) => { xhrJson("backend.php", { op: "pref-feeds", method: "regenOPMLKey" }, (reply) => {
if (reply) { if (reply) {
@ -208,10 +208,10 @@ function opmlRegenKey() {
new Effect.Highlight(e); new Effect.Highlight(e);
notify(''); Notify.close();
} else { } 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"); Utils.helpDialog("main");
}; };
this.hotkey_actions["toggle_combined_mode"] = function () { this.hotkey_actions["toggle_combined_mode"] = function () {
notify_progress("Loading, please wait..."); Notify.progress("Loading, please wait...");
const value = App.isCombinedMode() ? "false" : "true"; const value = App.isCombinedMode() ? "false" : "true";
@ -491,7 +491,7 @@ const App = {
}) })
}; };
this.hotkey_actions["toggle_cdm_expanded"] = function () { this.hotkey_actions["toggle_cdm_expanded"] = function () {
notify_progress("Loading, please wait..."); Notify.progress("Loading, please wait...");
const value = getInitParam("cdm_expanded") ? "false" : "true"; const value = getInitParam("cdm_expanded") ? "false" : "true";

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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