From 93322573a56ee5da41cf35345229bc4f19c36b05 Mon Sep 17 00:00:00 2001
From: Gab <24553253+gabrix73@users.noreply.github.com>
Date: Mon, 1 Dec 2025 23:07:38 +0100
Subject: Implement prefill feature for posts and replies
Added prefill functionality for new posts and replies, including styling for prefilled input fields and a notification banner.
---
index.php | 240 ++++++++++++++++++++++++++++++++++++++++++++++----------------
1 file changed, 179 insertions(+), 61 deletions(-)
(limited to 'index.php')
diff --git a/index.php b/index.php
index 255bc5f..62497e9 100644
--- a/index.php
+++ b/index.php
@@ -241,6 +241,15 @@ $csrfToken = $_SESSION['csrf_token'];
border: 2px solid #999;
}
+ input.prefilled {
+ background: #e8f5e9;
+ border: 2px solid var(--primary);
+ }
+
+ .dark-theme input.prefilled {
+ background: #1b3d1b;
+ }
+
button {
margin-top: 15px;
padding: 12px 20px;
@@ -332,6 +341,39 @@ $csrfToken = $_SESSION['csrf_token'];
font-size: 0.85em;
}
+ .prefill-banner {
+ background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
+ color: white;
+ padding: 12px 15px;
+ border-radius: 4px;
+ margin-bottom: 15px;
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
+ }
+
+ .prefill-banner.reply {
+ background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
+ }
+
+ .prefill-banner-icon {
+ font-size: 1.5em;
+ }
+
+ .prefill-banner-text {
+ flex: 1;
+ }
+
+ .prefill-banner-text strong {
+ display: block;
+ margin-bottom: 2px;
+ }
+
+ .prefill-banner-text small {
+ opacity: 0.9;
+ }
+
footer {
text-align: center;
margin-top: 40px;
@@ -383,6 +425,15 @@ $csrfToken = $_SESSION['csrf_token'];
+
+
+
📝
+
+ New Post
+ Fields pre-filled from Onion Newsreader
+
+
+