summaryrefslogtreecommitdiff
path: root/searx/static/themes/simple/src/js
AgeCommit message (Collapse)Author
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-27[fix] simple: detect touch screen using media queryAlexandre Flament
related to https://github.com/searxng/searxng/issues/928
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-30[mod] simple theme, JS: introduce window.searxng.theme namespaceMarkus Heiser
In window.searxng.theme the theme data can be passed through to JS implementations. Initial the window.searxng.theme namespace starts with a value for `img_load_error`:: // image that is displayed if load of <img src='...'> failed img_load_error: 'img/img_load_error.svg' The searx/static/themes/__common__/js/image_layout.js is patched to uses the value, if the theme defines a value for img_load_error in this namespace. 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-19[enh] simple theme: add "simple-style" preferencesAlexandre Flament
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
2021-10-28[enh] simple theme: image detailAlexandre Flament
When an image is selected, the detail with the full size image is displayed on the right side of the screen (or full screen on tablet and phone). When Javascript is disabled, the thumbnail is a linked to the full size image, as it was before. When the image proxy is enabled, the full size image is also proxied, in consequence this commit increases the bandwidth usage of instances. The detail can be closed by the close button or the Esc key. It is possible to go to the next and previous images using the j and k keys or the button on the top right of the screen.
2021-10-01SearXNG: simple themeAlexandre Flament
2021-09-24[enh] themes: display the engine descriptionsAlexandre Flament
2021-09-22[fix] searx.js null pointer exception when category div is missingMrPaulBlack
2021-08-31[mod] simple theme: fix eslint errors, fix VIM keysAlexandre Flament
* VIM keys: fix the next page and previous pages (n, p keys) * Map: Enable the wikipedia map (the layer was initialized but not included)
2021-06-16[mod] simple theme: leaflet becomes a packages.json dependencyAlexandre Flament
the build of the themes updates: * js/leaflet.js ( was leaflet/leaflet.js ) * css/leaflet.css ( was leaflet/leaflet.css ) * css/images ( was leaflet/images )
2021-06-16[mod] simple theme: move source files to the src directoryAlexandre Flament