From 4c17be62b3587268254abe669841f4c142cb2c22 Mon Sep 17 00:00:00 2001 From: Maxim Stewart Date: Mon, 21 Jan 2019 14:47:31 -0600 Subject: [PATCH] Added Iframe detection and themeing. --- index.html | 23 ++++++++++++++++--- resources/css/iframe.css | 4 ++++ resources/js/uiActions.js | 7 +++++- resources/php/connection.php | 10 ++++++++ resources/php/dbController.php | 21 ++++------------- resources/php/filesystemActions.php | 2 +- resources/php/getDirList.php | 2 +- ...erverMessanger.php => serverMessenger.php} | 0 8 files changed, 47 insertions(+), 22 deletions(-) create mode 100644 resources/css/iframe.css create mode 100644 resources/php/connection.php rename resources/php/{serverMessanger.php => serverMessenger.php} (100%) diff --git a/index.html b/index.html index 312732d..0ee49b9 100644 --- a/index.html +++ b/index.html @@ -25,9 +25,9 @@ - - - + + +

@@ -66,6 +66,23 @@ + + + diff --git a/resources/css/iframe.css b/resources/css/iframe.css new file mode 100644 index 0000000..071331c --- /dev/null +++ b/resources/css/iframe.css @@ -0,0 +1,4 @@ +#controls, #fullPathHeader, #dynDiv, +.errorStyling, .dirStyle, .movieStyle, .fileStyle { + background-color: rgba(0,0,0,0.2); +} diff --git a/resources/js/uiActions.js b/resources/js/uiActions.js index ef164dc..46be735 100644 --- a/resources/js/uiActions.js +++ b/resources/js/uiActions.js @@ -119,4 +119,9 @@ const downloadItem = () => { const clearDlList = () => { document.getElementById("CLEARBTTN").click(); } const onloadSetBG = () => { updateBG("resources/images/backgrounds/000.jpg"); } -const updateBG = (bgImg) => { document.getElementById("bg").src = bgImg; } + +const updateBG = (bgImg) => { + try { + document.getElementById("bg").src = bgImg; + } catch (e) { } +} diff --git a/resources/php/connection.php b/resources/php/connection.php new file mode 100644 index 0000000..cb6fcba --- /dev/null +++ b/resources/php/connection.php @@ -0,0 +1,10 @@ + Database connection failed!"; + serverMessage("error", $message); +} +?> diff --git a/resources/php/dbController.php b/resources/php/dbController.php index 27837f8..86abe82 100644 --- a/resources/php/dbController.php +++ b/resources/php/dbController.php @@ -1,15 +1,9 @@ Database connection failed!"; - serverMessage("error", $message); - die("ERROR: Could not connect to db."); - } - + GLOBAL $db; $res = $db->query('Select * FROM faves'); $GeneratedXML = ""; while ($row = $res->fetchArray(SQLITE3_ASSOC)) { @@ -20,15 +14,9 @@ function getTabLinks() { } function manageLink($ACTION, $PATH) { - $db = new SQLite3('resources/db/webfm.db'); + GLOBAL $db; $ACTION_TYPE = ""; - if($db === false){ - $message = "Server: [Error] --> Database connection failed!"; - serverMessage("error", $message); - die("ERROR: Could not connect to db."); - } - // If action isn't true then we add else we delete or exit. if ($ACTION == "false") { $stmt = $db->prepare('INSERT INTO faves VALUES(:link)'); @@ -44,6 +32,7 @@ function manageLink($ACTION, $PATH) { $stmt->bindValue(":link", $PATH, SQLITE3_TEXT); $stmt->execute(); + $stmt->close(); $message = "Server: [Success] --> Fave link: " . $PATH . " " . $ACTION_TYPE . " the database!"; diff --git a/resources/php/filesystemActions.php b/resources/php/filesystemActions.php index a040bdb..d82703a 100644 --- a/resources/php/filesystemActions.php +++ b/resources/php/filesystemActions.php @@ -1,6 +1,6 @@