|
|
@ -369,52 +369,48 @@ const CommonDialogs = {
|
|
|
|
|
|
|
|
|
|
|
|
dialog.show();
|
|
|
|
dialog.show();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
genUrlChangeKey: function(feed, is_cat) {
|
|
|
|
publishedOPML: function() {
|
|
|
|
if (confirm(__("Generate new syndication address for this feed?"))) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Notify.progress("Trying to change address...", true);
|
|
|
|
Notify.progress("Loading, please wait...", true);
|
|
|
|
|
|
|
|
|
|
|
|
const query = {op: "pref-feeds", method: "regenFeedKey", id: feed, is_cat: is_cat};
|
|
|
|
xhrJson("backend.php", {op: "pref-feeds", method: "getOPMLKey"}, (reply) => {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const dialog = new fox.SingleUseDialog({
|
|
|
|
|
|
|
|
title: __("Public OPML URL"),
|
|
|
|
|
|
|
|
regenOPMLKey: function() {
|
|
|
|
|
|
|
|
if (confirm(__("Replace current OPML publishing address with a new one?"))) {
|
|
|
|
|
|
|
|
Notify.progress("Trying to change address...", true);
|
|
|
|
|
|
|
|
|
|
|
|
xhrJson("backend.php", query, (reply) => {
|
|
|
|
xhrJson("backend.php", {op: "pref-feeds", method: "regenOPMLKey"}, (reply) => {
|
|
|
|
|
|
|
|
if (reply) {
|
|
|
|
const new_link = reply.link;
|
|
|
|
const new_link = reply.link;
|
|
|
|
const e = $('gen_feed_url');
|
|
|
|
const target = this.domNode.querySelector('.generated_url');
|
|
|
|
|
|
|
|
|
|
|
|
if (new_link) {
|
|
|
|
if (new_link && target) {
|
|
|
|
e.innerHTML = e.innerHTML.replace(/&key=.*$/,
|
|
|
|
target.href = new_link;
|
|
|
|
"&key=" + new_link);
|
|
|
|
target.innerHTML = new_link;
|
|
|
|
|
|
|
|
|
|
|
|
e.href = e.href.replace(/&key=.*$/,
|
|
|
|
new Effect.Highlight(target);
|
|
|
|
"&key=" + new_link);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new Effect.Highlight(e);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Notify.close();
|
|
|
|
Notify.close();
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Notify.error("Could not change feed URL.");
|
|
|
|
Notify.error("Could not change feed URL.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
publishedOPML: function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Notify.progress("Loading, please wait...", true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xhrJson("backend.php", {op: "pref-feeds", method: "getOPMLKey"}, (reply) => {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const dialog = new fox.SingleUseDialog({
|
|
|
|
|
|
|
|
title: __("Public OPML URL"),
|
|
|
|
|
|
|
|
content: `
|
|
|
|
content: `
|
|
|
|
<header>${__("Your Public OPML URL is:")}</header>
|
|
|
|
<header>${__("Your Public OPML URL is:")}</header>
|
|
|
|
<section>
|
|
|
|
<section>
|
|
|
|
<div class='panel text-center'>
|
|
|
|
<div class='panel text-center'>
|
|
|
|
<a id='pub_opml_url' href="${App.escapeHtml(reply.link)}" target='_blank'>${reply.link}</a>
|
|
|
|
<a class='generated_url' href="${App.escapeHtml(reply.link)}" target='_blank'>${App.escapeHtml(reply.link)}</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
<footer class='text-center'>
|
|
|
|
<footer class='text-center'>
|
|
|
|
<button dojoType='dijit.form.Button' onclick="return Helpers.OPML.changeKey()">
|
|
|
|
<button dojoType='dijit.form.Button' onclick="return App.dialogOf(this).regenOPMLKey()">
|
|
|
|
${__('Generate new URL')}
|
|
|
|
${__('Generate new URL')}
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
<button dojoType='dijit.form.Button' type='submit' class='alt-primary'>
|
|
|
|
<button dojoType='dijit.form.Button' type='submit' class='alt-primary'>
|
|
|
@ -441,18 +437,47 @@ const CommonDialogs = {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const dialog = new fox.SingleUseDialog({
|
|
|
|
const dialog = new fox.SingleUseDialog({
|
|
|
|
title: __("Show as feed"),
|
|
|
|
title: __("Show as feed"),
|
|
|
|
|
|
|
|
regenFeedKey: function(feed, is_cat) {
|
|
|
|
|
|
|
|
if (confirm(__("Generate new syndication address for this feed?"))) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Notify.progress("Trying to change address...", true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const query = {op: "pref-feeds", method: "regenFeedKey", id: feed, is_cat: is_cat};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xhrJson("backend.php", query, (reply) => {
|
|
|
|
|
|
|
|
const new_link = reply.link;
|
|
|
|
|
|
|
|
const target = this.domNode.querySelector(".generated_url");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (new_link && target) {
|
|
|
|
|
|
|
|
target.innerHTML = target.innerHTML.replace(/&key=.*$/,
|
|
|
|
|
|
|
|
"&key=" + new_link);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
target.href = target.href.replace(/&key=.*$/,
|
|
|
|
|
|
|
|
"&key=" + new_link);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new Effect.Highlight(target);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Notify.close();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Notify.error("Could not change feed URL.");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
},
|
|
|
|
content: `
|
|
|
|
content: `
|
|
|
|
<header>${__("%s can be accessed via the following secret URL:").replace("%s", App.escapeHtml(reply.title))}</header>
|
|
|
|
<header>${__("%s can be accessed via the following secret URL:").replace("%s", App.escapeHtml(reply.title))}</header>
|
|
|
|
<section>
|
|
|
|
<section>
|
|
|
|
<div class='panel text-center'>
|
|
|
|
<div class='panel text-center'>
|
|
|
|
<a id='gen_feed_url' href="${App.escapeHtml(reply.link)}" target='_blank'>${App.escapeHtml(reply.link)}</a>
|
|
|
|
<a class='generated_url' href="${App.escapeHtml(reply.link)}" target='_blank'>${App.escapeHtml(reply.link)}</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
<footer>
|
|
|
|
<footer>
|
|
|
|
<button dojoType='dijit.form.Button' style='float : left' class='alt-info'
|
|
|
|
<button dojoType='dijit.form.Button' style='float : left' class='alt-info'
|
|
|
|
onclick='window.open("https://tt-rss.org/wiki/GeneratedFeeds")'>
|
|
|
|
onclick='window.open("https://tt-rss.org/wiki/GeneratedFeeds")'>
|
|
|
|
<i class='material-icons'>help</i> ${__("More info...")}</button>
|
|
|
|
<i class='material-icons'>help</i> ${__("More info...")}</button>
|
|
|
|
<button dojoType='dijit.form.Button' onclick="return CommonDialogs.genUrlChangeKey('${feed}', '${is_cat}')">
|
|
|
|
<button dojoType='dijit.form.Button' onclick="return App.dialogOf(this).regenFeedKey('${feed}', '${is_cat}')">
|
|
|
|
${__('Generate new URL')}
|
|
|
|
${__('Generate new URL')}
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
<button dojoType='dijit.form.Button' class='alt-primary' type='submit'>
|
|
|
|
<button dojoType='dijit.form.Button' class='alt-primary' type='submit'>
|
|
|
|