From 8f094c8d91e35830e38db24ab8fd4bdb01b66698 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sat, 18 Jul 2020 00:52:10 +0200 Subject: [PATCH] Cleanup JS code --- index.php | 91 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 44 deletions(-) diff --git a/index.php b/index.php index 32c93d3..4b1dee0 100644 --- a/index.php +++ b/index.php @@ -406,73 +406,76 @@ function outputHtml() // + if(GateKeeper::isDeleteAllowed()) + { + + echo " $('td.del a').click(function(){ - var answer = confirm('Are you sure you want to delete : \'' + $(this).attr("data-name") + "\' ?"); + var answer = confirm('Are you sure you want to delete : \"' + $(this).attr(\"data-name\") + '\" ?'); return answer; }); -logging == true) { -?> - function logFileClick(path) - { - $.ajax({ - async: false, - type: "POST", - data: {log: path}, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - cache: false - }); - } - $("a.file").click(function(){ - logFileClick("location->getDir(true, true, false, 0);?>" + $(this).html()); - return true; + echo " + function logFileClick(path) + { + $.ajax({ + async: false, + type: \"POST\", + data: {log: path}, + contentType: \"application/x-www-form-urlencoded; charset=UTF-8\", + cache: false }); -location->getDir(true, true, false, 0) . "' + $(this).html()); + return true; + }); + "; + } if(EncodeExplorer::getConfig("thumbnails") == true && $this->mobile == false) { -?> - function positionThumbnail(e) { - xOffset = 30; - yOffset = 10; - $("#thumb").css("left",(e.clientX + xOffset) + "px"); - diff = 0; - if(e.clientY + $("#thumb").height() > $(window).height()) - diff = e.clientY + $("#thumb").height() - $(window).height(); + echo " + function positionThumbnail(e) { + xOffset = 30; + yOffset = 10; + $('#thumb').css(\"left\",(e.clientX + xOffset) + \"px\"); - $("#thumb").css("top",(e.pageY - yOffset - diff) + "px"); - } + diff = 0; + if(e.clientY + $('#thumb').height() > $(window).height()) + diff = e.clientY + $('#thumb').height() - $(window).height(); - $("a.thumb").hover(function(e){ - $("#thumb").remove(); - $("body").append("
\"Preview\"<\/div>"); - positionThumbnail(e); - $("#thumb").fadeIn("medium"); - }, - function(){ - $("#thumb").remove(); - }); + $('#thumb').css(\"top\",(e.pageY - yOffset - diff) + \"px\"); + } - $("a.thumb").mousemove(function(e){ - positionThumbnail(e); - }); + $('a.thumb').hover(function(e){ + $('#thumb').remove(); + $('body').append('
\"Preview\"<\/div>'); + positionThumbnail(e); + $('#thumb').fadeIn(\"medium\"); + }, + function() { $('#thumb').remove(); }); + + $('a.thumb').mousemove(function(e) { positionThumbnail(e); }); + $('a.thumb').click(function(e) { $('#thumb').remove(); return true;} ); + "; - $("a.thumb").click(function(e){$("#thumb").remove(); return true;}); - - }); +}); //]]> + <?php if(EncodeExplorer::getConfig('main_title') != null) print EncodeExplorer::getConfig('main_title'); ?> ">