diff --git a/resources/js/ajax.js b/resources/js/ajax.js index e915fe9..188289d 100644 --- a/resources/js/ajax.js +++ b/resources/js/ajax.js @@ -35,7 +35,7 @@ function getDir(query) { // Create path from array of items for (pathNode of pathNodes) { path += pathNode; } - formULPTH.value = path; // Used when upoading a file + formULPTH.value = path; // Used when uploading a file path = "dirQuery=" + path; process(path); } @@ -48,7 +48,13 @@ function process(path) { xhttp.onreadystatechange = function() { if (this.readyState === 4 && this.status === 200) { // Send the returned data to further process - updatePage(this.responseXML); + if (this.responseXML != null) { + updatePage(this.responseXML); + } else { + document.getElementById('dynDiv').innerHTML = + "
" + + "No content returned. Check the folder path.
"; + } } }; xhttp.open("POST", "resources/php/process.php", true); // Open the connection @@ -57,7 +63,7 @@ function process(path) { xhttp.send(path); // Start the process // Use a cookie for persistence during browser session.... - document.cookie = path +"; path=" + document.URL; + document.cookie = path +"; path=" + document.URL + "; expires=Sun, 31 Dec 2034 12:00:00 UTC"; } function updatePage(returnData) { diff --git a/resources/php/open.php b/resources/php/open.php index eaa0cce..066dcbd 100644 --- a/resources/php/open.php +++ b/resources/php/open.php @@ -4,7 +4,7 @@ function openFile($FILE) { include 'config.php'; $EXTNSN = strtolower(pathinfo($FILE, PATHINFO_EXTENSION)); - if (preg_match('(mkv|avi|flv|mov|m4v|mpg|wmv|mpeg)', $EXTNSN) === 1) { + if (preg_match('(mkv|avi|flv|mov|m4v|mpg|wmv|mpeg|mp4|webm)', $EXTNSN) === 1) { shell_exec($MEDIAPLAYER . $MPLAYER_WH . "\"" . $FILE . "\" > /dev/null &"); } else if (preg_match('(png|jpg|jpeg|gif)', $EXTNSN) === 1) { shell_exec($IMGVIEWER . ' "' . $FILE . '" > /dev/null &'); diff --git a/resources/php/process.php b/resources/php/process.php index 9358550..1112b48 100644 --- a/resources/php/process.php +++ b/resources/php/process.php @@ -1,41 +1,43 @@