forked from geokrety/geokrety-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
funkcje-3.min.js
14 lines (14 loc) · 3.13 KB
/
funkcje-3.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function zliczaj(a){var b=document.getElementById("licznik"),c=document.getElementById("poledoliczenia"),e=c.value,f=c.value.length,d=0,g=0;for(i=0;i<f;i++)e.charAt(i)=="\n"&&(d++,g++,navigator.appName!="Netscape"&&i++),d++;b.value=a-d;if(d>a)c.value=navigator.appName!="Netscape"?c.substring(0,a):c.value.substring(0,a-g),b.value=0,alert("max length "+a+"!")}
function count_remaining(a,b,c){a=document.getElementById(a);b=document.getElementById(b);if(a.value.length>c)a.value=a.value.substring(0,c);b.innerHTML=""+(c-a.value.length)}function copy_value_to_innerHTML(a,b){var c=document.getElementById(a);document.getElementById(b).innerHTML=c.value}
function RuchyPola(a){var b=document;if(a==0||a==3||a==5)b.getElementById("latlon").disabled=!1,b.getElementById("wpt").disabled=!1,b.getElementById("btn_sprawdzskrzynke").disabled=!1,b.getElementById("NazwaSkrzynki").disabled=!1;else if(a==1||a==2||a==4||a==6)b.getElementById("latlon").disabled=!0,b.getElementById("wpt").disabled=!0,b.getElementById("btn_sprawdzskrzynke").disabled=!0,b.getElementById("NazwaSkrzynki").disabled=!0}
function sprawdzWpt(a){if(a){var b=window.event?event.keyCode:a.keyCode;if(b==9||b>=16&&b<=20||b>=33&&b<=40)return}var b=document,c=b.getElementById("latlon"),e=b.getElementById("NazwaSkrzynki"),f=b.getElementById("ajax_status"),d=b.getElementById("wpt").value.replace(/^\s\s*/,"").replace(/\s\s*$/,""),g=b.getElementById("wynikWpt");if(d.length>=6){if(a||f.title!=d)f.innerHTML="Retrieving...",f.title=d,$.get("szukaj-ajax.php",{skad:"ajax",wpt:d},function(a){f.innerHTML="";a=JSON.parse(a);a.lat!=""?
(c.value=a.lat+" "+a.lon,c.disabled=!1):(c.disabled=!1,c.value="");e.disabled=!0;g.innerHTML=a.tresc})}else c.disabled=!1,c.value="",e.disabled=!1,e.value="",g.innerHTML="",f.title=""}
function sprawdzNazwe(){var a=document,b=a.getElementById("NazwaSkrzynki").value.replace(/^\s\s*/,"").replace(/\s\s*$/,""),c=a.getElementById("wpt"),e=a.getElementById("latlon"),f=a.getElementById("NazwaSkrzynki"),d=a.getElementById("ajax_status"),g=a.getElementById("wynikWpt");b.length>=5?(g.innerHTML="",d.innerHTML="Retrieving...",d.title=b,$.get("szukaj-ajax.php",{skad:"ajax",NazwaSkrzynki:b},function(a){d.innerHTML="";a=JSON.parse(a);a.IleSkrzynek==1?(e.disabled=!0,e.value=a.lat+" "+a.lon,c.value=
a.wpt):(e.disabled=!1,e.value="",c.disabled=!1,c.value="");g.innerHTML=a.tresc})):(c.disabled=!1,c.value="",e.disabled=!1,e.value="",f.disabled=!1,g.innerHTML="",d.title="",d.innerHTML="<br /><br /><br />Enter at least 5 characters of the name")}
function sprawdzGK(a){if(a&&(a=window.event?event.keyCode:a.keyCode,a==9||a>=16&&a<=20||a>=33&&a<=40))return;var a=document.getElementById("nr").value.replace(/^\s\s*/,"").replace(/\s\s*$/,""),b=document.getElementById("wynikNr");/^[a-zA-Z0-9]{6}(\.[a-zA-Z0-9]{6})*$/.test(a)?(b.innerHTML="Retrieving...",$.get("szukaj-ajax.php",{skad:"ajax",nr:a},function(a){b.innerHTML=a})):b.innerHTML=""}
function CzySkasowac(a,b){var c=confirm("Are you sure you want to delete "+b);c&&(a.href+="&confirmed=1");return c};
function Potwierdz(theLink, tresc){ var is_confirmed = confirm(tresc);
if (is_confirmed) {
theLink.href += '?confirmed=1';
}
return is_confirmed;}