changeset 32:72a1b77b4548

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 29 Jul 2022 13:57:20 -0600
parents 6d265f5e18e2
children 4fdc4ec0050b
files src/test/tiny.html src/thread.html.luan
diffstat 2 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/test/tiny.html	Wed Jul 27 22:10:18 2022 -0600
+++ b/src/test/tiny.html	Fri Jul 29 13:57:20 2022 -0600
@@ -177,7 +177,7 @@
 				});
 
 				editor.ui.registry.addToggleButton('styleCode', {
-					icon: 'sourcecode',
+					icon: 'code-sample',
 					tooltip: 'Code',
 					onAction: function(api) {
 						editor.execCommand('mceToggleFormat', false, 'code');
@@ -210,8 +210,8 @@
 				setup: tinymceSetup,
 				//menubar: false,
 				statusbar: false,
+				plugins: ['link', 'image', 'media', 'lists', 'code', 'autoresize'],
 				toolbar: 'link insertImage insertVideo | styleCode bold italic underline strikethrough superscript styleText | blockquote numlist bullist',
-				plugins: ['link', 'image', 'media', 'lists', 'code', 'autoresize'],
 				autoresize_bottom_margin: 0,
 				link_target_list: false,
 				link_title: false,
--- a/src/thread.html.luan	Wed Jul 27 22:10:18 2022 -0600
+++ b/src/thread.html.luan	Fri Jul 29 13:57:20 2022 -0600
@@ -71,19 +71,26 @@
 				} while( node = node.parentNode );
 			}
 
-			function cancelEdit(a) {
-				let postDiv = getPostDiv(a);
+			function cancelEdit(src) {
+				let postDiv = getPostDiv(src);
 				postDiv.querySelector('[output]').style.display = 'block';
 				postDiv.querySelector('[edit]').innerHTML = '';
 			}
-			function saveEdit(a) {
-				let postDiv = getPostDiv(a);
+			function saveEdit(src) {
+				let postDiv = getPostDiv(src);
 				let post = postDiv.getAttribute('post');
 				let text = postDiv.querySelector('textarea').value;
 				let postData = 'post=' + post + '&text=' + encodeURIComponent(text);
 				ajax("save_edit.js",postData);
 			}
 
+			function upload(src) {
+				let postDiv = getPostDiv(src);
+				let textarea = postDiv.querySelector('textarea');
+				textarea.focus();
+				textarea.setRangeText('xyz',textarea.selectionStart,textarea.selectionEnd,'select');
+			}
+
 			function deletePost(span) {
 				span.innerHTML = document.querySelector('[hidden][delete]').innerHTML;
 			}
@@ -142,6 +149,7 @@
 		<div hidden edit>
 			<textarea></textarea>
 			<p>
+				<button onclick="upload(this)">upload</button>
 				<button onclick="saveEdit(this)">save</button>
 				<button onclick="cancelEdit(this)">cancel</button>
 			</p>