summaryrefslogtreecommitdiff
path: root/js/Feeds.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-17 19:34:54 +0300
committerAndrew Dolgov <[email protected]>2021-02-17 19:34:54 +0300
commitb16abc157ee584f4be80a537ee24ec9e5ff25496 (patch)
treeb09e841d5cc1be8b066ac831588d01792ea1ad01 /js/Feeds.js
parent92cb91e2e22282e3ad9da2f5312d7815720af6b6 (diff)
* App: rename hidden to hidden_tag
* search: use client dialog * add some form field helpers
Diffstat (limited to 'js/Feeds.js')
-rw-r--r--js/Feeds.js42
1 files changed, 35 insertions, 7 deletions
diff --git a/js/Feeds.js b/js/Feeds.js
index 73f1bc338..0567cf8c5 100644
--- a/js/Feeds.js
+++ b/js/Feeds.js
@@ -1,6 +1,6 @@
'use strict'
-/* global __, App, Headlines, xhrPost, dojo, dijit, Form, fox, PluginHost, Notify, $$, fox */
+/* global __, App, Headlines, xhrPost, xhrJson, dojo, dijit, Form, fox, PluginHost, Notify, $$, fox */
const Feeds = {
counters_last_request: 0,
@@ -566,14 +566,42 @@ const Feeds = {
return tree.model.store.getValue(nuf, 'bare_id');
},
search: function() {
- xhrPost("backend.php",
- {op: "feeds", method: "search",
- param: Feeds.getActive() + ":" + Feeds.activeIsCat()},
- (transport) => {
+ xhrJson("backend.php",
+ {op: "feeds", method: "search"},
+ (reply) => {
try {
const dialog = new fox.SingleUseDialog({
- id: "searchDlg",
- content: transport.responseText,
+ content: `
+ <form onsubmit='return false'>
+ <section>
+ <fieldset>
+ <input dojoType='dijit.form.ValidationTextBox' id='search_query'
+ style='font-size : 16px; width : 540px;'
+ placeHolder="${__("Search %s...").replace("%s", Feeds.getName(Feeds.getActive(), Feeds.activeIsCat()))}"
+ name='query' type='search' value=''>
+ </fieldset>
+
+ ${reply.show_language ?
+ `
+ <fieldset>
+ <label class='inline'>${__("Language:")}</label>
+ ${App.FormFields.select_tag("search_language", reply.default_language, reply.all_languages,
+ {title: __('Used for word stemming')}, "search_language")}
+ </fieldset>
+ ` : ''}
+ </section>
+
+ <footer>
+ ${reply.show_syntax_help ?
+ `${App.FormFields.button_tag(App.FormFields.icon("help") + " " + __("Search syntax"), "",
+ {class: 'alt-info pull-left', onclick: "window.open('https://tt-rss.org/wiki/SearchSyntax')"})}
+ ` : ''}
+
+ ${App.FormFields.submit_tag(__('Search'), {onclick: "App.dialogOf(this).execute()"})}
+ ${App.FormFields.cancel_dialog_tag(__('Cancel'))}
+ </footer>
+ </form>
+ `,
title: __("Search"),
execute: function () {
if (this.validate()) {