pastebin - collaborative debugging tool
kpaste.net RSS


file
Posted by Anonymous on Thu 19th Nov 2020 10:23
raw | new post

  1. function isMatch(el, match){//cross plateform Element.matches() workaround
  2.     return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, match);
  3.   }
  4.  
  5.   function getDOMClosest(elem, selector){//DOM closest ancestor speified by a CSS selector
  6.     for ( ; elem && elem !== document; elem = elem.parentNode ) {
  7.       if ( isMatch(elem, selector) ) return elem;
  8.     }
  9.     return null;
  10.   }
  11.  
  12.  
  13.   document.addEventListener('click', function(event){
  14.       let markedEl = document.querySelector(".show-mobile");
  15.       if (markedEl){
  16.           markedEl.classList.remove("show-mobile");
  17.       }
  18.       else{
  19.           let el = event.target;
  20.           if(el.tagName === 'P' && el.classList.contains("social-infos")){
  21.               el.classList.toggle("show-mobile");
  22.           }
  23.           else{
  24.               let element = getDOMClosest(event.target, ".social-infos");
  25.               if(element){
  26.                   el.classList.toggle("show-mobile");
  27.               }
  28.           }
  29.       }
  30.      
  31.   });
  32.  
  33. $(document).keydown(function (event) {
  34.     if (event.keyCode == 123) { // Prevent F12
  35.         return false;
  36.     } else if (event.ctrlKey && event.shiftKey && event.keyCode == 73) { // Prevent Ctrl+Shift+I        
  37.         return false;
  38.     }
  39. });
  40.  
  41.  
  42. $(document).on("contextmenu", function (e) {        
  43.     e.preventDefault();
  44. });
  45.  
  46.   function clickListener(ev){
  47.     if(isMatch(ev.target, ".register-position-btn a, .register-position-btn span, .register-position-btn i")){
  48.         console.log('HEY');
  49.         document.querySelector('app-login .wrap-login100').style.cssText += 'display:none !important;'
  50.         ev.preventDefault();
  51.         ev.stopPropagation();
  52.         location.pathname = '/menu/edit/25/item/PROCESS/145';
  53.     }else if((ev.target.innerText=="DEMANDE COMPTE CLIENT")){
  54.                         console.log('ok2');
  55.                         location.pathname = '/menu/edit/25/item/PROCESS/145';
  56.                
  57.         }
  58. }
  59.  
  60.  
  61. document.addEventListener("click", clickListener);
  62.  
  63.  
  64. function toggleBtnClickEvHandler(event){
  65.     var evTarget = event.target;
  66.     var toggleBtn;
  67.     if(evTarget.parentElement.classList.contains("header-bottom-toggler")){
  68.         toggleBtn = evTarget.parentElement;
  69.     }
  70.     else if(evTarget.classList.contains("header-bottom-toggler")){
  71.         toggleBtn = evTarget;
  72.     }
  73.    
  74.     if(toggleBtn){
  75.         var headerBottomBtnsContainerEl = document.querySelector(".header-bottom-btns-container");
  76.         if(headerBottomBtnsContainerEl){
  77.             headerBottomBtnsContainerEl.classList.toggle("toggle-on");
  78.             toggleBtn.classList.toggle("toggle-on");
  79.         }
  80.     }
  81. }
  82.  
  83.   document.addEventListener("click", toggleBtnClickEvHandler)

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at