@@ -137,6 +137,7 @@ Hooks.ScrollDown = {
137
137
Hooks . CopyToClipboard = {
138
138
mounted ( ) {
139
139
this . el . addEventListener ( "click" , ( e ) => {
140
+ alert ( 'inside the copy to clipboard message' ) ;
140
141
// @link https://css-tricks.com/copy-paste-the-web/
141
142
// Select the email link anchor text
142
143
const link = this . el . getAttribute ( "phx-value-link" ) ;
@@ -296,13 +297,23 @@ Hooks.Emojify = {
296
297
Hooks . Space = {
297
298
mounted ( ) {
298
299
this . el . addEventListener ( "click" , ( e ) => {
299
- const id = e . target . value ;
300
- const textarea = document . getElementById ( id ) ;
300
+ const id = e . target . value ; //id is post-form_body
301
+ let textarea = document . getElementById ( id ) ;
302
+
303
+ let mySpecialThingy = document . getElementById ( 'space-mode' ) ;
304
+ console . log ( 'print my special thingy' ) ;
305
+ console . log ( mySpecialThingy ) ; //just says undefined
306
+ let printAllIds = document . querySelectorAll ( '*[id]' ) ;
307
+ console . log ( printAllIds ) ;
301
308
//https://stackoverflow.com/questions/15131072/check-whether-string-contains-a-line-break
302
309
var match = / \r | \n / . exec ( textarea . value ) ;
303
310
if ( ! match ) {
304
- alert ( 'Must contain paragraph breaks to add excessive spaces' ) ;
311
+ //alert('Must contain paragraph breaks to add excessive spaces');
312
+ //textarea.value =`<span
313
+ //class="text-red-500 font-semibold italic text-xs">blahblah</span>`;
314
+ alert ( printAllIds ) ;
305
315
}
316
+
306
317
textarea . value = textarea . value . replace ( / \n / g, "\n\n" ) ;
307
318
} ) ;
308
319
} ,
0 commit comments