12 Commits
Author SHA1 Message Date
Andy Dixon 012a688160 Merge pull request #37 from andydixon/development
Fix hiding clone buttons. Fixes #18
2024-11-13 12:34:54 +00:00
Andy Dixon 4b8650c4c1 Merge pull request #35 from andydixon/development
Massive refactor of code
2024-11-12 21:22:06 +00:00
Andy Dixon cdf15d94fc Merge pull request #34 from andydixon/development
Keep button styles the same and option to show full URL
2024-11-12 19:34:25 +00:00
Andy Dixon 85874dcd0c Update welcome.html
Because I am stooopid
2024-11-12 17:14:15 +00:00
Andy Dixon adb33af82a Merge pull request #33 from andydixon/development
UI refinements
2024-11-11 20:11:40 +00:00
Andy Dixon 7289c12e8d Merge pull request #32 from andydixon/development
(Not a proper) Fix for issue #31
2024-11-11 19:46:10 +00:00
Andy Dixon 77c6d88f80 Update index.html
Added example of cloning elements
2024-11-11 19:21:05 +00:00
Andy Dixon a7f699a77b Merge pull request #30 from andydixon/development
development
2024-11-11 19:07:58 +00:00
Andy Dixon 8ee09b881c Merge pull request #28 from andydixon/development
Development Sync
2024-10-09 21:14:11 +01:00
Andy Dixon 3878fd4c3d Merge pull request #27 from andydixon/development
Development Sync
2024-10-09 20:56:19 +01:00
Andy Dixon 18853fee87 Merge pull request #26 from andydixon/development
Revert accidental commit and apply correct code
2024-10-09 20:36:48 +01:00
Andy Dixon c1b3580d8b Merge pull request #25 from andydixon/development
Development sync into master
2024-10-09 20:31:07 +01:00
9 changed files with 144 additions and 135 deletions
+59 -33
View File
@@ -13,7 +13,7 @@ body {
.pageContainer .controls { .pageContainer .controls {
flex: 0 1 auto; flex: 0 1 auto;
height: 60px; height: 60px;
background-color: #1a1d20; background-color: #666666;
border-bottom: 1px solid #1a1a1a; border-bottom: 1px solid #1a1a1a;
-webkit-box-shadow: 0 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); box-shadow: 0 10px 13px -7px #000000, -1px -1px 15px 5px rgba(0, 0, 0, 0);
@@ -26,7 +26,7 @@ body {
.controls .logo { .controls .logo {
background-image: url("/cms/img/logo.png"); background-image: url("/cms/img/logo.png");
width: 60px; width: 128px;
height: 60px; height: 60px;
display: block; display: block;
position: absolute; position: absolute;
@@ -39,40 +39,12 @@ body {
right: 110px; right: 110px;
} }
/* CSS */
.headerButton {
/*display: flex;*/
flex-direction: column;
align-items: center;
padding: 6px 14px;
font-family: -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
border-radius: 6px;
border: none;
background: #6E6D70;
box-shadow: 0px 0.5px 1px rgba(0, 0, 0, 0.1), inset 0px 0.5px 0.5px rgba(255, 255, 255, 0.5), 0px 0px 0px 0.5px rgba(0, 0, 0, 0.12);
color: #DFDEDF;
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
}
.headerButton:focus {
box-shadow: inset 0px 0.8px 0px -0.25px rgba(255, 255, 255, 0.2), 0px 0.5px 1px rgba(0, 0, 0, 0.1), 0px 0px 0px 3.5px rgba(58, 108, 217, 0.5);
outline: 0;
}
.headerButton.dangerButton {
background-color: #6E4D50;
}
.controls #urlbox { .controls #urlbox {
margin: 15px 70px; margin: 15px 150px;
text-align: center; text-align: center;
font-size: 1.5em; font-size: 1.5em;
color: black;
position: absolute; position: absolute;
color: #dee2e6;
} }
.controls #urlbox div { .controls #urlbox div {
@@ -84,7 +56,6 @@ body {
position: absolute; position: absolute;
top: 20px; top: 20px;
right: 10px; right: 10px;
color: #dee2e6;
} }
.controls .buttonContainer ul { .controls .buttonContainer ul {
@@ -98,6 +69,61 @@ body {
margin-right: 10px; margin-right: 10px;
} }
.blueButton {
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;
cursor: pointer;
color: #ffffff !important;
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
padding: 6px 13px;
text-decoration: none !important;
text-shadow: 0 1px 0 #263666;
}
.blueButton:hover {
background: #415989 linear-gradient(to bottom, #415989 5%, #2e466e 100%);
color: #ffffff;
text-decoration: none;
}
.blueButton:active {
text-decoration: none;
}
.greenButton {
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;
cursor: pointer;
color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
padding: 6px 13px;
text-decoration: none;
text-shadow: 0 1px 0 #5b8a3c;
}
.greenButton:hover {
background: #72b352 linear-gradient(to bottom, #72b352 5%, #77b55a 100%);
color: #ffffff;
text-decoration: none;
}
.greenButton:active {
position: relative;
top: 1px;
text-decoration: none;
}
/** /**
New Page Modal New Page Modal
*/ */
-73
View File
@@ -1,73 +0,0 @@
body {
font-family: Arial, sans-serif;
background-color: #111519;
}
.login-container {
width: 350px;
margin: 100px auto;
padding: 40px;
background-color: #212529;
border-radius: 8px;
box-shadow: 0 4px 10px rgb(0, 0, 0);
}
.login-container h2 {
text-align: center;
margin-bottom: 30px;
color: #dee2e6;
}
.login-container label {
display: block;
margin-bottom: 8px;
color: #dee2e6;
}
.login-container input[type="text"],
.login-container input[type="password"] {
width: 100%;
padding: 12px;
margin-bottom: 20px;
border: 1px solid #1a1a1a;
border-radius: 4px;
box-sizing: border-box;
background: #2b3035;
color: #dee2e6;
}
.login-container button {
width: 100%;
padding: 12px;
background-color: #0066cc;
border: none;
border-radius: 4px;
color: #ffffff;
font-size: 16px;
cursor: pointer;
}
.login-container button:hover {
background-color: #005bb5;
}
.error-message {
color: #ff4d4d;
margin-bottom: 20px;
text-align: center;
}
.logo {
display: block;
margin: auto;
}
.shamelessPlug {
margin: 12px 0 -30px 0;
padding: 0;
display: block;
text-align: center;
color: #111519;
font-size: 0.8em;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

+17 -17
View File
@@ -9,7 +9,7 @@ spl_autoload_register(function ($class) {
use NeoCMS\Authentication; use NeoCMS\Authentication;
// Instantiate the Authentication class // Instantiate the Authentication class
$authentication = new Authentication($config['authentication'] ?? []); $authentication = new Authentication($config['authentication']??[]);
// Check if the user is logged in // Check if the user is logged in
if (!$authentication->isLoggedIn()) { if (!$authentication->isLoggedIn()) {
@@ -23,12 +23,21 @@ if (!$authentication->isLoggedIn()) {
<html lang="en-gb"> <html lang="en-gb">
<head> <head>
<title>NeoCMS</title> <title>NeoCMS</title>
<!-- Include jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://code.jquery.com/ui/1.14.0/jquery-ui.min.js" crossorigin="anonymous"></script> <script src="https://code.jquery.com/ui/1.14.0/jquery-ui.min.js" crossorigin="anonymous"></script>
<!-- Include TinyMCE -->
<script src="/cms/tinymce/tinymce.min.js"></script> <script src="/cms/tinymce/tinymce.min.js"></script>
<!-- Include Bootstrap for modal -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<!-- Include JqueryUI CSS -->
<link rel="stylesheet" href="https://code.jquery.com/ui/1.14.0/themes/base/jquery-ui.css"> <link rel="stylesheet" href="https://code.jquery.com/ui/1.14.0/themes/base/jquery-ui.css">
<!-- Include editor styles -->
<link rel="stylesheet" href="/cms/css/editor.css"> <link rel="stylesheet" href="/cms/css/editor.css">
<!-- Include Bootstrap JS -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head> </head>
<body> <body>
@@ -36,33 +45,24 @@ if (!$authentication->isLoggedIn()) {
<div class="pageContainer"> <div class="pageContainer">
<div class="controls"> <div class="controls">
<div class="logo"></div> <div class="logo"></div>
<?php if ($config['showFullUrl']) {?> <?php if($config['showFullUrl']) echo '<div id="urlbox"></div>';?>
<div id="urlbox"></div>
<?php } ?>
<div class="buttonContainer"> <div class="buttonContainer">
<ul> <ul>
<li> <li><a href="#" id="selectPage" class="blueButton">Select Page</a></li>
<button class="headerButton" id="newPage" role="button">New Page</button> <li><a href="#" id="newPage" class="blueButton">New Page</a></li>
</li> <li><a href="#" id="savePage" class="greenButton">Save Changes</a></li>
<li>
<button class="headerButton" id="selectPage" role="button">Select Page</button>
</li>
<li>
<button class="headerButton dangerButton" id="savePage" role="button">Publish Changes</button>
</li>
</ul> </ul>
</div> </div>
<div class="loggedInDetails"> <div class="loggedInDetails">
Logged in as: <?php echo $authentication->getLoggedinUser(); ?><br/> Logged in as: <?php echo $authentication->getLoggedinUser(); ?><br />
<?php <?php
if (!is_writable("logs/")) { if ( ! is_writable("logs/")) {
echo "<span class='redText'>Make /cms/logs/ writeable!</span>"; echo "<span class='redText'>Make /cms/logs/ writeable!</span>";
} }
?> ?>
</div> </div>
</div> </div>
<iframe id="frameContainer" src="<?php echo $config['skipWelcomePage'] ? "/" : "welcome.html"; ?>" <iframe id="frameContainer" src="<?php echo $config['skipWelcomePage'] ? "/" : "welcome.html"; ?>" class="frame"></iframe>
class="frame"></iframe>
</div> </div>
<!-- Modal --> <!-- Modal -->
<div id="editModal" class="modal fade" role="dialog"> <div id="editModal" class="modal fade" role="dialog">
+3 -3
View File
@@ -266,7 +266,7 @@ $(document).ready(function () {
$(this).find('.buttonContainer').remove(); $(this).find('.buttonContainer').remove();
addButtonsToNeoDupe(this); addButtonsToNeoDupe(this);
}); });
$('#urlbox').html("<strong>Editing:</strong> <div>" + $(iframeDoc)[0].URL + "</div>"); $('#urlbox').html("<strong>Editing:</strong> <div>"+$(iframeDoc)[0].URL+"</div>");
} }
// Function to add buttons to a neo-dupe element inside the iframe // Function to add buttons to a neo-dupe element inside the iframe
@@ -274,7 +274,7 @@ $(document).ready(function () {
/** /**
* DANGER WILL ROBINSON: This may break stuff, but is needed for the buttons to be positioned properly * DANGER WILL ROBINSON: This may break stuff, but is needed for the buttons to be positioned properly
* Lets see how we go. * Since this is alpha, lets see how we go.
*/ */
if ($(element).css('position') === 'static') { if ($(element).css('position') === 'static') {
$(element).css('position', 'relative'); $(element).css('position', 'relative');
@@ -285,7 +285,7 @@ $(document).ready(function () {
$buttonContainer.css("position", "absolute"); $buttonContainer.css("position", "absolute");
$buttonContainer.css("top", "5px"); $buttonContainer.css("top", "5px");
$buttonContainer.css("right", "5px"); $buttonContainer.css("right", "5px");
$buttonContainer.css("z-index", "9999"); $buttonContainer.css("z-index","9999");
var $duplicateBeforeButton = $(iframeDoc.createElement('button')); var $duplicateBeforeButton = $(iframeDoc.createElement('button'));
+62 -6
View File
@@ -16,8 +16,8 @@ use NeoCMS\Logger;
$error = ''; $error = '';
// Instantiate the Authentication and Logger classes // Instantiate the Authentication and Logger classes
$authentication = new Authentication($config['authentication'] ?? []); $authentication = new Authentication($config['authentication']??[]);
$logger = new Logger($config['audit'] ?? true); $logger = new Logger($config['audit']??true);
if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$username = $_POST['username'] ?? ''; $username = $_POST['username'] ?? '';
@@ -47,13 +47,70 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>NeoCMS Login</title> <title>Login</title>
<link rel="stylesheet" href="/cms/css/login.css"/> <style>
/* Basic styling for the login form */
body {
font-family: Arial, sans-serif;
background-color: #eef1f5;
}
.login-container {
width: 350px;
margin: 100px auto;
padding: 40px;
background-color: #ffffff;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.login-container h2 {
text-align: center;
margin-bottom: 30px;
color: #333333;
}
.login-container label {
display: block;
margin-bottom: 8px;
color: #555555;
}
.login-container input[type="text"],
.login-container input[type="password"] {
width: 100%;
padding: 12px;
margin-bottom: 20px;
border: 1px solid #cccccc;
border-radius: 4px;
box-sizing: border-box;
}
.login-container button {
width: 100%;
padding: 12px;
background-color: #0066cc;
border: none;
border-radius: 4px;
color: #ffffff;
font-size: 16px;
cursor: pointer;
}
.login-container button:hover {
background-color: #005bb5;
}
.error-message {
color: #ff4d4d;
margin-bottom: 20px;
text-align: center;
}
</style>
</head> </head>
<body> <body>
<div class="login-container"> <div class="login-container">
<img class="logo" src="/cms/img/loginlogo.png" alt="NeoCMS logo"/>
<h2>NeoCMS Login</h2> <h2>NeoCMS Login</h2>
<?php if (!empty($error)): ?> <?php if (!empty($error)): ?>
<div class="error-message"><?php echo htmlspecialchars($error); ?></div> <div class="error-message"><?php echo htmlspecialchars($error); ?></div>
@@ -66,7 +123,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<input type="password" id="password" name="password" required> <input type="password" id="password" name="password" required>
<button type="submit">Log In</button> <button type="submit">Log In</button>
<p class="shamelessPlug">NeoCMS &copy;<?php echo date('Y'); ?> Andy Dixon</p>
</form> </form>
</div> </div>
+1 -1
View File
@@ -126,4 +126,4 @@
<div class="hiddendiv common"></div></body></html> <div class="hiddendiv common"></div></body></html>
+2 -2
View File
@@ -6,6 +6,6 @@
<body> <body>
<div class="editable">This is editable content 1.</div> <div class="editable">This is editable content 1.</div>
<div class="editable">This is editable content 2.</div> <div class="editable">This is editable content 2.</div>
<div class="editable">This is editable content 3.</div> <div class="editable neo-dupe">This is editable content 3, and this element can be cloned.</div>
</body> </body>
</html> </html>