function includeHTML() { var z, i, elmnt, file, xhttp; /*loop through a collection of all HTML elements:*/ z = document.getElementsByTagName("*"); for (i = 0; i < z.length; i++) { elmnt = z[i]; /*search for elements with a certain atrribute:*/ file = elmnt.getAttribute("w3-include-html"); if (file) { /*make an HTTP request using the attribute value as the file name:*/ xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4) { if (this.status == 200) {elmnt.innerHTML = this.responseText;} if (this.status == 404) {elmnt.innerHTML = "Page not found.";} /*remove the attribute, and call this function once more:*/ elmnt.removeAttribute("w3-include-html"); includeHTML(); } } xhttp.open("GET", file, true); xhttp.send(); /*exit the function:*/ return; } } } function jaxin(elm,server) { var elmnt, server, xhttp; /*loop through a collection of all HTML elements:*/ elmnt = document.getElementById(elm); /*make an HTTP request using the attribute value as the file name:*/ xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4) { if (this.status == 200) { if (elmnt != null) elmnt.innerHTML = this.responseText;} if (this.status == 404) { if (elmnt != null) elmnt.innerHTML = "Page not found.";} /*remove the attribute, and call this function once more:*/ } } xhttp.open("GET", server, true); xhttp.send(); /*exit the function:*/ return; } function mydark() { element = document.getElementById("topbar"); if (element.classList.contains('custodark')) { element.classList.remove("custodark"); } else { element.classList.add("custodark"); //element.style.color="inherit"; //funny to reverese again } element = document.getElementById("moonbutt"); if (element.classList.contains('customoon')) { element.style.color="inherit"; //funny to reverese again element.classList.remove("customoon"); //changeCSS('pos.css', 0); xe=document.getElementsByTagName("body")[0].style; xe.background="inherit"; //xe.color="black"; s = document.getElementById("maincont"); s.style.color="inherit"; sb = document.getElementById("sbcont"); sb.style.color="inherit"; } else { element.classList.add("customoon"); xe=document.getElementsByTagName("body")[0].style; xe.background="#212121" s = document.getElementById("maincont"); s.style.color="#dadada"; sb = document.getElementById("sbcont"); sb.style.color="#dadada"; } } function sbconth() { hideit = document.getElementById("sbcont"); sbcont = document.getElementById("sbcont"); maincont = document.getElementById("maincont"); //if (hideit.style.width=="") would help about start console.log(hideit.style.width); var w = window.innerWidth; if (w>499) { if ((hideit.style.width=="150px") || (hideit.style.width=="") ) { hideit.style.width = '0px'; document.getElementById("maincont").style.marginLeft = "0px"; sbcont.style.left = '-250px'; maincont.style.left = '0px'; console.log("i1"+maincont.style.marginLeft+":"+hideit.style.width); } else { hideit.style.width = '150px'; sbcont.style.left = '0px'; document.getElementById("maincont").style.marginLeft = "150px"; console.log("i2"+maincont.style.marginLeft+":"+hideit.style.width); } } else { if ((hideit.style.width=="150px")&& (maincont.style.marginLeft=="") || (maincont.style.marginLeft=="0px")) { document.getElementById("maincont").style.marginLeft = "150px"; hideit.style.width = '150px'; sbcont.style.left = '0px'; } else { document.getElementById("maincont").style.marginLeft = "0px"; sbcont.style.left = '-250px'; hideit.style.width = '150px'; } } } function sbconth2() { hideit = document.getElementById("sbcont"); sbcont = document.getElementById("sbcont"); maincont = document.getElementById("maincont"); //if (hideit.style.width=="") would help about start console.log(hideit.style.width); //sbcont.style.display="block"; sbcont.style.width = '150px'; maincont.style.overflowX ="hidden;"; sbcont.style.top = "60px"; var w = window.innerWidth; if (w>1100) if (sbcont.style.display=="block") sbcont.style.display="none"; else sbcont.style.display="block"; } function reloadme(){ location.reload(); return false; } function dlmode00() { var element = document.body; element.classList.toggle("dark-mode"); s = document.getElementById("maincont"); s.classList.toggle("dark-mode"); s = document.getElementById("sbcont"); s.classList.toggle("dark-mode"); element = document.getElementById("topbar"); if (element.classList.contains('custodark')) { element.classList.remove("custodark"); } else { element.classList.add("custodark"); //element.style.color="inherit"; //funny to reverese again } element = document.getElementById("moonbutt"); if (element.classList.contains('customoon')) { element.style.color="inherit"; //funny to reverese again element.classList.remove("customoon"); //changeCSS('pos.css', 0); locallight(); } else { element.classList.add("customoon"); localdark(); } //hidt = document.getElementById("tble"); // hidt.classList.toggle("table-not-striped"); hideit = document.getElementById("sbcont"); hideit.classList.toggle("dark-mode"); //hideit.style.color ="#ffffff"; } function localdark(){ if (typeof(Storage) !== "undefined") { // Store localStorage.setItem("light", "dark"); jaxin("","ssession.php?light="+dark); // Retrieve document.getElementById("result").innerHTML = localStorage.getItem("lastname"); } else { // document.getElementById("result").innerHTML = "Sorry, your browser does not support Web Storage..."; } } function locallight(){ if (typeof(Storage) !== "undefined") { // Store localStorage.setItem("light", "light"); jaxin("","ssession.php?light="+light); // Retrieve document.getElementById("result").innerHTML = localStorage.getItem("lastname"); } else { // document.getElementById("result").innerHTML = "Sorry, your browser does not support Web Storage..."; } } function checklight(){ if (localStorage.getItem("light") === null) { localStorage.setItem("light", "light"); light="light"; } else { light=localStorage.getItem("light"); //localStorage.getItem("light")="LIGHT"; } return light; } function init(){ var w = window.innerWidth; var h = window.innerHeight; sbcont = document.getElementById("sbcont"); sbcont.style.left = '0px'; maincont = document.getElementById("maincont"); // maincont.style.left = '150px'; maincont.style.left = '0px'; maincont.style.width ="100%;"; //document.getElementById("maincont").style.marginLeft = "0px"; bod = element = document.body; bod.style.overflowX ="hidden"; // setTimeout(function(){ sbcont.style.display="block";sbcont.style.width = '150px';maincont.style.overflowX ="hidden;";}, 250); //make sure sidebar show // if (w<499) {maincont.style.left = '0px'; sbcont.style.left = '-250px'; } } function init2(){ var w = window.innerWidth; var h = window.innerHeight; sbcont = document.getElementById("sbcont"); sbcont.style.left = '0px'; maincont = document.getElementById("maincont"); maincont.style.left = '150px'; maincont.style.left = '0px'; maincont.style.width ="100%;"; //document.getElementById("maincont").style.marginLeft = "0px"; bod = element = document.body; bod.style.overflowX ="hidden"; // setTimeout(function(){ sbcont.style.display="block";sbcont.style.width = '150px';maincont.style.overflowX ="hidden;";}, 250); //make sure sidebar show if (w<1100) { //active user icon var cols = document.getElementsByClassName('icon-menufold')[0]; // cols.style.Color = 'black'; cols.style.filter = 'invert(100%)'; } } function Pager(tableName) { this.tableName = tableName; var sel = document.getElementById('selecti'); r= sel.options[sel.selectedIndex].value; rn=Number(r); itemsPerPage=rn; this.itemsPerPage = itemsPerPage; this.currentPage = 1; this.pages = 0; this.inited = false; this.showRecords = function(from, to) { var rows = document.getElementById(tableName).rows; // i starts from 1 to skip table header row for (var i = 1; i < rows.length; i++) { if (i < from || i > to) rows[i].style.display = 'none'; else rows[i].style.display = ''; } } this.showPage = function(pageNumber) { if (! this.inited) { alert("not inited"); return; } var sel = document.getElementById('selecti'); r= sel.options[sel.selectedIndex].value; rn=Number(r); var oldPageAnchor = document.getElementById('pg'+this.currentPage); if (oldPageAnchor != null) oldPageAnchor.className = 'pg-normal'; this.currentPage = pageNumber; var newPageAnchor = document.getElementById('pg'+this.currentPage); if (newPageAnchor != null) newPageAnchor.className = 'pg-selected'; var from = (pageNumber - 1) * itemsPerPage + 1; var to = from + itemsPerPage - 1; this.showRecords(from, to); } this.prev = function() { if (this.currentPage > 1) this.showPage(this.currentPage - 1); } this.next = function() { if (this.currentPage < this.pages) { this.showPage(this.currentPage + 1); } } this.init = function() { var rows = document.getElementById(tableName).rows; var records = (rows.length - 1); var sel = document.getElementById('selecti'); r= sel.options[sel.selectedIndex].value; rn=Number(r); itemsPerPage=rn; this.pages = Math.ceil(records / rn); this.inited = true; } this.showPageNav = function(pagerName, positionId) { if (! this.inited) { alert("not inited"); return; } var element = document.getElementById(positionId); var pagerHtml = '<span onclick="' + pagerName + '.prev();" class="pg-normal"> « </span> '; for (var page = 1; page <= this.pages; page++) pagerHtml += '<span id="pg' + page + '" class="pg-normal" onclick="' + pagerName + '.showPage(' + page + ');">' + page + '</span> '; pagerHtml += '<span onclick="'+pagerName+'.next();" class="pg-normal"> » </span>'; console.log(page+":"+totalrows+":"+rn); if((page===2) && (totalrows===rn)) element.style.display = 'none'; else if((page===2) && (totalrows<rn)) element.style.display = 'none'; else { element.innerHTML = pagerHtml; element.style.display = 'block';} } } //end function Pager rows = Array.prototype.slice.call(document.querySelectorAll('tbody tr')) totalrows=rows.length var sel = document.getElementById('selecti'); var opt = document.createElement('option'); opt.appendChild( document.createTextNode('All') ); opt.value = totalrows; sel.appendChild(opt); var input = document.getElementById("mySTInput"); input.addEventListener("keyup", function(event) { if (event.keyCode === 13) { // Cancel the default action, if needed event.preventDefault(); mySTFunction(); // Trigger the button element with a click //document.getElementById("myBtn").click(); } }); <!-- var sel = document.getElementById('selecti'); r= sel.options[sel.selectedIndex].value; rn=Number(r); --> var pager = new Pager('tble'); pager.init(); pager.showPageNav('pager', 'pageNavPosition'); pager.showPage(1); function newr(r){ //rn=Number(r); var pager = new Pager('tble'); pager.init(); pager.showPageNav('pager', 'pageNavPosition'); pager.showPage(1); } function newr(r){ //rn=Number(r); var pager = new Pager('tble'); pager.init(); pager.showPageNav('pager', 'pageNavPosition'); pager.showPage(1); } function mySTFunction() { var input, filter, found, table, tr, td, i, j; input = document.getElementById("mySTInput"); filter = input.value.toUpperCase(); table = document.getElementById("tble"); tr = table.getElementsByTagName("tr"); for (i = 0; i < tr.length; i++) { td = tr[i].getElementsByTagName("td"); for (j = 0; j < td.length; j++) { if (td[j].innerHTML.toUpperCase().indexOf(filter) > -1) { found = true; } } if (found) { tr[i].style.display = ""; found = false; } else if (!tr[i].id.match('^tableHeader')) { tr[i].style.display = "none"; } } } function mySTFunction2() { var input, filter, found, table, tr, td, i, j; input = document.getElementById("mySTInput2"); filter = input.value.toUpperCase(); table = document.getElementById("tble2"); tr = table.getElementsByTagName("tr"); for (i = 0; i < tr.length; i++) { td = tr[i].getElementsByTagName("td"); for (j = 0; j < td.length; j++) { if (td[j].innerHTML.toUpperCase().indexOf(filter) > -1) { found = true; } } if (found) { tr[i].style.display = ""; found = false; } else if (!tr[i].id.match('^tableHeader')) { tr[i].style.display = "none"; } } } function sortTableX(n) { var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0; table = document.getElementById("tble"); switching = true; //Set the sorting direction to ascending: dir = "asc"; /*Make a loop that will continue until no switching has been done:*/ while (switching) { //start by saying: no switching is done: switching = false; rows = table.rows; /*Loop through all table rows (except the first, which contains table headers):*/ for (i = 1; i < (rows.length - 1); i++) { //start by saying there should be no switching: shouldSwitch = false; /*Get the two elements you want to compare, one from current row and one from the next:*/ x = rows[i].getElementsByTagName("TD")[n]; y = rows[i + 1].getElementsByTagName("TD")[n]; /*check if the two rows should switch place, based on the direction, asc or desc:*/ if (dir == "asc") { if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) { //if so, mark as a switch and break the loop: shouldSwitch= true; break; } } else if (dir == "desc") { if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) { //if so, mark as a switch and break the loop: shouldSwitch = true; break; } } } if (shouldSwitch) { /*If a switch has been marked, make the switch and mark that a switch has been done:*/ rows[i].parentNode.insertBefore(rows[i + 1], rows[i]); switching = true; //Each time a switch is done, increase this count by 1: switchcount ++; } else { /*If no switching has been done AND the direction is "asc", set the direction to "desc" and run the while loop again.*/ if (switchcount == 0 && dir == "asc") { dir = "desc"; switching = true; } } } } function sortTable(tableClass, n) { var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0; table = document.getElementsByClassName(tableClass)[0]; switching = true; dir = "asc"; while (switching) { switching = false; rows = table.getElementsByTagName("TR"); for (i = 1; i < (rows.length - 1); i++) { shouldSwitch = false; x = rows[i].getElementsByTagName("TD")[n]; y = rows[i + 1].getElementsByTagName("TD")[n]; var cmpX=isNaN(parseInt(x.innerHTML))?x.innerHTML.toLowerCase():parseInt(x.innerHTML); var cmpY=isNaN(parseInt(y.innerHTML))?y.innerHTML.toLowerCase():parseInt(y.innerHTML); cmpX=(cmpX=='-')?0:cmpX; cmpY=(cmpY=='-')?0:cmpY; if (dir == "asc") { if (cmpX > cmpY) { shouldSwitch= true; break; } } else if (dir == "desc") { if (cmpX < cmpY) { shouldSwitch= true; break; } } } if (shouldSwitch) { rows[i].parentNode.insertBefore(rows[i + 1], rows[i]); switching = true; switchcount ++; } else { if (switchcount == 0 && dir == "asc") { dir = "desc"; switching = true; } } } } function pushlsslbar_on() { // document.getElementById("lsslbar").style.width = "200px"; // document.getElementById("main").style.marginLeft = "200px"; // document.getElementById("ccontent").style.marginLeft = "200px"; //document.body.style.backgroundColor = "rgba(0,0,0,0.4)"; hideit = document.getElementById("lsslbar"); if (hideit.style.width=="200px") hideit.style.width = '0px'; else hideit.style.width = '200px'; //new toggle hide/show } function pushlsslbar_off() { document.getElementById("lsslbar").style.width = "0"; document.getElementById("cleft").style.marginLeft= "0"; document.body.style.backgroundColor = "white"; } function lsslbar_on() { // document.getElementById("lsslbar").style.width = "300px"; hideit = document.getElementById("lsslbar"); if (hideit.style.width=="300px") hideit.style.width = '0px'; else hideit.style.width = '300px'; } function lsslbar_off() { document.getElementById("lsslbar").style.width = "0"; // document.getElementById("cleft").style.marginLeft= "0"; } function rsslbar_on() { //document.getElementById("rsslbar").style.width = "250px"; //document.getElementById("rsslbar").style.display="block"; hideit = document.getElementById("rsslbar"); //if (!hideit.style.width) { if (hideit.style.width=="250px") hideit.style.width = '0px'; else hideit.style.width ='250px'; } function rsslbar_off() { document.getElementById("rsslbar").style.width = "0"; } function extbar_on() { //document.getElementById("extbar").style.width = "0px"; //document.getElementById("extbar").style.display="block"; document.getElementById("extbar").style.width = "200px"; document.getElementById("extbar").style.height = "200px"; } function extbar_off() { //document.getElementById("extbar").style.width = "0"; document.getElementById("extbar").style.height = "0px"; //document.getElementById("extbar").style.height = "0"; //document.getElementById("extbar").style.display="none"; } function alertbar_on() { document.getElementById("alertbar").style.right = "0%"; //document.getElementById("extbar").style.width = "0px"; //document.getElementById("extbar").style.display="block"; document.getElementById("alertbar").style.right = "10%"; document.getElementById("alertbar").style.width = "200px"; document.getElementById("alertbar").style.height = "70px"; } function alertbar_off() { // document.getElementById("alertbar").style.width = "200px"; document.getElementById("alertbar").style.height = "0px"; document.getElementById("alertbar").style.right = "30%"; document.getElementById("alertbar").style.width = "10px"; document.getElementById("alertbar").style.top = "-10px"; //document.getElementById("extbar").style.height = "0"; //document.getElementById("extbar").style.display="none"; } function mydate(){ var d=new Date(); var ma=d.getMonth(); var da=d.getDate(); var ya=d.getFullYear(); weekday=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; //var month=[]; //var month=new Array(); month=["January","February","March","April","May","June","July","August","September","October","November","December"]; var mm = month[d.getMonth()]; var nn = weekday[d.getDay()]; ttime=d.getTime(); this.day_name=nn; this.month_name=mm; this.month=ma; this.date=da; this.year=ya; this.times=ttime; this.datez=ya+"/"+ma+"/"+da; this.datey=nn+","+mm+" "+da; this.time = d.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"); return this; } function setlang(lang){ jaxin("","ssession.php?lang="+lang); var x = document.getElementById("snackbar2"); x.innerHTML ="Set Lang to "+lang; snackbar2reload(lang); } function inclock (){ var myVar = setInterval(function() { myTimer(); }, 1000); } function myTimer() { var d = new Date(); var ma=d.getMonth(); var da=d.getDate(); var ya=d.getFullYear(); ma=ma+1; day=ya+"/"+ma+"/"+da; document.getElementById("clock").innerHTML = day+":"+d.toLocaleTimeString(); }
Edit file:socks.js23409