mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 04:38:28 +00:00
Revert "Merge pull request #267 from pi-hole/folderStructure"
This reverts commitfba3d10fa4, reversing changes made to4ee75f4167.
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
function eventsource() {
|
||||
var alInfo = $("#alInfo");
|
||||
var alSuccess = $("#alSuccess");
|
||||
var ta = $("#output");
|
||||
var source = new EventSource("scripts/pi-hole/php/gravity.sh.php");
|
||||
|
||||
ta.html("");
|
||||
ta.show();
|
||||
alInfo.show();
|
||||
alSuccess.hide();
|
||||
|
||||
source.addEventListener("message", function(e) {
|
||||
if(e.data.indexOf("Pi-hole blocking is") !== -1)
|
||||
{
|
||||
alSuccess.show();
|
||||
}
|
||||
|
||||
ta.append(e.data);
|
||||
|
||||
}, false);
|
||||
|
||||
// Will be called when script has finished
|
||||
source.addEventListener("error", function(e) {
|
||||
alInfo.delay(1000).fadeOut(2000, function() { alInfo.hide(); });
|
||||
source.close();
|
||||
$("#gravityBtn").removeAttr("disabled");
|
||||
}, false);
|
||||
}
|
||||
|
||||
$("#gravityBtn").on("click", () => {
|
||||
$("#gravityBtn").attr("disabled", true);
|
||||
eventsource();
|
||||
});
|
||||
|
||||
// Handle hiding of alerts
|
||||
$(function(){
|
||||
$("[data-hide]").on("click", function(){
|
||||
$(this).closest("." + $(this).attr("data-hide")).hide();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user