BetterFap - Fap Gauntlet

Fap Gauntlet for BetterFap

  1. // ==UserScript==
  2. // @name BetterFap - Fap Gauntlet
  3. // @author Goog
  4. // @description Fap Gauntlet for BetterFap
  5. // @namespace https://aint-got-none.fap/
  6. // @include https://test.betterfap.com/*
  7. // @include https://betterfap.com/*
  8. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
  9. // @require http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js
  10. // @grant unsafeWindow
  11. // @version 0.56
  12. // ==/UserScript==
  13.  
  14. // Change/Add/Remove masturbation styles here
  15.  
  16. var masturbationStyle = [
  17. 'Normal Grip',
  18. 'Inverse Grip',
  19. 'Only Down-Strokes',
  20. 'Only Up-Strokes',
  21. //'Palm Circles',
  22. 'Squeeze',
  23. 'Top half only',
  24. 'Bottom half only',
  25. //'spin'
  26. ];
  27.  
  28. var gripStrength = [
  29. 'Loose',
  30. 'Normal',
  31. 'Tight'
  32. //'inverse',
  33. //'normal'
  34. ];
  35.  
  36. // Change/Add/Remove speeds as you like
  37.  
  38. var fapsPerSec = [
  39. 0.1,
  40. 0.2,
  41. 0.33,
  42. 0.5,
  43. 1,
  44. 1.5,
  45. 2,
  46. 2.5,
  47. 3,
  48. 3.5,
  49. 4,
  50. 4.5,
  51. 5
  52. ];
  53.  
  54. // Change/Add/Remove dildo styles here
  55.  
  56. var dildoStyle = [
  57. 'Rub outside',
  58. 'Prod',
  59. 'Normal Thrusts',
  60. 'Deep thrusts',
  61. 'All the way'
  62. ];
  63.  
  64. // Strict speeds with a dildo didn't make sense to me
  65. // so add any speeds you'd like with a dildo here
  66.  
  67. var dildoSpeed = [
  68. 'Slow',
  69. 'Moderate',
  70. 'Fast'
  71. ];
  72.  
  73. // Below is non-user-friendly stuff.
  74. // Don't touch it if you dont want the script to break!
  75.  
  76. var FGisON = false;
  77. var firstStart = true;
  78. var isPlaying = false;
  79. var currViewObj = null;
  80. var lines = 0;
  81. var currFPS = 0;
  82. var denialMode = false;
  83. var dildoMode = false;
  84. var canCum = false;
  85. var canCumNext = false;
  86. var canCumPrev = false;
  87. var currIntensity = null;
  88. var currDilInt = null;
  89. var currDilSpeed = null;
  90. var randTime = 1000;
  91. var changedNormally = null;
  92. var dildoStuff = [];
  93. var handsOffMode = false;
  94. var visualGuideMode = false;
  95. var autoOverride = false;
  96. var currCurve;
  97. var buttonsHidden = false;
  98. var cumText;
  99.  
  100. // Don't touch this.
  101. var visualCurve = [
  102. 'linear',
  103. 'ease',
  104. 'ease-in',
  105. 'ease-in-out',
  106. 'ease-out'
  107. ];
  108.  
  109. var context = new AudioContext();
  110. var o = context.createOscillator();
  111. o.type = "sawtooth";
  112. o.connect(context.destination);
  113. o.frequency.value = 0;
  114.  
  115. function getRandomInt(min, max) {
  116. return Math.floor(Math.random() * (max - min + 1)) + min;
  117. }
  118.  
  119. function getRandomFPS() {
  120.  
  121. // check bottom of script if you want to see the depths of autism
  122.  
  123. //return cleanGauss(generateGaussianNoise(3 ,2));
  124.  
  125. var rand = getRandomInt(0, fapsPerSec.length - 1);
  126. return fapsPerSec[rand];
  127. }
  128.  
  129. function getCumState() { // 1 in 7 chance to be allowed to cum
  130. if (getRandomInt(1, 7) == 1) {
  131. //if (getRandomInt(1, 3) == 1) {
  132. canCum = canCumNext;
  133. canCumNext = true;
  134. } else {
  135. canCum = canCumNext;
  136. canCumNext = false;
  137. }
  138.  
  139. return canCum;
  140. }
  141.  
  142. function getCumText() {
  143. if (canCum === true) {
  144. cumText = "You can cum.";
  145. } else {
  146. cumText = "Do not cum.";
  147. }
  148. return cumText;
  149. }
  150.  
  151. function getRandomIntensity() {
  152. var rand = getRandomInt(1, 75);
  153. var x = 2000;
  154. return masturbationStyle[getRandomInt(0, masturbationStyle.length - 1)];
  155. }
  156.  
  157. function getRandTime(randFPS) {
  158. return getRandomInt(1, 4) * 10;
  159. }
  160.  
  161. function getDildoSpeed() {
  162. var rand = getRandomInt(0, 2);
  163. return dildoSpeed[rand];
  164. }
  165.  
  166. function getdildoStyle() {
  167. var rand = getRandomInt(0, 4);
  168. return dildoStyle[rand];
  169. }
  170.  
  171. function getGripStrength(style) {
  172. var rand = getRandomInt(0, gripStrength.length - 1);
  173. if (style == 'Palm Circles') {
  174. return "";
  175. }
  176. return gripStrength[rand];
  177. }
  178.  
  179. function getVisualCurve() {
  180. var rand = getRandomInt(0, visualCurve.length - 1);
  181. return visualCurve[rand];
  182. }
  183.  
  184. function sleep(milliseconds) {
  185. var start = new Date().getTime();
  186. for (var i = 0; i < 1e7; i++) {
  187. if ((new Date().getTime() - start) > milliseconds) {
  188. break;
  189. }
  190. }
  191. }
  192.  
  193. function getNewFapData(lastInten, lastFPS) { // sets the next image's fap data
  194.  
  195. i = 0;
  196. currIntensity = getRandomIntensity();
  197. currFPS = getRandomFPS();
  198. randTime = getRandTime(currFPS) + 1;
  199. //randTime = 7;
  200. getCumState();
  201. currDilInt = getdildoStyle();
  202. currDilSpeed = getDildoSpeed();
  203. currCurve = getVisualCurve();
  204. currGripStrength = getGripStrength(currIntensity);
  205.  
  206. // it's fucking hard to maintain a feather-light touch four or five times a second, so let's not.
  207.  
  208. if (((currFPS >= 4) && currIntensity == 'Inverse Grip') ||
  209. ((currFPS >= 4) && currIntensity == 'Squeeze') ||
  210. ((currFPS > 3) && currIntensity == 'Palm Circles') ||
  211. ((currFPS > 3) && currIntensity == 'Only Up-Strokes') ||
  212. ((currFPS > 3) && currIntensity == 'Only Down-Strokes')
  213. ) {
  214. do {
  215. currIntensity = getRandomIntensity();
  216. currFPS = getRandomFPS();
  217. currGripStrength = getGripStrength(currIntensity);
  218. } while (((currFPS >= 4) && currIntensity == 'Inverse Grip') ||
  219. ((currFPS >= 4) && currIntensity == 'Squeeze') ||
  220. ((currFPS > 3) && currIntensity == 'Palm Circles') ||
  221. ((currFPS > 3) && currIntensity == 'Only Up-Strokes') ||
  222. ((currFPS > 3) && currIntensity == 'Only Down-Strokes'));
  223. }
  224.  
  225. if (isPlaying) {
  226. o.frequency.value = currFPS;
  227. }
  228.  
  229. if (visualGuideMode) {
  230. if (currFPS < 2) {
  231. $("#VisualGuide")[0].style.animation = "play 0s infinite " + currCurve;
  232. $("#VisualGuide")[0].style.animation = "play " + (1 / currFPS) + "s infinite " + currCurve;
  233. } else {
  234. $("#VisualGuide")[0].style.animation = "play 0s infinite " + currCurve;
  235. $("#VisualGuide")[0].style.animation = "play " + (1 / currFPS) + "s infinite linear";
  236. }
  237. }
  238. }
  239.  
  240. function remakeDialog() {
  241.  
  242. $("#FapDialog")[0].style.display = "block";
  243.  
  244. document.querySelector('div[id="FapDialog"]').innerHTML = "Starting...";
  245.  
  246. if (remakeDialog.interval) {
  247. clearInterval(remakeDialog.interval);
  248. }
  249.  
  250. // set the first image's length, faps per sec, etc
  251.  
  252. i = 0;
  253. currIntensity = getRandomIntensity();
  254. currFPS = getRandomFPS();
  255. randTime = getRandTime(currFPS); // every randtime after this has +1 so that the numbers show as multiples of ten on the first stroke instead of 10x + 9 which was annoying my autism greatly
  256. //randTime = 7;
  257. getCumState();
  258. currDilInt = getdildoStyle();
  259. currDilSpeed = getDildoSpeed();
  260. currCurve = getVisualCurve();
  261. currGripStrength = getGripStrength(currIntensity);
  262.  
  263. // it's fucking hard to maintain a feather-light touch four or five times a second, so let's not.
  264.  
  265. if (((currFPS >= 4) && currIntensity == 'Inverse Grip') ||
  266. ((currFPS >= 4) && currIntensity == 'Squeeze') ||
  267. ((currFPS > 3) && currIntensity == 'Palm Circles') ||
  268. ((currFPS > 3) && currIntensity == 'Only Up-Strokes') ||
  269. ((currFPS > 3) && currIntensity == 'Only Down-Strokes')
  270. ) {
  271. do {
  272. currIntensity = getRandomIntensity();
  273. currFPS = getRandomFPS();
  274. } while (((currFPS >= 4) && currIntensity == 'Inverse Grip') ||
  275. ((currFPS >= 4) && currIntensity == 'Squeeze') ||
  276. ((currFPS > 3) && currIntensity == 'Palm Circles') ||
  277. ((currFPS > 3) && currIntensity == 'Only Up-Strokes') ||
  278. ((currFPS > 3) && currIntensity == 'Only Down-Strokes'));
  279. }
  280.  
  281. if (isPlaying) { // if the user has the audio helper enabled, change it to match current FPS
  282. o.frequency.value = currFPS;
  283. }
  284.  
  285. if (visualGuideMode) {
  286. $("#VisualGuide")[0].style.display = "block";
  287. $("#VisualGuide")[0].style.animation = "play " + (1 / currFPS) + "s infinite " + currCurve;
  288. }
  289.  
  290. currViewObj = unsafeWindow.AppState.viewing;
  291.  
  292. remakeDialog.interval = setInterval(
  293. function oneSecTimer() {
  294.  
  295. if (handsOffMode && !canCum) {
  296. document.querySelector('div[id="FapDialog"]').innerHTML = "Hands Off, " + (randTime - i);
  297. } else if (handsOffMode && canCum) {
  298. document.querySelector('div[id="FapDialog"]').innerHTML = "Hands Off, " + (randTime - i) + "<br> You could have cum.";
  299. } else if (denialMode === false && dildoMode === false) {
  300. document.querySelector('div[id="FapDialog"]').innerHTML = currIntensity + ", " + currGripStrength + "<br />" + currFPS + "/sec, " + (randTime - i);
  301. } else if (denialMode === true && dildoMode === false) {
  302. document.querySelector('div[id="FapDialog"]').innerHTML = currIntensity + ", " + currGripStrength + "<br />" + currFPS + "/sec, " + (randTime - i) + "<br />" + getCumText();
  303. } else if (denialMode === false && dildoMode === true) {
  304. document.querySelector('div[id="FapDialog"]').innerHTML = currDilInt + "<br />" + currDilSpeed + ", " + (randTime - i);
  305. } else if (denialMode === true && dildoMode === true) {
  306. document.querySelector('div[id="FapDialog"]').innerHTML = currDilInt + "<br />" + currDilSpeed + ", " + (randTime - i) + "<br />" + getCumText();
  307. }
  308.  
  309. //if (visualGuideMode)
  310. //document.querySelector('div[id="FapDialog"]').innerHTML = document.querySelector('div[id="FapDialog"]').innerHTML + "<br />" + currCurve;
  311.  
  312. if ((randTime - i <= 1) && !(autoOverride)) { // aka if the time ticked down normally to 0, go to next image and get new fap data
  313.  
  314. handsOffMode = false;
  315.  
  316. //document.querySelector('div[id="errordiv"]').innerHTML += "<br/> "+ (lines++) + " t doesnt work right, <br />fav to rec breaks when start on fav or ue<br />thinks changed every slide";
  317.  
  318.  
  319. getNewFapData(currIntensity, currFPS);
  320.  
  321. //****next image function****
  322.  
  323. var $ = unsafeWindow.jQuery;
  324.  
  325. window.top.postMessage({
  326. action: 'next',
  327. cr: $.cookie().cr
  328. }, window.top.location.protocol + window.top.location.host);
  329.  
  330. if (denialMode) {
  331.  
  332. logit("now:" + canCum + " next:" + canCumNext);
  333. if (canCumNext && !canCum) {
  334. logit("switched to favs");
  335. window.top.postMessage({
  336. action: 'mode',
  337. mode: 'favorites',
  338. sort: 'rand',
  339. cr: $.cookie().cr
  340. }, window.top.location.protocol + window.top.location.host);
  341. } else if (!canCum && !canCumNext) {
  342. try {
  343. logit("switched to recs");
  344. window.top.postMessage({
  345. action: 'mode',
  346. mode: 'recommend',
  347. cr: $.cookie().cr
  348. }, window.top.location.protocol + window.top.location.host);
  349. unsafeWindow.AppState.tab.clear();
  350. } catch (error) {
  351. logit(error);
  352. }
  353. }
  354.  
  355. }
  356.  
  357. //****
  358.  
  359. changedNormally = true;
  360.  
  361. setTimeout(function () {
  362. currViewObj = unsafeWindow.AppState.viewing;
  363. }, 1000);
  364.  
  365. } else if ((currViewObj != unsafeWindow.AppState.viewing) && (!(changedNormally) && !(handsOffMode))) { // if the user skipped their current image (or hit backspace or the image changed literally at all)
  366.  
  367. currViewObj = unsafeWindow.AppState.viewing;
  368.  
  369. //getNewFapData(currIntensity, currFPS);
  370.  
  371. //document.querySelector('div[id="errordiv"]').innerHTML += "<br/> "+ (lines++) + " thought it was changed!";
  372.  
  373. } else if (autoOverride && randTime - i <= 1) {
  374. getNewFapData(currIntensity, currFPS);
  375. }
  376.  
  377. i = i + 1;
  378.  
  379. if (i > 2) {
  380. changedNormally = false;
  381. }
  382.  
  383. },
  384. 1000);
  385. }
  386.  
  387. function redrawOptions() {
  388.  
  389. $("div#tippy-top").first().append('<div class="view-item-container" id="embed-container-copy" style="width: 200px; height: 300px, position: relative;">');
  390.  
  391. $("div#tippy-top").first().append('<div id="FapDialog" style="font-size:400%; color: #00FF00"></div>');
  392.  
  393. $("#embed-container-copy").append('<div id="dropdown" style="font-size:100%; color: white; width: 100px; position: fixed; left: -20px; top: 50px; z-index:81000 !important">▼ Hide</div>');
  394. $("#embed-container-copy").append('<div id="ToggleAutoAdvance" style="font-size:120%; color: white; width: 200px; position: fixed; left: -10px; top: 100px; z-index:81000 !important">Disable Auto-Advance</div>');
  395. $("#embed-container-copy").append('<div id="ToggleFG" style="font-size:120%; color: white; width: 200px; position: fixed; left: -10px; top: 70px; z-index:81000 !important">Enable Fap Gauntlet</div>');
  396. $("#embed-container-copy").append('<div id="ToggleDenial" style="font-size:120%; color: white; width: 200px; position: fixed; left: -10px; top: 190px; z-index:81000 !important">Enable Denial Mode</div>');
  397. $("#embed-container-copy").append('<div id="ToggleVG" style="font-size:120%; color: white; width: 200px; position: fixed; left: -10px; top: 130px; z-index:81000 !important">Enable Visual Guide</div>');
  398. $("#embed-container-copy").append('<div id="ToggleDildo" style="font-size:120%; color: white; width: 200px; position: fixed; left: -10px; top: 220px; z-index:81000 !important">Enable Dildo Mode</div>');
  399. $("#embed-container-copy").append('<div id="ToggleAH" style="font-size:120%; color: white; width: 200px; position: fixed; left: -10px; top: 160px; z-index:81000 !important">Enable Audio Helper</div>');
  400. $("#embed-container-copy").append('<div id="errordiv" style="font-size:100%; display:inline; color: white; width: 400px; position: fixed; right: -20px; top: 50px; z-index:81000 !important">ErrorLog:</div>');
  401.  
  402. var visualguide = document.createElement('div');
  403. visualguide.innerHTML = '<div id="VisualGuide"></div>';
  404. $("#embed-container-copy")[0].appendChild(visualguide);
  405.  
  406. var topBar = document.getElementsByClassName("top-bar-center top-bar-interact")[1];
  407. var edgedDiv = document.createElement('div');
  408. edgedDiv.innerHTML = "";
  409. edgedDiv.zIndex = 81000;
  410. edgedDiv.id = "EdgedButton";
  411. edgedDiv.style.width = "auto";
  412. edgedDiv.style.alignSelf = "left";
  413. topBar.prepend(edgedDiv);
  414.  
  415. $("#VisualGuide")[0].style.backgroundImage = "url('https://www.dropbox.com/s/b4s8lyqexgg4app/sprite.png?raw=1')";
  416. $("#VisualGuide")[0].style.height = "600px";
  417. $("#VisualGuide")[0].style.width = "50px";
  418. $("#VisualGuide")[0].style.position = "fixed";
  419. $("#VisualGuide")[0].style.left = "10px";
  420. $("#VisualGuide")[0].style.top = "250px";
  421. $("#VisualGuide")[0].style.zIndex = "81000";
  422. $("#VisualGuide")[0].style.animation = "play 0s infinite linear";
  423. $("#VisualGuide")[0].style.display = "none";
  424.  
  425. var style = document.createElement('style');
  426. style.type = 'text/css';
  427. var keyFrames = '\
  428. @keyframes play {\
  429. 100% {\
  430. background-position: 100%;\
  431. }\
  432. }';
  433. style.innerHTML = keyFrames; //.replace(/A_DYNAMIC_VALUE/g, "180deg");
  434. document.getElementsByTagName('head')[0].appendChild(style);
  435.  
  436. //--- Activate the dialog.
  437.  
  438. $("#FapDialog")[0].style.position = "fixed";
  439. $("#FapDialog")[0].style.left = "200px";
  440. $("#FapDialog")[0].style.top = "50px";
  441. $("#FapDialog")[0].style.zIndex = "80000";
  442. $("#ToggleAutoAdvance")[0].style.zIndex = "81000";
  443. $("#ToggleAutoAdvance")[0].style.cursor = "pointer";
  444. $("#ToggleFG")[0].style.cursor = "pointer";
  445. $("#ToggleAH")[0].style.cursor = "pointer";
  446. $("#ToggleVG")[0].style.cursor = "pointer";
  447. $("#ToggleDenial")[0].style.cursor = "pointer";
  448. $("#ToggleDildo")[0].style.cursor = "pointer";
  449. $("#EdgedButton")[0].style.cursor = "pointer";
  450. $("#dropdown")[0].style.cursor = "pointer";
  451.  
  452.  
  453.  
  454. }
  455.  
  456. function logit(st) {
  457.  
  458. document.querySelector('div[id="errordiv"]').innerHTML += "<br/> " + (lines++) + " " + st;
  459.  
  460. if (lines % 40 == 0) {
  461.  
  462. document.querySelector('div[id="errordiv"]').innerHTML = "<br/> " + (lines++) + " " + st;
  463.  
  464. }
  465.  
  466. }
  467.  
  468.  
  469. function reassignEventListeners() {
  470.  
  471. $(document).keypress(function (e) {
  472. // if t pressed remake the dialog
  473. if (e.which == 116 || e.keyCode == 116) {
  474. randTime = 3;
  475. }
  476. //document.querySelector('div[id="errordiv"]').innerHTML += "<br/> "+ (lines++) + " " + e.which;
  477. if (e.keyCode == 37 || e.which == 97) {
  478. getNewFapData();
  479. }
  480. if (e.keyCode == 39 || e.which == 100) {
  481. getNewFapData();
  482. }
  483. });
  484.  
  485. $(document).keypress(function (e) {
  486. // if t pressed remake the dialog
  487.  
  488. });
  489.  
  490. $("#dropdown")[0].addEventListener("click", function (e) {
  491. if (buttonsHidden) {
  492. $("#dropdown")[0].innerHTML = "▼ Hide";
  493. $("#ToggleAutoAdvance")[0].style.display = "block";
  494. $("#ToggleFG")[0].style.display = "block";
  495. $("#ToggleAH")[0].style.display = "block";
  496. $("#ToggleVG")[0].style.display = "block";
  497. $("#ToggleDenial")[0].style.display = "block";
  498. $("#ToggleDildo")[0].style.display = "block";
  499. buttonsHidden = false;
  500. } else {
  501. $("#dropdown")[0].innerHTML = "▲ Unhide";
  502. $("#ToggleAutoAdvance")[0].style.display = "none";
  503. $("#ToggleFG")[0].style.display = "none";
  504. $("#ToggleAH")[0].style.display = "none";
  505. $("#ToggleVG")[0].style.display = "none";
  506. $("#ToggleDenial")[0].style.display = "none";
  507. $("#ToggleDildo")[0].style.display = "none";
  508. buttonsHidden = true;
  509. }
  510. }, false);
  511.  
  512. $("#ToggleAutoAdvance")[0].addEventListener("click", function (e) {
  513. if (autoOverride) {
  514. alert('Automatic Page Cycling Re-enabled!');
  515. $("#ToggleAutoAdvance")[0].innerHTML = "Disable Auto-Advance";
  516. autoOverride = false;
  517. } else {
  518. alert('Automatic Page Cycling disabled!');
  519. $("#ToggleAutoAdvance")[0].innerHTML = "Enable Auto-Advance";
  520. autoOverride = true;
  521. }
  522. }, false);
  523.  
  524.  
  525. $("#ToggleFG")[0].addEventListener("click", function (e) {
  526. if (FGisON) {
  527. $("#ToggleFG")[0].innerHTML = "Enable Fap Gauntlet";
  528. clearInterval(remakeDialog.interval);
  529. o.frequency.value = 0;
  530. $("#VisualGuide")[0].style.animation = "play 0s infinite linear";
  531. $("#FapDialog")[0].style.display = "none";
  532. FGisON = false;
  533. } else {
  534. FGisON = true;
  535. $("#VisualGuide")[0].style.animation = "play " + (1 / currFPS) + "s infinite " + currCurve;
  536. $("#ToggleFG")[0].innerHTML = "Disable Fap Gauntlet";
  537. remakeDialog();
  538. }
  539. }, false);
  540.  
  541. $("#ToggleVG")[0].addEventListener("click", function (e) {
  542. $ = unsafeWindow.jQuery;
  543. if (visualGuideMode) {
  544. $("#ToggleVG")[0].innerHTML = "Enable Visual Guide";
  545. $("#VisualGuide")[0].style.display = "none";
  546. visualGuideMode = false;
  547. $("#VisualGuide")[0].style.animation = "play 0s infinite linear";
  548. } else {
  549. $("#ToggleVG")[0].innerHTML = "Disable Visual Guide";
  550. $("#VisualGuide")[0].style.display = "block";
  551. visualGuideMode = true;
  552. $("#VisualGuide")[0].style.animation = "play " + (1 / currFPS) + "s infinite " + currCurve;
  553. }
  554. }, false);
  555.  
  556. $("#ToggleDildo")[0].addEventListener("click", function (e) {
  557. if (dildoMode) {
  558. $("#ToggleDildo")[0].innerHTML = "Enable Dildo Mode";
  559. dildoMode = false;
  560. } else {
  561. $("#ToggleDildo")[0].innerHTML = "Disable Dildo Mode";
  562. dildoMode = true;
  563. }
  564. }, false);
  565.  
  566. $("#ToggleAH")[0].addEventListener("click", function (e) {
  567. if (isPlaying) {
  568. $("#ToggleAH")[0].innerHTML = "Enable Audio Helper";
  569. o.frequency.value = 0;
  570. isPlaying = false;
  571. } else if (firstStart) {
  572. $("#ToggleAH")[0].innerHTML = "Disable Audio Helper";
  573. o.start();
  574. firstStart = false;
  575. o.frequency.value = currFPS;
  576. isPlaying = true;
  577. } else {
  578. $("#ToggleAH")[0].innerHTML = "Disable Audio Helper";
  579. o.frequency.value = currFPS;
  580. isPlaying = true;
  581. }
  582. }, false);
  583.  
  584. $("#ToggleDenial")[0].addEventListener("click", function (e) {
  585. if (denialMode) {
  586. $("#ToggleDenial")[0].innerHTML = "Enable Denial Mode";
  587. $("#EdgedButton")[0].innerHTML = "";
  588. denialMode = false;
  589. } else {
  590. $("#ToggleDenial")[0].innerHTML = "Disable Denial Mode";
  591. $("#EdgedButton")[0].innerHTML = "I Edged!";
  592. denialMode = true;
  593. }
  594. }, false);
  595.  
  596. $("#EdgedButton")[0].addEventListener("click", function (e) {
  597. if (denialMode) {
  598. handsOffMode = true;
  599.  
  600. $ = unsafeWindow.jQuery;
  601.  
  602. $("#VisualGuide")[0].style.animation = "play 0s infinite linear";
  603.  
  604. //change image
  605. var $ = unsafeWindow.jQuery;
  606.  
  607. window.top.postMessage({
  608. action: 'next',
  609. cr: $.cookie().cr
  610. }, window.top.location.protocol + window.top.location.host);
  611. setTimeout(function () {
  612. currViewObj = unsafeWindow.AppState.viewing;
  613. }, 1000);
  614.  
  615. o.frequency.value = 0;
  616. randTime = 45;
  617. i = 0;
  618. }
  619.  
  620.  
  621.  
  622. }, false);
  623. }
  624.  
  625. $(window).bind('hashchange', function () {
  626. reassignEventListeners();
  627. });
  628.  
  629. setTimeout(function () { // thanks for not having a sleep function js //update: using GM's built in wait until document loaded @thing breaks jquery on the site, weird
  630.  
  631. redrawOptions();
  632. reassignEventListeners();
  633.  
  634. }, 2000);