SHARE
TWEET

фрагмент fenki window_helper js

a guest Feb 9th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function _ChangeMapOnClick()
  2. {
  3.     var m=document.getElementById("download-map");
  4.     if(m!=null){m.onclick=function(e)
  5. {
  6.     _ChangeMapOnClickHandler(m,true)
  7. };
  8. m.ontouchend=function(e){_ChangeMapOnClickHandler(m,true)};var t=window.localStorage.getItem("m");if(t==null||t=="null"||t=="a")_ChangeMapOnClickHandler(m,false)
  9.     }
  10. }
  11.  
  12. function _ChangeMapOnClickHandler(m,l)
  13. {
  14.     var t=window.localStorage.getItem("m");
  15.     var a=document.querySelectorAll(".leaflet-zoom-animated g path");
  16.     for(var i=0;i<a.length;i++)
  17.     {
  18.         var color="#dddddd";
  19.         if(t==null||t=="null")
  20.         {
  21.             color="rgb("+(Math.random()*255^1)+","+(Math.random()*255^1)+","+(Math.random()*255^1)+")"
  22.         }
  23.         else if(t=="a")
  24.         {
  25.             color=120+Math.random()*87^1;color="rgb("+color+","+color+","+color+")"
  26.         }
  27.         a[i].setAttribute("fill",color)
  28.     }
  29.         if(t==null||t=="null")res="a";if(t=="a")res="b";
  30.         if(t=="b")res=null;if(l)window.localStorage.setItem("m",res)
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top