Advertisement
Marcin324

Code

Apr 12th, 2023
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.74 KB | None | 0 0
  1. jQuery(document).ready(function ($) {
  2. if ($(".home-map-container")[0]) {
  3. function checkMap() {
  4. if ($(".map-category")[0]) {
  5. clearInterval(storeTimeInterval);
  6.  
  7. $(".firstPopup")
  8. .detach()
  9. .appendTo(
  10. "#progress_map_vue_component>div>div>div:nth-child(10) .map-category-tile"
  11. );
  12. $(".secondPopup")
  13. .detach()
  14. .appendTo(
  15. "#progress_map_vue_component>div>div>div:nth-child(9) .map-category-tile"
  16. );
  17. $(".thirdPopup")
  18. .detach()
  19. .appendTo(
  20. "#progress_map_vue_component>div>div>div:nth-child(5) .map-category-tile"
  21. );
  22. $(".fourthPopup")
  23. .detach()
  24. .appendTo(
  25. "#progress_map_vue_component>div>div>div:nth-child(4) .map-category-tile"
  26. );
  27. $(".fifthPopup")
  28. .detach()
  29. .appendTo(
  30. "#progress_map_vue_component>div>div>div:nth-child(1) .map-category-tile"
  31. );
  32. $(".sixthPopup")
  33. .detach()
  34. .appendTo(
  35. " #progress_map_vue_component>div>div>div:nth-child(2) .map-category-tile"
  36. );
  37. $(".seventhPopup")
  38. .detach()
  39. .appendTo(
  40. "#progress_map_vue_component>div>div>div:nth-child(7) .map-category-tile"
  41. );
  42. $(".eighthPopup")
  43. .detach()
  44. .appendTo(
  45. " #progress_map_vue_component>div>div>div:nth-child(6) .map-category-tile"
  46. );
  47. $(".ninthPopup")
  48. .detach()
  49. .appendTo(
  50. " #progress_map_vue_component>div>div>div:nth-child(8) .map-category-tile"
  51. );
  52. }
  53. }
  54. let storeTimeInterval = setInterval(checkMap, 700);
  55. }
  56. //
  57. setTimeout(() => {
  58. if (jQuery(".map-container").length) {
  59. jQuery(".map-category-tile").prepend(
  60. '<i class="fa-regular fa-circle-xmark"></i>'
  61. );
  62. }
  63. }, 500);
  64.  
  65. //
  66. const goToFirstDesiredElement = jQuery(
  67. ".firstpopupcontainer .goToDesiredElement"
  68. );
  69. const goToNextDesiredElement = jQuery(".goToDesiredElement4");
  70. const goToThirdDesiredElement = jQuery(".goToDesiredElement2");
  71. const goToFourthDesiredElement = jQuery(".goToDesiredElement5");
  72. const goTofifthDesiredElement = jQuery(".goToDesiredElement6");
  73. const goTsixthDesiredElement = jQuery(".goToDesiredElement7");
  74. const goTseventhDesiredElement = jQuery(".goToDesiredElement8");
  75. const goToeightDesiredElement = jQuery(".goToDesiredElement3");
  76. const goToninghtDesiredElement = jQuery(".goToDesiredElement10");
  77.  
  78. goToFirstDesiredElement.click(function (e) {
  79. e.stopPropagation();
  80. let mapPopup = jQuery("#category-tile-27");
  81. let bigPopupContainer = jQuery(".firstpopupcontainer");
  82. let firstPopupOverlay = jQuery(".firstpopup");
  83. //
  84. firstPopupOverlay.removeClass("overlay");
  85. mapPopup.addClass("active");
  86. bigPopupContainer.removeClass("activeAditionalPopup");
  87. localStorage.setItem("personMovedFirst", "map-person-moved");
  88. jQuery(".map-person").addClass(localStorage.getItem("personMovedFirst"));
  89. });
  90. goToNextDesiredElement.click(function (e) {
  91. e.stopPropagation();
  92. let secondBigPopupContainer = jQuery(".fourthpopupcontainer");
  93. secondBigPopupContainer.removeClass("activeAditionalPopup");
  94. jQuery(".fifthpopupcontainer ").removeClass("activeAditionalPopup");
  95. jQuery(".fourthpopup").removeClass("overlay");
  96. jQuery(".fifthpopup ").removeClass("overlay");
  97. localStorage.setItem("personMovedFourth", "map-person-moved4");
  98. jQuery(".map-person").addClass(localStorage.getItem("personMovedFourth"));
  99. });
  100. goToThirdDesiredElement.click(function (e) {
  101. e.stopPropagation();
  102. let thirdBigPopupContainer = jQuery(".secondpopupcontainer");
  103. let thirdMapPopup = jQuery("#category-tile-36");
  104. thirdMapPopup.addClass("active");
  105. thirdBigPopupContainer.removeClass("activeAditionalPopup");
  106. jQuery(".secondpopup").removeClass("overlay");
  107.  
  108. localStorage.setItem("personMovedThird", "map-person-moved3");
  109. jQuery(".map-person").addClass(localStorage.getItem("personMovedThird"));
  110. });
  111. goToFourthDesiredElement.click(function (e) {
  112. e.stopPropagation();
  113. let fourthBigPopupContainer = jQuery(".sixthpopupcontainer ");
  114. let fourthMapPopup = jQuery("#category-tile-40");
  115. fourthMapPopup.addClass("active");
  116. fourthBigPopupContainer.removeClass("activeAditionalPopup");
  117. jQuery(".fifthpopup ").removeClass("overlay");
  118. jQuery(".sixthpopup ").removeClass("overlay");
  119. localStorage.setItem("personMovedFourth", "map-person-moved6 ");
  120. jQuery(".map-person").addClass(localStorage.getItem("personMovedFourth"));
  121. });
  122. goTofifthDesiredElement.click(function (e) {
  123. e.stopPropagation();
  124. let fifthBigPopupContainer = jQuery(".seventhpopupcontainer");
  125. let fifthMapPopup = jQuery("#category-tile-39");
  126. fifthMapPopup.addClass("active");
  127. fifthBigPopupContainer.removeClass("activeAditionalPopup");
  128. });
  129. goTofifthDesiredElement.click(function (e) {
  130. e.stopPropagation();
  131. let sixthBigPopupContainer = jQuery(".eighthpopupcontainer ");
  132. let sixthMapPopup = jQuery("#category-tile-34");
  133. sixthMapPopup.addClass("active");
  134. sixthBigPopupContainer.removeClass("activeAditionalPopup");
  135. });
  136.  
  137. goTsixthDesiredElement.click(function (e) {
  138. e.stopPropagation();
  139. let eightElement = jQuery(".eighthpopup");
  140. let seventhMapPopupContainer = jQuery(".eighthpopupcontainer");
  141. let seventhMapPopup = jQuery("#category-tile-34");
  142. seventhMapPopup.addClass("active");
  143. seventhMapPopupContainer.removeClass("activeAditionalPopup");
  144. eightElement.removeClass("overlay");
  145. localStorage.setItem("personMovedFifth", "map-person-moved7 ");
  146. jQuery(".map-person").addClass(localStorage.getItem("personMovedFifth"));
  147. });
  148.  
  149. goTseventhDesiredElement.click(function (e) {
  150. e.stopPropagation();
  151. let ninthElement = jQuery(".seventhpopup");
  152. let ninthMapPopupContainer = jQuery(".seventhpopupcontainer");
  153. let ninthMapPopup = jQuery("#category-tile-35");
  154. ninthMapPopup.addClass("active");
  155. ninthMapPopupContainer.removeClass("activeAditionalPopup");
  156. ninthElement.removeClass("overlay");
  157. localStorage.setItem("personMovedSixth", "map-person-moved8");
  158. jQuery(".map-person").addClass(localStorage.getItem("personMovedSixth"));
  159. });
  160. goToeightDesiredElement.click(function (e) {
  161. e.stopPropagation();
  162. jQuery(".thirdpopup").removeClass("overlay");
  163. jQuery(".thirdpopupcontainer ").removeClass("activeAditionalPopup");
  164. jQuery("#category-tile-33").addClass("active");
  165. localStorage.setItem("personMovedSeventh", "map-person-moved9");
  166. jQuery(".map-person").addClass(localStorage.getItem("personMovedSeventh"));
  167. });
  168. goToninghtDesiredElement.click(function (e) {
  169. e.stopPropagation();
  170. jQuery(".fifthpopup ").removeClass("overlay");
  171. jQuery(".fifthpopupcontainer ").removeClass("activeAditionalPopup");
  172. jQuery("#category-tile-29").addClass("active");
  173. localStorage.setItem("personMovedSecond", "map-person-moved2");
  174. jQuery(".map-person").addClass(localStorage.getItem("personMovedSecond"));
  175. });
  176.  
  177. if ($(".home-map-container")[0]) {
  178. function checkMap() {
  179. if ($(".map-category")[0]) {
  180. clearInterval(storeTimeInterval);
  181. let completedElements = jQuery(".completed");
  182. if (completedElements.length >= 10) {
  183. jQuery(".congratspopup").removeClass("hiddencongrats");
  184. }
  185. jQuery(".closecongrats").click(function () {
  186. jQuery(".congratspopup").addClass("hiddencongrats");
  187. });
  188. }
  189. }
  190. let storeTimeInterval = setInterval(checkMap, 500);
  191. }
  192. jQuery(".goToDesiredElement14").click(function () {
  193. jQuery(".ninthpopup").removeClass("overlay");
  194. jQuery(".ninthpopupcontainer").removeClass("activeAditionalPopup");
  195. jQuery(".congratspopup").removeClass("hiddencongrats");
  196. jQuery(".closecongrats").click(function () {
  197. jQuery(".congratspopup").addClass("hiddencongrats");
  198. });
  199. });
  200. //
  201. $(document).click(function (e) {
  202. if (
  203. !$(e.target).hasClass("active") &&
  204. $(e.target).parents(".map-category").length === 0
  205. ) {
  206. $(".map-category-tile").removeClass("active");
  207. }
  208. });
  209. //
  210. $(document).click(function (e) {
  211. if (
  212. !$(e.target).hasClass("activeAditionalPopup") &&
  213. $(e.target).parents(".popupcontainer").length === 0
  214. ) {
  215. $(".firstpopupcontainer ").removeClass("activeAditionalPopup");
  216. }
  217. });
  218. //
  219. jQuery(".close-button").click(function (e) {
  220. e.preventDefault();
  221. jQuery(".popupitems").hide();
  222. });
  223. jQuery(".goToLe").click(function (e) {
  224. e.preventDefault();
  225. jQuery(".popupitems").hide();
  226. });
  227. //
  228. if (localStorage.getItem("hiddenPopup") == "hidenElement") {
  229. jQuery(".secondpopupcontainer").addClass("hidenElement");
  230. }
  231. //
  232. if (localStorage.getItem("hidenElementNext") == "hidenElementNext") {
  233. jQuery(".thirdpopupcontainer").addClass("hidenElementNext");
  234. }
  235. //
  236. if (localStorage.getItem("hidenElementLast") == "hidenElementLast") {
  237. jQuery(".fourthpopupcontainer").addClass("hidenElementLast");
  238. }
  239. //
  240. jQuery("#menu-item-3246").addClass("bookmarkicon");
  241. jQuery("#menu-item-3248").addClass("notification fa-solid fa-bell");
  242. jQuery("#menu-item-3246 a").addClass("notes-as-popupmod");
  243. //
  244. var test = jQuery(
  245. ".notes-container.basic-style #notes-view-container .notes-view-inside-container .note-header .close-button"
  246. );
  247. test.click(function () {
  248. jQuery("#notes-view-container").hide();
  249. });
  250.  
  251. const searchFormHandler = function searchFormHandler() {
  252. $(".searchresults").toggleClass("activeSearchPopup");
  253. };
  254.  
  255. const closeSearch = function closeSearch() {
  256. $(".searchresults").removeClass("activeSearchPopup");
  257. };
  258.  
  259. const searchResultsModal = function searchResultsModal(e) {
  260. e.preventDefault();
  261.  
  262. var q = $("#q").val();
  263.  
  264. // AJAX request
  265. $.ajax({
  266. url: "./search.php",
  267. type: "post",
  268. data: {
  269. q: q,
  270. },
  271. success: function (response) {
  272. // Add response in Modal body
  273. $(".searchresults__content").html(response);
  274. },
  275. });
  276. };
  277.  
  278. const bookmarksPopup = function bookmarksPopup(e) {
  279. e.preventDefault();
  280. e.stopPropagation();
  281. $(".bookmarksContainer").addClass("activeBookMark");
  282. $(".upperContainer").addClass("overlay");
  283. };
  284. const closeBookMarkContainer = function closeBookMarkContainer() {
  285. $(".bookmarksContainer").removeClass("activeBookMark");
  286. $(".upperContainer").removeClass("overlay");
  287. };
  288.  
  289. const bookMarkSingle = function bookMarkSingle(e) {
  290. e.preventDefault();
  291. e.stopPropagation();
  292. let favorites = JSON.parse(localStorage.getItem("favItem")) || [];
  293. let learningElementHeader = jQuery(".leHead");
  294. let learningElementID = jQuery(".content-container").attr("id");
  295. let postLink = window.location.href;
  296.  
  297. let bookmarkedItem = {
  298. id: learningElementID,
  299. titleBookmark: learningElementHeader.html(),
  300. postLink: postLink,
  301. };
  302. bookmarkedItem.fav = true;
  303.  
  304. let arr_str = favorites.map(JSON.stringify);
  305. if (arr_str.includes(JSON.stringify(bookmarkedItem))) {
  306. let bookMarkSingle = jQuery(".bookMarkSingle");
  307. bookMarkSingle.removeClass("fav");
  308. bookMarkSingle.addClass("notfav");
  309. let retrievedScores = JSON.parse(localStorage.getItem("favItem"));
  310. retrievedScores = retrievedScores.filter(
  311. (val) => val.id !== learningElementID
  312. );
  313. localStorage.setItem("favItem", JSON.stringify(retrievedScores));
  314. } else {
  315. !arr_str.includes(JSON.stringify(bookmarkedItem)) &&
  316. favorites.push(bookmarkedItem);
  317. favorites.map(function (element) {
  318. let bookMarkSingle = jQuery(".bookMarkSingle");
  319. if (learningElementID === element.id) {
  320. bookMarkSingle.removeClass("notfav");
  321. bookMarkSingle.addClass("fav");
  322. }
  323. });
  324. localStorage.setItem("favItem", JSON.stringify(favorites));
  325. }
  326. };
  327. const notification = function notification(e) {
  328. e.preventDefault();
  329. e.stopPropagation();
  330. $(".notificationsnew").addClass("activenotification");
  331. };
  332.  
  333. const closeNotifications = function closeNotifications(e) {
  334. e.preventDefault();
  335. e.stopPropagation();
  336. $(".notificationsnew").removeClass("activenotification");
  337. };
  338.  
  339. const notesaspopup = function notesaspopup(e) {
  340. e.preventDefault();
  341. e.stopPropagation();
  342. jQuery("#notes-view-container").css("display", "flex");
  343. };
  344.  
  345. jQuery("#menu-item-3237 a").click(notesaspopup);
  346. jQuery(".search-field").click(searchResultsModal);
  347. jQuery(".searchform").click(searchFormHandler);
  348. jQuery(".closeSearch").click(closeSearch);
  349. jQuery(".bookmarkicon").click(bookmarksPopup);
  350. jQuery(".closeBookMarks").click(closeBookMarkContainer);
  351. jQuery(".bookMarkSingle").click(bookMarkSingle);
  352. jQuery(".notification").click(notification);
  353. jQuery(".closeNotifications").click(closeNotifications);
  354.  
  355. //
  356. $(".home .searchresults ").click(function (e) {
  357. e.stopPropagation();
  358. });
  359. $("body").click(function () {
  360. $(".search_result").hide();
  361. });
  362.  
  363. //
  364. setTimeout(() => {
  365. let favorites19 = JSON.parse(localStorage.getItem("favItem")) || [];
  366. favorites19.map(function (element) {
  367. let learningElementID = jQuery(".content-container").attr("id");
  368. let bookMarkSingle = jQuery(".bookMarkSingle");
  369. if (learningElementID === element.id) {
  370. bookMarkSingle.removeClass("notfav");
  371. bookMarkSingle.addClass("fav");
  372. }
  373. }, 100);
  374. });
  375.  
  376. $("#easyPaginate").easyPaginate({
  377. paginateElement: "div",
  378. elementsPerPage: 4,
  379. effect: "slide",
  380. firstButtonText: "<",
  381. lastButtonText: ">",
  382. });
  383.  
  384. $(".notificationsnew #easyPaginate2").easyPaginate({
  385. paginateElement: "div",
  386. elementsPerPage: 4,
  387. effect: "slide",
  388. firstButtonText: "<",
  389. lastButtonText: ">",
  390. });
  391.  
  392. if (jQuery("#easyPaginate3").length > 0) {
  393. jQuery(".searchresults #easyPaginate3").easyPaginate({
  394. paginateElement: "a",
  395. elementsPerPage: 4,
  396. effect: "slide",
  397. firstButtonText: "<",
  398. lastButtonText: ">",
  399. });
  400. }
  401.  
  402. var myDiv = jQuery("#notes-view-container > div > div.note-header > button");
  403. if (myDiv.length > 0) {
  404. jQuery(myDiv).click(function () {
  405. jQuery(".notes-as-popup").css("display", "none");
  406. });
  407. }
  408.  
  409. var existCondition = setInterval(function () {
  410. if (
  411. jQuery("#notes-view-container > div > div.note-header > button").length
  412. ) {
  413. clearInterval(existCondition);
  414. const parameters = function parameters() {
  415. jQuery("#notes-view-container > div > div.note-header > button").click(
  416. function () {
  417. jQuery(".notes-as-popup").css("display", "none");
  418. }
  419. );
  420. };
  421. parameters();
  422. }
  423. }, 100);
  424.  
  425. jQuery(".formbeinsp form").submit(function (event) {
  426. let scrolled = false;
  427. checkForm(title);
  428. if (link.length != 0) checkForm(link);
  429. checkSelect(subcategory);
  430. checkSelect(tagLevel);
  431.  
  432. function checkForm(field) {
  433. if (!field.val()) {
  434. event.preventDefault();
  435. higlightField(field);
  436. if (!scrolled) {
  437. scrolled = scrollForm(field);
  438. }
  439. }
  440. }
  441.  
  442. function checkSelect(field) {
  443. if (field.val() == "default") {
  444. event.preventDefault();
  445. higlightSelect(field);
  446. if (!scrolled) {
  447. scrolled = scrollForm(field);
  448. }
  449. }
  450. }
  451. });
  452. });
  453.  
  454. jQuery(document).ready(function () {
  455. let existCondition9 = setInterval(function () {
  456. if (
  457. jQuery(".postid-3275 .mark-as-complete-button-container button").length >
  458. 0
  459. ) {
  460. clearInterval(existCondition9);
  461. const parameters = function parameters() {
  462. jQuery(".postid-3275 .mark-as-complete-button-container button").click(
  463. function (e) {
  464. e.stopPropagation();
  465. e.preventDefault();
  466. jQuery(".popupitems").show().focus();
  467. }
  468. );
  469. };
  470. parameters();
  471. }
  472. }, 100);
  473. //
  474. let existCondition8 = setInterval(function () {
  475. if (
  476. jQuery(".postid-3273 .mark-as-complete-button-container button").length >
  477. 0
  478. ) {
  479. clearInterval(existCondition8);
  480. const parameters = function parameters() {
  481. jQuery(".postid-3273 .mark-as-complete-button-container button").click(
  482. function (e) {
  483. e.stopPropagation();
  484. e.preventDefault();
  485. jQuery(".popupitems").show().focus();
  486. }
  487. );
  488. };
  489. parameters();
  490. }
  491. jQuery(".map-category-tile")
  492. .before()
  493. .click(function () {
  494. jQuery(".map-category-tile").removeClass("active");
  495. });
  496. }, 100);
  497.  
  498. //
  499. let existCondition7 = setInterval(function () {
  500. if (
  501. jQuery(".postid-3272 .mark-as-complete-button-container button").length >
  502. 0
  503. ) {
  504. clearInterval(existCondition7);
  505. const parameters = function parameters() {
  506. jQuery(".postid-3272 .mark-as-complete-button-container button").click(
  507. function (e) {
  508. e.stopPropagation();
  509. e.preventDefault();
  510. jQuery(".popupitems").show().focus();
  511. }
  512. );
  513. };
  514. parameters();
  515. }
  516. jQuery(".map-category-tile")
  517. .before()
  518. .click(function () {
  519. jQuery(".map-category-tile").removeClass("active");
  520. });
  521. }, 100);
  522.  
  523. //
  524. let existCondition6 = setInterval(function () {
  525. if (
  526. jQuery(".postid-3271 .mark-as-complete-button-container button").length >
  527. 0
  528. ) {
  529. clearInterval(existCondition6);
  530. const parameters = function parameters() {
  531. jQuery(".postid-3271 .mark-as-complete-button-container button").click(
  532. function (e) {
  533. e.stopPropagation();
  534. e.preventDefault();
  535. jQuery(".popupitems").show().focus();
  536. }
  537. );
  538. };
  539. parameters();
  540. }
  541. jQuery(".map-category-tile")
  542. .before()
  543. .click(function () {
  544. jQuery(".map-category-tile").removeClass("active");
  545. });
  546. }, 100);
  547. //
  548. let existCondition5 = setInterval(function () {
  549. if (
  550. jQuery(".postid-2061 .mark-as-complete-button-container button").length >
  551. 0
  552. ) {
  553. clearInterval(existCondition5);
  554. const parameters = function parameters() {
  555. jQuery(".postid-2061 .mark-as-complete-button-container button").click(
  556. function (e) {
  557. e.stopPropagation();
  558. e.preventDefault();
  559. jQuery(".popupitems").show().focus();
  560. }
  561. );
  562. };
  563. parameters();
  564. }
  565. jQuery(".map-category-tile")
  566. .before()
  567. .click(function () {
  568. jQuery(".map-category-tile").removeClass("active");
  569. });
  570. }, 100);
  571. //
  572. let existCondition4 = setInterval(function () {
  573. if (
  574. jQuery(".postid-3274 .mark-as-complete-button-container button").length >
  575. 0
  576. ) {
  577. clearInterval(existCondition4);
  578. const parameters = function parameters() {
  579. jQuery(".postid-3274 .mark-as-complete-button-container button").click(
  580. function (e) {
  581. e.stopPropagation();
  582. e.preventDefault();
  583. jQuery(".popupitems").show().focus();
  584. }
  585. );
  586. };
  587. parameters();
  588. }
  589. jQuery(".map-category-tile")
  590. .before()
  591. .click(function () {
  592. jQuery(".map-category-tile").removeClass("active");
  593. });
  594. }, 100);
  595. //
  596. //
  597. let existCondition3 = setInterval(function () {
  598. if (
  599. jQuery(".postid-3276 .mark-as-complete-button-container button").length >
  600. 0
  601. ) {
  602. clearInterval(existCondition3);
  603. const parameters = function parameters() {
  604. jQuery(".postid-3276 .mark-as-complete-button-container button").click(
  605. function (e) {
  606. e.stopPropagation();
  607. e.preventDefault();
  608. jQuery(".popupitems").show().focus();
  609. }
  610. );
  611. };
  612. parameters();
  613. }
  614. jQuery(".map-category-tile")
  615. .before()
  616. .click(function () {
  617. jQuery(".map-category-tile").removeClass("active");
  618. });
  619. }, 100);
  620. //
  621. let existCondition2 = setInterval(function () {
  622. if (
  623. jQuery(".postid-3267 .mark-as-complete-button-container button").length >
  624. 0
  625. ) {
  626. clearInterval(existCondition2);
  627. const parameters = function parameters() {
  628. jQuery(".postid-3267 .mark-as-complete-button-container button").click(
  629. function (e) {
  630. e.stopPropagation();
  631. e.preventDefault();
  632. jQuery(".popupitems").show().focus();
  633. }
  634. );
  635. };
  636. parameters();
  637. }
  638. jQuery(".map-category-tile")
  639. .before()
  640. .click(function () {
  641. jQuery(".map-category-tile").removeClass("active");
  642. });
  643. }, 100);
  644.  
  645. //
  646. jQuery(document).ready(function () {
  647. let existCondition = setInterval(function () {
  648. if (
  649. jQuery(".postid-3268 .mark-as-complete-button-container button")
  650. .length > 0
  651. ) {
  652. clearInterval(existCondition);
  653. const parameters2 = function parameters() {
  654. jQuery(
  655. ".postid-3268 .mark-as-complete-button-container button"
  656. ).click(function (e) {
  657. e.stopPropagation();
  658. e.preventDefault();
  659. jQuery(".popupitems").show().focus();
  660. });
  661. };
  662. parameters2();
  663. }
  664. jQuery(".map-category-tile")
  665. .before()
  666. .click(function () {
  667. jQuery(".map-category-tile").removeClass("active");
  668. });
  669. }, 100);
  670.  
  671. var validator = jQuery("#reflectForm").validate();
  672. jQuery(".reflectarea").keyup(function () {
  673. var goodLength = validator.element(".reflectarea");
  674. if (goodLength) {
  675. jQuery(".submitbutton").removeAttr("disabled");
  676. } else {
  677. jQuery(".submitbutton").attr("disabled", "true");
  678. }
  679. });
  680.  
  681. if (jQuery(".submitbutton").prop("disabled") == true) {
  682. jQuery(".submitbutton").click(function () {
  683. jQuery("body").addClass("has-overlay");
  684. jQuery(".loader2").addClass("activeLoader");
  685. });
  686. }
  687. });
  688. });
  689.  
  690. jQuery(document).ready(function () {
  691. if (jQuery(".secondelement.current")) {
  692. jQuery(".popupcontainer__item--firstelement").find("video")[0].pause();
  693. }
  694. jQuery(".firstpopup .fa-circle-info").click(function () {
  695. jQuery(".firstpopupcontainer").addClass("activeAditionalPopup");
  696. jQuery(".firstpopup ").addClass("overlay");
  697. jQuery(".popupcontainer__item--firstelement.current")
  698. .find("video")[0]
  699. .play();
  700. });
  701. jQuery(".secondpopup .fa-circle-info").click(function () {
  702. jQuery(".secondpopupcontainer").addClass("activeAditionalPopup");
  703. jQuery(".secondpopup ").addClass("overlay");
  704. jQuery(".goToDesiredElement2").hide();
  705. if (jQuery(".secondpopup .secondpopupcontainer").length > 0) {
  706. setTimeout(function () {
  707. let index = 1;
  708. let total = jQuery(
  709. ".secondpopup .secondpopupcontainer .popupcontainer__item--secondelement"
  710. ).length;
  711. let nextButtonPopup = jQuery(
  712. ".secondpopup .secondpopupcontainer .nextButtonPopup"
  713. );
  714. jQuery(nextButtonPopup).on("click", function () {
  715. let element = jQuery(
  716. ".secondpopup .secondpopupcontainer .popupcontainer__item--secondelement"
  717. );
  718. jQuery(
  719. ".secondpopup .secondpopupcontainer .popupcontainer__item--secondelement"
  720. ).removeClass("current");
  721.  
  722. if (element.length > 0) {
  723. jQuery(
  724. ".secondpopup .secondpopupcontainer .popupcontainer__item--secondelement"
  725. )
  726. .eq(index)
  727. .addClass("current ");
  728. index = (index + 1) % total;
  729. let item = jQuery(
  730. ".secondpopup .secondpopupcontainer .popupcontainer__item--secondelement:nth-child(3)"
  731. );
  732. item.hasClass("current");
  733. if (item.hasClass("current")) {
  734. jQuery(".goToDesiredElement2").show();
  735. } else {
  736. jQuery(".goToDesiredElement2").hide();
  737. }
  738. }
  739. });
  740. }, 500);
  741. }
  742. });
  743.  
  744. jQuery(".thirdpopup .fa-circle-info").click(function () {
  745. jQuery(".thirdpopupcontainer").addClass("activeAditionalPopup");
  746. jQuery(".thirdpopup ").addClass("overlay");
  747. if (jQuery(".thirdpopup .thirdpopupcontainer").length > 0) {
  748. setTimeout(function () {
  749. let index = 1;
  750. let total = jQuery(
  751. ".thirdpopup .thirdpopupcontainer .popupcontainer__item--secondelement"
  752. ).length;
  753. let nextButtonPopup = jQuery(
  754. ".thirdpopup .thirdpopupcontainer .nextButtonPopup"
  755. );
  756.  
  757. jQuery(nextButtonPopup).on("click", function () {
  758. let element = jQuery(
  759. ".thirdpopup .thirdpopupcontainer .popupcontainer__item--secondelement"
  760. );
  761. jQuery(
  762. ".thirdpopup .thirdpopupcontainer .popupcontainer__item--secondelement"
  763. ).removeClass("current");
  764.  
  765. if (element.length > 0) {
  766. jQuery(
  767. ".thirdpopup .thirdpopupcontainer .popupcontainer__item--secondelement"
  768. )
  769. .eq(index)
  770. .addClass("current ");
  771. index = (index + 1) % total;
  772. let item = jQuery(
  773. ".thirdpopup .thirdpopupcontainer .popupcontainer__item--secondelement:nth-child(2)"
  774. );
  775. }
  776. });
  777. }, 500);
  778. }
  779. });
  780. jQuery(".fourthpopup .fa-circle-info").click(function () {
  781. jQuery(".fourthpopup").addClass("overlay");
  782. jQuery(".fourthpopupcontainer").addClass("activeAditionalPopup");
  783. if (jQuery(".fourthpopup .fourthpopupcontainer").length > 0) {
  784. setTimeout(function () {
  785. let index = 1;
  786. let total = jQuery(
  787. ".fourthpopup .fourthpopupcontainer .popupcontainer__item--secondelement"
  788. ).length;
  789. let nextButtonPopup = jQuery(
  790. ".fourthpopup .fourthpopupcontainer .nextButtonPopup"
  791. );
  792.  
  793. jQuery(nextButtonPopup).on("click", function () {
  794. let element = jQuery(
  795. ".fourthpopup .fourthpopupcontainer .popupcontainer__item--secondelement"
  796. );
  797. jQuery(
  798. ".fourthpopup .fourthpopupcontainer .popupcontainer__item--secondelement"
  799. ).removeClass("current");
  800.  
  801. if (element.length > 0) {
  802. jQuery(
  803. ".fourthpopup .fourthpopupcontainer .popupcontainer__item--secondelement"
  804. )
  805. .eq(index)
  806. .addClass("current ");
  807. index = (index + 1) % total;
  808. let item = jQuery(
  809. ".fourthpopup .fourthpopupcontainer .popupcontainer__item--secondelement:nth-child(2)"
  810. );
  811. }
  812. });
  813. }, 500);
  814. }
  815. });
  816.  
  817. jQuery(".fifthpopup .fa-circle-info").click(function () {
  818. let fifthPopupSlides = function fifthPopupSlides() {
  819. jQuery(".fifthpopupcontainer").addClass("activeAditionalPopup");
  820. jQuery(".fifthpopup ").addClass("overlay");
  821. if (jQuery(".fifthpopup .fifthpopupcontainer").length > 0) {
  822. setTimeout(function () {
  823. let index = 1;
  824. let total = jQuery(
  825. ".fifthpopup .fifthpopupcontainer .popupcontainer__item--secondelement"
  826. ).length;
  827. let nextButtonPopup = jQuery(
  828. ".fifthpopup .fifthpopupcontainer .nextButtonPopup"
  829. );
  830.  
  831. jQuery(nextButtonPopup).on("click", function () {
  832. let element = jQuery(
  833. ".fifthpopup .fifthpopupcontainer .popupcontainer__item--secondelement"
  834. );
  835. jQuery(
  836. ".fifthpopup .fifthpopupcontainer .popupcontainer__item--secondelement"
  837. ).removeClass("current");
  838.  
  839. if (element.length > 0) {
  840. jQuery(
  841. ".fifthpopup .fifthpopupcontainer .popupcontainer__item--secondelement"
  842. )
  843. .eq(index)
  844. .addClass("current ");
  845. index = (index + 1) % total;
  846. let item = jQuery(
  847. ".fifthpopup .fifthpopupcontainer .popupcontainer__item--secondelement:nth-child(2)"
  848. );
  849. }
  850. });
  851. }, 500);
  852. }
  853. };
  854. fifthPopupSlides();
  855. });
  856.  
  857. //
  858. jQuery(".sixthpopup .fa-circle-info").click(function () {
  859. jQuery(".sixthpopupcontainer").addClass("activeAditionalPopup");
  860. jQuery(".sixthpopup ").addClass("overlay");
  861. if (jQuery(".sixthpopup .sixthpopupcontainer").length > 0) {
  862. setTimeout(function () {
  863. let index = 1;
  864. let total = jQuery(
  865. ".sixthpopup .sixthpopupcontainer .popupcontainer__item--secondelement"
  866. ).length;
  867. let nextButtonPopup = jQuery(
  868. ".sixthpopup .sixthpopupcontainer .nextButtonPopup"
  869. );
  870.  
  871. jQuery(nextButtonPopup).on("click", function () {
  872. let element = jQuery(
  873. ".sixthpopup .sixthpopupcontainer .popupcontainer__item--secondelement"
  874. );
  875. jQuery(
  876. ".sixthpopup .sixthpopupcontainer .popupcontainer__item--secondelement"
  877. ).removeClass("current");
  878.  
  879. if (element.length > 0) {
  880. jQuery(
  881. ".sixthpopup .sixthpopupcontainer .popupcontainer__item--secondelement"
  882. )
  883. .eq(index)
  884. .addClass("current ");
  885. index = (index + 1) % total;
  886. let item = jQuery(
  887. ".sixthpopup .sixthpopupcontainer .popupcontainer__item--secondelement:nth-child(2)"
  888. );
  889. }
  890. });
  891. }, 500);
  892. }
  893. });
  894. //
  895. jQuery(".seventhpopup .fa-circle-info").click(function () {
  896. jQuery(".seventhpopupcontainer").addClass("activeAditionalPopup");
  897. jQuery(".seventhpopup").addClass("overlay");
  898. if (jQuery(".seventhpopup .seventhpopupcontainer").length > 0) {
  899. setTimeout(function () {
  900. let index = 1;
  901. let total = jQuery(
  902. ".seventhpopup .seventhpopupcontainer .popupcontainer__item--secondelement"
  903. ).length;
  904. let nextButtonPopup = jQuery(
  905. ".seventhpopup .seventhpopupcontainer .nextButtonPopup"
  906. );
  907.  
  908. jQuery(nextButtonPopup).on("click", function () {
  909. let element = jQuery(
  910. ".seventhpopup .seventhpopupcontainer .popupcontainer__item--secondelement"
  911. );
  912. jQuery(
  913. ".seventhpopup .seventhpopupcontainer .popupcontainer__item--secondelement"
  914. ).removeClass("current");
  915.  
  916. if (element.length > 0) {
  917. jQuery(
  918. ".seventhpopup .seventhpopupcontainer .popupcontainer__item--secondelement"
  919. )
  920. .eq(index)
  921. .addClass("current ");
  922. index = (index + 1) % total;
  923. let item = jQuery(
  924. ".seventhpopup .seventhpopupcontainer .popupcontainer__item--secondelement:nth-child(2)"
  925. );
  926. }
  927. });
  928. }, 500);
  929. }
  930. });
  931. //
  932. jQuery(".eighthpopup .fa-circle-info").click(function () {
  933. jQuery(".eighthpopupcontainer").addClass("activeAditionalPopup");
  934. jQuery(".eighthpopup").addClass("overlay");
  935. if (jQuery(".eighthpopup .eighthpopupcontainer").length > 0) {
  936. setTimeout(function () {
  937. let index = 1;
  938. let total = jQuery(
  939. ".eighthpopup .eighthpopupcontainer .popupcontainer__item--secondelement"
  940. ).length;
  941. let nextButtonPopup = jQuery(
  942. ".eighthpopup .eighthpopupcontainer .nextButtonPopup"
  943. );
  944.  
  945. jQuery(nextButtonPopup).on("click", function () {
  946. let element = jQuery(
  947. ".eighthpopup .eighthpopupcontainer .popupcontainer__item--secondelement"
  948. );
  949. jQuery(
  950. ".eighthpopup .eighthpopupcontainer .popupcontainer__item--secondelement"
  951. ).removeClass("current");
  952.  
  953. if (element.length > 0) {
  954. jQuery(
  955. ".eighthpopup .eighthpopupcontainer .popupcontainer__item--secondelement"
  956. )
  957. .eq(index)
  958. .addClass("current ");
  959. index = (index + 1) % total;
  960. let item = jQuery(
  961. ".eighthpopup .eighthpopupcontainer .popupcontainer__item--secondelement:nth-child(2)"
  962. );
  963. }
  964. });
  965. }, 500);
  966. }
  967. });
  968. //
  969. //
  970. jQuery(".ninthpopup .fa-circle-info").click(function () {
  971. jQuery(".ninthpopupcontainer").addClass("activeAditionalPopup");
  972. jQuery(".ninthpopup").addClass("overlay");
  973. if (jQuery(".ninthpopup .ninthpopupcontainer").length > 0) {
  974. setTimeout(function () {
  975. let index = 1;
  976. let total = jQuery(
  977. ".ninthpopup .ninthpopupcontainer .popupcontainer__item--secondelement"
  978. ).length;
  979. let nextButtonPopup = jQuery(
  980. ".ninthpopup .ninthpopupcontainer .nextButtonPopup"
  981. );
  982.  
  983. jQuery(nextButtonPopup).on("click", function () {
  984. let element = jQuery(
  985. ".ninthpopup .ninthpopupcontainer .popupcontainer__item--secondelement"
  986. );
  987. jQuery(
  988. ".ninthpopup .ninthpopupcontainer .popupcontainer__item--secondelement"
  989. ).removeClass("current");
  990.  
  991. if (element.length > 0) {
  992. jQuery(
  993. ".ninthpopup .ninthpopupcontainer .popupcontainer__item--secondelement"
  994. )
  995. .eq(index)
  996. .addClass("current ");
  997. index = (index + 1) % total;
  998. let item = jQuery(
  999. ".ninthpopup .ninthpopupcontainer .popupcontainer__item--secondelement:nth-child(2)"
  1000. );
  1001. }
  1002. });
  1003. }, 500);
  1004. }
  1005. });
  1006. //
  1007. jQuery(".closeFirstPopup").click(function () {
  1008. jQuery(".firstpopupcontainer").removeClass("activeAditionalPopup");
  1009. jQuery(".firstpopup ").removeClass("overlay");
  1010. jQuery(".popupcontainer__item--firstelement").find("video")[0].pause();
  1011. jQuery(".popupcontainer__item--firstelement.secondelement")
  1012. .find("video")[0]
  1013. .play();
  1014. jQuery(".popupcontainer__item--firstelement.secondelement ")
  1015. .find("video")[0]
  1016. .pause();
  1017. });
  1018. jQuery(".closeSecondtPopup").click(function (e) {
  1019. e.stopPropagation();
  1020. jQuery(".secondpopupcontainer").removeClass("activeAditionalPopup");
  1021. jQuery(".secondpopup ").removeClass("overlay");
  1022. });
  1023. jQuery(".closeThirdPopup").click(function (e) {
  1024. e.stopPropagation();
  1025. jQuery(".thirdpopupcontainer").removeClass("activeAditionalPopup");
  1026. jQuery(".thirdpopup ").removeClass("overlay");
  1027. });
  1028. jQuery(".closeFourthPopup").click(function (e) {
  1029. e.stopPropagation();
  1030. jQuery(".fourthpopup ").removeClass("overlay");
  1031. jQuery(".fourthpopupcontainer").removeClass("activeAditionalPopup");
  1032. });
  1033. jQuery(".closefifthPopup").click(function (e) {
  1034. e.stopPropagation();
  1035. jQuery(".fifthpopupcontainer").removeClass("activeAditionalPopup");
  1036. jQuery(".fifthpopup ").removeClass("overlay");
  1037. });
  1038. jQuery(".closesixthPopup").click(function (e) {
  1039. e.stopPropagation();
  1040. jQuery(".sixthpopupcontainer").removeClass("activeAditionalPopup");
  1041. jQuery(".sixthpopup ").removeClass("overlay");
  1042. });
  1043. jQuery(".closeseventhPopup").click(function (e) {
  1044. e.stopPropagation();
  1045. jQuery(".seventhpopupcontainer").removeClass("activeAditionalPopup");
  1046. jQuery(".seventhpopup").removeClass("overlay");
  1047. });
  1048. jQuery(".closeeighthPopup").click(function (e) {
  1049. e.stopPropagation();
  1050. jQuery(".eighthpopup ").removeClass("overlay");
  1051. jQuery(".eighthpopupcontainer").removeClass("activeAditionalPopup");
  1052. });
  1053. jQuery(".closeninthPopup").click(function (e) {
  1054. e.stopPropagation();
  1055. jQuery(".ninthpopup ").removeClass("overlay");
  1056. jQuery(".ninthpopupcontainer ").removeClass("activeAditionalPopup");
  1057. });
  1058. });
  1059.  
  1060. jQuery(document).ready(function () {
  1061. jQuery(".closeSearch").on("click", function () {
  1062. jQuery(".search_result").hide();
  1063. });
  1064. if (jQuery(".input_search").val() == "") {
  1065. jQuery(".search_result").hide();
  1066. }
  1067. jQuery(".input_search").on("keyup change", function (e) {
  1068. jQuery(".search_result").show();
  1069. });
  1070. if (jQuery(".popupcontainer").length > 0) {
  1071. setTimeout(function () {
  1072. var index = 1;
  1073. var total = jQuery(".popupcontainer__item--firstelement").length;
  1074. var nextButtonPopup = jQuery(".nextButton");
  1075.  
  1076. jQuery(nextButtonPopup).on("click", function () {
  1077. let element = jQuery(".popupcontainer__item--firstelement");
  1078. jQuery(".popupcontainer__item--firstelement").removeClass("current");
  1079. jQuery(".popupcontainer__item--firstelement.secondelement")
  1080. .find("video")[0]
  1081. .play();
  1082. jQuery(".popupcontainer__item--firstelement").find("video")[0].pause();
  1083. if (element.length > 0) {
  1084. jQuery(".popupcontainer__item--firstelement")
  1085. .eq(index)
  1086. .addClass("current ");
  1087. index = (index + 1) % total;
  1088. let item = jQuery(".popupcontainer__item--firstelement:nth-child(2)");
  1089. item.hasClass("current");
  1090. if (item.hasClass("current")) {
  1091. jQuery(".goToDesiredElement").show();
  1092. } else {
  1093. jQuery(".goToDesiredElement").hide();
  1094. }
  1095. }
  1096. });
  1097. }, 500);
  1098. }
  1099.  
  1100. if (jQuery(".popupcontainer").length > 0) {
  1101. setTimeout(function () {
  1102. var index2 = 1;
  1103. var total2 = jQuery(".popupcontainer__item--firstelement").length;
  1104. var nextButtonPopup2 = jQuery(".backButton");
  1105.  
  1106. jQuery(nextButtonPopup2).on("click", function () {
  1107. let element = jQuery(".popupcontainer__item--firstelement");
  1108. jQuery(".popupcontainer__item--firstelement").removeClass("current");
  1109. if (element.length > 0) {
  1110. jQuery(".popupcontainer__item--firstelement")
  1111. .eq(index2)
  1112. .addClass("current");
  1113. index2 = (index2 - 1) % total2;
  1114. let item = jQuery(".popupcontainer__item--firstelement");
  1115. item.hasClass("current");
  1116. if (item.hasClass("current")) {
  1117. jQuery(".goToDesiredElement").hide();
  1118. }
  1119. }
  1120. });
  1121. }, 500);
  1122. }
  1123. let item2 = jQuery(
  1124. ".popupcontainer__item > .popupcontainer__item--firstelement"
  1125. );
  1126. if (item2.hasClass("current")) {
  1127. jQuery(".backButton").hide();
  1128. } else {
  1129. jQuery(".backButton").show();
  1130. }
  1131. });
  1132. $("#mark_as_complete_vue_component > div > button").click(function () {
  1133. $(".popupitems ").toggleClass("opened");
  1134. });
  1135. $(document).click(function (e) {
  1136. if (
  1137. !$(e.target)
  1138. .parents()
  1139. .andSelf()
  1140. .is("#mark_as_complete_vue_component > div > button")
  1141. ) {
  1142. $(".popupitems ").removeClass("opened");
  1143. }
  1144. });
  1145. $(".popupitems ").click(function (e) {
  1146. e.stopPropagation();
  1147. });
  1148. jQuery(".alertify-notifier .ajs-success").append(`<div class="buttonContainer"
  1149. "><a class="goToMain" href="https://learn2.roche.com/commercial-learning/"
  1150. ">Go landing page</a><a class="goToLe" href=""
  1151. ">Go learning element</a></div>`);
  1152. jQuery(document).ready(function () {
  1153. if (jQuery(".ajs-success").length > 0) {
  1154. jQuery(".alertify-notifier .ajs-success")
  1155. .append(`<div class="buttonContainer"
  1156. "><a class="goToMain" href="https://learn2.roche.com/commercial-learning/"
  1157. ">Go landing page</a><a class="goToLe" href=""
  1158. ">Go learning element</a></div>`);
  1159. if (jQuery(".goToMain").length > 0) {
  1160. jQuery(".goToMain").click(function (e) {
  1161. window.location.hash = "example";
  1162. if (jQuery("body").hasClass("home2")) {
  1163. }
  1164. });
  1165. }
  1166. }
  1167. });
  1168.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement