script to js file
This commit is contained in:
49
js/h1502.js
Normal file
49
js/h1502.js
Normal file
@@ -0,0 +1,49 @@
|
||||
// Script to open and close sidebar
|
||||
function w3_open() {
|
||||
document.getElementById("mySidebar").style.display = "block";
|
||||
document.getElementById("myOverlay").style.display = "block";
|
||||
}
|
||||
|
||||
function w3_close() {
|
||||
document.getElementById("mySidebar").style.display = "none";
|
||||
document.getElementById("myOverlay").style.display = "none";
|
||||
}
|
||||
//acsreader accordion menu
|
||||
function acsreaderAccFunc() {
|
||||
var x = document.getElementById("acsreaderAcc");
|
||||
if (x.className.indexOf("w3-show") == -1) {
|
||||
x.className += " w3-show";
|
||||
x.previousElementSibling.className += " w3-dark-grey";
|
||||
} else {
|
||||
x.className = x.className.replace(" w3-show", "");
|
||||
x.previousElementSibling.className =
|
||||
x.previousElementSibling.className.replace(" w3-dark-grey", "");
|
||||
}
|
||||
}
|
||||
//admin accordion menu
|
||||
function adminAccFunc() {
|
||||
var x = document.getElementById("adminAcc");
|
||||
if (x.className.indexOf("w3-show") == -1) {
|
||||
x.className += " w3-show";
|
||||
x.previousElementSibling.className += " w3-dark-grey";
|
||||
} else {
|
||||
x.className = x.className.replace(" w3-show", "");
|
||||
x.previousElementSibling.className =
|
||||
x.previousElementSibling.className.replace(" w3-dark-grey", "");
|
||||
}
|
||||
}
|
||||
|
||||
$( document ).ready(function() {
|
||||
if(typeof(EventSource) !== "undefined") {
|
||||
var systemdate = new EventSource("helperpage/systemdate.php");
|
||||
systemdate.onmessage = function(event) {
|
||||
$("#systemdate").text("Datetime: " + event.data);
|
||||
};
|
||||
var systemload = new EventSource("helperpage/systemload.php");
|
||||
systemload.onmessage = function(event) {
|
||||
$("#systemload").text("Systemload: " + event.data);
|
||||
};
|
||||
} else {
|
||||
$("#systemdate").text("browser not supported.");
|
||||
}
|
||||
});
|
||||
@@ -7,66 +7,5 @@
|
||||
<p class="w3-right" id="systemload">system load</p>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
// Script to open and close sidebar
|
||||
function w3_open() {
|
||||
document.getElementById("mySidebar").style.display = "block";
|
||||
document.getElementById("myOverlay").style.display = "block";
|
||||
}
|
||||
|
||||
function w3_close() {
|
||||
document.getElementById("mySidebar").style.display = "none";
|
||||
document.getElementById("myOverlay").style.display = "none";
|
||||
}
|
||||
|
||||
function acsreaderAccFunc() {
|
||||
var x = document.getElementById("acsreaderAcc");
|
||||
if (x.className.indexOf("w3-show") == -1) {
|
||||
x.className += " w3-show";
|
||||
x.previousElementSibling.className += " w3-dark-grey";
|
||||
} else {
|
||||
x.className = x.className.replace(" w3-show", "");
|
||||
x.previousElementSibling.className =
|
||||
x.previousElementSibling.className.replace(" w3-dark-grey", "");
|
||||
}
|
||||
}
|
||||
function adminAccFunc() {
|
||||
var x = document.getElementById("adminAcc");
|
||||
if (x.className.indexOf("w3-show") == -1) {
|
||||
x.className += " w3-show";
|
||||
x.previousElementSibling.className += " w3-dark-grey";
|
||||
} else {
|
||||
x.className = x.className.replace(" w3-show", "");
|
||||
x.previousElementSibling.className =
|
||||
x.previousElementSibling.className.replace(" w3-dark-grey", "");
|
||||
}
|
||||
}
|
||||
|
||||
// Modal Image Gallery
|
||||
function onClick(element) {
|
||||
document.getElementById("img01").src = element.src;
|
||||
document.getElementById("modal01").style.display = "block";
|
||||
var captionText = document.getElementById("caption");
|
||||
captionText.innerHTML = element.alt;
|
||||
}
|
||||
|
||||
$( document ).ready(function() {
|
||||
if(typeof(EventSource) !== "undefined") {
|
||||
var systemdate = new EventSource("helperpage/systemdate.php");
|
||||
systemdate.onmessage = function(event) {
|
||||
$("#systemdate").text("Datetime: " + event.data);
|
||||
};
|
||||
|
||||
var systemload = new EventSource("helperpage/systemload.php");
|
||||
systemload.onmessage = function(event) {
|
||||
$("#systemload").text("Systemload: " + event.data);
|
||||
};
|
||||
} else {
|
||||
$("#systemdate").text("browser not supported.");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -13,5 +13,6 @@ body {font-size:16px;}
|
||||
.w3-half img:hover{opacity:1}
|
||||
</style>
|
||||
<script src="js/jquery-3.2.1.min.js"></script>
|
||||
<script src="js/h1502.js"></script>
|
||||
<body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user