-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfailedAttempts.js
31 lines (26 loc) · 1.08 KB
/
failedAttempts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// NOTES: TRIAL && ERROR CODES
// EXECCOMMAND OBSOLETE AS OF JUL18 2022
document.designMode = "on";
document.execCommand("foreColor", false, "yellow");
document.designMode = "off";
// NOTION NOW SAFEGUARDS MODIFICATION TO THE EXISTING DOM, NO SUBTRACTIONS SEEM TO BE ALLOWED
document.getElementById('commentOn').removeAttribute('id');
// ORIGINAL INTENT WAS TO CREATE AN INPUT FIELD PER SELECTED TEXT, BUT I OPTED FOR PAGE SUMMARY
// ALSO: "style.visibility" DOES NOT WORK
getSelectedText();
createSpan("commentOn");
let newInput = document.createElement('input');
newInput.setAttribute('type', 'text');
newInput.setAttribute('placeholder', 'add comment');
newInput.classList.add('commented');
let flag = document.getElementsByClassName('commentOn');
if (flag > 0) {
for (let i = 0; i<flag.length; i++) {
flag[i].appendChild(newInput);
}
} else {
flag[0].appendChild(newInput);
}
// A DUH ATTEMPT, BUT JUST GENERATING A NEW URL WITH NEW PARAM DIDNT SAVE CHANGES
// NOTION WILL ALSO REDIRECT TO INTENDED PAGE WITHOUT WHATEVER PARAM YOUVE SET
window.location.search += '¶m=1';