summaryrefslogtreecommitdiff
path: root/searx/static/themes/simple/src/js/main
AgeCommit message (Collapse)Author
2025-02-28[web-client] simple theme: move sources to client/simple/srcMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-26[refactor] results.js: wait one second before loading full high-res imageMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-26[refactor] results.js: cancel image loading after next one selectedBnyro
2025-01-20[fix] results.js: back button not working after closing image result manuallyBnyro
2025-01-20[mod] add swipe events to the image gallery (gesture control)Markus Heiser
Adds [1] to the searxng.min.js and horizontal swipe events to the image gallery. [1] https://www.npmjs.com/package/swiped-events Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-20[feat] image results: dismiss image viewer on back button press on mobile ↵Bnyro
devices
2024-12-16[refactor] webapp.py: reuse get_client_settings() method to unify preference ↵Bnyro
handling before render
2024-12-16[fix] settings: javascript crash when entering due to missing search formBnyro
2024-12-01[fix] if image load fails on client side, show default imageMarkus Heiser
BTW: change icon color from red to gray Closes: - https://github.com/searxng/searxng/issues/4066 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-11-29[chore] search.js: remove leftovers from shift to multiselect categories PRBnyro
2024-11-29[feat] search: shift/ctrl click a category to select multiple categoriesBnyro
2024-11-24[chore] *: fix typos detected by typos-cliBnyro
2024-08-15[fix] search box: clear button don't appear on mouse-copyMarkus Heiser
You have to copy and paste the query without using the keyboard to replicate the issue. As soon as you press the keyboard the cross appears. [1] - [1] https://github.com/searxng/searxng/issues/3725#issuecomment-2282655272 Reported-by: @Immortality-IMT in [1] Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-04-27[feat] preferences: button to enable/disable all enginesBnyro
2024-04-08[enh] add keybindings for copying URLsYaksh Bariya
'y': for in Vim-mode (yank) 'c': for SearXNG-mode (copy) This should help keyboard heavy users
2024-01-29[feat] preferences: button to copy input to restore preferences hashBnyro
2023-12-28Prevent default browser behavior on click eventahmad-alkadri
2023-11-14[fix] Images cannot be clicked anymore #3006Jinyuan Huang
URL in sidedbar only exists in HTTP POST requests. On HTTP GET requests the selector ``#search_url button#copy_url`` results in a ``null`` type and a ``.style.display`` raises:: Uncaught TypeError: d.querySelector(...) is null As a result, the initialization of the event handler is no longer carried out. Closes: https://github.com/searxng/searxng/issues/3003 Suggested-by: Markus Heiser <markus.heiser@darmarit.de>
2023-11-10add a "copy" button to the "search-url" sidebarJinyuan Huang
2023-10-13[fix] search.js: crash on homepage when setting form listenersBnyro
2023-09-19[mod] reformatted keyBindingLayouts in JS client (default, vim)Jinyuan Huang
2023-09-18[feat] search on category select without JSBnyro
Co-authored-by: Alexandre Flament <alex@al-f.net>
2023-09-16[fix] keyboard navigation / simple theme (UI)Jinyuan Huang
- avoid loop select - fix select next item in mixed result lists Replaces: https://github.com/searxng/searxng/pull/2789 Closes: https://github.com/searxng/searxng/issues/2751 Closes: https://github.com/searxng/searxng/issues/2788
2023-09-12[mod] improve handling of the hotkeysMarkus Heiser
- KeyboardEvent: keyCode property is depricated, replaced by key property [2] - the check for ifDetailOpened is not necessary, because the hotkeys are not only applicable to image-results, by example: `!goi !go !scc hello` - Key bindings like h for help are to be used in general (not only in vim-mode) [1] https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode [2] https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-09-12[feature] key bindings: left & right arrow are always onJinyuan Huang
2023-04-15[mod] Ignore autocomplete_min on queries that include '!' (!bang)Markus Heiser
Closes: https://github.com/searxng/searxng/issues/1566 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-04-10[mod] Update input when selecting by TABMarkus Heiser
When the user press [TAB] the input form should be filled with the highlighted item from the autocomplete list, but not release a search / with other words: what we now have by pressing once on [ENTER] should be mapped to the [TAB] key and pressing [ENTER] once should release a search query. [1] [1] https://github.com/searxng/searxng/issues/778#issuecomment-1016593816 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-04-10[mod] Update input when selecting autocomplete prediction with keyboardrinagorsha
- Update input when selecting autocomplete prediction with keyboard - Search immediately by pressing enter key - Search immediately by clicking on an autocomplete suggestion Related: - https://github.com/searxng/searxng/issues/778
2022-08-27Theme: fix autocompletion with the POST methodAlexandre FLAMENT
With the POST method, autocomplete.js does not URL encode the values. For example "1+1" is sent as "1+1" which is read as "1 1" since space are URL encoded with a plus. There is no clean way to fix the bug since autocomplete.js seems abandoned. The commit monkey patches the ajax function of autocomplete.js Related to #1695
2022-06-14[fix] keyboard.js - highlightResult: don't steal focus on click eventMarkus Heiser
For keyboard navigation the highlightResult() function in keyboard.js steals the focus. On a mouse click event (non keyboard action) the focus should resist where it is, otherwise a marked region gets lost. This is the reason why text can't be selected when using simple theme with JS enabled. Closes: https://github.com/searxng/searxng/issues/794 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-06-13UX fix: when the user clicks on the search input, don't move the cursor at ↵Alexandre Flament
the end Related to https://github.com/searxng/searxng/pull/1153#issuecomment-1154247988
2022-06-02Theme: enable autofocus of #q only on the index page and when the width > 50emAlexandre FLAMENT
Related to #1270
2022-05-10[fix] loading of external resources in JS client toolkitmrpaulblack
2022-05-07[mod] add setting: search.autocomplete_minMarkus Heiser
Minimun characters to type before autocompleter starts. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-05-07[mod] client_settings: pass settings from server to JS clientMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-25[fix] revert changes from #997mrpaulblack
* in #997 there was a bug introduced: #1002 -> for now we just revert the change to make the image detail modal usable again
2022-03-24[simple theme] refactor search formMonty
* update search input form params; inspiried by whoogle * remove autofocus from result page input form (JS impl. as well as input param) -> autofocus on landing page still works only on desktop and tablet with JS impl. * update landing page margins on mobile * rework border and radius for search form to 0.8rem and outline * remove positioning from autocomplete JS lib and use CSS impl. * match search box and autocomplete width * rework search form to a google like design on mobile * fix settings icon display withg RTL on mobile on result page when search input is empty
2022-03-20[fix] Text can't be selected when using simple theme with JS enabledMarkus Heiser
Closes: https://github.com/searxng/searxng/issues/794 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-19simple theme: JS version: the reset button clear the textAlexandre Flament
The <input type="reset"> introduced in the PR 894, restores the default value. It works in the index page, but it doesn't work in the /search page: the reset button restore the initial query. This PR: * fix the JS version: the reset button clear the text * keep the clear button in the / page * hide the clear button in the /search page
2022-02-26[simple theme] replace Image_layout.js with flexbox CS impl.mrpaulblack
* drop image_layout.js from simple theme * move image_layout.js to oscar theme and delete common js dir (since its empty now) * align top position of image detail modal with bottom position of search header * use flexbox to display images; row height can be set via @results-image-row-height in defenitions.less * display span title underneath each image with a max width of 12rem * increase margin and padding around image article on desktop and tablet * make article height smaller on phone layout (height of 6rem) to display more content on current view * remove content from result, if the title and content matches * use a group that cotains the flex image article, if images are mixed with other categories * fix pylint issues in webapp.py * use the default.html result template in unit tests (thanks @return42)
2022-02-20[mod] infinite_scroll as preferenceAlexandre Flament
* oscar theme: code from searx/plugins/infinite_scroll.py * simple theme: new implementation Co-authored-by: Markus Heiser <markus.heiser@darmarIT.de>
2022-01-10[fix] autocomple.js: register li.onmousedown instead li.onclickMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-29[fix] simple theme: hide the image if img load failsMarkus Heiser
Add event listener to query selector:: '#urls img.image' From the user point of view, I think it is better to hide the image: img_load_error.svg is helplful in the image category because it still allows to select the image. IMO, in the news category, the fact there is a missing image won't help to choose the links. From a developer point of view, the place holder is signal that may be the engine needs to be updated (at least give a look). The browser console should show the same information too, but it requires some additional steps. [1] [1] https://github.com/searxng/searxng/pull/610#issuecomment-997640132 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-14[fix] eslint --fixMarkus Heiser
automatically fix some of the problems reported by eslint rules:: $ ./manage nvm.bash nvm-env$ npm --prefix searx/static/themes/simple run eslint-fix Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-05[fix] simple theme: make autocomplete-js CSP compliantMarkus Heiser
The CSP issue is, that the `_Position` function in the autocomplete-js set the style attributes by `setAttribute("style", ...)`. Using `setAttribute` to set the style attribute invokes the HTML parser and CSP is triggered [1]. This patch overwrite the `_Position` function of autocomplete-js. BTW: remove trailing whitespace [1] https://stackoverflow.com/a/57633533 Closes: https://github.com/searxng/searxng/issues/352 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-21[simple theme] rework select; add safesearch to search and replace / with ↵mrpaulblack
› in article url * rework selection UI in pref (fix based on: https://github.com/twelsby/searx/commit/78643e9f43a103c523f112e9f3ce26a5c7bb3a0f) * moved search filters underneath categories * cut params from url and replace / with › * make h3 and url in article bigger * add safe search select to search filter (this will not override settings and only be valid while on result page in a session) * make search form button not overlap each other when js is disabled * 1rem padding around preview image and thumbnail in default article template
2021-11-05[fix] simple theme: image detail: click on the URL to the HTML page worksAlexandre Flament
Before this commit, the default click event on an image result is prevented, this include clicks inside the detail. This commit makes sure the click happends outside the detail to prevent the default event.
2021-11-05[fix] simple theme: various about the hotkeys helpAlexandre Flament
* dark mode: #555 border (same as infoboxes and other borders) * remove a call to console.log * center the dialog without using the style attribute.
2021-11-05[fix] simple theme: disable hotkeys when they are not enabled in the preferencesAlexandre Flament
2021-11-05[mod] SearXNG: remove "searx" from the searx*.js file names.Alexandre Flament