|
|
@ -89,9 +89,6 @@ const Utils = {
|
|
|
|
|
|
|
|
|
|
|
|
if (!this.hotkey_prefix && hotkeys_map[0].indexOf(keychar) != -1) {
|
|
|
|
if (!this.hotkey_prefix && hotkeys_map[0].indexOf(keychar) != -1) {
|
|
|
|
|
|
|
|
|
|
|
|
const date = new Date();
|
|
|
|
|
|
|
|
const ts = Math.round(date.getTime() / 1000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.hotkey_prefix = keychar;
|
|
|
|
this.hotkey_prefix = keychar;
|
|
|
|
$("cmdline").innerHTML = keychar;
|
|
|
|
$("cmdline").innerHTML = keychar;
|
|
|
|
Element.show("cmdline");
|
|
|
|
Element.show("cmdline");
|
|
|
@ -123,9 +120,11 @@ const Utils = {
|
|
|
|
let action_name = false;
|
|
|
|
let action_name = false;
|
|
|
|
|
|
|
|
|
|
|
|
for (const sequence in hotkeys_map[1]) {
|
|
|
|
for (const sequence in hotkeys_map[1]) {
|
|
|
|
if (sequence == hotkey_full) {
|
|
|
|
if (hotkeys_map[1].hasOwnProperty(sequence)) {
|
|
|
|
action_name = hotkeys_map[1][sequence];
|
|
|
|
if (sequence == hotkey_full) {
|
|
|
|
break;
|
|
|
|
action_name = hotkeys_map[1][sequence];
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -282,43 +281,46 @@ const Utils = {
|
|
|
|
//console.log("parsing runtime info...");
|
|
|
|
//console.log("parsing runtime info...");
|
|
|
|
|
|
|
|
|
|
|
|
for (const k in data) {
|
|
|
|
for (const k in data) {
|
|
|
|
const v = data[k];
|
|
|
|
if (data.hasOwnProperty(k)) {
|
|
|
|
|
|
|
|
const v = data[k];
|
|
|
|
|
|
|
|
|
|
|
|
if (k == "dep_ts" && parseInt(getInitParam("dep_ts")) > 0) {
|
|
|
|
console.log("RI:", k, "=>", v);
|
|
|
|
if (parseInt(getInitParam("dep_ts")) < parseInt(v) && getInitParam("reload_on_ts_change")) {
|
|
|
|
|
|
|
|
window.location.reload();
|
|
|
|
if (k == "dep_ts" && parseInt(getInitParam("dep_ts")) > 0) {
|
|
|
|
|
|
|
|
if (parseInt(getInitParam("dep_ts")) < parseInt(v) && getInitParam("reload_on_ts_change")) {
|
|
|
|
|
|
|
|
window.location.reload();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (k == "update_result") {
|
|
|
|
if (k == "update_result") {
|
|
|
|
const updatesIcon = dijit.byId("updatesIcon").domNode;
|
|
|
|
const updatesIcon = dijit.byId("updatesIcon").domNode;
|
|
|
|
|
|
|
|
|
|
|
|
if (v) {
|
|
|
|
if (v) {
|
|
|
|
Element.show(updatesIcon);
|
|
|
|
Element.show(updatesIcon);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Element.hide(updatesIcon);
|
|
|
|
Element.hide(updatesIcon);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (k == "max_feed_id" || k == "num_feeds") {
|
|
|
|
if (k == "max_feed_id" || k == "num_feeds") {
|
|
|
|
if (init_params[k] != v) {
|
|
|
|
if (init_params[k] != v) {
|
|
|
|
console.log("feed count changed, need to reload feedlist.");
|
|
|
|
console.log("feed count changed, need to reload feedlist.");
|
|
|
|
Feeds.reload();
|
|
|
|
Feeds.reload();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
init_params[k] = v;
|
|
|
|
init_params[k] = v;
|
|
|
|
notify('');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
PluginHost.run(PluginHost.HOOK_RUNTIME_INFO_LOADED, data);
|
|
|
|
PluginHost.run(PluginHost.HOOK_RUNTIME_INFO_LOADED, data);
|
|
|
@ -349,7 +351,7 @@ const Utils = {
|
|
|
|
if (params.hasOwnProperty(k)) {
|
|
|
|
if (params.hasOwnProperty(k)) {
|
|
|
|
switch (k) {
|
|
|
|
switch (k) {
|
|
|
|
case "label_base_index":
|
|
|
|
case "label_base_index":
|
|
|
|
_label_base_index = parseInt(params[k])
|
|
|
|
_label_base_index = parseInt(params[k]);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "hotkeys":
|
|
|
|
case "hotkeys":
|
|
|
|
// filter mnemonic definitions (used for help panel) from hotkeys map
|
|
|
|
// filter mnemonic definitions (used for help panel) from hotkeys map
|
|
|
@ -357,8 +359,10 @@ const Utils = {
|
|
|
|
|
|
|
|
|
|
|
|
const tmp = [];
|
|
|
|
const tmp = [];
|
|
|
|
for (const sequence in params[k][1]) {
|
|
|
|
for (const sequence in params[k][1]) {
|
|
|
|
const filtered = sequence.replace(/\|.*$/, "");
|
|
|
|
if (params[k][1].hasOwnProperty(sequence)) {
|
|
|
|
tmp[filtered] = params[k][1][sequence];
|
|
|
|
const filtered = sequence.replace(/\|.*$/, "");
|
|
|
|
|
|
|
|
tmp[filtered] = params[k][1][sequence];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
params[k][1] = tmp;
|
|
|
|
params[k][1] = tmp;
|
|
|
@ -458,8 +462,10 @@ const CommonDialogs = {
|
|
|
|
|
|
|
|
|
|
|
|
let count = 0;
|
|
|
|
let count = 0;
|
|
|
|
for (const feedUrl in feeds) {
|
|
|
|
for (const feedUrl in feeds) {
|
|
|
|
select.addOption({value: feedUrl, label: feeds[feedUrl]});
|
|
|
|
if (feeds.hasOwnProperty(feedUrl)) {
|
|
|
|
count++;
|
|
|
|
select.addOption({value: feedUrl, label: feeds[feedUrl]});
|
|
|
|
|
|
|
|
count++;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Effect.Appear('feedDlg_feedsContainer', {duration: 0.5});
|
|
|
|
Effect.Appear('feedDlg_feedsContainer', {duration: 0.5});
|
|
|
@ -687,7 +693,7 @@ const CommonDialogs = {
|
|
|
|
|
|
|
|
|
|
|
|
const query = {op: "pref-feeds", quiet: 1, method: "remove", ids: feed_id};
|
|
|
|
const query = {op: "pref-feeds", quiet: 1, method: "remove", ids: feed_id};
|
|
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", query, (transport) => {
|
|
|
|
xhrPost("backend.php", query, () => {
|
|
|
|
if (dijit.byId("feedEditDlg")) dijit.byId("feedEditDlg").hide();
|
|
|
|
if (dijit.byId("feedEditDlg")) dijit.byId("feedEditDlg").hide();
|
|
|
|
|
|
|
|
|
|
|
|
if (App.isPrefs()) {
|
|
|
|
if (App.isPrefs()) {
|
|
|
@ -752,10 +758,10 @@ const CommonDialogs = {
|
|
|
|
const e = $('gen_feed_url');
|
|
|
|
const e = $('gen_feed_url');
|
|
|
|
|
|
|
|
|
|
|
|
if (new_link) {
|
|
|
|
if (new_link) {
|
|
|
|
e.innerHTML = e.innerHTML.replace(/\&key=.*$/,
|
|
|
|
e.innerHTML = e.innerHTML.replace(/&key=.*$/,
|
|
|
|
"&key=" + new_link);
|
|
|
|
"&key=" + new_link);
|
|
|
|
|
|
|
|
|
|
|
|
e.href = e.href.replace(/\&key=.*$/,
|
|
|
|
e.href = e.href.replace(/&key=.*$/,
|
|
|
|
"&key=" + new_link);
|
|
|
|
"&key=" + new_link);
|
|
|
|
|
|
|
|
|
|
|
|
new Effect.Highlight(e);
|
|
|
|
new Effect.Highlight(e);
|
|
|
@ -1509,7 +1515,7 @@ function removeFeedIcon(id) {
|
|
|
|
|
|
|
|
|
|
|
|
const query = { op: "pref-feeds", method: "removeicon", feed_id: id };
|
|
|
|
const query = { op: "pref-feeds", method: "removeicon", feed_id: id };
|
|
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", query, (transport) => {
|
|
|
|
xhrPost("backend.php", query, () => {
|
|
|
|
notify_info("Feed icon removed.");
|
|
|
|
notify_info("Feed icon removed.");
|
|
|
|
if (App.isPrefs()) {
|
|
|
|
if (App.isPrefs()) {
|
|
|
|
Feeds.reload();
|
|
|
|
Feeds.reload();
|
|
|
|