1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 13:35:56 +00:00

various dialog-related fixes; stop referring to many dialogs by name; move filter test initial dialog to client side

This commit is contained in:
Andrew Dolgov
2021-02-12 10:35:13 +03:00
parent 72e38bfe1f
commit bf6d0f2817
8 changed files with 51 additions and 82 deletions

View File

@@ -248,10 +248,21 @@ const Filters = {
});
},
href: "backend.php?op=pref-filters&method=testFilterDlg"
content: `
<div>
<img id='prefFilterLoadingIndicator' src='images/indicator_tiny.gif'>&nbsp;
<span id='prefFilterProgressMsg'>Looking for articles...</span>
</div>
<ul class='panel panel-scrollable list list-unstyled' id='prefFilterTestResultList'></ul>
<footer class='text-center'>
<button dojoType='dijit.form.Button' onclick="dijit.byId('filterTestDlg').hide()"><?php echo __('Close this window') ?></button>
</footer>
`
});
dojo.connect(test_dlg, "onLoad", null, function (/* e */) {
dojo.connect(test_dlg, "onShow", null, function (/* e */) {
test_dlg.getTestResults(params, 0);
});

View File

@@ -118,22 +118,6 @@ const Helpers = {
alert(__("No profiles selected."));
}
},
activateProfile: function () {
const sel_rows = this.getSelectedProfiles();
if (sel_rows.length == 1) {
if (confirm(__("Activate selected profile?"))) {
Notify.progress("Loading, please wait...");
xhrPost("backend.php", {op: "rpc", method: "setprofile", id: sel_rows.toString()}, () => {
window.location.reload();
});
}
} else {
alert(__("Please choose a profile to activate."));
}
},
addProfile: function () {
if (this.validate()) {
Notify.progress("Creating profile...", true);
@@ -148,8 +132,19 @@ const Helpers = {
}
},
execute: function () {
if (this.validate()) {
//
const sel_rows = this.getSelectedProfiles();
if (sel_rows.length == 1) {
if (confirm(__("Activate selected profile?"))) {
Notify.progress("Loading, please wait...");
xhrPost("backend.php", {op: "rpc", method: "setprofile", id: sel_rows.toString()}, () => {
window.location.reload();
});
}
} else {
alert(__("Please choose a profile to activate."));
}
},
href: query