diff --git a/README.md b/README.md
index fd2e221cc..5084d80e2 100644
--- a/README.md
+++ b/README.md
@@ -243,4 +243,4 @@ Scriptlog is Open Source and Free PHP Blog Software licensed under the [MIT Lice
---
-*Thank you for creating with Scriptlog.*
+*Thank you for creating with Scriptlog.*
\ No newline at end of file
diff --git a/composer.json b/composer.json
index b5cf61956..cf10879d3 100644
--- a/composer.json
+++ b/composer.json
@@ -37,7 +37,7 @@
"vlucas/phpdotenv": "^5.6",
"voku/anti-xss": "^4.1"
},
- "require-dev": {
+"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"phpmetrics/phpmetrics": "^2.9",
"phpstan/phpstan": "^1.10",
diff --git a/src/admin/admin-layout.php b/src/admin/admin-layout.php
index 828a32895..d857e107f 100755
--- a/src/admin/admin-layout.php
+++ b/src/admin/admin-layout.php
@@ -187,7 +187,54 @@ function admin_footer($stylePath, $ubench = null)
$('#summernote').summernote({
height: 300,
minHeight: null,
- maxHeight: null,
+ maxHeight: null,
+ toolbar: [
+ ['style', ['style']],
+ ['font', ['bold', 'italic', 'underline', 'clear']],
+ ['fontname', ['fontname']],
+ ['color', ['color']],
+ ['para', ['ul', 'ol', 'paragraph']],
+ ['height', ['height']],
+ ['insert', ['link', 'picture', 'video']],
+ ['view', ['fullscreen', 'codeview']],
+ ['help', ['help']]
+ ],
+ callbacks: {
+ onImageUpload: function(files) {
+ // Upload image to server
+ var file = files[0];
+ var formData = new FormData();
+ formData.append('image', file);
+ formData.append('csrfToken', $('#csrf-token').val());
+
+ // Get post_id from hidden input if available
+ var postId = $('#post_id').val() || null;
+ if (postId) {
+ formData.append('post_id', postId);
+ }
+
+ $.ajax({
+ url: '/admin/media-upload.php',
+ method: 'POST',
+ data: formData,
+ processData: false,
+ contentType: false,
+ xhrFields: {
+ withCredentials: true
+ },
+ success: function(response) {
+ if (response.success && response.data && response.data.url) {
+ $('#summernote').summernote('insertImage', response.data.url);
+ } else {
+ alert('Failed to upload image: ' + (response.error?.message || 'Unknown error'));
+ }
+ },
+ error: function(xhr, status, error) {
+ alert('Failed to upload image: ' + error);
+ }
+ });
+ }
+ }
});
});
@@ -225,6 +272,10 @@ function admin_footer($stylePath, $ubench = null)
});
+
+">
+">
+