Skip to content

Commit 804fa5c

Browse files
committed
forced in properly styled spacify error
1 parent b25b1a4 commit 804fa5c

File tree

4 files changed

+55
-1525
lines changed

4 files changed

+55
-1525
lines changed

assets/js/app.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ Hooks.ScrollDown = {
137137
Hooks.CopyToClipboard = {
138138
mounted() {
139139
this.el.addEventListener("click", (e) => {
140+
alert('inside the copy to clipboard message');
140141
// @link https://css-tricks.com/copy-paste-the-web/
141142
// Select the email link anchor text
142143
const link = this.el.getAttribute("phx-value-link");
@@ -296,13 +297,23 @@ Hooks.Emojify = {
296297
Hooks.Space = {
297298
mounted() {
298299
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);
301308
//https://stackoverflow.com/questions/15131072/check-whether-string-contains-a-line-break
302309
var match = /\r|\n/.exec(textarea.value);
303310
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);
305315
}
316+
306317
textarea.value = textarea.value.replace(/\n/g, "\n\n");
307318
});
308319
},

0 commit comments

Comments
 (0)