Advertisement
Guest User

Anking V11 Card Back Fix

a guest
Nov 5th, 2022
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.72 KB | None | 0 0
  1. <script>
  2. // ############## HINT REVEAL SHORTCUTS ##############
  3. // Visit https://keycode.info/ to get the number/letter for the key you want to assign.
  4. // The shortcuts are Alt + the number/letter below
  5. // All shortcuts will also open with "H" if using the Hint Hotkeys add-on
  6.  
  7. var lecturenotes = '49';
  8. var missedQ = '50';
  9. var pathoma = '51';
  10. var bnb = '52';
  11. var firstaid = '53';
  12. var sketchy = '54';
  13. var pixorize = '55';
  14. var physeo = '56';
  15. var ome= '112';
  16. var additional = '57';
  17. var OpenCloseAll = '222';
  18.  
  19. var ScrollToHint = true;
  20. </script>
  21.  
  22.  
  23. <div class="clozefield">{{cloze:Text}}</div>
  24.  
  25. <!-- ############## EDIT CLOZE DURING REVIEW ##############
  26. -change below (not above) to "edit:cloze:Text" for editable field,
  27. but be sure to have the correct add-on installed-->
  28.  
  29. <div class="editcloze">{{cloze:Text}}</div>
  30.  
  31.  
  32. <!-- ############## TEXT-TO-SPEECH ##############
  33. replace the arrows/dashes from the statement below with double brackets-->
  34.  
  35. <!--tts en_US voices=Apple_Samantha speed=1.4:cloze-only:Text-->
  36.  
  37.  
  38. <hr>
  39.  
  40.  
  41. <!-- ############## SHOW HINTS AUTOMATICALLY ##############
  42. For instructions on how to show a field automatically, visit www.ankingmed.com/faq and type "show hint" into the search bar -->
  43.  
  44. <!-- OME AUTO OPEN FIELD -->
  45. <div style="max-width:300px; display:block; margin-left:auto; margin-right: auto;">{{#OME}}{{OME}}{{/OME}}</div>
  46.  
  47. <!-- LECTURE NOTES FIELD -->
  48. {{#Lecture Notes}}<a href="#" class="hint" id="hint-ln" onclick="this.style.display='none'; myFunction('button-ln', 'hint-ln', 'button-ln'); return false;">
  49. <button class="button-ln"><img src="_Anking_v3.png"> Lecture Notes</button></a>{{/Lecture Notes}}
  50.  
  51. <div id="button-ln" class="generalclass" style="display:none;">
  52. {{#Lecture Notes}}<button onclick="document.getElementById('hint-ln').style.display='inline-block'; myFunction('button-ln', 'hint-ln', 'button-ln')" class="button-ln" style="background:#ababab; color:black!important; font-weight:bold; width:50%!important;"><img src="_Anking_v3.png"> Lecture Notes</button>
  53. <br>
  54. <div class="hints" id="lecture">{{edit:Lecture Notes}}</div>
  55. {{/Lecture Notes}}</div>
  56.  
  57.  
  58. <!-- MISSED QUESTIONS FIELD -->
  59. {{#Missed Questions}}<a href="#" class="hint" id="hint-mq" onclick="this.style.display='none'; myFunction('button-mq', 'hint-mq', 'button-mq'); return false;">
  60. <button class="button-mq"><img src="_Anking_v3.png"> Missed Questions</button></a>{{/Missed Questions}}
  61.  
  62. <div id="button-mq" class="generalclass" style="display:none;">
  63. {{#Missed Questions}}<button onclick="document.getElementById('hint-mq').style.display='inline-block'; myFunction('button-mq', 'hint-mq', 'button-mq')" class="button-mq" style="background:#ababab; color:black!important; font-weight:bold; width:50%!important;"><img src="_Anking_v3.png"> Missed Questions</button>
  64. <br>
  65. <div class="hints" id="missed">{{edit:Missed Questions}}</div>
  66. {{/Missed Questions}}</div>
  67.  
  68.  
  69. <!-- PATHOMA FIELD -->
  70. {{#Pathoma}}<a href="#" class="hint" id="hint-pat" onclick="this.style.display='none'; myFunction('button-pat', 'hint-pat', 'button-pat'); return false;">
  71. <button class="button-pat"><img src="_pathoma.icon.png"></button></a>{{/Pathoma}}
  72.  
  73. <div id="button-pat" class="generalclass" style="display:none;">
  74. {{#Pathoma}}<button onclick="document.getElementById('hint-pat').style.display='inline-block'; myFunction('button-pat', 'hint-pat', 'button-pat')" class="button-pat" style="background:#ababab; color:black!important; font-weight:bold; width:50%!important;"><img src="_pathoma.icon.png"></button>
  75. <br>
  76. <div class="hints" id="pathoma">{{edit:Pathoma}}</div>
  77. {{/Pathoma}}</div>
  78.  
  79.  
  80. <!-- BOARDS AND BEYOND FIELD -->
  81. {{#Boards and Beyond}}<a href="#" class="hint" id="hint-bb" onclick="this.style.display='none'; myFunction('button-bb', 'hint-bb', 'button-bb'); return false;">
  82. <button class="button-bb"><img src="_b&b.icon.png"> Boards and Beyond</button></a>{{/Boards and Beyond}}
  83.  
  84. <div id="button-bb" class="generalclass" style="display:none;">
  85. {{#Boards and Beyond}}<button onclick="document.getElementById('hint-bb').style.display='inline-block'; myFunction('button-bb', 'hint-bb', 'button-bb')" class="button-bb" style="background:#ababab; color:black!important; font-weight:bold; width:50%!important;"><img src="_b&b.icon.png"> Boards and Beyond</button>
  86. <br>
  87. <div class="hints" id="bnb">{{edit:Boards and Beyond}}</div>
  88. {{/Boards and Beyond}}</div>
  89.  
  90.  
  91. <!-- EXTRA FIELD -->
  92. <p></p>{{#Extra}}
  93. <div id="extra">{{edit:Extra}}</div>
  94. {{/Extra}}<br>
  95. <div id="testscroll"></div>
  96.  
  97.  
  98. <!-- FIRST AID FIELD -->
  99. {{#First Aid}}<a href="#" class="hint" id="hint-fa" onclick="this.style.display='none'; myFunction('button-fa', 'hint-fa', 'button-fa'); return false;">
  100. <button class="button-fa"><img src="_first-aid.icon_v2.1.png">First Aid</button></a>{{/First Aid}}
  101.  
  102. <div id="button-fa" class="generalclass" style="display:none;">
  103. {{#First Aid}}<button onclick="document.getElementById('hint-fa').style.display='inline-block'; myFunction('button-fa', 'hint-fa', 'button-fa')" class="button-fa" style="background:#ababab; color:black!important; font-weight:bold; width:50%!important;"><img src="_first-aid.icon_v2.1.png">First Aid</button>
  104. <div class="hints" id="firstaid">{{edit:First Aid}}</div>
  105. {{/First Aid}}</div>
  106.  
  107.  
  108. <!-- SKETCHY FIELD -->
  109. {{#Sketchy}}<a href="#" class="hint" id="hint-sketchy" onclick="this.style.display='none'; myFunction('button-sketchy', 'hint-sketchy', 'button-sketchy'); return false;">
  110. <button class="button-sketchy"><img src="_sketchy.icon.png"> Sketchy</button></a>{{/Sketchy}}
  111.  
  112. <div id="button-sketchy" class="generalclass" style="display:none;">
  113. {{#Sketchy}}<button onclick="document.getElementById('hint-sketchy').style.display='inline-block'; myFunction('button-sketchy', 'hint-sketchy', 'button-sketchy')" class="button-sketchy" style="background:#ababab; color:black!important; font-weight:bold; width:50%!important;"><img src="_sketchy.icon.png"> Sketchy</button>
  114. <br>
  115. <div class="hints" id="sketchy">{{edit:Sketchy}}</div>
  116. {{/Sketchy}}</div>
  117.  
  118.  
  119. <!-- PIXORIZE FIELD -->
  120. {{#Pixorize}}<a href="#" class="hint" id="hint-pixorize" onclick="this.style.display='none'; myFunction('button-pixorize', 'hint-pixorize', 'button-pixorize'); return false;">
  121. <button class="button-pixorize"><img src="_pixorize.png"> Pixorize</button></a>{{/Pixorize}}
  122.  
  123. <div id="button-pixorize" class="generalclass" style="display:none;">
  124. {{#Pixorize}}<button onclick="document.getElementById('hint-pixorize').style.display='inline-block'; myFunction('button-pixorize', 'hint-pixorize', 'button-pixorize')" class="button-pixorize" style="background:#ababab; color:black!important; font-weight:bold; width:50%!important;"><img src="_pixorize.png"> Pixorize</button>
  125. <br>
  126. <div class="hints" id="pixorize">{{edit:Pixorize}}</div>
  127. {{/Pixorize}}</div>
  128.  
  129.  
  130. <!-- PHYSEO FIELD -->
  131. {{#Physeo}}<a href="#" class="hint" id="hint-physeo" onclick="this.style.display='none'; myFunction('button-physeo', 'hint-physeo', 'button-physeo'); return false;">
  132. <button class="button-physeo"><img src="_physeologo.icon.png"></button></a>{{/Physeo}}
  133.  
  134. <div id="button-physeo" class="generalclass" style="display:none;">
  135. {{#Physeo}}<button onclick="document.getElementById('hint-physeo').style.display='inline-block'; myFunction('button-physeo', 'hint-physeo', 'button-physeo')" class="button-physeo" style="background:#ababab; color:black!important; font-weight:bold; width:50%!important;"><img src="_physeologo.icon.png"></button>
  136. <br>
  137. <div class="hints" id="physeo">{{edit:Physeo}}</div>
  138. {{/Physeo}}</div>
  139.  
  140.  
  141. <!-- OME FIELD (CLOSED BY DEFAULT)
  142. {{#OME}}<a href="#" class="hint" id="hint-ome" onclick="this.style.display='none'; myFunction('button-ome', 'hint-ome', 'button-ome'); return false;">
  143. <button class="button-ome"><img src="_omelogo.icon.png"> OnlineMedEd</button></a>{{/OME}}
  144.  
  145. <div id="button-ome" class="generalclass" style="display:none;">
  146. {{#OME}}<button onclick="document.getElementById('hint-ome').style.display='inline-block'; myFunction('button-ome', 'hint-ome', 'button-ome')" class="button-ome" style="background:#ababab; color:black!important; font-weight:bold; width:50%!important;"><img src="_omelogo.icon.png"> OnlineMedEd</button>
  147. <br>
  148. <div class="hints" id="ome">{{edit:OME}}</div>
  149. {{/OME}}</div>
  150. -->
  151.  
  152. <!-- ADDITIONAL RESOURCES FIELD -->
  153. {{#Additional Resources}}<a href="#" class="hint" id="hint-ar" onclick="this.style.display='none'; myFunction('button-ar', 'hint-ar', 'button-ar'); return false;">
  154. <button class="button-ar"><img src="_Anking_v3.png"> Additional Resources</button></a>{{/Additional Resources}}
  155.  
  156. <div id="button-ar" class="generalclass" style="display:none;">
  157. {{#Additional Resources}}<button onclick="document.getElementById('hint-ar').style.display='inline-block'; myFunction('button-ar', 'hint-ar', 'button-ar')" class="button-ar" style="background:#ababab; color:black!important; font-weight:bold; width:50%!important;"><img src="_Anking_v3.png"> Additional Resources</button>
  158. <br>
  159. <div class="hints" id="additional">{{edit:Additional Resources}}</div>
  160. {{/Additional Resources}}</div>
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167. <script>
  168. //HINT REVEALS
  169. function myFunction(divid, id, divid) {
  170. var x = document.getElementById(divid), y = document.getElementById(id), z = document.getElementById(divid);
  171. if (x.style.display == "none")
  172. {
  173. x.style.display = "block"; y.style.display = "none"; z.scrollToId;
  174. }
  175. else {
  176. x.style.display = "none"; y.style.display = "inline-block";
  177. }
  178. if (ScrollToHint){
  179. z.scrollIntoView({
  180. behavior: "smooth", //"auto" for instant scrolling
  181. block: "start",
  182. inline: "nearest"
  183. }); }
  184. }
  185. document.onkeydown = function(evt) {
  186. evt = evt || window.event;
  187. if (evt.altKey && evt.keyCode == lecturenotes) {
  188. myFunction('button-ln', 'hint-ln', 'button-ln')}
  189. if (evt.altKey && evt.keyCode == missedQ) {
  190. myFunction('button-mq', 'hint-mq', 'button-mq')}
  191. if (evt.altKey && evt.keyCode == pathoma) {
  192. myFunction('button-pat', 'hint-pat', 'button-pat')}
  193. if (evt.altKey && evt.keyCode == bnb) {
  194. myFunction('button-bb', 'hint-bb', 'button-bb')}
  195. if (evt.altKey && evt.keyCode == firstaid) {
  196. myFunction('button-fa', 'hint-fa', 'button-fa')}
  197. if (evt.altKey && evt.keyCode == sketchy) {
  198. myFunction('button-sketchy', 'hint-sketchy', 'button-sketchy')}
  199. if (evt.altKey && evt.keyCode == pixorize) {
  200. myFunction('button-pixorize', 'hint-pixorize', 'button-pixorize')}
  201. if (evt.altKey && evt.keyCode == physeo) {
  202. myFunction('button-physeo', 'hint-physeo', 'button-physeo')}
  203. if (evt.altKey && evt.keyCode == ome) {
  204. myFunction('button-ome', 'hint-ome', 'button-ome')}
  205. if (evt.altKey && evt.keyCode == additional) {
  206. myFunction('button-ar', 'hint-ar', 'button-ar')}
  207.  
  208. if (evt.keyCode == OpenCloseAll) {
  209. try{myFunction('button-ar', 'hint-ar', 'button-ar');}
  210. finally{try{myFunction('button-ome', 'hint-ome', 'button-ome');}
  211. finally{try{myFunction('button-physeo', 'hint-physeo', 'button-physeo');}
  212. finally{try{myFunction('button-pixorize', 'hint-pixorize', 'button-pixorize');}
  213. finally{try{myFunction('button-sketchy', 'hint-sketchy', 'button-sketchy');}
  214. finally{try{myFunction('button-fa', 'hint-fa', 'button-fa');}
  215. finally{try{myFunction('button-bb', 'hint-bb', 'button-bb');}
  216. finally{try{myFunction('button-pat', 'hint-pat', 'button-pat');}
  217. finally{try{myFunction('button-mq', 'hint-mq', 'button-mq');}
  218. finally{myFunction('button-ln', 'hint-ln', 'button-ln');}}}}}}}}}
  219. }
  220. }
  221. </script>
  222.  
  223.  
  224. <br>
  225. <br>
  226.  
  227. <script>
  228. //ENTER THE TAG TERM WHICH, WHEN PRESENT, WILL TRIGGER A RED BACKGROUND
  229. var tagID
  230. </script>
  231.  
  232. {{#Tags}}
  233. <div id="tags-container">{{clickable::Tags}}</div>
  234. <script>
  235. var tagContainer = document.getElementById("tags-container")
  236. if (tagContainer.childElementCount == 0) {
  237. var tagList= tagContainer.innerHTML.split(" ");
  238. var kbdList = [];
  239. var newTagContent = document.createElement("div");
  240.  
  241. for (var i = 0; i < tagList.length; i++) {
  242. var newTag = document.createElement("kbd");
  243. newTag.innerHTML = tagList[i];
  244. newTagContent.append(newTag)
  245. }
  246. tagContainer.innerHTML = newTagContent.innerHTML;
  247. tagContainer.style.cursor = "default";
  248. }
  249. if (tagContainer.innerHTML.indexOf(tagID) != -1) {
  250. tagContainer.style.backgroundColor = "rgba(251,11,11,.15)";
  251. }
  252.  
  253. function showtags() {
  254. var xx = document.getElementById("tags-container");
  255.  
  256. if (xx.style.display
  257. === "none") {
  258. xx.style.display = "block";
  259. } else {
  260. xx.style.display =
  261. "none";
  262. }
  263. }
  264. document.addEventListener('keyup', function(e) {
  265. if(e.key =="c"){
  266. showtags();
  267. }
  268. });
  269.  
  270.  
  271. </script>
  272. {{/Tags}}
  273.  
  274. <div id="pic"><a href="https://www.ankingmed.com">
  275. <img src="_AnKingRound.png" alt="The AnKing" style="height:50px;border:0;position:fixed;bottom:10px;right:10px;">
  276. </a></div>
  277.  
  278.  
  279.  
  280.  
  281. <!-- WIKIPEDIA SEARCHES -->
  282. <div id="popup-container">
  283. <button id="close-popup-btn" onclick="closePopup(true)">&times;</button>
  284. <a id="open-wiki-btn" href="">&#8618;</a>
  285. <div id="tc"></div>
  286. <div id="fadebottom_v"></div>
  287. <div id="ic"><img id="popup-image"></div>
  288. </div>
  289. <style>
  290. #tc {
  291. color: #222222;
  292. position: absolute;
  293. top: 16px;
  294. margin: 0px;
  295. left: 15px;
  296. text-decoration: none;
  297. height: 320px;
  298. overflow: hidden;
  299. overflow-y: scroll;
  300. white-space: pre-wrap;
  301. width: 300px;
  302. }
  303.  
  304. #tc p {
  305. margin: 0px;
  306. }
  307.  
  308. #tc::-webkit-scrollbar {
  309. display: none;
  310. }
  311.  
  312. #fadebottom_v {
  313. height: 30px;
  314. width: 300px;
  315. background: -webkit-linear-gradient(270deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 1));
  316. z-index: 111;
  317. position: absolute;
  318. bottom: 0px;
  319. left: 15px;
  320. }
  321.  
  322. #hc {
  323. color: #666;
  324. font-weight: bold;
  325. }
  326.  
  327. #ic {
  328. right: 0px;
  329. top: 30px;
  330. position: absolute;
  331. }
  332.  
  333. #ic img {
  334. width: 160px;
  335. height: auto;
  336. object-fit: cover;
  337. overflow: hidden;
  338. }
  339.  
  340. #popup-image {
  341. width: 140px;
  342. height: auto;
  343. }
  344.  
  345. #popup-container {
  346. background: #fff;
  347. position: absolute;
  348. bottom: 30px;
  349. right: 10px;
  350. z-index: 110;
  351. -webkit-box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.3), 0 0 1px 1px rgba(0, 0, 0, 0.05);
  352. box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.3), 0 0 1px 1px rgba(0, 0, 0, 0.05);
  353. padding: 0;
  354. display: none;
  355. font-size: 17px;
  356. line-height: 20px;
  357. border-radius: 2px;
  358. width: 480px;
  359. height: 340px;
  360. overflow: hidden;
  361. font-family: Arial;
  362. text-align: left;
  363. border: 1px solid #d0d0d0;
  364. border-radius: 5px;
  365. }
  366.  
  367. #close-popup-btn {
  368. position: absolute;
  369. top: 1px;
  370. right: 5px;
  371. width: 32px;
  372. height: 32px;
  373. background: none;
  374. border: 0;
  375. cursor: pointer;
  376. font-family: 'Josefin Sans', sans-serif;
  377. font-size: 20px;
  378. outline: none;
  379. text-align: right;
  380. z-index: 112;
  381. }
  382.  
  383. #open-wiki-btn {
  384. position: absolute;
  385. top: 10px;
  386. right: 30px;
  387. width: 15px;
  388. height: 32px;
  389. background: none;
  390. border: 0;
  391. cursor: pointer;
  392. text-decoration: none;
  393. color: #222222;
  394. font-family: 'Josefin Sans', sans-serif;
  395. font-size: 17px;
  396. outline: none;
  397. text-align: left;
  398. z-index: 112;
  399. }
  400. </style>
  401.  
  402. <script>
  403. function getSummaryFor(word) {
  404. word = word.replace(/^[\.,\/#\!$%\^&\*;:{}=\-_`~()\'\s]+|[\.,\/#\!$%\^&\*;:{}=\-_`~()\'\s]+$/g, "");
  405. var pc = document.getElementById("popup-container");
  406. var hc = document.getElementById("hc");
  407. var tc = document.getElementById("tc");
  408. var ic = document.getElementById("ic");
  409. var imgelem = document.getElementById("popup-image");
  410. imgelem.src = "";
  411. var shortsum ="";
  412. fetch("https://en.wikipedia.org/api/rest_v1/page/summary/" + word).then(function(response) {return response.json();}).then(function(response) {
  413. shortsum = response.description;
  414. shortsum = shortsum.replace(/(Disambiguation.*)/g, "Disambiguation");
  415. tc.innerHTML = "<span id='hc'>" +capfl(shortsum) + "</span>" +"\n" +response.extract_html + "\n";
  416. tc.style.width = "420px";
  417. if (response.extract_html && !response.extract.endsWith("to:")){
  418. pc.style.display = "block";
  419. document.getElementById("open-wiki-btn").href = response.content_urls.desktop.page;
  420. }else{pc.style.display = "none";}
  421. if (!response.thumbnail.source || response.type ==="disambiguation"){
  422. tc.style.width = "420px";
  423. }else{tc.style.width="300px";imgelem.src = response.thumbnail.source;}
  424. }).catch(function(error) {console.log(error);});}
  425.  
  426. function closePopup(deselectAlso=false){
  427. pcc.style.display = 'none';
  428. if (deselectAlso){clearSelection();}
  429. }
  430. var pcc = document.getElementById("popup-container");
  431. var prevSel = "";
  432. document.addEventListener('click', function() {
  433. var currentSelection = getSelectionText();
  434. if (currentSelection !==""){prevSel = currentSelection;}
  435. if (currentSelection && !mustClickW ){
  436. getSummaryFor(currentSelection);
  437. }else{closePopup();}
  438. });
  439. document.addEventListener('keyup', function(e) {
  440. if(e.key =="w"){
  441. if(pcc.style.display ==="block"){closePopup();}else{getSummaryFor(prevSel);}
  442. }
  443. });
  444. function getSelectionText() {
  445. var text = "";
  446. if (window.getSelection) {
  447. text = window.getSelection().toString();
  448. } else if (document.selection && document.selection.type != "Control") { text = document.selection.createRange().text;}
  449. return text;
  450. }
  451. function capfl(s) {
  452. return s.charAt(0).toUpperCase() + s.slice(1);
  453. }
  454. function clearSelection(){
  455. if (window.getSelection) {window.getSelection().removeAllRanges();}
  456. else if (document.selection) {document.selection.empty();}
  457. }
  458.  
  459. //CUSTOMIZATION
  460. //this is a variable controlling whether user must click the "w" key to open the popup.
  461. //if set to true: user must select text, then click the "w" key to open wikipedia popup. Clicking "w" key again will close the popup.
  462. //if set to false: user only needs to select text. popup will open automatically. Clicking "w" is an alternative but not obligatory way of opening/closing the popup in this mode.
  463. //BELOW SET to true or to false.
  464. var mustClickW = true;
  465. //END CUSTOMIZATION
  466. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement