forked from open-webui/open-webui
		
	fix: cors & #281
This commit is contained in:
		
							parent
							
								
									0c30a08596
								
							
						
					
					
						commit
						0ae57b5ae1
					
				
					 5 changed files with 20 additions and 49 deletions
				
			
		| 
						 | 
				
			
			@ -83,7 +83,7 @@
 | 
			
		|||
		blocks.forEach((block) => {
 | 
			
		||||
			// only add button if browser supports Clipboard API
 | 
			
		||||
 | 
			
		||||
			if (navigator.clipboard && block.childNodes.length < 2 && block.id !== 'user-message') {
 | 
			
		||||
			if (block.childNodes.length < 2 && block.id !== 'user-message') {
 | 
			
		||||
				let code = block.querySelector('code');
 | 
			
		||||
				code.style.borderTopRightRadius = 0;
 | 
			
		||||
				code.style.borderTopLeftRadius = 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -121,10 +121,6 @@
 | 
			
		|||
				topBarDiv.appendChild(button);
 | 
			
		||||
 | 
			
		||||
				block.prepend(topBarDiv);
 | 
			
		||||
 | 
			
		||||
				// button.addEventListener('click', async () => {
 | 
			
		||||
				// 	await copyCode(block, button);
 | 
			
		||||
				// });
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -132,7 +128,7 @@
 | 
			
		|||
			let code = block.querySelector('code');
 | 
			
		||||
			let text = code.innerText;
 | 
			
		||||
 | 
			
		||||
			await navigator.clipboard.writeText(text);
 | 
			
		||||
			await copyToClipboard(text);
 | 
			
		||||
 | 
			
		||||
			// visual feedback that task is completed
 | 
			
		||||
			button.innerText = 'Copied!';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue