mirror of
				https://github.com/qurator-spk/sbb_ner.git
				synced 2025-10-31 17:44:12 +01:00 
			
		
		
		
	add demo url text parameter
This commit is contained in:
		
							parent
							
								
									311c3fc06e
								
							
						
					
					
						commit
						a93385a4f8
					
				
					 1 changed files with 12 additions and 1 deletions
				
			
		|  | @ -30,7 +30,7 @@ $(document).ready(function(){ | |||
| 
 | ||||
|                     if (url_params.has('text')) { | ||||
| 
 | ||||
|                         var text = url_params.get('text') | ||||
|                         var text = decodeURIComponent(url_params.get('text')) | ||||
| 
 | ||||
|                         $('#inputtext').val(text); | ||||
| 
 | ||||
|  | @ -52,5 +52,16 @@ function update() { | |||
|     var model_id = $('#model').val(); | ||||
|     var input_text = $('#inputtext').val() | ||||
| 
 | ||||
|     if (input_text.length < 200) { | ||||
| 
 | ||||
|         var url_params = new URLSearchParams(window.location.search); | ||||
| 
 | ||||
|         url_params.set('text', encodeURIComponent(input_text)) | ||||
| 
 | ||||
|         window.history.replaceState({}, '', `${location.pathname}?${url_params}`); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     do_task(task, model_id, input_text); | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue