Edge-nuity Megascript

Completes through instructional, summary, and warm-up sections by guessing answers (they don’t impact grades). You can begin activities while the instructor is speaking, when theres an activity, a "Search clipboard" button appears for quick access to answers during quizzes (will search your copied text on brainly and auto-redirect) And much more (read desc).

目前为 2024-12-27 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Edge-nuity Megascript
  3. // @version 1.9
  4. // @description Completes through instructional, summary, and warm-up sections by guessing answers (they don’t impact grades). You can begin activities while the instructor is speaking, when theres an activity, a "Search clipboard" button appears for quick access to answers during quizzes (will search your copied text on brainly and auto-redirect) And much more (read desc).
  5. // @author TTT
  6. // @license MIT
  7. // @include *://*nuity.com*/*
  8. // @include https://brainly.com/*
  9. // @grant none
  10. // @namespace https://www.tampermonkey.net/
  11. // ==/UserScript==
  12. function redirectToStudent() {
  13. const currentHref = window.location.href;
  14.  
  15. const newHref = currentHref.replace("core.learn", "student");
  16.  
  17. window.location.href = newHref;
  18. }
  19.  
  20. if (window.location.href.includes("core.learn") && window.location.href.includes("/EdgeAuth/lti/goodbye")) {
  21.  
  22. setInterval(redirectToStudent, 1000);
  23. }
  24.  
  25. function clickVisibleElementWithClass() {
  26. const elements = document.getElementsByClassName('btn btn-primary modal-dialog-button');
  27.  
  28. for (let i = 0; i < elements.length; i++) {
  29. const targetElement = elements[i];
  30. const computedStyle = window.getComputedStyle(targetElement);
  31. const boundingRect = targetElement.getBoundingClientRect();
  32.  
  33. const isVisible =
  34. computedStyle.opacity !== '0' &&
  35. computedStyle.visibility !== 'hidden' &&
  36. computedStyle.display !== 'none' &&
  37. boundingRect.width > 0 &&
  38. boundingRect.height > 0;
  39.  
  40. if (isVisible) {
  41. const simulatedClickEvent = new MouseEvent('click', {
  42. view: window,
  43. bubbles: true,
  44. cancelable: true
  45. });
  46. targetElement.dispatchEvent(simulatedClickEvent);
  47. console.log('Clicked a visible button!');
  48. addBeforeUnloadListener();
  49. break;
  50. }
  51. }
  52. }
  53.  
  54. setInterval(clickVisibleElementWithClass, 1000);
  55.  
  56. const checkElementVisibility = (element) => {
  57. const boundingRect = element.getBoundingClientRect();
  58. const computedStyle = window.getComputedStyle(element);
  59. return (
  60. computedStyle.opacity !== '0' &&
  61. computedStyle.visibility !== 'hidden' &&
  62. computedStyle.display !== 'none' &&
  63. boundingRect.width > 0 &&
  64. boundingRect.height > 0
  65. );
  66. };
  67.  
  68. const checkForTimerStayElement = () => {
  69. const targetElement = document.getElementById('timerStay');
  70.  
  71. if (targetElement && checkElementVisibility(targetElement)) {
  72. const simulatedClickEvent = new MouseEvent('click', {
  73. view: window,
  74. bubbles: true,
  75. cancelable: true
  76. });
  77. targetElement.dispatchEvent(simulatedClickEvent);
  78. console.log('Clicked timerStay element!');
  79. addBeforeUnloadListener();
  80. }
  81. };
  82.  
  83. if (window.top === window.self) {
  84. const intervalId = setInterval(checkForTimerStayElement, 100);
  85. }
  86.  
  87. const addBeforeUnloadListener = () => {
  88. window.onbeforeunload = function (event) {
  89. const message = 'Are you sure you want to leave this page?';
  90. event.returnValue = message;
  91. return message;
  92. };
  93. };
  94.  
  95. let videoElement = null;
  96. let alertTriggered = false;
  97. let alertScheduled = false;
  98.  
  99. const callback = function(mutationsList, observer) {
  100. for (const mutation of mutationsList) {
  101. if (mutation.type === 'childList') {
  102. videoElement = document.getElementById("home_video_js");
  103. if (videoElement) {
  104. startCheckingVideo();
  105.  
  106. observer.disconnect();
  107. }
  108. }
  109. }
  110. };
  111.  
  112. const config = {
  113. attributes: false,
  114. childList: true,
  115. subtree: true
  116. };
  117.  
  118. const targetNode = document.body;
  119. const observer = new MutationObserver(callback);
  120. observer.observe(targetNode, config);
  121.  
  122. function insertDiv() {
  123. let logoImage = document.querySelector('img.course-logo-bug[src="/images/logobug-edge-ex.png"][alt="Edge EX"]');
  124. if (logoImage && !document.getElementById('testDiv')) {
  125.  
  126. const testDiv = document.createElement('div');
  127. testDiv.id = 'testDiv';
  128. testDiv.style.fontFamily = 'Atkinson Hyperlegible';
  129. testDiv.style.color = 'black';
  130. testDiv.style.margin = '10px';
  131. testDiv.style.width = 'calc(100% - 20px)';
  132. testDiv.style.maxWidth = '999px';
  133. testDiv.style.marginLeft = 'auto';
  134. testDiv.style.marginRight = 'auto';
  135. testDiv.style.position = 'fixed';
  136. testDiv.style.top = '50%';
  137. testDiv.style.left = '50%';
  138. testDiv.style.transform = 'translate(-50%, -50%)';
  139. testDiv.style.backgroundColor = 'aqua';
  140. testDiv.style.padding = '10px';
  141. testDiv.style.borderRadius = '5px';
  142. testDiv.style.zIndex = '2147483647';
  143.  
  144. const firstItemContainer = document.createElement('div');
  145.  
  146. const textSpan = document.createElement('span');
  147. textSpan.style.display = 'inline';
  148. textSpan.textContent = "Sadly, the script you downloaded (Edge-nuity Megascript) Does not support Edge-x classes, which you have one or more of. (Each marked by):";
  149.  
  150. firstItemContainer.appendChild(textSpan);
  151.  
  152. const imageContainer = document.createElement('span');
  153. imageContainer.style.display = 'inline';
  154. imageContainer.style.marginLeft = '10px';
  155.  
  156. const imgElement1 = document.createElement('img');
  157. imgElement1.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAACSVBMVEUAAAAAAAAAAIAAAIAAAGYAAHEAAIAAAHQAAHcAAIAAAHkAAIAAAHkAAIAAAHoAAIAAAIAAAHsAAIAAAHsAAIAAAHwAAHwAAHkAAHwAAHkAAH0AAHoAAHoAAH0AAHsAAH0AAH0AAHsAAHsAAHwAAHoAAHsAAHwAAHsAAH0AAH0AAHsAAHwAAH0AAHsAAHwAAHwAAHwAAH0AAH0AAHwAAHsAAHwAAHsAAHwAAHwAAHwAAHwAAHwAAH0AAHwAAHsAAHwAAHwAAHsAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAH0AAHsAAHwAAHsAAHwAAHsAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwAAHwCAn0DA34EBH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SDggZRIZiqJ6wRztkh78ycytcamKJKBuqpp4BFr61QWh69/2ZHS5LSBJdiZCkkiwXoSgMI9nI7QjBVBIyEZyZFIbFCKYsklQj1iGwimTyGFOOQPZOI624tdBXOZ28jVoBPaXJ5GtITjX8Mg8nPxIsGKwwhXQkLdgNrZqlqWGkb2ja/KJqyKwbFmXEUlDG0YlTEuNNNNh/Z1K0M41d9QQAAAAASUVORK5CYII=';
  158. imgElement1.alt = 'Embedded Image';
  159. imgElement1.style.maxHeight = '50px';
  160.  
  161. imageContainer.appendChild(imgElement1);
  162.  
  163. firstItemContainer.appendChild(imageContainer);
  164.  
  165. testDiv.appendChild(firstItemContainer);
  166.  
  167. const additionalInfoDiv = document.createElement('div');
  168. additionalInfoDiv.style.marginTop = '10px';
  169. additionalInfoDiv.textContent = "However, I'm gonna work on adding it as soon as possible, join ";
  170.  
  171. const link = document.createElement('a');
  172. link.href = "https://discord.gg/6qJwkYSmrQ";
  173. link.target = "_blank";
  174. link.style.color = 'blue';
  175. link.style.textDecoration = 'underline';
  176. link.textContent = "HERE";
  177.  
  178. additionalInfoDiv.appendChild(link);
  179. additionalInfoDiv.append(" and ping me \"@TallTacoTristan\" in any chat if you want to volunteer your own class, which I will complete for you in return.");
  180.  
  181. testDiv.appendChild(additionalInfoDiv);
  182.  
  183. const line3Div = document.createElement('div');
  184. line3Div.style.marginTop = '10px';
  185. line3Div.textContent = "If not, simply note: only normal classes are supported, any normal class is marked by:";
  186.  
  187. const imageContainer2 = document.createElement('span');
  188. imageContainer2.style.display = 'inline';
  189. imageContainer2.style.marginLeft = '10px';
  190. const imgElement2 = document.createElement('img');
  191. imgElement2.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAGYNAABl0QFoooEwAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAIABJREFUeJzt3Xl4VOXB/vHvmZmEyL6JgiCggCjiRq0FJBYU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AxVWWkRbQ8X1lZOqcajpNJJxFcBzYP0e8peYDuMnKqy0imZD/FKw/wc41nQaSbuQwymWAAAB6ElEQVQysB6H8B8gutZ0GD9SYWXM2FPBugP4Gfq6+823wF8h9hDcu8V0GD/TD07GjTseEqPBGoUWxfCyBNhvQegxKHlZj9FkhgrLmGgOVAwHazRwOvpeeMU3wJMQmQzRVabDBI1+SFxhTG8IXwNcDnQwnUYOUAHWDLAfgxX/gufjpgMFlQrLVUaGoVd/CI0E+1JUXibFgYXA8xCZCtENpgOJCsvF9imvnwMHm04UAAngXSpLahpEvzUdSPalwvKEaDYkBleuP8fZYPcynchHSoE3gZmQeA0mlJgOJLVTYXlSXnewhgJngH0W0NJ0Im+xPgV7OvAmRIqCvKiD16iwPO/GJtBqINinAgPA6o8KbG9x4GOw50NoPsTf0SjKu1RYvjMyDD37QGgQ0J/KNRe7Gw6VSVvBfg+sBZUFtWsh3FdmOpQ4Q4UVCNGWEO8J9AH6Vc1RfwLQ3myulMTAXlt5esdisJdB6FMIfwZRTS/sUyqs4LIgrxuEekGiG5WjsG57/XLDNDk7gNVgrYFE1e/2GgitgtJPYVK52XiSaSosqUW0KZR3g0g7sNsBVb+HDv7hzzSt+tWkchu7akodKwc4CIiDvbXqYzuA6oLZAsSATWBtgkTV79YmsDdCYiNkr9e9TyIiIiIi6fZ/tyEb8N5jlqcAAAAASUVORK5CYII=';
  192. imgElement2.alt = 'Courseware Image';
  193. imgElement2.style.maxHeight = '50px';
  194.  
  195. imageContainer2.appendChild(imgElement2);
  196. line3Div.appendChild(imageContainer2);
  197. testDiv.appendChild(line3Div);
  198.  
  199. document.body.appendChild(testDiv);
  200. }
  201. }
  202.  
  203. setInterval(function () {
  204. if (window.location.href.includes("student.") && window.location.href.includes(".com/")) {
  205. insertDiv();
  206. }
  207. }, 1000);
  208.  
  209.  
  210. function startCheckingVideo() {
  211. setInterval(() => {
  212. if (videoElement) {
  213. const currentTime = videoElement.currentTime;
  214. const duration = videoElement.duration;
  215.  
  216. if (currentTime >= duration) {
  217. if (!alertScheduled) {
  218. alertScheduled = true;
  219. let checksCount = 0;
  220. let allChecksPassed = true;
  221.  
  222. const intervalId = setInterval(() => {
  223. const homeVideoContainer = document.getElementById("home_video_container");
  224. if (homeVideoContainer && homeVideoContainer.parentNode.style.opacity == 1) {
  225. checksCount++;
  226. } else {
  227. allChecksPassed = false;
  228. }
  229.  
  230. if (checksCount === 10) {
  231. clearInterval(intervalId);
  232. if (allChecksPassed) {
  233. new Notification("Reload!");
  234. alertTriggered = true;
  235. }
  236. alertScheduled = false;
  237. }
  238. }, 100);
  239. }
  240. } else {
  241. alertTriggered = false;
  242. }
  243. }
  244. }, 550);
  245. }
  246.  
  247.  
  248. (function() {
  249. 'use strict';
  250.  
  251. let completeCount = 0;
  252.  
  253. const originalConsoleLog = console.log;
  254. console.log = function() {
  255. const message = Array.from(arguments).join(' ');
  256. if (message.includes('complete')) {
  257. completeCount++;
  258. if (completeCount === 2) {
  259. const goRightButton = document.querySelector('li.FrameRight a');
  260. if (goRightButton) {
  261. goRightButton.click();
  262. completeCount = 0;
  263. }
  264. }
  265. }
  266. originalConsoleLog.apply(console, arguments);
  267. };
  268. })();
  269. function checkAutoplay() {
  270. const isAutoplayChecked = document.getElementById('autoplayCheckbox').checked;
  271. if (isAutoplayChecked) {
  272. playVideo();
  273. }
  274. }
  275. if (window.top === window.self) {
  276. setInterval(checkAutoplay, 1000);}
  277.  
  278. function playVideo() {
  279. var playButton = window.frames[0].document.getElementById("uid1_play");
  280. if (playButton != undefined) {
  281. setTimeout(function() {
  282. if (playButton.className == "play") {
  283. playButton.children[0].click();
  284. }
  285. }, 1000);
  286. }
  287. }
  288.  
  289. function showColumn() {
  290. try {
  291. window.frames[0].frames[0].document.getElementsByClassName("right-column")[0].children[0].style.display = "block";
  292. } catch (TypeError) {}
  293.  
  294. try {
  295. window.frames[0].frames[0].document.getElementsByClassName("left-column")[0].children[0].style.display = "block";
  296. } catch (TypeError) {}
  297. }
  298. if (window.top === window.self) {
  299. setInterval(showColumn, 1000);}
  300.  
  301.  
  302. function clearLocalStorage() {
  303. try {
  304. localStorage.clear();
  305. } catch (error) {}
  306. }
  307.  
  308. function removeElementsByClassName(className) {
  309. var elements = document.getElementsByClassName(className);
  310. Array.prototype.forEach.call(elements, function(element) {
  311. try {
  312. element.parentNode.removeChild(element);
  313. } catch (error) {}
  314. });
  315. }
  316.  
  317. function handleOnload() {
  318. var classNamesToRemove = [
  319. "brn-expanded-bottom-banner",
  320. "brn-brainly-plus-box",
  321. "brn-fullscreen-toplayer",
  322. "sg-overlay sg-overlay--dark"
  323. ];
  324. classNamesToRemove.forEach(function(className) {
  325. removeElementsByClassName(className);
  326. });
  327. }
  328.  
  329. if (window.location.href.includes("brainly.com")) {
  330. clearLocalStorage();
  331. handleOnload();
  332. }
  333.  
  334. function redirectToFirstSearchItem() {
  335. if (window.location.href.startsWith('https://brainly.com/app/ask')) {
  336. const searchItem = document.querySelector('[data-testid="search-item-facade-wrapper"]');
  337. if (searchItem) {
  338. const anchorElement = searchItem.querySelector('a');
  339. if (anchorElement) {
  340. const href = anchorElement.getAttribute('href');
  341. const fullUrl = `https://brainly.com${href}`;
  342. window.location.href = fullUrl;
  343. clearInterval(interval);
  344. }
  345. }
  346. }
  347. }
  348. const interval = setInterval(redirectToFirstSearchItem, 1000);
  349.  
  350.  
  351.  
  352. function checkElement() {
  353. const element = document.querySelector('[data-testid="answer_box"][data-test="locked_answer"]');
  354.  
  355. if (element && document.location.href.includes("brainly.com/question")) {
  356. location.reload();
  357. }
  358. }if (window.top === window.self) {
  359. setInterval(checkElement, 750);}
  360.  
  361.  
  362.  
  363. function extractTextFromIframe() {
  364. var iframeDocument = window.frames[0].document;
  365.  
  366. var targetElements = iframeDocument.getElementsByClassName("Assessment_Main_Body_Content_Question");
  367.  
  368. var visibleElements = Array.from(targetElements).filter(function(element) {
  369. return element.style.display !== "none" && element.id.includes("q_");
  370. });
  371.  
  372. if (visibleElements.length > 0) {
  373. var finalTextOutput = [];
  374.  
  375. var regex = />([^<]+)</g;
  376. var regexSpecial = /»([^«]+)«/g;
  377. var regexCleanUp = /[\n\r]+|<[^>]*>|&nbsp;| /g;
  378.  
  379. visibleElements.forEach(function(targetElement) {
  380. var elementText = "";
  381.  
  382. let matches;
  383. while ((matches = regex.exec(targetElement.innerHTML)) !== null) {
  384. var extractedText = matches[1].trim();
  385. if (extractedText && !/(class|src|align|style)=/i.test(extractedText)) {
  386. elementText += extractedText + " ";
  387. }
  388. }
  389.  
  390. while ((matches = regexSpecial.exec(targetElement.innerHTML)) !== null) {
  391. var extractedText = matches[1].trim();
  392. if (extractedText && !/(class|src|align|style)=/i.test(extractedText)) {
  393. elementText += extractedText + " ";
  394. }
  395. }
  396.  
  397. var imgElements = targetElement.getElementsByTagName("img");
  398. Array.from(imgElements).forEach(function(img) {
  399. if (img.alt) {
  400. elementText += img.alt.trim() + " ";
  401. }
  402. });
  403.  
  404. elementText = elementText.replace(regexCleanUp, ' ').trim();
  405. elementText = elementText.replace(/\u00A0/g, ' ');
  406.  
  407. if (elementText) {
  408. finalTextOutput.push(elementText);
  409. }
  410. });
  411.  
  412. var tempTextArea = document.createElement("textarea");
  413. tempTextArea.value = finalTextOutput.join("\n").replace(/\s+/g, ' ');
  414.  
  415. document.body.appendChild(tempTextArea);
  416. tempTextArea.select();
  417. document.execCommand("Copy");
  418. document.body.removeChild(tempTextArea);
  419.  
  420. setTimeout(function() {
  421. var buttons = Array.from(document.getElementsByTagName('button'));
  422. var searchClipboardButton = buttons.find(button => button.innerText === "Search Clipboard");
  423. if (searchClipboardButton) {
  424. searchClipboardButton.click();
  425. } else {
  426. alert("Make sure the Search Clipboard button is checked in the options pane.");
  427. }
  428. }, 101);
  429. }
  430. }
  431.  
  432. const activityTitleElement = document.getElementById("activity-title");
  433.  
  434. if (activityTitleElement) {
  435. const activityTitleText = activityTitleElement.textContent || activityTitleElement.innerText;
  436.  
  437. function handleAssessment() {
  438. setTimeout(() => {
  439. extractTextFromIframe();
  440. }, 250);
  441.  
  442. const iframe = window.frames[0];
  443. const iframeDocument = iframe.document;
  444.  
  445. const targetElements = iframeDocument.getElementsByClassName("Assessment_Main_Body_Content_Question");
  446.  
  447. const visibleElements = Array.from(targetElements).filter(function(element) {
  448. return element.style.display !== "none" && element.id.includes("q_");
  449. });
  450.  
  451. }
  452.  
  453. function handleAssignment() {
  454. const nestedIframeDocument = window.frames[0].frames[0].document;
  455. const contentElements = nestedIframeDocument.getElementsByClassName("content");
  456. const altElements = nestedIframeDocument.querySelectorAll('[alt]');
  457. let contentText = '';
  458.  
  459. if (contentElements.length > 0) {
  460. contentText = Array.from(contentElements)
  461. .map(element => element.innerText)
  462. .join('\n');
  463. }
  464.  
  465. const altValues = Array.from(altElements)
  466. .map(element => element.getAttribute('alt'))
  467. .join('\n');
  468.  
  469. const combinedText = contentText + (contentText && altValues ? '\n' : '') + altValues;
  470.  
  471. if (combinedText) {
  472. navigator.clipboard.writeText(combinedText)
  473. .then(() => {
  474. console.log('Content copied to clipboard!');
  475.  
  476. setTimeout(() => {
  477. clickSearchClipboard();
  478. }, 100);
  479. });
  480. }
  481. }
  482.  
  483. document.addEventListener('keydown', function(event) {
  484. if (event.key === '3') {
  485. if (activityTitleText.includes("Test") || activityTitleText.includes("Exam") || activityTitleText.includes("Quiz")) {
  486. handleAssessment();
  487. } else if (activityTitleText.includes("Assignment")) {
  488. handleAssignment();
  489. }
  490. }
  491. });
  492. }
  493.  
  494. function clickSearchClipboard() {
  495. const buttons = Array.from(document.querySelectorAll('button'));
  496. const buttonToClick = buttons.find(button => button.innerText === 'Search Clipboard');
  497. if (buttonToClick) {
  498. buttonToClick.click();
  499. } else {
  500. alert("Make sure the Search Clipboard button is checked in the options pane.");
  501. }
  502. }
  503.  
  504. function addKeyListener() {
  505. const frame = window.frames[0];
  506. const initialButtonCheck = document.getElementById('searchActionButton');
  507.  
  508. if (!window.location.href.includes("nuity")) {
  509. return;
  510. }
  511.  
  512. if (frame && !frame.keyListenerAdded) {
  513. frame.keyListenerAdded = true;
  514.  
  515. frame.document.addEventListener('keydown', function(event) {
  516. if (event.key === '3') {
  517. const activityTitleText = document.getElementById('activity-title')?.textContent || '';
  518.  
  519. if (activityTitleText.includes("Assignment")) {
  520. handleAssignment();
  521. }
  522.  
  523. if (activityTitleText.includes("Test") || activityTitleText.includes("Exam") || activityTitleText.includes("Quiz")) {
  524. handleAssessment();
  525. }
  526.  
  527. if (initialButtonCheck) {
  528. initialButtonCheck.click();
  529. }
  530. }
  531. });
  532. }
  533. }
  534.  
  535. setInterval(addKeyListener, 1000);
  536.  
  537.  
  538. function checkForButton() {
  539. const iframeDocument = window.frames[0].document;
  540. const audioEntryButton = iframeDocument.getElementById('btnEntryAudio');
  541.  
  542. if (audioEntryButton) {
  543. const existingButton = iframeDocument.getElementById('searchActionButton');
  544.  
  545. if (!existingButton) {
  546. const searchActionButton = iframeDocument.createElement('button');
  547. searchActionButton.innerText = "Search question";
  548. searchActionButton.id = "searchActionButton";
  549.  
  550. searchActionButton.style.webkitTextSizeAdjust = "100%";
  551. searchActionButton.style.borderSpacing = "0";
  552. searchActionButton.style.borderCollapse = "collapse";
  553. searchActionButton.style.fontFamily = '"Helvetica Neue", Helvetica, Arial, sans-serif';
  554. searchActionButton.style.display = "inline-block";
  555. searchActionButton.style.boxSizing = "border-box";
  556. searchActionButton.style.height = "28px";
  557. searchActionButton.style.border = "1px solid #8d8e8f";
  558. searchActionButton.style.color = "#ffffff";
  559. searchActionButton.style.fontSize = "13px";
  560. searchActionButton.style.lineHeight = "28px";
  561. searchActionButton.style.fontWeight = "bold";
  562. searchActionButton.style.textDecoration = "none";
  563. searchActionButton.style.webkitFontSmoothing = "antialiased";
  564. searchActionButton.style.whiteSpace = "nowrap";
  565. searchActionButton.style.textShadow = "0 0 5px rgba(255, 255, 255, 0.6)";
  566. searchActionButton.style.zoom = "1";
  567. searchActionButton.style.webkitBorderRadius = "3px";
  568. searchActionButton.style.backgroundColor = "#1a1a1a";
  569. searchActionButton.style.backgroundPosition = "center bottom";
  570. searchActionButton.style.backgroundSize = "100% 100%";
  571. searchActionButton.style.boxShadow = "inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)";
  572. searchActionButton.style.cursor = "pointer";
  573. searchActionButton.style.userSelect = "none";
  574. searchActionButton.style.position = "relative";
  575. searchActionButton.style.padding = "0 40px";
  576. searchActionButton.style.textAlign = "center";
  577. searchActionButton.style.margin = "0 10px";
  578.  
  579. audioEntryButton.parentElement.appendChild(searchActionButton);
  580.  
  581. searchActionButton.style.position = "absolute";
  582. searchActionButton.style.left = "50%";
  583. searchActionButton.style.transform = "translateX(-50%)";
  584.  
  585. const bottomTrayElements = iframeDocument.querySelectorAll('[class*="bottom-tray"]');
  586. bottomTrayElements.forEach(trayElement => {
  587. trayElement.style.position = 'relative';
  588. const buttonClone = searchActionButton.cloneNode(true);
  589. trayElement.appendChild(buttonClone);
  590. buttonClone.style.position = "absolute";
  591. buttonClone.style.left = "50%";
  592. buttonClone.style.transform = "translateX(-50%)";
  593. });
  594. }
  595. }
  596. }
  597. if (window.top === window.self) {
  598. const buttonCheckInterval = setInterval(checkForButton, 500);
  599. }
  600.  
  601.  
  602. const observerConfig = {
  603. attributes: false,
  604. childList: true,
  605. subtree: true
  606. };
  607.  
  608. const mutationCallback = function(mutations, observerInstance) {
  609. for (const mutation of mutations) {
  610. if (mutation.type === 'childList') {
  611. const detectedElements = document.querySelectorAll('.mark-return');
  612. if (detectedElements.length > 0) {
  613. appendSearchButton(detectedElements[0].parentNode);
  614. }
  615. }
  616. }
  617. };
  618.  
  619. const appendSearchButton = function(parentContainer) {
  620. const existingButton = document.getElementById('uniqueSearchButtonId');
  621. if (existingButton) return;
  622.  
  623. const searchActionButton = document.createElement('button');
  624. searchActionButton.innerText = "Search question";
  625. searchActionButton.id = "uniqueSearchButtonId";
  626.  
  627. searchActionButton.style.webkitTextSizeAdjust = "100%";
  628. searchActionButton.style.borderSpacing = "0";
  629. searchActionButton.style.borderCollapse = "collapse";
  630. searchActionButton.style.fontFamily = '"Helvetica Neue", Helvetica, Arial, sans-serif';
  631. searchActionButton.style.display = "inline-block";
  632. searchActionButton.style.boxSizing = "border-box";
  633. searchActionButton.style.height = "28px";
  634. searchActionButton.style.border = "1px solid #8d8e8f";
  635. searchActionButton.style.color = "#ffffff";
  636. searchActionButton.style.fontSize = "13px";
  637. searchActionButton.style.lineHeight = "28px";
  638. searchActionButton.style.fontWeight = "bold";
  639. searchActionButton.style.textDecoration = "none";
  640. searchActionButton.style.webkitFontSmoothing = "antialiased";
  641. searchActionButton.style.whiteSpace = "nowrap";
  642. searchActionButton.style.textShadow = "0 0 5px rgba(255, 255, 255, 0.6)";
  643. searchActionButton.style.zoom = "1";
  644. searchActionButton.style.webkitBorderRadius = "3px";
  645. searchActionButton.style.backgroundColor = "#1a1a1a";
  646. searchActionButton.style.backgroundPosition = "center bottom";
  647. searchActionButton.style.backgroundSize = "100% 100%";
  648. searchActionButton.style.boxShadow = "inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)";
  649. searchActionButton.style.cursor = "pointer";
  650. searchActionButton.style.userSelect = "none";
  651.  
  652. searchActionButton.style.position = "absolute";
  653. searchActionButton.style.left = "35%";
  654. searchActionButton.style.top = "50%";
  655. searchActionButton.style.transform = "translate(-70%, -50%)";
  656.  
  657. parentContainer.style.position = "relative";
  658. parentContainer.appendChild(searchActionButton);
  659. };
  660.  
  661. const targetElement = document.body;
  662.  
  663. const observerInstance = new MutationObserver(mutationCallback);
  664.  
  665. observerInstance.observe(targetElement, observerConfig);
  666.  
  667. (function() {
  668. function checkAndAddListener() {
  669. const frame = window.frames[0];
  670.  
  671. if (frame && frame.document) {
  672. const button = frame.document.getElementById("searchActionButton");
  673.  
  674. if (button) {
  675. if (!button.dataset.listenerAdded) {
  676. button.addEventListener('click', handleAssignment);
  677. button.dataset.listenerAdded = true;
  678. console.log("Listener added to the button within the iframe.");
  679. }
  680. }
  681. }
  682. }
  683. if (window.top === window.self) {
  684. setInterval(checkAndAddListener, 500);}
  685.  
  686. })();
  687.  
  688. if (window.top === window.self) {
  689. function monitorFrameForButton() {
  690. const frame = window.frames[0];
  691.  
  692. const checkInterval = setInterval(() => {
  693. if (frame && frame.document) {
  694. const button = frame.document.getElementById('uniqueSearchButtonId');
  695. if (button) {
  696. if (!frame.hasListenerAdded) {
  697. button.addEventListener('click', handleAssessment);
  698. frame.hasListenerAdded = true;
  699. console.log('Listener added to the button.');
  700.  
  701. clearInterval(checkInterval);
  702. }
  703. }
  704. }
  705. }, 100);
  706. }
  707.  
  708. monitorFrameForButton();
  709. }
  710.  
  711.  
  712. let buttonsClicked = false;
  713.  
  714. function updateTextareaAndClickButtonsOnce() {
  715. try {
  716. const iframeDoc = window.frames[0].frames[0].document;
  717.  
  718. if (iframeDoc.readyState === 'complete') {
  719. const textarea = iframeDoc.querySelector('.QuestionTextArea');
  720.  
  721. if (textarea && textarea.value.trim() === '') {
  722. const answerChoices = iframeDoc.querySelectorAll('.answer-choice-label');
  723.  
  724. let allText = '';
  725.  
  726. answerChoices.forEach(choice => {
  727. allText += choice.textContent.trim() + '\n';
  728. });
  729.  
  730. textarea.value = allText.trim();
  731.  
  732. const buttons = iframeDoc.querySelectorAll('.answer-choice-button');
  733.  
  734. buttons.forEach(button => {
  735. if (button) {
  736. button.click();
  737. } else {
  738. console.warn("Button with class 'answer-choice-button' not found.");
  739. }
  740. });
  741.  
  742. const doneButtons = iframeDoc.querySelectorAll('.done-start');
  743. setTimeout(() => {
  744. doneButtons.forEach(doneButton => {
  745. if (doneButton) {
  746. doneButton.click();
  747. } else {
  748. console.warn("Button with class 'done-start' not found.");
  749. }
  750. });
  751.  
  752. const retryButtons = iframeDoc.querySelectorAll('.done-retry');
  753. setTimeout(() => {
  754. retryButtons.forEach(retryButton => {
  755. if (retryButton) {
  756. retryButton.click();
  757. } else {
  758. console.warn("Button with class 'done-retry' not found.");
  759. }
  760. });
  761. },400);
  762. }, 200);
  763. }
  764. }
  765. } catch (error) {
  766. console.error("An error occurred:", error);
  767. }
  768. }
  769. function checkUpdateTextareaAndClickButtonsOnce() {
  770. const isAutoWritingChecked = document.getElementById('autoWritingCheckbox').checked;
  771. const element = document.getElementById('activity-title');
  772.  
  773. const isAssignmentTitle = element && element.textContent.includes("Assignment");
  774.  
  775. const isAutoWritingOnAssignmentChecked = isAssignmentTitle
  776. ? document.getElementById('autoWritingOnAssignmentCheckbox').checked
  777. : true;
  778.  
  779. if (isAutoWritingChecked && (isAssignmentTitle ? isAutoWritingOnAssignmentChecked : true)) {
  780. updateTextareaAndClickButtonsOnce();
  781. }
  782. }
  783. if (window.top === window.self) {
  784. setInterval(checkUpdateTextareaAndClickButtonsOnce, 1000);}
  785.  
  786.  
  787.  
  788. function checkOpacity() {
  789. if (frames[0] && frames[0].document) {
  790. var homeVideoContainer = frames[0].document.getElementById("home_video_container");
  791. if (homeVideoContainer && homeVideoContainer.parentNode.style.opacity == 1) {
  792. } else {
  793. try {
  794. if (document.getElementById("activity-title").innerText == "Assignment") {}
  795. if (["Instruction", "Summary", "Warm-Up"].includes(document.getElementById("activity-title").innerText)) {
  796. try {
  797. clickFootnavAndNextFrame();
  798. window.options = window.frames[0].frames[0].document.getElementsByClassName("answer-choice-button");
  799. window.options[Math.floor(Math.random() * window.options.length)].click();
  800. } catch (TypeError) {}
  801. try {
  802. window.frames[0].API.Frame.check();
  803. } catch (TypeError) {}
  804. }
  805. } catch (TypeError) {}
  806. }
  807. }
  808. }
  809.  
  810. function checkcheckOpacity() {
  811. const isGuessingChecked = document.getElementById('guessingCheckbox').checked;
  812. if (isGuessingChecked) {
  813. checkOpacity();
  814. }
  815. }
  816. if (window.top === window.self) {
  817. setInterval(checkcheckOpacity, 1000);}
  818.  
  819.  
  820.  
  821. setInterval(function() {
  822. var element = document.getElementById("invis-o-div");
  823. if (element) {
  824. element.remove();
  825. }
  826. }, 1000);
  827.  
  828.  
  829.  
  830. function clickFootnavAndNextFrame() {
  831. try {
  832. document.getElementsByClassName("footnav goRight")[0].click();
  833. } catch (TypeError) {}
  834.  
  835. try {
  836. window.frames[0].API.FrameChain.nextFrame();
  837. } catch (TypeError) {}
  838. }
  839.  
  840.  
  841.  
  842. var clipboardButton;
  843.  
  844. function createClipboardSearchButton() {
  845. try {
  846. var iframe = document.querySelector("iframe");
  847. if (iframe) {
  848. var rect = iframe.getBoundingClientRect();
  849. var iframeTop = rect.top + window.scrollY;
  850. var iframeRight = rect.right + window.scrollX;
  851.  
  852. var buttonContainer = document.createElement('div');
  853. buttonContainer.style.position = 'fixed';
  854. buttonContainer.style.top = (iframeTop + 10) + 'px';
  855. buttonContainer.style.left = (iframeRight - 150) + 'px';
  856. buttonContainer.style.zIndex = '9999';
  857. document.body.appendChild(buttonContainer);
  858.  
  859. clipboardButton = document.createElement('button');
  860. clipboardButton.innerText = 'Search Clipboard';
  861. buttonContainer.appendChild(clipboardButton);
  862. }
  863. } catch (error) {
  864. console.error('Error accessing the first iframe:', error);
  865. }
  866. }
  867.  
  868. function checkClipboardSearchButton() {
  869. const isClipboardChecked = document.getElementById('searchClipboardCheckbox').checked;
  870.  
  871. if (isClipboardChecked) {
  872. if (!clipboardButton) {
  873. createClipboardSearchButton();
  874. }
  875. } else {
  876. if (clipboardButton) {
  877. clipboardButton.parentElement.removeChild(clipboardButton);
  878. clipboardButton = null;
  879. }
  880. }
  881. }
  882. if (window.top === window.self) {
  883. setInterval(checkClipboardSearchButton, 1000);}
  884.  
  885.  
  886. document.addEventListener('click', function(event) {
  887. if (event.target.tagName === 'BUTTON' && event.target.innerText.includes('Clipboard')) {
  888. navigator.clipboard.readText().then(function(clipboardText) {
  889. if (clipboardText) {
  890. var isBrainlyChecked = document.getElementById('searchInBrainlyCheckbox').checked;
  891. var searchUrl = 'https://brainly.com/app/ask?entry=top&q=' + encodeURIComponent(clipboardText);
  892.  
  893. if (isBrainlyChecked) {
  894. var brainlyIframe = document.getElementById('brainly-chat-iframe');
  895. if (brainlyIframe) {
  896. brainlyIframe.src = searchUrl;
  897. }
  898. } else {
  899. window.open(searchUrl, '_blank');
  900. }
  901. }
  902. }).catch(function(err) {
  903. console.error('Failed to read clipboard contents: ', err);
  904. });
  905. }
  906. });
  907.  
  908. function addDeepaiIframes() {
  909. const wrapElement = document.getElementById('wrap');
  910.  
  911. if (!document.getElementById('deepai-chat-iframe')) {
  912. const deepaiIframe = document.createElement('iframe');
  913. deepaiIframe.id = 'deepai-chat-iframe';
  914. deepaiIframe.src = 'https://deepai.org/chat';
  915.  
  916. deepaiIframe.style.width = '25%';
  917. deepaiIframe.style.height = '100vh';
  918. deepaiIframe.style.border = 'none';
  919. deepaiIframe.style.position = 'absolute';
  920. deepaiIframe.style.top = '0';
  921. deepaiIframe.style.right = '0';
  922. deepaiIframe.style.zIndex = '20000';
  923. wrapElement.style.position = 'relative';
  924. deepaiIframe.style.opacity = '0';
  925. deepaiIframe.style.transition = 'opacity 0.5s';
  926. deepaiIframe.sandbox = 'allow-same-origin allow-scripts';
  927.  
  928. document.body.appendChild(deepaiIframe);
  929. }
  930. }
  931.  
  932. function addBrainlyIframes() {
  933. const wrapElement = document.getElementById('wrap');
  934.  
  935. if (!document.getElementById('brainly-chat-iframe')) {
  936. const brainlyIframe = document.createElement('iframe');
  937. brainlyIframe.id = 'brainly-chat-iframe';
  938. brainlyIframe.src = 'https://brainly.com/search';
  939.  
  940. brainlyIframe.style.width = '25%';
  941. brainlyIframe.style.height = '100vh';
  942. brainlyIframe.style.border = 'none';
  943. brainlyIframe.style.position = 'absolute';
  944. brainlyIframe.style.top = '0';
  945. brainlyIframe.style.left = '0';
  946. brainlyIframe.style.zIndex = '20000';
  947. wrapElement.style.position = 'relative';
  948. brainlyIframe.style.opacity = '0';
  949. brainlyIframe.style.transition = 'opacity 0.5s';
  950. brainlyIframe.sandbox = 'allow-same-origin allow-scripts';
  951.  
  952. document.body.appendChild(brainlyIframe);
  953. }
  954. }
  955.  
  956. addDeepaiIframes();
  957. addBrainlyIframes();
  958.  
  959. function updateDeepaiIframeVisibility() {
  960. const deepaiIframe = document.getElementById('deepai-chat-iframe');
  961. const isAiChatChecked = document.getElementById('aiChatCheckbox').checked;
  962.  
  963. if (deepaiIframe) {
  964. if (isAiChatChecked) {
  965. deepaiIframe.style.opacity = '1';
  966. deepaiIframe.style.display = 'block';
  967. } else {
  968. deepaiIframe.style.opacity = '0';
  969. setTimeout(() => deepaiIframe.style.display = 'none', 500);
  970. }
  971. }
  972. }
  973.  
  974. function updateBrainlyIframeVisibility() {
  975. const brainlyIframe = document.getElementById('brainly-chat-iframe');
  976. const isBrainlyChecked = document.getElementById('searchInBrainlyCheckbox').checked;
  977.  
  978. if (brainlyIframe) {
  979. if (isBrainlyChecked) {
  980. brainlyIframe.style.opacity = '1';
  981. brainlyIframe.style.display = 'block';
  982. } else {
  983. brainlyIframe.style.opacity = '0';
  984. setTimeout(() => brainlyIframe.style.display = 'none', 500);
  985. }
  986. }
  987. }
  988.  
  989. setInterval(() => {
  990. updateDeepaiIframeVisibility();
  991. updateBrainlyIframeVisibility();
  992. }, 1000);
  993.  
  994. function createButtonAndPane() {
  995. if (document.querySelector('#tweaksButton')) return;
  996.  
  997. const mainFootDiv = document.querySelector('.mainfoot');
  998.  
  999. const toggleButton = document.createElement('button');
  1000. toggleButton.id = 'tweaksButton';
  1001. toggleButton.textContent = 'Toggle Options';
  1002.  
  1003. toggleButton.style.border = "1px solid #5f5f5f";
  1004. toggleButton.style.boxShadow = "inset 0 0 5px rgba(0, 0, 0, 0.6)";
  1005. toggleButton.style.backgroundColor = "rgb(39, 39, 39)";
  1006. toggleButton.style.color = "#f9a619";
  1007. toggleButton.style.borderRadius = "3px";
  1008. toggleButton.style.marginLeft = "40%";
  1009. toggleButton.style.zIndex = "2";
  1010. toggleButton.style.padding = '5px 10px';
  1011.  
  1012. mainFootDiv.appendChild(toggleButton);
  1013.  
  1014. if (!window.pane) {
  1015. window.pane = document.createElement('div');
  1016. window.pane.style.display = 'none';
  1017. document.body.appendChild(window.pane);
  1018.  
  1019. const popupMenu = document.createElement('div');
  1020. popupMenu.className = 'popup-menu';
  1021.  
  1022. const aiChatItem = createMenuItem('AI Chat', 'aiChatCheckbox');
  1023. popupMenu.appendChild(aiChatItem);
  1024.  
  1025. const searchInBrainlyItem = createMenuItem('Search in Brainly frame', 'searchInBrainlyCheckbox');
  1026. popupMenu.appendChild(searchInBrainlyItem);
  1027.  
  1028. const autoVocabItem = createMenuItem('Auto Vocab', 'autoVocabCheckbox');
  1029. popupMenu.appendChild(autoVocabItem);
  1030.  
  1031. const autoWritingItem = createMenuItem('Auto Writing', 'autoWritingCheckbox');
  1032. popupMenu.appendChild(autoWritingItem);
  1033.  
  1034. const autoplayItem = createMenuItem('Autoplay', 'autoplayCheckbox');
  1035. popupMenu.appendChild(autoplayItem);
  1036.  
  1037. const searchClipboardItem = createMenuItem('Search Clipboard Button', 'searchClipboardCheckbox');
  1038. popupMenu.appendChild(searchClipboardItem);
  1039.  
  1040. const guessingItem = createMenuItem('Guessing', 'guessingCheckbox');
  1041. popupMenu.appendChild(guessingItem);
  1042.  
  1043. const autoWritingOnAssignmentItem = createMenuItem('AutoWriting On Assignment', 'autoWritingOnAssignmentCheckbox');
  1044. popupMenu.appendChild(autoWritingOnAssignmentItem);
  1045.  
  1046. window.pane.appendChild(popupMenu);
  1047.  
  1048. const footerText = document.createElement('div');
  1049. footerText.style.marginTop = '20px';
  1050. footerText.style.color = 'rgb(249, 166, 25)';
  1051. footerText.style.textAlign = "center";
  1052. footerText.textContent = "This was made by me, TallTacoTristan, as a way to make edge-nuity " +
  1053. "classes MUCH easier and skip by the tedious bits but it took a long time, over " +
  1054. "100 hours of just coding, to write over a thousand lines, it has many features, " +
  1055. "the ones above are less than half, just the ones that need a toggle. " +
  1056. "So please leave a good review on my page for all the time I spent to save yours, Thank you.";
  1057.  
  1058. const discordMessage = document.createElement('div');
  1059. discordMessage.textContent = "Join this discord if you have any issues, questions, or suggestions!.";
  1060. discordMessage.style.marginTop = '10px';
  1061.  
  1062. const discordLink = document.createElement('a');
  1063. discordLink.textContent = "https://discord.gg/6qJwkYSmrQ";
  1064. discordLink.href = "https://discord.gg/6qJwkYSmrQ";
  1065. discordLink.target = "_blank";
  1066. discordLink.style.marginTop = '5px';
  1067. discordLink.style.color = 'cyan';
  1068. discordLink.style.textDecoration = 'underline';
  1069.  
  1070. footerText.appendChild(discordMessage);
  1071. footerText.appendChild(discordLink);
  1072.  
  1073. window.pane.appendChild(footerText);
  1074.  
  1075.  
  1076. loadCheckboxState('aiChat', 'aiChatCheckbox');
  1077. loadCheckboxState('searchInBrainly', 'searchInBrainlyCheckbox');
  1078. loadCheckboxState('autoVocab', 'autoVocabCheckbox');
  1079. loadCheckboxState('autoWriting', 'autoWritingCheckbox');
  1080. loadCheckboxState('autoplay', 'autoplayCheckbox');
  1081. loadCheckboxState('searchClipboard', 'searchClipboardCheckbox');
  1082. loadCheckboxState('guessing', 'guessingCheckbox');
  1083. loadCheckboxState('autoWritingOnAssignment', 'autoWritingOnAssignmentCheckbox');
  1084.  
  1085. makeDraggable(window.pane);
  1086. }
  1087.  
  1088. toggleButton.addEventListener('click', function() {
  1089. console.log('Button clicked! Toggling pane visibility.');
  1090.  
  1091. if (window.pane.style.display === 'none' || window.pane.style.display === '') {
  1092. window.pane.style.width = "50%";
  1093. window.pane.style.height = "auto";
  1094. window.pane.style.position = "absolute";
  1095. window.pane.style.marginTop = "20vh";
  1096. window.pane.style.marginLeft = "25%";
  1097. window.pane.style.border = "1px solid rgb(95, 95, 95)";
  1098. window.pane.style.borderRadius = "3px";
  1099. window.pane.style.backgroundColor = "rgb(39, 39, 39)";
  1100. window.pane.style.overflow = "hidden";
  1101. window.pane.style.color = "rgb(249, 166, 25)";
  1102. window.pane.style.textAlign = "center";
  1103. window.pane.style.overflowY = "scroll";
  1104. window.pane.style.display = 'block';
  1105.  
  1106. checkCheckboxState('aiChatCheckbox');
  1107. checkCheckboxState('searchInBrainlyCheckbox');
  1108. checkCheckboxState('autoVocabCheckbox');
  1109. checkCheckboxState('autoWritingCheckbox');
  1110. checkCheckboxState('autoplayCheckbox');
  1111. checkCheckboxState('searchClipboardCheckbox');
  1112. checkCheckboxState('guessingCheckbox');
  1113. checkCheckboxState('autoWritingOnAssignmentCheckbox');
  1114. } else {
  1115. window.pane.style.display = 'none';
  1116. }
  1117. });
  1118. }
  1119. function makeDraggable(element) {
  1120. let offsetX, offsetY;
  1121.  
  1122. element.addEventListener('mousedown', function(e) {
  1123. e.preventDefault();
  1124. offsetX = e.clientX - element.getBoundingClientRect().left + element.offsetWidth / 2;
  1125. offsetY = e.clientY - element.getBoundingClientRect().top + element.offsetHeight / 2;
  1126. element.classList.add('dragging');
  1127.  
  1128. document.addEventListener('mousemove', dragElement);
  1129. document.addEventListener('mouseup', stopDragging);
  1130. });
  1131.  
  1132. function dragElement(e) {
  1133. e.preventDefault();
  1134. let x = e.clientX - offsetX;
  1135. let y = e.clientY - offsetY;
  1136.  
  1137. element.style.left = x + 'px';
  1138. element.style.top = y + 'px';
  1139. }
  1140.  
  1141. function stopDragging() {
  1142. element.classList.remove('dragging');
  1143. document.removeEventListener('mousemove', dragElement);
  1144. document.removeEventListener('mouseup', stopDragging);
  1145. }
  1146. }
  1147. function createMenuItem(text, checkboxId) {
  1148. const itemDiv = document.createElement('div');
  1149. itemDiv.className = 'menu-item';
  1150.  
  1151. const checkbox = document.createElement('input');
  1152. checkbox.type = 'checkbox';
  1153. checkbox.id = checkboxId;
  1154.  
  1155. const storedValue = localStorage.getItem(checkboxId);
  1156. if (storedValue !== null) {
  1157. checkbox.checked = (storedValue === 'true');
  1158. }
  1159.  
  1160. const label = document.createElement('label');
  1161. label.innerText = text;
  1162. label.setAttribute('for', checkboxId);
  1163.  
  1164. itemDiv.appendChild(checkbox);
  1165. itemDiv.appendChild(label);
  1166.  
  1167. checkbox.addEventListener('change', () => {
  1168. console.log(`${text} checkbox is now ${checkbox.checked ? 'checked' : 'unchecked'}`);
  1169. localStorage.setItem(checkboxId, checkbox.checked);
  1170. });
  1171.  
  1172. return itemDiv;
  1173. }
  1174.  
  1175. function loadCheckboxState(checkboxId) {
  1176. const storedValue = localStorage.getItem(checkboxId);
  1177. if (storedValue !== null) {
  1178. const checkbox = document.getElementById(checkboxId);
  1179. if (checkbox) {
  1180. checkbox.checked = (storedValue === 'true');
  1181. }
  1182. }
  1183. }
  1184.  
  1185. function checkCheckboxState(checkboxId) {
  1186. const checkbox = document.getElementById(checkboxId);
  1187. const storedValue = localStorage.getItem(checkboxId);
  1188.  
  1189. if (storedValue !== null && checkbox) {
  1190. if (checkbox.checked !== (storedValue === 'true')) {
  1191. checkbox.checked = (storedValue === 'true');
  1192. }
  1193. }
  1194. }
  1195. if (window.top === window.self) {
  1196. setInterval(createButtonAndPane, 1000);}
  1197.  
  1198.  
  1199.  
  1200. var checkbox = document.getElementById('searchInBrainlyCheckbox');
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206. let lastTitle = '';
  1207.  
  1208. function checkForAssignment() {
  1209. const element = document.getElementById('activity-title');
  1210. if (element) {
  1211. const currentTitle = element.textContent || element.innerText;
  1212.  
  1213. const excludedKeywords = [
  1214. "Summary", "Warm-Up", "Instruction", "Quiz",
  1215. "Assignment", "Unit Test",
  1216. "Unit Review", "Cumulative Exam Review",
  1217. "Vocab","Cumulative Exam"
  1218. ];
  1219.  
  1220. const containsExcludedKeyword = excludedKeywords.some(keyword => currentTitle.includes(keyword));
  1221. const currentContainsAssignment = currentTitle.includes("Assignment");
  1222.  
  1223. if (currentTitle !== lastTitle) {
  1224. if (currentContainsAssignment || !containsExcludedKeyword) {
  1225. new Notification("Done!");
  1226. }
  1227. lastTitle = currentTitle;
  1228. }
  1229. }
  1230. }if (window.top === window.self) {
  1231. setInterval(checkForAssignment, 1000);}
  1232.  
  1233. const isAutoVocabChecked = document.getElementById('autoVocabCheckbox').checked;
  1234.  
  1235.  
  1236. function clickNextButtonIfVocabulary() {
  1237. if (document.getElementById("activity-title").innerText === "Vocabulary") {
  1238. const nextButton = window.frames[0].document.getElementsByClassName("uibtn uibtn-blue uibtn-arrow-next")[0];
  1239. if (nextButton) {
  1240. nextButton.click();
  1241. console.log("Clicked next button");
  1242. } else {
  1243. console.log("Next button not found");
  1244. }
  1245. }
  1246. }
  1247.  
  1248. function vocabCompleter() {
  1249. if (document.getElementById("activity-title").innerText === "Vocabulary") {
  1250. var i = 0;
  1251. try {
  1252. var txt = window.frames[0].document.getElementsByClassName("word-background")[0].value;
  1253. window.frames[0].document.getElementsByClassName("word-textbox")[0].value = txt;
  1254. var event = new Event("keyup");
  1255. window.frames[0].document.getElementsByClassName("word-textbox word-normal")[0].dispatchEvent(event);
  1256. } catch (e) {
  1257. console.error(e);
  1258. return;
  1259. }
  1260.  
  1261. var speed = 50;
  1262. var output = "Vocab Completer, ";
  1263.  
  1264. window.frames[0].document.getElementsByClassName("playbutton vocab-play")[0].click();
  1265. window.frames[0].document.getElementsByClassName("playbutton vocab-play")[1].click();
  1266.  
  1267. }
  1268. }
  1269.  
  1270. function checkAndExecuteFunctions() {
  1271. const isAutoVocabChecked = document.getElementById('autoVocabCheckbox').checked;
  1272. if (isAutoVocabChecked) {
  1273. clickNextButtonIfVocabulary();
  1274. vocabCompleter();
  1275. }
  1276. }
  1277. if (window.top === window.self) {
  1278. setInterval(checkAndExecuteFunctions, 1000);}
  1279.  
  1280.  
  1281. if (window.top === window.self) {
  1282. setInterval(() => {
  1283. const activityTitle = document.getElementById("activity-title").innerText;
  1284. const homeVideoContainer = document.querySelector('.home-video-container');
  1285. const shouldClick = !(
  1286. homeVideoContainer &&
  1287. homeVideoContainer.parentNode.style.opacity == "1"
  1288. );
  1289.  
  1290. if (shouldClick && !["Assignment", "Quiz"].includes(activityTitle)) {
  1291. const goRightButton = document.querySelector(".FrameRight");
  1292. if (goRightButton) {
  1293. goRightButton.onclick();
  1294. }
  1295. const iconButton = document.querySelector(".nav-icon[data-bind='realEnable: $root.stageView().nextEnabled']");
  1296. if (iconButton) {
  1297. iconButton.click();
  1298. }
  1299. }
  1300. }, 1000);}
  1301.  

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址