From 03dd469c27320e3da7057351afa415b48b972d5d Mon Sep 17 00:00:00 2001 From: Andy Dixon Date: Wed, 9 Oct 2024 20:44:46 +0100 Subject: [PATCH 1/3] Fix issue #22 Fix issue with ugly buttons :hover css --- cms/css/editor.css | 2 ++ cms/js/cms.js | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cms/css/editor.css b/cms/css/editor.css index c5f1922..4bfaf6a 100644 --- a/cms/css/editor.css +++ b/cms/css/editor.css @@ -73,6 +73,7 @@ body { .blueButton:hover { background: linear-gradient(to bottom, #415989 5%, #2e466e 100%); background-color: #415989; + color: #ffffff; } .greenButton { @@ -94,6 +95,7 @@ body { .greenButton:hover { background: linear-gradient(to bottom, #72b352 5%, #77b55a 100%); background-color: #72b352; + color: #ffffff; } .greenButton:active { diff --git a/cms/js/cms.js b/cms/js/cms.js index 0c0c4dd..8e1bad0 100644 --- a/cms/js/cms.js +++ b/cms/js/cms.js @@ -119,7 +119,7 @@ $(document).ready(function () { } else { showMessage("New page Created", "success"); $('#frameContainer').contents().get(0).location.href = response.url; - $("#newPageForm").dialog("close"); // Close the modal on success + $('.ui-dialog-content').dialog('close'); } }, error: function () { @@ -169,7 +169,7 @@ $(document).ready(function () { // Add click event to list items to redirect $("#fileList li").click(function () { $('#frameContainer').contents().get(0).location.href = $(this).data("url"); // Redirect to the clicked file's URL - $("#fileListDialog").dialog("close"); // Close the modal + $('.ui-dialog-content').dialog('close'); }); }, error: function () { @@ -186,7 +186,7 @@ $(document).ready(function () { width: 500, buttons: { Close: function () { - $(this).dialog("close"); + $('.ui-dialog-content').dialog('close'); } } }); From d5febe1cbe430ed662228d9533bb9497f8cacaf6 Mon Sep 17 00:00:00 2001 From: Andy Dixon Date: Wed, 9 Oct 2024 20:50:11 +0100 Subject: [PATCH 2/3] Fix multiple code issues --- cms/css/editor.css | 24 ++++++++++-------------- cms/init.php | 4 ++-- cms/js/cms.js | 12 ++++++------ cms/login/index.php | 2 +- cms/neoCMSCore.php | 16 ++++++++-------- index.html | 2 +- 6 files changed, 28 insertions(+), 32 deletions(-) diff --git a/cms/css/editor.css b/cms/css/editor.css index 4bfaf6a..0d903b8 100644 --- a/cms/css/editor.css +++ b/cms/css/editor.css @@ -15,8 +15,8 @@ body { height: 70px; background-color: #666666; border-bottom: 1px solid #1a1a1a; - -webkit-box-shadow: 0px 10px 13px -7px #000000, -1px -1px 15px 5px rgba(0, 0, 0, 0); - box-shadow: 0px 10px 13px -7px #000000, -1px -1px 15px 5px rgba(0, 0, 0, 0); + -webkit-box-shadow: 0 10px 13px -7px #000000, -1px -1px 15px 5px rgba(0, 0, 0, 0); + box-shadow: 0 10px 13px -7px #000000, -1px -1px 15px 5px rgba(0, 0, 0, 0); } .pageContainer .frame { @@ -55,9 +55,8 @@ body { } .blueButton { - box-shadow: inset 0px 0px 15px 3px #23395e; - background: linear-gradient(to bottom, #2e466e 5%, #415989 100%); - background-color: #2e466e; + box-shadow: inset 0 0 15px 3px #23395e; + background: #2e466e linear-gradient(to bottom, #2e466e 5%, #415989 100%); border-radius: 17px; border: 1px solid #1f2f47; display: inline-block; @@ -67,19 +66,17 @@ body { font-size: 15px; padding: 6px 13px; text-decoration: none; - text-shadow: 0px 1px 0px #263666; + text-shadow: 0 1px 0 #263666; } .blueButton:hover { - background: linear-gradient(to bottom, #415989 5%, #2e466e 100%); - background-color: #415989; + background: #415989 linear-gradient(to bottom, #415989 5%, #2e466e 100%); color: #ffffff; } .greenButton { - box-shadow: inset 0px 0px 15px 3px #3e7327; - background: linear-gradient(to bottom, #77b55a 5%, #72b352 100%); - background-color: #77b55a; + box-shadow: inset 0 0 15px 3px #3e7327; + background: #77b55a linear-gradient(to bottom, #77b55a 5%, #72b352 100%); border-radius: 17px; border: 1px solid #4b8f29; display: inline-block; @@ -89,12 +86,11 @@ body { font-size: 15px; padding: 6px 13px; text-decoration: none; - text-shadow: 0px 1px 0px #5b8a3c; + text-shadow: 0 1px 0 #5b8a3c; } .greenButton:hover { - background: linear-gradient(to bottom, #72b352 5%, #77b55a 100%); - background-color: #72b352; + background: #72b352 linear-gradient(to bottom, #72b352 5%, #77b55a 100%); color: #ffffff; } diff --git a/cms/init.php b/cms/init.php index 22c7bef..61fd4da 100644 --- a/cms/init.php +++ b/cms/init.php @@ -26,7 +26,7 @@ if (!$_SESSION["core"]->isLoggedIn() && stripos($_SERVER['REQUEST_URI'], "/login // str_starts_with compatibility for php 7 if (!function_exists('str_starts_with')) { - function str_starts_with($haystack, $needle) + function str_starts_with($haystack, $needle): bool { //str_starts_with(string $haystack, string $needle): bool @@ -40,7 +40,7 @@ if (!function_exists('str_starts_with')) { //str_ends_with compatibility for php 7 if (!function_exists('str_ends_with')) { - function str_ends_with($haystack, $needle) + function str_ends_with($haystack, $needle): bool { //str_starts_with(string $haystack, string $needle): bool diff --git a/cms/js/cms.js b/cms/js/cms.js index 8e1bad0..a0b2141 100644 --- a/cms/js/cms.js +++ b/cms/js/cms.js @@ -1,12 +1,12 @@ $(document).ready(function () { - var currentDiv; - var iframeDoc; + let currentDiv; + let iframeDoc; $('#frameContainer').on('load', function () { // Get the iframe document - var iframe = document.getElementById('frameContainer'); + const iframe = document.getElementById('frameContainer'); iframeDoc = iframe.contentDocument || iframe.contentWindow.document; // Set up click handler on divs with class 'editable' in the iframe @@ -16,7 +16,7 @@ $(document).ready(function () { currentDiv = $(this); // Get the content of the div - var content = currentDiv.html(); + const content = currentDiv.html(); // Set the content in TinyMCE $('#editor').val(content); @@ -47,7 +47,7 @@ $(document).ready(function () { // Save changes made to a div, but not save to the file on the server $('#saveBtn').click(function () { // Get the data from TinyMCE - var data = tinymce.get('editor').getContent(); + const data = tinymce.get('editor').getContent(); // Set the data back to the div in the iframe $(currentDiv).html(data); @@ -200,7 +200,7 @@ $(document).ready(function () { * @param type - string "success" or "error" */ function showMessage(message, type) { - var messageBar = $('#message-bar'); + const messageBar = $('#message-bar'); // Set the text message messageBar.text(message); diff --git a/cms/login/index.php b/cms/login/index.php index c6c4995..d6d02a0 100644 --- a/cms/login/index.php +++ b/cms/login/index.php @@ -15,7 +15,7 @@ if (isset($_POST['username']) && isset($_POST['password'])) { ?> - + Login