[mod] add swipe events to the image gallery (gesture control)
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>
This commit is contained in:
		
							parent
							
								
									d9115b8d48
								
							
						
					
					
						commit
						601ffcb8a3
					
				| @ -109,7 +109,8 @@ module.exports = function (grunt) { | |||||||
|           'js/searxng.head.min.js': ['src/js/head/*.js'], |           'js/searxng.head.min.js': ['src/js/head/*.js'], | ||||||
|           'js/searxng.min.js': [ |           'js/searxng.min.js': [ | ||||||
|             'src/js/main/*.js', |             'src/js/main/*.js', | ||||||
|             './node_modules/autocomplete-js/dist/autocomplete.js' |             './node_modules/autocomplete-js/dist/autocomplete.js', | ||||||
|  |             './node_modules/swiped-events/src/swiped-events.js' | ||||||
|           ] |           ] | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|  | |||||||
							
								
								
									
										9
									
								
								searx/static/themes/simple/package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										9
									
								
								searx/static/themes/simple/package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -7,7 +7,8 @@ | |||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "autocomplete-js": "^2.7.1", |         "autocomplete-js": "^2.7.1", | ||||||
|         "leaflet": "^1.9.4", |         "leaflet": "^1.9.4", | ||||||
|         "normalize.css": "^8.0.1" |         "normalize.css": "^8.0.1", | ||||||
|  |         "swiped-events": "^1.2.0" | ||||||
|       }, |       }, | ||||||
|       "devDependencies": { |       "devDependencies": { | ||||||
|         "ejs": "^3.1.10", |         "ejs": "^3.1.10", | ||||||
| @ -8989,6 +8990,12 @@ | |||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "CC0-1.0" |       "license": "CC0-1.0" | ||||||
|     }, |     }, | ||||||
|  |     "node_modules/swiped-events": { | ||||||
|  |       "version": "1.2.0", | ||||||
|  |       "resolved": "https://registry.npmjs.org/swiped-events/-/swiped-events-1.2.0.tgz", | ||||||
|  |       "integrity": "sha512-KRu67z1hb4sPxMdFIF2kaufYHTcWOb8NVLbIl2g5dPWZkEQ6D3wfSIVJ7iXbicTt9cO3e0vARqgx9fITtTZxQw==", | ||||||
|  |       "license": "MIT" | ||||||
|  |     }, | ||||||
|     "node_modules/table": { |     "node_modules/table": { | ||||||
|       "version": "6.9.0", |       "version": "6.9.0", | ||||||
|       "resolved": "https://registry.npmjs.org/table/-/table-6.9.0.tgz", |       "resolved": "https://registry.npmjs.org/table/-/table-6.9.0.tgz", | ||||||
|  | |||||||
| @ -24,7 +24,8 @@ | |||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "autocomplete-js": "^2.7.1", |     "autocomplete-js": "^2.7.1", | ||||||
|     "leaflet": "^1.9.4", |     "leaflet": "^1.9.4", | ||||||
|     "normalize.css": "^8.0.1" |     "normalize.css": "^8.0.1", | ||||||
|  |     "swiped-events": "^1.2.0" | ||||||
|   }, |   }, | ||||||
|   "scripts": { |   "scripts": { | ||||||
|     "all": "npm install && grunt", |     "all": "npm install && grunt", | ||||||
|  | |||||||
| @ -113,6 +113,17 @@ | |||||||
|       if (!window.location.hash) searxng.closeDetail(); |       if (!window.location.hash) searxng.closeDetail(); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|  |     d.querySelectorAll('.swipe-horizontal').forEach( | ||||||
|  |       obj => { | ||||||
|  |         obj.addEventListener('swiped-left', function (e) { | ||||||
|  |           searxng.selectNext(false); | ||||||
|  |         }); | ||||||
|  |         obj.addEventListener('swiped-right', function (e) { | ||||||
|  |           searxng.selectPrevious(false); | ||||||
|  |         }); | ||||||
|  |       } | ||||||
|  |     ); | ||||||
|  | 
 | ||||||
|     w.addEventListener('scroll', function () { |     w.addEventListener('scroll', function () { | ||||||
|       var e = d.getElementById('backToTop'), |       var e = d.getElementById('backToTop'), | ||||||
|         scrollTop = document.documentElement.scrollTop || document.body.scrollTop, |         scrollTop = document.documentElement.scrollTop || document.body.scrollTop, | ||||||
|  | |||||||
| @ -5,7 +5,7 @@ | |||||||
| 		<span class="title">{{ result.title|striptags }}</span>{{- "" -}} | 		<span class="title">{{ result.title|striptags }}</span>{{- "" -}} | ||||||
|                 <span class="source">{{- result.parsed_url.netloc -}}</span>{{- "" -}} |                 <span class="source">{{- result.parsed_url.netloc -}}</span>{{- "" -}} | ||||||
|         </a>{{- "" -}} |         </a>{{- "" -}} | ||||||
|         <div class="detail">{{- "" -}} |         <div class="detail swipe-horizontal">{{- "" -}} | ||||||
|                 <a class="result-detail-close" href="#">{{ icon('close') }}</a>{{- "" -}} |                 <a class="result-detail-close" href="#">{{ icon('close') }}</a>{{- "" -}} | ||||||
|                 <a class="result-detail-previous" href="#">{{ icon('chevron-left') }}</a>{{- "" -}} |                 <a class="result-detail-previous" href="#">{{ icon('chevron-left') }}</a>{{- "" -}} | ||||||
|                 <a class="result-detail-next" href="#">{{ icon('chevron-right') }}</a>{{- "" -}} |                 <a class="result-detail-next" href="#">{{ icon('chevron-right') }}</a>{{- "" -}} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Markus Heiser
						Markus Heiser