javascript:(function() { /* OPTIONAL VARIABLES */ var promptInstructionsDomTakeVideoNotes = 1; /* prompt with instructions */ var allowKeyPressDomTakeVideoNotes = 1; /* use key press events */ /* CONFIG VARIABLES */ var heightDomTakeVideoNotes = /* set initial height for notes */ "100px"; var ignoredKeysDomTakeVideoNotes = /* keys pressed that do not active not box */ "Home End PageUp PageDown ArrowUp ArrowDown f v k s"; /* Set max height and width that note box can be sest to. */ var maxWidthDomTakeVideoNotes = "1000px"; var maxHeightDomTakeVideoNotes = "600px"; /* DOM VARIABLES */ /* Lookout for a video tag. */ var checkVideoTagDomTakeVideoNotes = document.getElementsByTagName("video"); /* Lookout for an iframe tag. */ var checkIframeDomTakeVideoNotes = document.getElementsByTagName("iframe"); /* style applied to video area. */ var noteBoxStyling = ` div#noteBoxDomTakeVideoNotes { position: fixed; z-index: 1000; left: 25%; bottom: 10px; max-width: 500px; max-height: 500px; margin-left: 20px; margin-bottom: 20px; } div#closeDomTakeVideoNotes { box-sizing: content-box; cursor: pointer; display: inline-block; position: absolute; z-index: 2; width: 15px; height: 15px; padding: 5px 5px 15px 5px; margin-top: -15px; margin-left: 5px; background: red; color: white; border-radius: 5px; text-align: center; } div#showHideNoteBoxDomTakeVideoNotes, textarea#textareaDomTakeVideoNotes { max-width: ${maxWidthDomTakeVideoNotes} !important; max-height: ${maxHeightDomTakeVideoNotes} !important; } div#showHideNoteBoxDomTakeVideoNotes { resize: both !important; overflow: auto; transform: rotateX(180deg); height: ${heightDomTakeVideoNotes}; width: 600px; padding: 0px; } textarea#textareaDomTakeVideoNotes { box-sizing: border-box; position: absolute; z-index: 1; resize: none; transform: rotateX(180deg); height: inherit; width: inherit; margin-left: 10px; margin-bottom: 10px; padding: 25px; } `; /* GLOBAL VARIABLES */ var textareaDomTakeVideoNotesID; /* defined later */ var textareaDomTakeVideoNotes = 0; /* when not taking notes allow fv to focus on video */ /* Instructions shown when run. */ var noteInstructionsDomTakeVideoNotes = ` TAKE VIDEO NOTES INSTRUCTIONS:\n\n I. Taking Notes:\n ***************\n - Start typing to take notes.\n - Press 'Ctrl + Shift' to unfocus note box.\n - Start typing again to take notes.\n - When not taking notes, and video out of view \n press ' f ' and ' v ' within 1 second of each other \n to bring in view. - Press 'Alt + a' to copy all in note box.\n - To hide notes and have option to save click\n the red button at top left of notes.\n\n`; /************************************* SUPPORT FUNCTIONS *************************************/ /* Select and copy notes. */ const copyNotesDomTakeVideoNotes = () => { textareaDomTakeVideoNotesID.select(); navigator.clipboard.writeText(textareaDomTakeVideoNotesID.value); }; /* Get the index of the video clicked. */ var lastVideoClickedIndexDomTakeVideoNotes = -1; var lastVideoTagNameDomTakeVideoNotes; const indexVideoClickedDomTakeVideoNotes = (el) => { if (!el) return; /* collect all video, iframe, or elements with action attr. on the page */ if (lastVideoTagNameDomTakeVideoNotes == "a") { if (useParDomTakeVideoNotes == 1) { lastVideoClickedIndexDomTakeVideoNotes = el.parentElement; } else { lastVideoClickedIndexDomTakeVideoNotes = el; } } else { let t = el.tagName; let unqId = String(t + countIdDomTakeVideoNotes); if (el.hasAttribute("id")) { let curId = el.getAttribute("id"); if (curId.indexOf(t) == -1) { let tId = curId + " "; el.setAttribute("id", String(tId + unqId)); } } else { el.setAttribute("id", String(unqId)); } /* store id value in global variable */ lastVideoClickedIndexDomTakeVideoNotes = unqId; } }; /* Listen for click and call indexVidoeClickedDomTakeVideoNotes if iframe or video tag. */ var countIdDomTakeVideoNotes = 0; var useParDomTakeVideoNotes = 0; const setVideoClickListenerDomTakeVideoNotes = () => { let clickOrOverVideo = (e) => { const el = e.target; if (!el) return; /* only handle clicks on