From 6d8c8025c1743591001687b52d382f7e72ce4921 Mon Sep 17 00:00:00 2001 From: M_Viper Date: Sat, 21 Mar 2026 00:54:23 +0100 Subject: [PATCH] Update from Git Manager GUI --- assets/css/forum-style.css | 2605 ++++++++++++++++++++++++++++++++++++ assets/js/forum-script.js | 1570 ++++++++++++++++++++++ 2 files changed, 4175 insertions(+) create mode 100644 assets/css/forum-style.css create mode 100644 assets/js/forum-script.js diff --git a/assets/css/forum-style.css b/assets/css/forum-style.css new file mode 100644 index 0000000..df65f02 --- /dev/null +++ b/assets/css/forum-style.css @@ -0,0 +1,2605 @@ +/* ═══════════════════════════════════════════════════════════ + WP Business Forum — Minecraft Modern Dark Theme + ═══════════════════════════════════════════════════════════ */ + +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); +@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css'); + +/* ── CSS Variables — Dark Gaming ────────────────────────────── */ +.wbf-wrap { + --c-primary: #00b4d8; + --c-primary-d: #0096c7; + --c-primary-l: rgba(0,180,216,.12); + --c-accent: #48cae4; + --c-green: #56cf7e; + --c-success: #56cf7e; + --c-danger: #f05252; + --c-warning: #f59e0b; + + --c-bg: #111318; + --c-bg2: #161a22; + --c-surface: #1e2330; + --c-surface2: #252c3d; + --c-border: rgba(255,255,255,.08); + --c-border-d: rgba(255,255,255,.14); + --c-text: #e8eaf0; + --c-text-dim: #b0b8cc; + --c-muted: #6b7a99; + --c-topbar: #0d1117; + + --c-hero-from: #0d1117; + --c-hero-to: #161a22; + --c-glow: 0 0 18px rgba(0,180,216,.25); + + --radius: 10px; + --radius-sm: 7px; + --shadow-sm: 0 2px 8px rgba(0,0,0,.35); + --shadow-md: 0 6px 20px rgba(0,0,0,.45); + --shadow-lg: 0 16px 40px rgba(0,0,0,.6); + --transition: .2s ease; + + font-family: 'Inter', -apple-system, sans-serif; + font-size: 15px; + color: var(--c-text); + background: var(--c-bg); + line-height: 1.6; + -webkit-font-smoothing: antialiased; +} +.wbf-wrap *, .wbf-wrap *::before, .wbf-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; } +.wbf-wrap a { color: var(--c-primary); text-decoration: none; } +.wbf-wrap a:hover { color: var(--c-accent); text-decoration: none; } +.wbf-muted { color: var(--c-muted); font-size: .875rem; } +.wbf-mt { margin-top: 1.5rem; } + +/* ── Topbar ─────────────────────────────────────────────────── */ +.wbf-topbar { + background: var(--c-topbar); + border-bottom: 1px solid rgba(0,180,216,.18); + position: sticky; top: 0; z-index: 200; +} +.wbf-topbar__inner { + max-width: 1200px; margin: 0 auto; + padding: .7rem 1.5rem; + display: flex; align-items: center; justify-content: space-between; +} +.wbf-topbar__brand { + color: var(--c-primary); + font-weight: 700; font-size: 1.05rem; + display: flex; align-items: center; gap: .5rem; + letter-spacing: .01em; +} +.wbf-topbar__brand:hover { color: var(--c-accent); } +.wbf-topbar__right { display: flex; align-items: center; gap: .75rem; } +.wbf-topbar__user { + color: var(--c-text-dim); + display: flex; align-items: center; gap: .5rem; + font-size: .875rem; +} +.wbf-topbar__user:hover { color: var(--c-text); } + +/* ── Hero ───────────────────────────────────────────────────── */ +.wbf-hero { + background: linear-gradient(160deg, #0d1117 0%, #161a22 50%, #0a1628 100%); + border-bottom: 1px solid rgba(0,180,216,.15); + padding: 3rem 1.5rem; + text-align: center; + position: relative; + overflow: hidden; +} +.wbf-hero::before { + content: ''; + position: absolute; inset: 0; + background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(0,180,216,.1) 0%, transparent 70%); + pointer-events: none; +} +.wbf-hero__inner { position: relative; z-index: 1; } +.wbf-hero__title { + color: #fff; + font-size: clamp(1.5rem, 4vw, 2rem); + font-weight: 700; + margin-bottom: .5rem; + text-shadow: 0 0 30px rgba(0,180,216,.4); +} +.wbf-hero__title i { color: var(--c-primary); } +.wbf-hero__sub { color: var(--c-text-dim); font-size: 1rem; } +.wbf-stats { + display: flex; justify-content: center; gap: 3rem; + margin-top: 2rem; position: relative; z-index: 1; +} +.wbf-stat { text-align: center; } +.wbf-stat__num { + display: block; font-size: 1.8rem; font-weight: 700; + color: var(--c-primary); + text-shadow: var(--c-glow); + line-height: 1; +} +.wbf-stat span:last-child { + font-size: .72rem; color: var(--c-muted); + text-transform: uppercase; letter-spacing: .07em; + display: block; margin-top: .25rem; +} + +/* ── Container / Grid ───────────────────────────────────────── */ +.wbf-container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; } +.wbf-grid { display: grid; grid-template-columns: 1fr 290px; gap: 1.5rem; align-items: start; } +@media (max-width: 900px) { .wbf-grid { grid-template-columns: 1fr; } } + +/* ── Sidebar — sticky + flex column ────────────────────────── */ +.wbf-sidebar { position: sticky; top: 58px; display: flex; flex-direction: column; gap: 0; } + +/* ── Section header ─────────────────────────────────────────── */ +.wbf-section-header { + display: flex; align-items: center; justify-content: space-between; + margin-bottom: 1rem; +} +.wbf-section-header h2 { + font-size: .85rem; font-weight: 700; color: var(--c-text-dim); + text-transform: uppercase; letter-spacing: .08em; +} + +/* ── Buttons ────────────────────────────────────────────────── */ +.wbf-btn { + display: inline-flex; align-items: center; gap: .4rem; + padding: .5rem 1rem; border-radius: var(--radius-sm); + font-size: .83rem; font-weight: 600; cursor: pointer; + border: 1.5px solid transparent; transition: var(--transition); + font-family: inherit; + background: var(--c-surface2); color: var(--c-text-dim); + border-color: var(--c-border-d); +} +.wbf-btn:hover { background: var(--c-surface); color: var(--c-text); border-color: var(--c-primary); } +.wbf-btn--primary { + background: var(--c-primary); color: #fff; + border-color: var(--c-primary); + box-shadow: 0 0 12px rgba(0,180,216,.3); +} +.wbf-btn--primary:hover { + background: var(--c-primary-d); border-color: var(--c-primary-d); + box-shadow: 0 0 20px rgba(0,180,216,.45); + color: #fff; +} +.wbf-btn--outline { + background: transparent; border-color: rgba(255,255,255,.18); + color: var(--c-text-dim); +} +.wbf-btn--outline:hover { border-color: var(--c-primary); color: var(--c-primary); } +.wbf-btn--sm { padding: .35rem .75rem; font-size: .78rem; } +.wbf-btn--full { width: 100%; justify-content: center; padding: .7rem; } +.wbf-btn:disabled { opacity: .45; cursor: not-allowed; } + +/* ── Category cards ─────────────────────────────────────────── */ +.wbf-categories { display: flex; flex-direction: column; gap: .6rem; } +.wbf-cat-card { + background: var(--c-surface); + border: 1px solid var(--c-border); + border-radius: var(--radius); + padding: 1rem 1.25rem; + display: flex; align-items: center; gap: 1rem; + transition: var(--transition); + box-shadow: var(--shadow-sm); + position: relative; overflow: hidden; +} +.wbf-cat-card::before { + content: ''; position: absolute; left: 0; top: 0; bottom: 0; + width: 3px; background: transparent; transition: var(--transition); +} +.wbf-cat-card:hover { + border-color: rgba(0,180,216,.35); + box-shadow: var(--shadow-md); + transform: translateY(-1px); +} +.wbf-cat-card:hover::before { background: var(--c-primary); } +.wbf-cat-icon { + width: 44px; height: 44px; border-radius: var(--radius-sm); + background: var(--c-primary-l); + color: var(--c-primary); + display: flex; align-items: center; justify-content: center; + font-size: 1.1rem; flex-shrink: 0; + border: 1px solid rgba(0,180,216,.2); +} +.wbf-cat-body { flex: 1; min-width: 0; } +.wbf-cat-name { font-weight: 700; font-size: .95rem; color: var(--c-text); } +.wbf-cat-name:hover { color: var(--c-primary); } +.wbf-cat-desc { color: var(--c-muted); font-size: .78rem; margin-top: .15rem; } +.wbf-cat-meta { display: flex; gap: 1rem; margin-top: .35rem; font-size: .75rem; color: var(--c-muted); } +.wbf-cat-meta span { display: flex; align-items: center; gap: .3rem; } +.wbf-cat-last { flex-shrink: 0; text-align: right; min-width: 160px; } +.wbf-cat-last__label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); } +.wbf-cat-last__title { display: block; font-size: .8rem; font-weight: 600; color: var(--c-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; } +.wbf-cat-last__author { display: block; font-size: .72rem; color: var(--c-muted); } +@media (max-width: 640px) { .wbf-cat-last { display: none; } } + +/* ── Thread List ────────────────────────────────────────────── */ +.wbf-thread-list { display: flex; flex-direction: column; gap: .45rem; } +.wbf-thread-row { + background: var(--c-surface); + border: 1px solid var(--c-border); + border-radius: var(--radius-sm); + padding: .85rem 1.1rem; + display: flex; align-items: center; gap: 1rem; + box-shadow: var(--shadow-sm); transition: var(--transition); +} +.wbf-thread-row:hover { border-color: rgba(0,180,216,.3); box-shadow: var(--shadow-md); } +.wbf-thread-row--pinned { border-left: 3px solid var(--c-green); } +.wbf-thread-row__body { flex: 1; min-width: 0; } +.wbf-thread-row__top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; } +.wbf-thread-row__title { font-weight: 600; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 400px; font-size: .9rem; } +.wbf-thread-row__title:hover { color: var(--c-primary); } +.wbf-thread-row__meta { font-size: .75rem; color: var(--c-muted); margin-top: .2rem; display: flex; gap: .75rem; } +.wbf-thread-row__stats { display: flex; align-items: center; gap: .85rem; font-size: .78rem; color: var(--c-muted); flex-shrink: 0; } +.wbf-thread-row__stats span { display: flex; align-items: center; gap: .3rem; } +.wbf-pin { color: var(--c-green); font-size: .82rem; } +.wbf-pin-icon { color: var(--c-green); margin-right: .4rem; } + +/* ── Thread single ──────────────────────────────────────────── */ +.wbf-thread-header { + background: var(--c-surface); + border: 1px solid var(--c-border); + border-radius: var(--radius); + padding: 1.25rem 1.5rem; + margin-bottom: 1.25rem; + box-shadow: var(--shadow-sm); + border-left: 3px solid var(--c-primary); +} +.wbf-thread-title { font-size: 1.35rem; font-weight: 700; color: var(--c-text); margin-bottom: .75rem; } +.wbf-thread-header-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; color: var(--c-muted); font-size: .875rem; } + +/* ── Posts ──────────────────────────────────────────────────── */ +.wbf-posts { display: flex; flex-direction: column; gap: .75rem; } +.wbf-post { + background: var(--c-surface); + border: 1px solid var(--c-border); + border-radius: var(--radius); + display: flex; gap: 1.1rem; + padding: 1.1rem; + box-shadow: var(--shadow-sm); +} +.wbf-post--op { + border-top: 2px solid var(--c-primary); + background: linear-gradient(180deg, rgba(0,180,216,.04) 0%, var(--c-surface) 80px); +} +.wbf-post__sidebar { + width: 86px; flex-shrink: 0; text-align: center; + display: flex; flex-direction: column; align-items: center; gap: .3rem; +} +.wbf-post__sidebar strong { font-size: .82rem; color: var(--c-text); word-break: break-word; } +.wbf-post__meta-small { font-size: .7rem; color: var(--c-muted); } +.wbf-post__body { flex: 1; min-width: 0; } +.wbf-post__content { line-height: 1.75; color: var(--c-text); word-break: break-word; } +.wbf-post__content p { margin-bottom: .75rem; } +.wbf-post__footer { + display: flex; align-items: center; justify-content: space-between; + margin-top: 1rem; padding-top: .75rem; + border-top: 1px solid var(--c-border); +} +.wbf-post__date { font-size: .75rem; color: var(--c-muted); } +@media (max-width: 600px) { .wbf-post { flex-direction: column; } .wbf-post__sidebar { flex-direction: row; width: auto; } } + +/* ── Reply box ──────────────────────────────────────────────── */ +.wbf-reply-box { + background: var(--c-surface); + border: 1px solid var(--c-border); + border-radius: var(--radius); + padding: 1.25rem 1.5rem; + margin-top: 1.5rem; + box-shadow: var(--shadow-sm); +} +.wbf-reply-box__title { font-size: .8rem; font-weight: 700; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-text-dim); } +.wbf-reply-form { display: flex; gap: 1rem; } +.wbf-reply-form__input { flex: 1; } +.wbf-reply-form__input textarea { + width: 100%; + background: var(--c-bg2); + border: 1.5px solid var(--c-border-d); + border-radius: var(--radius-sm); + padding: .75rem; + font-family: inherit; font-size: .88rem; + color: var(--c-text); + resize: vertical; transition: var(--transition); +} +.wbf-reply-form__input textarea::placeholder { color: var(--c-muted); } +.wbf-reply-form__input textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(0,180,216,.1); } +.wbf-reply-form__actions { display: flex; justify-content: space-between; align-items: center; margin-top: .75rem; } +.wbf-reply-counter { font-size: .75rem; color: var(--c-muted); } + +/* ── Likes ──────────────────────────────────────────────────── */ +.wbf-like-btn { + background: none; + border: 1.5px solid var(--c-border-d); + border-radius: 20px; + padding: .28rem .7rem; + font-size: .78rem; cursor: pointer; + display: inline-flex; align-items: center; gap: .35rem; + color: var(--c-muted); font-family: inherit; + transition: var(--transition); +} +.wbf-like-btn:hover { border-color: var(--c-primary); color: var(--c-primary); } +.wbf-like-btn.wbf-liked { + background: var(--c-primary-l); + border-color: var(--c-primary); + color: var(--c-primary); + box-shadow: 0 0 8px rgba(0,180,216,.2); +} + +/* ── Badges ─────────────────────────────────────────────────── */ +.wbf-badge { display: inline-block; padding: .12rem .45rem; border-radius: 4px; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; } +.wbf-badge--admin { background: rgba(240,82,82,.15); color: #f05252; border: 1px solid rgba(240,82,82,.3); } +.wbf-badge--mod { background: rgba(245,158,11,.12); color: #f59e0b; border: 1px solid rgba(245,158,11,.25); } +.wbf-badge--member { background: rgba(0,180,216,.12); color: var(--c-primary); border: 1px solid rgba(0,180,216,.25); } +.wbf-badge--closed { background: rgba(255,255,255,.05); color: var(--c-muted); border: 1px solid var(--c-border); } + +/* ── Avatar ─────────────────────────────────────────────────── */ +.wbf-avatar { border-radius: 50%; object-fit: cover; background: var(--c-surface2); border: 2px solid var(--c-border); } + +/* ── Sidebar widgets ────────────────────────────────────────── */ +.wbf-widget { + background: var(--c-surface); + border: 1px solid var(--c-border); + border-radius: var(--radius); + padding: 1.25rem; + box-shadow: var(--shadow-sm); +} + + +.wbf-sidebar .wbf-auth-tabs { margin-bottom: 1.25rem; } +.wbf-sidebar .wbf-auth-tab { padding: .6rem .5rem; font-size: .85rem; } +.wbf-widget__title { + font-size: .7rem; font-weight: 700; margin-bottom: .85rem; + display: flex; align-items: center; gap: .45rem; + color: var(--c-muted); text-transform: uppercase; letter-spacing: .08em; +} +.wbf-widget__title i { color: var(--c-primary); } +.wbf-recent-list { list-style: none; display: flex; flex-direction: column; gap: .55rem; } +.wbf-recent-list li { border-bottom: 1px solid var(--c-border); padding-bottom: .55rem; } +.wbf-recent-list li:last-child { border-bottom: none; padding-bottom: 0; } +.wbf-recent-list a { display: block; font-size: .8rem; font-weight: 600; color: var(--c-text-dim); line-height: 1.4; } +.wbf-recent-list a:hover { color: var(--c-primary); } +.wbf-recent-list span { display: block; font-size: .7rem; color: var(--c-muted); margin-top: .12rem; } + +/* ── Profile widget ─────────────────────────────────────────── */ +.wbf-profile-widget { text-align: center; } +.wbf-profile-widget__avatar { margin-bottom: .6rem; } +.wbf-profile-widget__info { display: flex; flex-direction: column; align-items: center; gap: .3rem; margin-bottom: .85rem; } +.wbf-profile-widget__info strong { color: var(--c-text); } +.wbf-profile-widget__posts { font-size: .75rem; color: var(--c-muted); } +.wbf-profile-widget__actions { display: flex; gap: .5rem; justify-content: center; } + +/* ── Profile page ───────────────────────────────────────────── */ +.wbf-profile-page { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; } +.wbf-profile-page__header { + background: linear-gradient(135deg, #0d1117 0%, #161d2e 100%); + border-bottom: 1px solid rgba(0,180,216,.15); + padding: 2rem; display: flex; gap: 1.75rem; align-items: flex-start; +} +.wbf-profile-page__avatar-wrap { position: relative; flex-shrink: 0; } +.wbf-profile-page__avatar { width: 96px; height: 96px; border-radius: 50%; border: 3px solid rgba(0,180,216,.4); object-fit: cover; box-shadow: 0 0 20px rgba(0,180,216,.2); } +.wbf-avatar-upload-btn { position: absolute; bottom: 0; right: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--c-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .72rem; cursor: pointer; } +.wbf-profile-page__info h2 { color: #fff; font-size: 1.25rem; display: flex; align-items: center; gap: .5rem; } +.wbf-profile-page__info .wbf-muted { color: rgba(255,255,255,.45); } +.wbf-profile-page__info p { color: rgba(255,255,255,.7); margin-top: .5rem; font-size: .875rem; } +.wbf-profile-stats { display: flex; gap: 2rem; margin-top: 1rem; } +.wbf-profile-stats div { text-align: center; } +.wbf-profile-stats span { display: block; font-size: 1.5rem; font-weight: 700; color: var(--c-primary); text-shadow: var(--c-glow); } +.wbf-profile-stats em { font-style: normal; font-size: .7rem; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .05em; } +.wbf-profile-edit { padding: 1.5rem 2rem; } +.wbf-profile-edit h3 { font-size: .85rem; font-weight: 700; margin-bottom: 1.1rem; display: flex; align-items: center; gap: .4rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-text-dim); } + +/* ── NEW Profile Layout ──────────────────────────────────── */ +.wbf-profile-layout { + display: grid; + grid-template-columns: 260px 1fr; + gap: 1.25rem; + align-items: start; +} + +/* Sidebar */ +.wbf-profile-sidebar { + background: var(--c-surface); + border: 1px solid var(--c-border); + border-radius: var(--radius); + overflow: hidden; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; +} +.wbf-profile-sidebar__avatar-wrap { + position: relative; + padding: 2rem 0 1.25rem; + width: 100%; + display: flex; + justify-content: center; + background: linear-gradient(160deg, #0d1117, #161d2e); + border-bottom: 1px solid rgba(0,180,216,.12); +} +.wbf-profile-sidebar__avatar { + width: 100px; height: 100px; + border-radius: 50%; + border: 3px solid rgba(0,180,216,.5); + object-fit: cover; + box-shadow: 0 0 24px rgba(0,180,216,.25); +} +.wbf-profile-sidebar__identity { + padding: 1rem 1.25rem .75rem; + display: flex; + flex-direction: column; + align-items: center; + gap: .35rem; + width: 100%; + border-bottom: 1px solid var(--c-border); +} +.wbf-profile-sidebar__identity h2 { + font-size: 1.05rem; + font-weight: 700; + color: var(--c-text); + margin: 0; +} +.wbf-profile-sidebar__username { + font-size: .78rem; + color: var(--c-muted); +} +.wbf-profile-sidebar__stats { + display: flex; + width: 100%; + border-bottom: 1px solid var(--c-border); +} +.wbf-profile-sidebar__stat { + flex: 1; + padding: .85rem .5rem; + display: flex; + flex-direction: column; + align-items: center; + gap: .2rem; +} +.wbf-profile-sidebar__stat:first-child { + border-right: 1px solid var(--c-border); +} +.wbf-profile-sidebar__stat span { + font-size: 1.3rem; + font-weight: 700; + color: var(--c-primary); + text-shadow: var(--c-glow); + line-height: 1; +} +.wbf-profile-sidebar__stat em { + font-style: normal; + font-size: .65rem; + text-transform: uppercase; + letter-spacing: .06em; + color: var(--c-muted); +} +.wbf-profile-sidebar__section { + width: 100%; + padding: .85rem 1.25rem; + text-align: left; + border-bottom: 1px solid var(--c-border); +} +.wbf-profile-sidebar__section:last-child { border-bottom: none; } +.wbf-profile-sidebar__section-label { + display: block; + font-size: .68rem; + font-weight: 700; + text-transform: uppercase; + letter-spacing: .07em; + color: var(--c-primary); + margin-bottom: .4rem; +} +.wbf-profile-sidebar__section p { + margin: 0; + font-size: .82rem; + color: var(--c-text-dim); + line-height: 1.55; +} +.wbf-profile-sidebar__sig { + font-style: italic; + color: var(--c-muted) !important; +} + +/* Main content area */ +.wbf-profile-main { + display: flex; + flex-direction: column; + gap: 1.25rem; +} +.wbf-profile-card { + background: var(--c-surface); + border: 1px solid var(--c-border); + border-radius: var(--radius); + overflow: hidden; +} +.wbf-profile-card__header { + padding: .75rem 1.25rem; + font-size: .82rem; + font-weight: 700; + text-transform: uppercase; + letter-spacing: .06em; + color: var(--c-text-dim); + border-bottom: 1px solid var(--c-border); + background: rgba(255,255,255,.02); + display: flex; + align-items: center; + gap: .5rem; +} +.wbf-profile-card__header i { color: var(--c-primary); } +.wbf-profile-card__count { + margin-left: auto; + font-size: .72rem; + font-weight: 600; + background: rgba(0,180,216,.12); + color: var(--c-primary); + padding: 1px 8px; + border-radius: 20px; +} +.wbf-profile-card__body { padding: 1.25rem; } +.wbf-profile-card__body--posts { + padding: .5rem 0; + max-height: 560px; + overflow-y: auto; +} +.wbf-profile-card__footer { + display: flex; + align-items: center; + gap: 1rem; + margin-top: 1rem; + padding-top: 1rem; + border-top: 1px solid var(--c-border); +} +.wbf-profile-edit-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 0 1rem; +} +.wbf-profile-empty { + color: var(--c-muted); + font-size: .85rem; + padding: .5rem 1.25rem; + margin: 0; +} + +/* Post items in profile */ +.wbf-profile-post-item { + padding: .7rem 1.25rem; + border-bottom: 1px solid var(--c-border); + transition: background .15s; +} +.wbf-profile-post-item:last-child { border-bottom: none; } +.wbf-profile-post-item:hover { background: rgba(255,255,255,.025); } +.wbf-profile-post-item__top { + display: flex; + align-items: center; + gap: .4rem; + flex-wrap: wrap; + margin-bottom: .3rem; +} +.wbf-profile-post-item__type { + flex-shrink: 0; + font-size: .66rem; + font-weight: 700; + padding: 1px 7px; + border-radius: 3px; +} +.wbf-profile-post-item__type--thread { + background: rgba(0,180,216,.14); + color: var(--c-primary); +} +.wbf-profile-post-item__type--reply { + background: rgba(148,163,184,.1); + color: var(--c-muted); +} +.wbf-profile-post-item__title { + font-size: .83rem; + font-weight: 600; + color: var(--c-primary); + text-decoration: none; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 340px; +} +.wbf-profile-post-item__title:hover { text-decoration: underline; } +.wbf-profile-post-item__cat { + font-size: .7rem; + color: var(--c-muted); + white-space: nowrap; +} +.wbf-profile-post-item__time { + margin-left: auto; + font-size: .7rem; + color: var(--c-muted); + white-space: nowrap; + flex-shrink: 0; +} +.wbf-profile-post-item__preview { + margin: 0; + font-size: .79rem; + color: var(--c-text-dim); + line-height: 1.45; +} + +/* ── Forms ──────────────────────────────────────────────────── */ +.wbf-form-row { margin-bottom: .8rem; } +.wbf-form-row label { display: block; font-size: .72rem; font-weight: 700; margin-bottom: .3rem; color: var(--c-text-dim); text-transform: uppercase; letter-spacing: .05em; } +.wbf-form-row input[type="text"], +.wbf-form-row input[type="email"], +.wbf-form-row input[type="password"], +.wbf-form-row textarea, +.wbf-form-row select { + width: 100%; + background: var(--c-bg2); + border: 1.5px solid var(--c-border-d); + border-radius: var(--radius-sm); + padding: .6rem .85rem; + font-family: inherit; font-size: .875rem; + color: var(--c-text); + transition: var(--transition); +} +.wbf-form-row input::placeholder, +.wbf-form-row textarea::placeholder { color: var(--c-muted); } +.wbf-form-row input:focus, +.wbf-form-row textarea:focus, +.wbf-form-row select:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(0,180,216,.12); background: var(--c-bg); } +.wbf-form-row select option { background: var(--c-surface2); color: var(--c-text); } + +/* ── Auth tabs ──────────────────────────────────────────────── */ +.wbf-auth-tabs { display: flex; gap: .4rem; margin-bottom: 1rem; } +.wbf-auth-tab { + flex: 1; padding: .5rem; + border: 1.5px solid var(--c-border-d); + border-radius: var(--radius-sm); + background: var(--c-bg2); cursor: pointer; + font-family: inherit; font-size: .82rem; font-weight: 600; + color: var(--c-muted); transition: var(--transition); +} +.wbf-auth-tab.active { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-l); } +.wbf-auth-panel { display: none; } +.wbf-auth-panel.active { display: block; } + +/* ── Modal ──────────────────────────────────────────────────── */ +.wbf-modal { + position: fixed; inset: 0; + background: rgba(0,0,0,.75); + backdrop-filter: blur(5px); + z-index: 9999; + display: flex; align-items: center; justify-content: center; + opacity: 0; pointer-events: none; transition: opacity .25s; padding: 1rem; +} +.wbf-modal.active { opacity: 1; pointer-events: all; } +.wbf-modal__box { + background: var(--c-surface); + border: 1px solid rgba(0,180,216,.25); + border-radius: var(--radius); + padding: 1.75rem; + width: 100%; max-width: 440px; + box-shadow: var(--shadow-lg), 0 0 40px rgba(0,180,216,.08); + position: relative; + transform: translateY(16px) scale(.98); transition: transform .25s; +} +.wbf-modal.active .wbf-modal__box { transform: translateY(0) scale(1); } +.wbf-modal__box--lg { max-width: 640px; } +.wbf-modal__close { + position: absolute; top: .75rem; right: .9rem; + background: none; border: none; font-size: 1.4rem; + cursor: pointer; color: var(--c-muted); line-height: 1; padding: .2rem .4rem; +} +.wbf-modal__close:hover { color: var(--c-text); } + +/* ── Misc ───────────────────────────────────────────────────── */ +.wbf-msg { font-size: .8rem; margin-left: .6rem; } +.wbf-notice { background: var(--c-primary-l); color: var(--c-primary); border: 1px solid rgba(0,180,216,.2); border-radius: var(--radius-sm); padding: .75rem 1rem; font-size: .875rem; display: flex; align-items: center; gap: .5rem; margin: 1rem 0; } +.wbf-notice--info { background: rgba(0,180,216,.06); color: var(--c-accent); border-color: rgba(0,180,216,.18); } +.wbf-notice--warning { background: rgba(245,158,11,.08); color: #f59e0b; border-color: rgba(245,158,11,.2); } +.wbf-empty { text-align: center; padding: 3rem 1rem; color: var(--c-muted); } +.wbf-empty i { font-size: 2.5rem; margin-bottom: .75rem; display: block; color: var(--c-border-d); } +.wbf-breadcrumb { display: flex; align-items: center; gap: .5rem; font-size: .8rem; margin-bottom: 1.1rem; color: var(--c-muted); } +.wbf-breadcrumb a { color: var(--c-primary); } +.wbf-pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 1.5rem; } +.wbf-page-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1.5px solid var(--c-border); background: var(--c-surface2); color: var(--c-text-dim); font-size: .82rem; font-weight: 600; text-decoration: none; transition: var(--transition); } +.wbf-page-btn:hover, .wbf-page-btn.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; box-shadow: 0 0 10px rgba(0,180,216,.3); } + +/* ── Custom scrollbar ───────────────────────────────────────── */ +.wbf-wrap ::-webkit-scrollbar { width: 6px; } +.wbf-wrap ::-webkit-scrollbar-track { background: var(--c-bg2); } +.wbf-wrap ::-webkit-scrollbar-thumb { background: var(--c-surface2); border-radius: 3px; } +.wbf-wrap ::-webkit-scrollbar-thumb:hover { background: var(--c-primary); } + +/* ── Responsive ─────────────────────────────────────────────── */ +@media (max-width: 480px) { + .wbf-topbar__right { gap: .35rem; } + .wbf-hero { padding: 1.75rem 1rem; } + .wbf-stats { gap: 1.5rem; } + .wbf-container { padding: 1rem; } + .wbf-profile-page__header { flex-direction: column; } +} + + +/* ── Hide WordPress page title on forum page ────────────────── */ +.wbf-forum-page .entry-title, +.wbf-forum-page .page-title, +.wbf-forum-page h1.entry-title, +.wbf-forum-page h1.page-title, +.wbf-forum-page .page-header, +.wbf-forum-page .post-title { + display: none !important; +} + +/* ════════════════════════════════════════════════════════════ + ELTERN-KIND HIERARCHIE + ════════════════════════════════════════════════════════════ */ + +/* ── Kategorie-Gruppen Liste ────────────────────────────────── */ +.wbf-cat-group-list { display: flex; flex-direction: column; gap: 1rem; } + +/* ── Elternkategorie-Header ─────────────────────────────────── */ +.wbf-cat-group { + border: 1px solid var(--c-border); + border-radius: var(--radius); + overflow: hidden; + box-shadow: var(--shadow-sm); +} + +.wbf-cat-parent { + background: var(--c-surface2); + padding: .9rem 1.25rem; + display: flex; align-items: center; gap: 1rem; + border-bottom: 1px solid var(--c-border); + position: relative; +} +.wbf-cat-parent::before { + content: ''; + position: absolute; left: 0; top: 0; bottom: 0; + width: 3px; background: var(--c-primary); +} +.wbf-cat-parent__icon { + width: 38px; height: 38px; flex-shrink: 0; + border-radius: var(--radius-sm); + background: var(--c-primary-l); + color: var(--c-primary); + display: flex; align-items: center; justify-content: center; + font-size: 1rem; + border: 1px solid rgba(0,180,216,.2); +} +.wbf-cat-parent__body { flex: 1; min-width: 0; } +.wbf-cat-parent__name { + font-weight: 700; font-size: .95rem; color: var(--c-text); + display: block; +} +.wbf-cat-parent__name:hover { color: var(--c-primary); } +.wbf-cat-parent__desc { font-size: .78rem; color: var(--c-muted); margin-top: .1rem; } +.wbf-cat-parent__stats { + display: flex; gap: 1rem; flex-shrink: 0; + font-size: .78rem; color: var(--c-muted); +} +.wbf-cat-parent__stats span { display: flex; align-items: center; gap: .3rem; } + +/* ── Kindkategorien (eingerückt, kompakt) ───────────────────── */ +.wbf-cat-children { + background: var(--c-surface); +} + +.wbf-cat-child { + display: flex; align-items: center; gap: .85rem; + padding: .7rem 1.25rem .7rem 2.5rem; /* links eingerückt */ + border-bottom: 1px solid var(--c-border); + transition: background var(--transition); + position: relative; +} +.wbf-cat-child:last-child { border-bottom: none; } +.wbf-cat-child:hover { background: rgba(255,255,255,.025); } + +/* Vertikale Verbindungslinie */ +.wbf-cat-child::before { + content: ''; + position: absolute; left: 1.35rem; top: 50%; + width: .6rem; height: 1px; + background: var(--c-border-d); +} + +.wbf-cat-child__icon { + width: 30px; height: 30px; flex-shrink: 0; + border-radius: var(--radius-sm); + background: rgba(0,180,216,.07); + color: var(--c-primary); + display: flex; align-items: center; justify-content: center; + font-size: .8rem; + border: 1px solid rgba(0,180,216,.12); +} +.wbf-cat-child__body { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; } +.wbf-cat-child__name { font-weight: 600; font-size: .875rem; color: var(--c-text-dim); } +.wbf-cat-child__name:hover { color: var(--c-primary); } +.wbf-cat-child__desc { font-size: .75rem; color: var(--c-muted); } +.wbf-cat-child__meta { + display: flex; align-items: center; gap: .75rem; flex-shrink: 0; + font-size: .75rem; color: var(--c-muted); +} +.wbf-cat-child__meta span { display: flex; align-items: center; gap: .25rem; } +.wbf-cat-child__last { + font-size: .72rem; color: var(--c-primary); + white-space: nowrap; overflow: hidden; + text-overflow: ellipsis; max-width: 160px; + display: flex; align-items: center; gap: .3rem; +} + +/* ── Subkategorie-Karten (in der Kategorie-Ansicht) ─────────── */ +.wbf-subcat-list { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); + gap: .6rem; + margin-bottom: 1.5rem; +} +.wbf-subcat-card { + background: var(--c-surface); + border: 1px solid var(--c-border); + border-radius: var(--radius-sm); + padding: .85rem 1rem; + display: flex; align-items: center; gap: .75rem; + text-decoration: none; transition: var(--transition); + box-shadow: var(--shadow-sm); +} +.wbf-subcat-card:hover { + border-color: rgba(0,180,216,.35); + background: var(--c-surface2); + transform: translateY(-1px); + box-shadow: var(--shadow-md); + text-decoration: none; +} +.wbf-subcat-card__icon { + width: 34px; height: 34px; flex-shrink: 0; + border-radius: var(--radius-sm); + background: var(--c-primary-l); + color: var(--c-primary); + display: flex; align-items: center; justify-content: center; + font-size: .9rem; + border: 1px solid rgba(0,180,216,.2); +} +.wbf-subcat-card__body { flex: 1; min-width: 0; } +.wbf-subcat-card__name { display: block; font-weight: 600; font-size: .85rem; color: var(--c-text); } +.wbf-subcat-card__desc { display: block; font-size: .72rem; color: var(--c-muted); margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.wbf-subcat-card__stats { font-size: .72rem; color: var(--c-muted); flex-shrink: 0; } + +/* ── Hide WP page title on forum page ───────────────────────── */ +.wbf-forum-page .entry-title, +.wbf-forum-page .page-title, +.wbf-forum-page h1.entry-title, +.wbf-forum-page h1.page-title, +.wbf-forum-page .page-header, +.wbf-forum-page .post-title { display: none !important; } + +/* ════════════════════════════════════════════════════════════ + ROLLEN-BADGES + ════════════════════════════════════════════════════════════ */ +.wbf-badge--owner { background:rgba(124,58,237,.18); color:#a78bfa; border:1px solid rgba(124,58,237,.35); } +.wbf-badge--admin { background:rgba(220,38,38,.15); color:#f87171; border:1px solid rgba(220,38,38,.3); } +.wbf-badge--mod { background:rgba(217,119,6,.14); color:#fbbf24; border:1px solid rgba(217,119,6,.3); } +.wbf-badge--vip { background:rgba(14,165,233,.14); color:#38bdf8; border:1px solid rgba(14,165,233,.3); } +.wbf-badge--member { background:rgba(0,180,216,.12); color:var(--c-primary); border:1px solid rgba(0,180,216,.25); } +.wbf-badge--banned { background:rgba(55,65,81,.3); color:#9ca3af; border:1px solid rgba(55,65,81,.4); } +.wbf-badge--closed { background:rgba(255,255,255,.05);color:var(--c-muted); border:1px solid var(--c-border); } + +/* ════════════════════════════════════════════════════════════ + SIGNATUR + ════════════════════════════════════════════════════════════ */ +.wbf-signature { + margin-top: .85rem; + padding-top: .6rem; +} +.wbf-signature__divider { + height: 1px; + background: linear-gradient(to right, var(--c-primary-l), transparent); + margin-bottom: .55rem; +} +.wbf-signature { + font-size: .78rem; + color: var(--c-muted); + font-style: italic; + line-height: 1.6; +} + +/* Signatur-Vorschau im Profil */ +.wbf-profile-sig-preview { + margin-top: .75rem; + padding: .6rem .85rem; + background: rgba(0,180,216,.06); + border-left: 2px solid var(--c-primary); + border-radius: 0 var(--radius-sm) var(--radius-sm) 0; + font-size: .82rem; color: var(--c-text-dim); font-style: italic; +} +.wbf-profile-sig-preview__label { + display: block; font-size: .7rem; font-style: normal; + font-weight: 700; color: var(--c-primary); + text-transform: uppercase; letter-spacing: .05em; + margin-bottom: .3rem; +} + +/* Signatur Zeichenzähler */ +.wbf-sig-counter { + font-size: .75rem; color: var(--c-muted); + text-align: right; margin-top: .3rem; +} +#wbfSigCount { color: var(--c-primary); font-weight: 600; } + +/* ════════════════════════════════════════════════════════════ + MOD-TOOLBAR + ════════════════════════════════════════════════════════════ */ +.wbf-mod-bar { + display: flex; align-items: center; gap: .5rem; + padding: .6rem 1rem; + background: rgba(217,119,6,.06); + border: 1px solid rgba(217,119,6,.2); + border-radius: var(--radius-sm); + margin-bottom: 1rem; + flex-wrap: wrap; +} +.wbf-mod-bar__label { + font-size: .72rem; font-weight: 700; + color: #fbbf24; + text-transform: uppercase; letter-spacing: .06em; + margin-right: .25rem; +} +.wbf-mod-btn { + background: var(--c-surface2); + border: 1px solid var(--c-border-d); + border-radius: var(--radius-sm); + padding: .3rem .75rem; + font-size: .78rem; font-weight: 600; + color: var(--c-text-dim); cursor: pointer; + font-family: inherit; display: flex; align-items: center; gap: .35rem; + transition: var(--transition); +} +.wbf-mod-btn:hover { border-color: #fbbf24; color: #fbbf24; } +.wbf-mod-btn--danger { color: var(--c-danger); border-color: rgba(240,82,82,.3); } +.wbf-mod-btn--danger:hover { background: rgba(240,82,82,.1); border-color: var(--c-danger); } +.wbf-mod-btn--sm { padding: .2rem .5rem; font-size: .72rem; } +.wbf-mod-btn--archive { color: #a78bfa; border-color: rgba(167,139,250,.3); } +.wbf-mod-btn--archive:hover { background: rgba(167,139,250,.1); border-color: #a78bfa; color: #a78bfa; } +.wbf-mod-btn--move { color: var(--c-primary); border-color: rgba(0,180,216,.3); } +.wbf-mod-btn--move:hover { background: rgba(0,180,216,.1); border-color: var(--c-primary); color: var(--c-primary); } + +/* ── Archived Badge ──────────────────────────────────────── */ +.wbf-badge--archived { + background: rgba(167,139,250,.12); + color: #a78bfa; + border: 1px solid rgba(167,139,250,.3); +} +.wbf-thread-row--archived { opacity: .7; } +.wbf-thread-row--archived:hover { opacity: 1; } + +/* ── Archive Section (Kategorie-Ansicht) ─────────────────── */ +.wbf-archive-section { + border: 1px solid rgba(167,139,250,.2); + border-radius: var(--radius); + overflow: hidden; +} +.wbf-archive-section__toggle { + display: flex; + align-items: center; + gap: .6rem; + padding: .75rem 1.1rem; + background: rgba(167,139,250,.06); + color: #a78bfa; + font-size: .82rem; + font-weight: 700; + cursor: pointer; + user-select: none; + letter-spacing: .03em; + transition: background .15s; +} +.wbf-archive-section__toggle:hover { background: rgba(167,139,250,.12); } +.wbf-archive-section__toggle .fa-chevron-down { + transition: transform .25s; +} +.wbf-archive-section__toggle.open .fa-chevron-down { + transform: rotate(180deg); +} +.wbf-archive-section__count { + font-size: .72rem; + background: rgba(167,139,250,.18); + color: #a78bfa; + padding: 1px 8px; + border-radius: 20px; +} +.wbf-archive-list { + display: none; + border-top: 1px solid rgba(167,139,250,.15); +} +.wbf-archive-list.open { display: block; } + +/* Kategorie Schloss-Label */ +.wbf-cat-lock { + font-size: .7rem; color: #fbbf24; + display: flex; align-items: center; gap: .25rem; +} + +/* ════════════════════════════════════════════════════════════ + DYNAMISCHE ROLLEN-BADGES (inline styles vom PHP gesetzt) + ════════════════════════════════════════════════════════════ */ +.wbf-role-badge { + display: inline-flex; + align-items: center; + gap: .3rem; + padding: .12rem .5rem; + border-radius: 4px; + border: 1px solid; + font-size: .68rem; + font-weight: 700; + letter-spacing: .04em; + text-transform: uppercase; + white-space: nowrap; +} +.wbf-role-badge i { font-size: .7rem; } +/* ════════════════════════════════════════════════════════════ + FEATURE: Ungelesene Beiträge + ════════════════════════════════════════════════════════════ */ + +/* Thread-Liste — "Neu"-Badge neben dem Titel */ +.wbf-new-badge { + display: inline-flex; + align-items: center; + gap: .25rem; + padding: 1px 8px; + background: rgba(0,180,216,.18); + color: var(--c-primary); + border: 1px solid rgba(0,180,216,.35); + border-radius: 30px; + font-size: .68rem; + font-weight: 700; + letter-spacing: .04em; + text-transform: uppercase; + vertical-align: middle; + margin-left: .4rem; + animation: wbf-pulse 2s infinite; +} +@keyframes wbf-pulse { + 0%, 100% { opacity: 1; } + 50% { opacity: .6; } +} + +/* Thread-Zeile mit neuen Antworten */ +.wbf-thread-row--has-new { + border-left: 3px solid var(--c-primary) !important; +} +.wbf-thread-row--has-new .wbf-thread-row__title { + color: var(--c-primary); +} + +/* Einzelner Post — neu (highlight) */ +.wbf-post--new { + background: linear-gradient(135deg, rgba(0,180,216,.06) 0%, transparent 60%); + border-color: rgba(0,180,216,.25) !important; + box-shadow: 0 0 0 1px rgba(0,180,216,.12), var(--shadow-sm); +} +.wbf-post--new::before { + content: ''; + position: absolute; + left: 0; top: 0; bottom: 0; + width: 3px; + background: var(--c-primary); + border-radius: 3px 0 0 3px; +} +/* "Neu"-Label im Post selbst */ +.wbf-post__new-label { + display: none; + align-items: center; + gap: .3rem; + font-size: .7rem; + font-weight: 700; + color: var(--c-primary); + text-transform: uppercase; + letter-spacing: .06em; + margin-bottom: .5rem; + padding: 3px 10px; + background: rgba(0,180,216,.1); + border: 1px solid rgba(0,180,216,.22); + border-radius: 4px; + width: fit-content; +} +.wbf-post--new .wbf-post__new-label { + display: inline-flex; +} +/* Sicherstellen dass .wbf-post position:relative hat */ +.wbf-post { position: relative; } + +/* ════════════════════════════════════════════════════════════ + FEATURE: Beitrag melden + ════════════════════════════════════════════════════════════ */ + +/* Report-Button im Post-Footer */ +.wbf-report-btn { + display: inline-flex; + align-items: center; + justify-content: center; + width: 30px; height: 30px; + border: 1.5px solid var(--c-border); + border-radius: var(--radius-sm); + background: transparent; + color: var(--c-muted); + font-size: .8rem; + cursor: pointer; + transition: var(--transition); +} +.wbf-report-btn:hover { + border-color: var(--c-danger); + color: var(--c-danger); + background: rgba(240,82,82,.08); +} +.wbf-report-btn:active { + transform: scale(.92); +} + +/* "Bereits gemeldet" Label */ +.wbf-reported-label { + display: inline-flex; + align-items: center; + justify-content: center; + width: 30px; height: 30px; + border: 1.5px solid rgba(240,82,82,.25); + border-radius: var(--radius-sm); + color: rgba(240,82,82,.45); + font-size: .8rem; + cursor: default; +} + +/* Danger-Button im Modal */ +.wbf-btn--danger { + background: var(--c-danger); + color: #fff; + border: none; +} +.wbf-btn--danger:hover { + background: #d93838; +} +/* ════════════════════════════════════════════════════════════ + FEATURE: Editor-Toolbar (Bild + Smilies) + ════════════════════════════════════════════════════════════ */ + +.wbf-editor-toolbar { + display: flex; + align-items: center; + gap: .2rem; + padding: .4rem .6rem; + background: var(--c-surface2); + border: 1.5px solid var(--c-border); + border-bottom: none; + border-radius: var(--radius-sm) var(--radius-sm) 0 0; + flex-wrap: wrap; + position: relative; +} + +/* Toolbar direkt über Textarea → Textarea obere Ecken eckig */ +.wbf-editor-toolbar + textarea { + border-top-left-radius: 0 !important; + border-top-right-radius: 0 !important; + border-top-color: transparent !important; +} + +.wbf-tb-btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: .3rem; + min-width: 30px; + height: 28px; + padding: 0 .55rem; + background: transparent; + border: 1.5px solid transparent; + border-radius: var(--radius-sm); + color: var(--c-text-dim); + font-size: .82rem; + cursor: pointer; + transition: var(--transition); + white-space: nowrap; + font-family: inherit; +} +.wbf-tb-btn:hover { + background: rgba(255,255,255,.07); + border-color: var(--c-border-d); + color: var(--c-text); +} +.wbf-tb-btn:active { transform: scale(.93); } +.wbf-tb-btn--emoji { font-size: 1rem; padding: 0 .45rem; } +.wbf-tb-btn--loading { opacity: .5; pointer-events: none; } + +.wbf-tb-divider { + width: 1px; + height: 18px; + background: var(--c-border-d); + margin: 0 .15rem; + flex-shrink: 0; +} + +/* ── Emoji-Picker ──────────────────────────────────────────── */ +.wbf-emoji-picker { + position: absolute; + top: calc(100% + 6px); + left: 0; + z-index: 500; + background: var(--c-surface); + border: 1.5px solid var(--c-border-d); + border-radius: var(--radius); + box-shadow: var(--shadow-md); + padding: .6rem; + width: 280px; + animation: wbfFadeIn .15s ease; +} +@keyframes wbfFadeIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } } + +.wbf-emoji-picker__grid { + display: grid; + grid-template-columns: repeat(10, 1fr); + gap: 2px; +} +.wbf-emoji-item { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + aspect-ratio: 1; + background: none; + border: 1.5px solid transparent; + border-radius: 5px; + font-size: 1.1rem; + cursor: pointer; + transition: var(--transition); + padding: 0; + line-height: 1; +} +.wbf-emoji-item:hover { + background: var(--c-surface2); + border-color: var(--c-border-d); + transform: scale(1.2); +} + +/* ── Toolbar: Farb/Größen-Dropdowns ─────────────────────── */ +.wbf-tb-dropdown__panel { + position: absolute; + top: calc(100% + 5px); + left: 0; + z-index: 600; + background: var(--c-surface); + border: 1.5px solid var(--c-border-d); + border-radius: var(--radius); + box-shadow: var(--shadow-md); + padding: .5rem; + min-width: 130px; + animation: wbfFadeIn .12s ease; +} +.wbf-tb-color-grid { + display: grid; + grid-template-columns: repeat(6, 1fr); + gap: 4px; +} +.wbf-tb-color-swatch { + width: 22px; height: 22px; + border-radius: 4px; + border: 2px solid transparent; + cursor: pointer; + transition: transform .12s, border-color .12s; + padding: 0; +} +.wbf-tb-color-swatch:hover { + transform: scale(1.2); + border-color: rgba(255,255,255,.5); +} +.wbf-tb-dropdown__item { + display: block; + width: 100%; + text-align: left; + padding: .35rem .65rem; + background: none; + border: none; + border-radius: var(--radius-sm); + color: var(--c-text-dim); + font-size: .82rem; + font-family: inherit; + cursor: pointer; + transition: background .1s; +} +.wbf-tb-dropdown__item:hover { + background: rgba(255,255,255,.07); + color: var(--c-text); +} + +/* ══════════════════════════════════════════════════════════ + BBCode — gerenderter Inhalt (.wbf-post__content) + ══════════════════════════════════════════════════════════ */ + +/* Zitat */ +.wbf-bb-quote { + margin: .65rem 0; + padding: .55rem .9rem; + border-left: 3px solid var(--c-primary); + background: rgba(0,180,216,.06); + border-radius: 0 var(--radius-sm) var(--radius-sm) 0; + color: var(--c-muted); + font-size: .88rem; + line-height: 1.55; +} +.wbf-bb-quote__author { + display: block; + margin-bottom: .3rem; + color: var(--c-primary); + font-size: .78rem; +} +/* Nested quotes */ +.wbf-bb-quote .wbf-bb-quote { + margin-top: .4rem; + border-left-color: rgba(0,180,216,.4); + background: rgba(0,180,216,.03); +} + +/* Code-Block */ +.wbf-bb-code { + margin: .6rem 0; + padding: .75rem 1rem; + background: rgba(0,0,0,.35); + border: 1px solid var(--c-border-d); + border-radius: var(--radius-sm); + font-family: 'Fira Code', 'Courier New', monospace; + font-size: .82rem; + line-height: 1.65; + overflow-x: auto; + color: #e2e8f0; + white-space: pre; +} +.wbf-bb-icode { + display: inline; + padding: 1px 5px; + background: rgba(0,0,0,.3); + border: 1px solid var(--c-border-d); + border-radius: 3px; + font-family: 'Fira Code', 'Courier New', monospace; + font-size: .83em; + color: #93c5fd; +} + +/* Spoiler */ +.wbf-bb-spoiler { + margin: .65rem 0; + border: 1.5px solid var(--c-border-d); + border-radius: var(--radius-sm); + overflow: hidden; +} +.wbf-bb-spoiler__btn { + display: flex; + align-items: center; + gap: .5rem; + width: 100%; + padding: .5rem .85rem; + background: rgba(255,255,255,.04); + border: none; + color: var(--c-text-dim); + font-size: .82rem; + font-weight: 600; + font-family: inherit; + cursor: pointer; + text-align: left; + transition: background .15s; +} +.wbf-bb-spoiler__btn:hover { background: rgba(255,255,255,.08); } +.wbf-bb-spoiler__body { + padding: .65rem .9rem; + border-top: 1px solid var(--c-border-d); + font-size: .88rem; + line-height: 1.55; +} + +/* Liste */ +.wbf-bb-list { + margin: .5rem 0 .5rem 1.4rem; + padding: 0; + font-size: .9rem; + line-height: 1.7; + color: var(--c-text); +} +.wbf-bb-list li { margin-bottom: .15rem; } + +/* Link */ +.wbf-bb-link { + color: var(--c-primary); + text-decoration: underline; + text-underline-offset: 2px; + word-break: break-word; +} +.wbf-bb-link:hover { opacity: .8; } + +/* Bild */ +.wbf-bb-img { + display: block; + max-width: 100%; + max-height: 480px; + height: auto; + border-radius: var(--radius-sm); + margin: .4rem 0; + cursor: zoom-in; +} + +/* Überschriften */ +.wbf-bb-h2 { + font-size: 1.1rem; + font-weight: 700; + color: var(--c-text); + margin: .9rem 0 .4rem; + padding-bottom: .3rem; + border-bottom: 1px solid var(--c-border); +} +.wbf-bb-h3 { + font-size: .95rem; + font-weight: 700; + color: var(--c-text); + margin: .75rem 0 .3rem; +} + +/* Ausrichtung */ +.wbf-bb-center { text-align: center; } +.wbf-bb-right { text-align: right; } + +/* Trennlinie */ +.wbf-bb-hr { + border: none; + border-top: 1px solid var(--c-border-d); + margin: .75rem 0; +} + +/* ══════════════════════════════════════════════════════════ + TAGS & HASHTAGS + ══════════════════════════════════════════════════════════ */ + +/* Tag-Chip (überall verwendet) */ +.wbf-tag { + display: inline-flex; + align-items: center; + gap: 3px; + padding: 3px 9px; + background: rgba(0,180,216,.08); + border: 1.5px solid rgba(0,180,216,.25); + border-radius: 20px; + color: var(--c-primary); + font-size: .75rem; + font-weight: 600; + text-decoration: none; + white-space: nowrap; + transition: background .15s, border-color .15s; + line-height: 1; +} +.wbf-tag i { font-size: .6rem; opacity: .75; } +.wbf-tag:hover { + background: rgba(0,180,216,.16); + border-color: var(--c-primary); + color: var(--c-primary); +} +.wbf-tag--sm { + font-size: .68rem; + padding: 2px 7px; +} +.wbf-tag--active { + background: rgba(0,180,216,.2); + border-color: var(--c-primary); +} +.wbf-tag__count { + margin-left: 2px; + opacity: .6; + font-weight: 400; +} + +/* Tag-Liste (unter Thread-Titel / Rows) */ +.wbf-tag-list { + display: flex; + flex-wrap: wrap; + gap: .3rem; + margin-top: .4rem; +} + +/* Tag-Cloud (Sidebar + Tag-Seite) */ +.wbf-tag-cloud { + display: flex; + flex-wrap: wrap; + gap: .35rem; + padding: .15rem 0; +} + +/* ── Tag-Input Widget (New Thread Modal) ─────────────────── */ +.wbf-tag-input-wrap { + position: relative; + display: flex; + flex-wrap: wrap; + align-items: center; + gap: .3rem; + padding: .4rem .6rem; + background: var(--c-surface2); + border: 1.5px solid var(--c-border); + border-radius: var(--radius-sm); + cursor: text; + min-height: 38px; + transition: border-color .15s; +} +.wbf-tag-input-wrap:focus-within { + border-color: var(--c-primary); + box-shadow: 0 0 0 3px rgba(0,180,216,.12); +} +.wbf-tag-pills { + display: flex; + flex-wrap: wrap; + gap: .25rem; + align-items: center; +} +.wbf-tag-pill { + display: inline-flex; + align-items: center; + gap: 4px; + background: rgba(0,180,216,.15); + border: 1px solid rgba(0,180,216,.35); + border-radius: 20px; + color: var(--c-primary); + font-size: .75rem; + font-weight: 600; + padding: 2px 8px 2px 9px; + line-height: 1; +} +.wbf-tag-pill button { + background: none; + border: none; + color: var(--c-primary); + opacity: .65; + cursor: pointer; + font-size: .9rem; + line-height: 1; + padding: 0 1px; + margin-left: 1px; + transition: opacity .1s; +} +.wbf-tag-pill button:hover { opacity: 1; } +.wbf-tag-pill-hint { + font-size: .68rem; + color: var(--c-muted); + font-style: italic; + padding: 0 4px; +} +.wbf-tag-input-wrap input[type="text"] { + flex: 1; + min-width: 120px; + background: none; + border: none; + outline: none; + color: var(--c-text); + font-size: .85rem; + font-family: inherit; + padding: 0; +} +.wbf-tag-input-wrap input[type="text"]::placeholder { + color: var(--c-muted); + opacity: .7; +} + +/* Autocomplete-Dropdown */ +.wbf-tag-suggest { + position: absolute; + top: calc(100% + 5px); + left: 0; + right: 0; + z-index: 700; + background: var(--c-surface); + border: 1.5px solid var(--c-border-d); + border-radius: var(--radius); + box-shadow: var(--shadow-md); + overflow: hidden; + animation: wbfFadeIn .12s ease; +} +.wbf-tag-suggest-item { + display: flex; + align-items: center; + gap: .4rem; + padding: .5rem .85rem; + font-size: .83rem; + color: var(--c-text-dim); + cursor: pointer; + transition: background .1s; +} +.wbf-tag-suggest-item i { color: var(--c-primary); font-size: .65rem; } +.wbf-tag-suggest-item:hover { background: rgba(255,255,255,.05); color: var(--c-text); } +.wbf-tag-suggest-count { + margin-left: auto; + font-size: .7rem; + color: var(--c-muted); + font-weight: 400; +} +.wbf-post__content img, +.wbf-post--op .wbf-post__content img { + max-width: 100%; + height: auto; + border-radius: var(--radius-sm); + border: 1px solid var(--c-border); + margin: .5rem 0; + display: block; + cursor: zoom-in; + transition: opacity var(--transition); +} +.wbf-post__content img:hover { opacity: .9; } + +/* ── Bild-Lightbox ─────────────────────────────────────────── */ +.wbf-lightbox { + position: fixed; + inset: 0; + background: rgba(0,0,0,.88); + backdrop-filter: blur(8px); + z-index: 99999; + display: flex; + align-items: center; + justify-content: center; + padding: 1.5rem; + cursor: zoom-out; + animation: wbfFadeIn .2s ease; +} +.wbf-lightbox img { + max-width: 92vw; + max-height: 88vh; + border-radius: var(--radius); + box-shadow: 0 24px 60px rgba(0,0,0,.7); + cursor: default; +} +.wbf-lightbox__close { + position: fixed; + top: 1.2rem; + right: 1.4rem; + background: rgba(255,255,255,.12); + border: none; + color: #fff; + font-size: 1.4rem; + width: 38px; + height: 38px; + border-radius: 50%; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + transition: var(--transition); +} +.wbf-lightbox__close:hover { background: rgba(255,255,255,.25); } + +/* ── Upload-Fortschrittsanzeige im Toolbar ─────────────────── */ +.wbf-tb-upload-progress { + font-size: .72rem; + color: var(--c-primary); + display: none; + align-items: center; + gap: .3rem; + margin-left: .2rem; +} +.wbf-tb-upload-progress.active { display: inline-flex; } +/* ── Beitrag bearbeiten — Edit-Button & Inline-Bereich ─────── */ +.wbf-edit-post-btn { + display: inline-flex; + align-items: center; + gap: .3rem; + background: none; + border: 1.5px solid var(--c-border); + border-radius: var(--radius-sm); + color: var(--c-muted); + font-size: .8rem; + padding: 3px 8px; + cursor: pointer; + transition: var(--transition); +} +.wbf-edit-post-btn:hover { + border-color: var(--c-primary); + color: var(--c-primary); + background: rgba(0,180,216,.07); +} + +/* ── Level-Badges ────────────────────────────────────────── */ +.wbf-level-badge { + display: inline-flex; + align-items: center; + gap: 4px; + font-size: .72rem; + font-weight: 700; + color: var(--lc, #94a3b8); + border: 1.5px solid var(--lc, #94a3b8); + background: rgba(148,163,184,.1); /* fallback */ + background: color-mix(in srgb, var(--lc, #94a3b8) 10%, transparent); + padding: 2px 8px; + border-radius: 20px; + white-space: nowrap; + letter-spacing: .02em; +} +.wbf-level-badge i { font-size: .68rem; } + +/* ── Level-Fortschrittsbalken (Profil-Sidebar) ───────────── */ +.wbf-level-progress { padding: 0; } +.wbf-level-progress__labels { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: .5rem; + gap: .5rem; +} +.wbf-level-progress__hint { + font-size: .68rem; + color: var(--c-muted); + text-align: right; + line-height: 1.3; +} +.wbf-level-progress__bar { + height: 5px; + background: rgba(255,255,255,.08); + border-radius: 99px; + overflow: hidden; +} +.wbf-level-progress__fill { + height: 100%; + border-radius: 99px; + transition: width .4s ease; + min-width: 4px; +} +.wbf-quote-btn { + display: inline-flex; + align-items: center; + gap: .3rem; + background: none; + border: 1.5px solid var(--c-border); + border-radius: var(--radius-sm); + color: var(--c-muted); + font-size: .8rem; + padding: 3px 8px; + cursor: pointer; + transition: var(--transition); +} +.wbf-quote-btn:hover { + border-color: var(--c-primary); + color: var(--c-primary); + background: rgba(0,180,216,.07); +} +.wbf-quote-btn:active, +.wbf-edit-post-btn:active { transform: scale(.92); } + +/* ── Profil-Layout responsive ───────────────────────────── */ +@media (max-width: 860px) { + .wbf-profile-layout { + grid-template-columns: 1fr; + } + .wbf-profile-sidebar { + flex-direction: row; + flex-wrap: wrap; + text-align: left; + } + .wbf-profile-sidebar__avatar-wrap { + padding: 1.25rem; + width: auto; + border-bottom: none; + border-right: 1px solid var(--c-border); + } + .wbf-profile-sidebar__identity { + align-items: flex-start; + flex: 1; + } + .wbf-profile-edit-grid { + grid-template-columns: 1fr; + } +} + +/* ════════════════════════════════════════════════════════════ + SUCHE — Topbar-Suchfeld + Dropdown + Ergebnisseite + ════════════════════════════════════════════════════════════ */ + +.wbf-search-form { + position: relative; + flex: 1; + max-width: 380px; + margin: 0 1rem; +} +.wbf-search-input-wrap { + position: relative; + display: flex; + align-items: center; +} +.wbf-search-icon { + position: absolute; + left: .75rem; + color: var(--c-muted); + font-size: .8rem; + pointer-events: none; +} +.wbf-search-form input { + width: 100%; + background: rgba(255,255,255,.06); + border: 1px solid rgba(255,255,255,.1); + border-radius: 20px; + color: #fff; + font-size: .85rem; + padding: .42rem .9rem .42rem 2.1rem; + outline: none; + transition: border-color .2s, background .2s; +} +.wbf-search-form input:focus { + border-color: var(--c-primary); + background: rgba(0,180,216,.07); +} +.wbf-search-form input::placeholder { color: var(--c-muted); } + +/* Live-Dropdown */ +.wbf-search-dropdown { + position: absolute; + top: calc(100% + 6px); + left: 0; right: 0; + background: var(--c-surface); + border: 1px solid var(--c-border); + border-radius: var(--radius); + box-shadow: 0 8px 24px rgba(0,0,0,.35); + z-index: 9999; + overflow: hidden; + max-height: 420px; + overflow-y: auto; +} +.wbf-search-dd-item { + display: flex; + flex-direction: column; + gap: .15rem; + padding: .7rem 1rem; + border-bottom: 1px solid rgba(255,255,255,.04); + text-decoration: none; + transition: background .15s; + cursor: pointer; +} +.wbf-search-dd-item:hover { background: rgba(0,180,216,.08); } +.wbf-search-dd-item:last-child { border-bottom: none; } +.wbf-search-dd-title { + font-size: .85rem; + font-weight: 600; + color: var(--c-primary); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.wbf-search-dd-meta { + display: flex; + gap: .6rem; + font-size: .72rem; + color: var(--c-muted); + flex-wrap: wrap; +} +.wbf-search-dd-preview { + font-size: .78rem; + color: var(--c-muted); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.wbf-search-dd-empty { + padding: 1rem; + text-align: center; + color: var(--c-muted); + font-size: .85rem; +} +.wbf-search-dd-footer { + padding: .55rem 1rem; + background: rgba(0,180,216,.06); + text-align: center; + font-size: .78rem; + color: var(--c-primary); + cursor: pointer; + border-top: 1px solid var(--c-border); +} +.wbf-search-dd-footer:hover { background: rgba(0,180,216,.12); } + +/* Ergebnisseite */ +.wbf-search-results { display: flex; flex-direction: column; gap: .75rem; } +.wbf-search-result-item { + background: var(--c-surface); + border: 1px solid var(--c-border); + border-radius: var(--radius); + padding: 1rem 1.25rem; + transition: border-color .15s; +} +.wbf-search-result-item:hover { border-color: rgba(0,180,216,.4); } +.wbf-search-result__meta { + display: flex; + align-items: center; + gap: .6rem; + margin-bottom: .4rem; + flex-wrap: wrap; + font-size: .75rem; + color: var(--c-muted); +} +.wbf-search-result__type { + display: inline-flex; + align-items: center; + gap: .25rem; + padding: 2px 8px; + border-radius: 3px; + font-weight: 600; + font-size: .7rem; +} +.wbf-search-result__type--thread { background: rgba(0,180,216,.12); color: var(--c-primary); } +.wbf-search-result__type--post { background: rgba(148,163,184,.1); color: var(--c-muted); } +.wbf-search-result__author { display: flex; align-items: center; gap: .3rem; } +.wbf-search-result__author img { border-radius: 50%; } +.wbf-search-result__title { + display: block; + font-size: .95rem; + font-weight: 700; + color: #e2e8f0; + text-decoration: none; + margin-bottom: .3rem; +} +.wbf-search-result__title:hover { color: var(--c-primary); } +.wbf-search-result__preview { + margin: 0; + font-size: .83rem; + color: var(--c-muted); + line-height: 1.5; +} + +/* ════════════════════════════════════════════════════════════ + BENACHRICHTIGUNGEN — Glocke + Dropdown + ════════════════════════════════════════════════════════════ */ + +.wbf-notif-wrap { + position: relative; +} +.wbf-notif-btn { + position: relative; + background: none; + border: 1px solid rgba(255,255,255,.12); + border-radius: 50%; + width: 34px; height: 34px; + display: flex; align-items: center; justify-content: center; + color: var(--c-muted); + cursor: pointer; + transition: border-color .2s, color .2s; + font-size: .9rem; +} +.wbf-notif-btn:hover { + border-color: var(--c-primary); + color: var(--c-primary); +} +.wbf-notif-badge { + position: absolute; + top: -4px; right: -4px; + background: var(--c-danger); + color: #fff; + font-size: .6rem; + font-weight: 700; + min-width: 16px; height: 16px; + border-radius: 8px; + display: flex; align-items: center; justify-content: center; + padding: 0 3px; + border: 2px solid var(--c-bg); +} +.wbf-notif-dropdown { + position: absolute; + top: calc(100% + 8px); + right: 0; + width: 340px; + background: var(--c-surface); + border: 1px solid var(--c-border); + border-radius: var(--radius); + box-shadow: 0 8px 28px rgba(0,0,0,.4); + z-index: 9999; + overflow: hidden; +} +.wbf-notif-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: .75rem 1rem; + border-bottom: 1px solid var(--c-border); + font-size: .85rem; + font-weight: 600; + color: #e2e8f0; +} +.wbf-notif-mark-read { + background: none; + border: none; + color: var(--c-primary); + font-size: .75rem; + cursor: pointer; + padding: 0; +} +.wbf-notif-mark-read:hover { text-decoration: underline; } +.wbf-notif-list { max-height: 380px; overflow-y: auto; } +.wbf-notif-loading { + padding: 1.5rem; + text-align: center; + color: var(--c-muted); +} +.wbf-notif-item { + display: flex; + gap: .75rem; + padding: .75rem 1rem; + border-bottom: 1px solid rgba(255,255,255,.04); + text-decoration: none; + transition: background .15s; + align-items: flex-start; + cursor: pointer; +} +.wbf-notif-item:hover { background: rgba(0,180,216,.06); } +.wbf-notif-item:last-child { border-bottom: none; } +.wbf-notif-item--unread { background: rgba(0,180,216,.05); } +.wbf-notif-item--unread .wbf-notif-item__text { color: #e2e8f0; } +.wbf-notif-item__avatar img { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; } +.wbf-notif-item__body { flex: 1; min-width: 0; } +.wbf-notif-item__text { + font-size: .82rem; + color: var(--c-muted); + line-height: 1.4; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.wbf-notif-item__text strong { color: var(--c-primary); } +.wbf-notif-item__time { + font-size: .7rem; + color: var(--c-muted); + margin-top: .15rem; +} +.wbf-notif-dot { + width: 7px; height: 7px; + border-radius: 50%; + background: var(--c-primary); + flex-shrink: 0; + margin-top: 5px; +} +.wbf-notif-empty { + padding: 2rem 1rem; + text-align: center; + color: var(--c-muted); + font-size: .85rem; +} + +@media (max-width: 640px) { + .wbf-search-form { max-width: 140px; margin: 0 .5rem; } + .wbf-notif-dropdown { width: 290px; right: -60px; } +} +/* ══════════════════════════════════════════════════════════ + REAKTIONEN + ══════════════════════════════════════════════════════════ */ +.wbf-reaction-bar { + display: flex; + align-items: center; + gap: .4rem; + flex-wrap: wrap; + margin-top: .35rem; +} +.wbf-reaction-summary { display: flex; gap: .3rem; flex-wrap: wrap; } +.wbf-reaction-pill { + display: inline-flex; + align-items: center; + gap: 3px; + padding: 2px 8px; + background: rgba(255,255,255,.06); + border: 1.5px solid var(--c-border); + border-radius: 20px; + font-size: .85rem; + cursor: pointer; + transition: background .12s, border-color .12s; + color: var(--c-text-dim); + line-height: 1.4; +} +.wbf-reaction-pill span { font-size: .72rem; font-weight: 700; } +.wbf-reaction-pill:hover, +.wbf-reaction-pill.wbf-reaction-active { + background: rgba(0,180,216,.1); + border-color: var(--c-primary); +} +.wbf-reaction-wrap { position: relative; } +.wbf-reaction-trigger { + display: inline-flex; + align-items: center; + gap: 3px; + padding: 2px 8px; + background: transparent; + border: 1.5px solid var(--c-border); + border-radius: 20px; + font-size: .82rem; + cursor: pointer; + color: var(--c-muted); + transition: border-color .12s, background .12s; + line-height: 1.4; +} +.wbf-reaction-trigger:hover { + border-color: var(--c-primary); + background: rgba(0,180,216,.07); +} +.wbf-reaction-picker { + position: absolute; + bottom: calc(100% + 6px); + left: 0; + z-index: 600; + display: none; + background: var(--c-surface); + border: 1.5px solid var(--c-border-d); + border-radius: 30px; + padding: 5px 8px; + box-shadow: var(--shadow-md); + display: none; + gap: 2px; + animation: wbfFadeIn .12s ease; +} +.wbf-reaction-picker[style*="display: block"], +.wbf-reaction-picker:not([style*="display: none"]) { + display: flex; +} +.wbf-reaction-btn { + background: none; + border: 2px solid transparent; + border-radius: 50%; + width: 34px; height: 34px; + font-size: 1.15rem; + cursor: pointer; + transition: transform .12s, background .1s; + display: flex; align-items: center; justify-content: center; +} +.wbf-reaction-btn:hover { transform: scale(1.3); background: rgba(255,255,255,.08); } +.wbf-reaction-btn.wbf-reaction-active { background: rgba(0,180,216,.12); border-color: var(--c-primary); } + +/* ══════════════════════════════════════════════════════════ + ONLINE-STATUS + ══════════════════════════════════════════════════════════ */ +.wbf-avatar-wrap { position: relative; display: inline-block; } +.wbf-online-dot { + position: absolute; + bottom: 1px; right: 1px; + width: 10px; height: 10px; + background: #22c55e; + border: 2px solid var(--c-surface, #1e2736); + border-radius: 50%; +} +.wbf-profile-sidebar__avatar-wrap .wbf-online-dot { + width: 14px; height: 14px; + bottom: 4px; right: 4px; +} + +/* ══════════════════════════════════════════════════════════ + @ERWÄHNUNGEN + ══════════════════════════════════════════════════════════ */ +.wbf-mention { + color: var(--c-primary); + font-weight: 600; + text-decoration: none; + background: rgba(0,180,216,.08); + border-radius: 4px; + padding: 0 3px; +} +.wbf-mention:hover { background: rgba(0,180,216,.18); } +.wbf-mention-dropdown { + position: absolute; + bottom: calc(100% + 4px); + left: 0; + z-index: 700; + background: var(--c-surface); + border: 1.5px solid var(--c-border-d); + border-radius: var(--radius); + box-shadow: var(--shadow-md); + overflow: hidden; + min-width: 220px; + animation: wbfFadeIn .12s ease; +} +.wbf-mention-item { + display: flex; + align-items: center; + gap: .5rem; + padding: .45rem .85rem; + cursor: pointer; + font-size: .84rem; + color: var(--c-text-dim); + transition: background .1s; +} +.wbf-mention-item:hover { background: rgba(255,255,255,.06); color: var(--c-text); } +.wbf-mention-item small { color: var(--c-muted); font-size: .73rem; margin-left: auto; } + +/* ══════════════════════════════════════════════════════════ + PRIVATE NACHRICHTEN (DM) + ══════════════════════════════════════════════════════════ */ +.wbf-dm-layout { + display: grid; + grid-template-columns: 280px 1fr; + gap: 0; + background: var(--c-surface); + border: 1px solid var(--c-border); + border-radius: var(--radius); + overflow: hidden; + min-height: 580px; +} +/* Sidebar */ +.wbf-dm-sidebar { + border-right: 1px solid var(--c-border); + display: flex; + flex-direction: column; +} +.wbf-dm-sidebar__header { + display: flex; + align-items: center; + justify-content: space-between; + padding: .9rem 1rem; + border-bottom: 1px solid var(--c-border); + background: rgba(255,255,255,.02); + font-size: .82rem; + font-weight: 700; + color: var(--c-text-dim); + text-transform: uppercase; + letter-spacing: .06em; +} +.wbf-dm-sidebar__header i { color: var(--c-primary); } +.wbf-dm-close-btn { + display: inline-flex; + align-items: center; + justify-content: center; + width: 28px; + height: 28px; + border-radius: 50%; + color: var(--c-muted); + text-decoration: none; + font-size: .95rem; + transition: background .15s, color .15s; +} +.wbf-dm-close-btn:hover { + background: rgba(240,82,82,.15); + color: #f05252; +} +.wbf-dm-inbox { flex: 1; overflow-y: auto; } +.wbf-dm-inbox-item { + display: flex; + align-items: center; + gap: .65rem; + padding: .75rem 1rem; + border-bottom: 1px solid var(--c-border); + text-decoration: none; + color: var(--c-text-dim); + transition: background .12s; +} +.wbf-dm-inbox-item:hover { background: rgba(255,255,255,.04); } +.wbf-dm-inbox-item--unread { background: rgba(0,180,216,.05); } +.wbf-dm-inbox-item--unread .wbf-dm-inbox-item__name { color: var(--c-text); font-weight: 700; } +.wbf-dm-inbox-item__avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; } +.wbf-dm-inbox-item__body { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; } +.wbf-dm-inbox-item__name { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.wbf-dm-inbox-item__badge { + flex-shrink: 0; + background: #22c55e; + color: #fff; + font-size: .68rem; + font-weight: 700; + padding: 1px 6px; + border-radius: 20px; +} +/* Main conversation area */ +.wbf-dm-main { display: flex; flex-direction: column; } +.wbf-dm-header { + display: flex; + align-items: center; + gap: .65rem; + padding: .75rem 1.1rem; + border-bottom: 1px solid var(--c-border); + background: rgba(255,255,255,.02); + font-weight: 600; + font-size: .9rem; + color: var(--c-text); +} +.wbf-dm-back-btn { + display: inline-flex; + align-items: center; + justify-content: center; + width: 30px; + height: 30px; + border-radius: 50%; + color: var(--c-muted); + text-decoration: none; + flex-shrink: 0; + transition: background .15s, color .15s; +} +.wbf-dm-back-btn:hover { + background: rgba(255,255,255,.08); + color: var(--c-text); +} +.wbf-dm-messages { + flex: 1; + overflow-y: auto; + padding: 1rem 1.1rem; + display: flex; + flex-direction: column; + gap: .5rem; + max-height: 440px; +} +.wbf-dm-no-msgs { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100%; + color: var(--c-muted); + font-size: .9rem; + gap: .5rem; + padding: 2rem 0; +} +.wbf-dm-no-msgs i { font-size: 2rem; opacity: .4; } +.wbf-dm-msg { display: flex; align-items: flex-end; gap: .5rem; } +.wbf-dm-msg--out { flex-direction: row-reverse; } +.wbf-dm-msg__avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; } +.wbf-dm-msg__bubble { max-width: 70%; } +.wbf-dm-msg__text { + padding: .55rem .85rem; + border-radius: 16px; + font-size: .875rem; + line-height: 1.5; + word-break: break-word; +} +.wbf-dm-msg--in .wbf-dm-msg__text { background: rgba(255,255,255,.07); border-bottom-left-radius: 4px; color: var(--c-text); } +.wbf-dm-msg--out .wbf-dm-msg__text { background: var(--c-primary); color: #fff; border-bottom-right-radius: 4px; } +.wbf-dm-msg__time { font-size: .68rem; color: var(--c-muted); margin-top: 3px; padding: 0 4px; display: flex; align-items: center; gap: 6px; } +.wbf-dm-msg--out .wbf-dm-msg__time { justify-content: flex-end; } +.wbf-dm-msg__del { + background: none; border: none; cursor: pointer; padding: 0; + color: var(--c-muted); font-size: .65rem; opacity: 0; + transition: opacity .15s, color .15s; line-height: 1; +} +.wbf-dm-msg:hover .wbf-dm-msg__del { opacity: 1; } +.wbf-dm-msg__del:hover { color: #f05252; } +.wbf-dm-compose { + display: flex; + gap: .65rem; + padding: .85rem 1rem; + border-top: 1px solid var(--c-border); + background: rgba(255,255,255,.02); + align-items: flex-end; +} +.wbf-dm-compose textarea { + flex: 1; + resize: none; + background: var(--c-surface2); + border: 1.5px solid var(--c-border); + border-radius: var(--radius-sm); + color: var(--c-text); + font-family: inherit; + font-size: .875rem; + padding: .5rem .75rem; + min-height: 42px; + max-height: 120px; + transition: border-color .15s; +} +.wbf-dm-compose textarea:focus { border-color: var(--c-primary); outline: none; } +.wbf-dm-empty { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + color: var(--c-muted); + gap: .75rem; + padding: 2rem; +} +.wbf-dm-empty i { font-size: 3rem; opacity: .25; } +.wbf-dm-empty p { font-size: .9rem; text-align: center; margin: 0; } +.wbf-dm-conversation { display: flex; flex-direction: column; height: 100%; } + +@media (max-width: 680px) { + .wbf-dm-layout { grid-template-columns: 1fr; } + .wbf-dm-sidebar { border-right: none; border-bottom: 1px solid var(--c-border); max-height: 220px; } +} +/* ════════════════════════════════════════════════════════════ + FEHLENDE KLASSEN — KOMPLETTER NACHTRAG + ════════════════════════════════════════════════════════════ */ + +/* ── Layout ─────────────────────────────────────────────────── */ +.wbf-main { min-width: 0; } +.wbf-thread-row__avatar { flex-shrink: 0; } +.wbf-reply-form__avatar { flex-shrink: 0; margin-top: .2rem; } + +/* ── Auth-Links im Forum-Text ───────────────────────────────── */ +.wbf-login-link, +.wbf-register-link { color: var(--c-primary); font-weight: 600; } +.wbf-login-link:hover, +.wbf-register-link:hover { color: var(--c-accent); } + +/* ── Like-Count ─────────────────────────────────────────────── */ +.wbf-like-count { font-variant-numeric: tabular-nums; min-width: 1ch; display: inline-block; } + +/* ── DM-Button ──────────────────────────────────────────────── */ +.wbf-dm-btn { + display: inline-flex; align-items: center; gap: .4rem; + padding: .4rem .9rem; border-radius: var(--radius-sm); + background: var(--c-primary-l); color: var(--c-primary); + border: 1.5px solid rgba(0,180,216,.25); + font-size: .82rem; font-weight: 600; cursor: pointer; + font-family: inherit; transition: var(--transition); +} +.wbf-dm-btn:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); } + +/* ── Toolbar Dropdown (BBCode-Editor) ───────────────────────── */ +.wbf-tb-dropdown { + position: absolute; z-index: 200; + background: var(--c-surface); + border: 1px solid var(--c-border-d); + border-radius: var(--radius-sm); + box-shadow: var(--shadow-md); + padding: .5rem; + display: none; + min-width: 140px; +} +.wbf-tb-dropdown.open { display: block; } +.wbf-tb-dropdown button { + display: block; width: 100%; text-align: left; + padding: .4rem .7rem; border: none; background: none; + color: var(--c-text-dim); font-size: .8rem; cursor: pointer; + border-radius: 4px; font-family: inherit; +} +.wbf-tb-dropdown button:hover { background: var(--c-surface2); color: var(--c-text); } +.wbf-color-panel-wrap, +.wbf-size-panel-wrap { position: relative; display: inline-block; } + +/* ── Post bearbeiten ────────────────────────────────────────── */ +.wbf-post__edit-wrap { + margin-top: .75rem; + display: none; +} +.wbf-post__edit-wrap.active { display: block; } +.wbf-edit-textarea { + width: 100%; + background: var(--c-bg2); + border: 1.5px solid var(--c-border-d); + border-radius: var(--radius-sm); + padding: .75rem; + font-family: inherit; font-size: .88rem; + color: var(--c-text); + resize: vertical; min-height: 80px; + transition: var(--transition); +} +.wbf-edit-textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(0,180,216,.1); } + +.wbf-save-edit-btn, +.wbf-cancel-edit-btn, +.wbf-save-thread-btn, +.wbf-cancel-thread-btn { + padding: .35rem .85rem; border-radius: var(--radius-sm); + font-size: .8rem; font-weight: 600; cursor: pointer; + font-family: inherit; border: 1.5px solid transparent; + transition: var(--transition); +} +.wbf-save-edit-btn, +.wbf-save-thread-btn { + background: var(--c-primary); color: #fff; + border-color: var(--c-primary); +} +.wbf-save-edit-btn:hover, +.wbf-save-thread-btn:hover { background: var(--c-primary-d); } +.wbf-cancel-edit-btn, +.wbf-cancel-thread-btn { + background: var(--c-surface2); color: var(--c-text-dim); + border-color: var(--c-border-d); +} +.wbf-cancel-edit-btn:hover, +.wbf-cancel-thread-btn:hover { border-color: var(--c-danger); color: var(--c-danger); } + +.wbf-edit-msg { + font-size: .75rem; font-style: italic; + color: var(--c-muted); margin-left: .5rem; +} + +/* ── Post-Content / Thread-Content (dynamische IDs) ─────────── */ +[class^="wbf-post-content-"], +[class^="wbf-thread-content-"] { transition: opacity .2s; } +[class^="wbf-post-edit-"], +[class^="wbf-thread-edit-"] { margin-top: .5rem; } + +/* ── Thread bearbeiten ──────────────────────────────────────── */ +.wbf-edit-thread-btn { + background: none; border: 1.5px solid var(--c-border-d); + border-radius: var(--radius-sm); padding: .3rem .7rem; + font-size: .78rem; font-weight: 600; color: var(--c-text-dim); + cursor: pointer; font-family: inherit; display: inline-flex; + align-items: center; gap: .35rem; transition: var(--transition); +} +.wbf-edit-thread-btn:hover { border-color: var(--c-primary); color: var(--c-primary); } + +/* ── Suche: Result-Karten ───────────────────────────────────── */ +.wbf-search-result__cat { + font-size: .72rem; color: var(--c-primary); + display: inline-flex; align-items: center; gap: .3rem; + background: var(--c-primary-l); + padding: .1rem .5rem; border-radius: 4px; +} +.wbf-search-result__date { + font-size: .72rem; color: var(--c-muted); + display: flex; align-items: center; gap: .3rem; +} + +/* ── Bild-Upload im Post ────────────────────────────────────── */ +.wbf-img-file-input { display: none; } + + +/* ════════════════════════════════════════════════════════════ + MITGLIEDER-LISTE + ════════════════════════════════════════════════════════════ */ + +/* Stat-Zahl als klickbarer Link */ +.wbf-stat__num--link { + cursor: pointer; + transition: var(--transition); +} +.wbf-stat__num--link:hover { + text-shadow: 0 0 24px rgba(0,180,216,.8); + opacity: .85; +} + +/* Filter-Leiste */ +.wbf-members-filter { + display: flex; align-items: center; gap: .6rem; + flex-wrap: wrap; margin-bottom: 1.5rem; +} +.wbf-members-search { + flex: 1; min-width: 180px; + background: var(--c-bg2); + border: 1.5px solid var(--c-border-d); + border-radius: var(--radius-sm); + padding: .55rem .85rem; + font-family: inherit; font-size: .875rem; + color: var(--c-text); + transition: var(--transition); +} +.wbf-members-search:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(0,180,216,.1); } +.wbf-members-search::placeholder { color: var(--c-muted); } +.wbf-members-sort { + background: var(--c-bg2); + border: 1.5px solid var(--c-border-d); + border-radius: var(--radius-sm); + padding: .55rem .75rem; + font-family: inherit; font-size: .82rem; + color: var(--c-text); + cursor: pointer; +} +.wbf-members-sort option { background: var(--c-surface2); } + +/* Mitglieder-Grid */ +.wbf-members-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); + gap: 1rem; +} + +/* Mitglieder-Karte */ +.wbf-member-card { + background: var(--c-surface); + border: 1px solid var(--c-border); + border-radius: var(--radius); + padding: 1.25rem 1rem; + text-align: center; + text-decoration: none; + display: flex; flex-direction: column; align-items: center; gap: .4rem; + transition: var(--transition); + box-shadow: var(--shadow-sm); + position: relative; +} +.wbf-member-card:hover { + border-color: rgba(0,180,216,.4); + transform: translateY(-2px); + box-shadow: var(--shadow-md); + text-decoration: none; +} + +/* Avatar + Online-Dot */ +.wbf-member-card__avatar-wrap { + position: relative; display: inline-block; margin-bottom: .25rem; +} +.wbf-member-card__avatar-wrap .wbf-avatar { width: 64px; height: 64px; } +.wbf-member-card__online-dot { + position: absolute; bottom: 2px; right: 2px; + width: 12px; height: 12px; border-radius: 50%; + background: var(--c-success); + border: 2px solid var(--c-surface); + box-shadow: 0 0 6px rgba(86,207,126,.5); +} + +.wbf-member-card__name { + font-size: .9rem; font-weight: 700; color: var(--c-text); + line-height: 1.3; word-break: break-word; +} +.wbf-member-card__username { + font-size: .75rem; color: var(--c-muted); +} +.wbf-member-card__badge { margin: .15rem 0; } +.wbf-member-card__stats { + display: flex; gap: .75rem; font-size: .72rem; color: var(--c-muted); + margin-top: .2rem; +} +.wbf-member-card__stats span { display: flex; align-items: center; gap: .25rem; } + +@media (max-width: 480px) { + .wbf-members-grid { grid-template-columns: repeat(2, 1fr); } +} \ No newline at end of file diff --git a/assets/js/forum-script.js b/assets/js/forum-script.js new file mode 100644 index 0000000..444e768 --- /dev/null +++ b/assets/js/forum-script.js @@ -0,0 +1,1570 @@ +(function ($) { + 'use strict'; + + /* ── Utilities ──────────────────────────────────────────────── */ + function wbfPost(action, data, cb, errCb) { + data.action = action; + data.nonce = WBF.nonce; + $.post(WBF.ajax_url, data, function (res) { + if (res.success) cb(res.data); + else if (errCb) errCb(res.data); + }); + } + + function showMsg($el, msg, ok) { + $el.text(msg).css('color', ok ? '#56cf7e' : '#f05252').show(); + setTimeout(function () { $el.fadeOut(); }, 4000); + } + + /* ── Auth Tabs ──────────────────────────────────────────────── */ + $(document).on('click', '.wbf-auth-tab', function () { + var tab = $(this).data('tab'); + $('.wbf-auth-tab').removeClass('active'); + $(this).addClass('active'); + $('.wbf-auth-panel').removeClass('active'); + $('[data-panel="' + tab + '"]').addClass('active'); + }); + + /* ── Auth Modal öffnen ──────────────────────────────────────── */ + $(document).on('click', '#wbfOpenLogin, .wbf-login-link', function (e) { + e.preventDefault(); + $('[data-tab="login"]').trigger('click'); + $('#wbfAuthModal').addClass('active'); + }); + $(document).on('click', '#wbfOpenRegister, .wbf-register-link', function (e) { + e.preventDefault(); + $('[data-tab="register"]').trigger('click'); + $('#wbfAuthModal').addClass('active'); + }); + + /* ── Modal schließen bei Klick außerhalb ────────────────────── */ + $(document).on('click', '.wbf-modal', function (e) { + if ($(e.target).hasClass('wbf-modal')) $(this).removeClass('active'); + }); + + /* ── Login ──────────────────────────────────────────────────── */ + $(document).on('keydown', '.wbf-field-password', function (e) { + if (e.key === 'Enter') $(this).closest('.wbf-auth-box').find('.wbf-login-submit-btn').trigger('click'); + }); + + /* ── Registrieren ───────────────────────────────────────────── */ + $(document).on('click', '.wbf-reg-submit-btn', function () { + var $btn = $(this).prop('disabled', true).html(''); + wbfPost('wbf_register', { + username: $(this).closest('.wbf-auth-box').find('.wbf-field-reg-user').val(), + display_name: $(this).closest('.wbf-auth-box').find('.wbf-field-reg-name').val(), + email: $(this).closest('.wbf-auth-box').find('.wbf-field-reg-email').val(), + password: $(this).closest('.wbf-auth-box').find('.wbf-field-reg-pass').val() + }, function () { + location.reload(); + }, function (d) { + showMsg($btn.closest('.wbf-auth-box').find('.wbf-reg-msg'), d.message || 'Fehler', false); + $btn.prop('disabled', false).html(' Konto erstellen'); + }); + }); + + /* ── Logout — direkt via Link (?wbf_do_logout=1) ───────────── */ + // Kein JS nötig — Logout-Button ist jetzt ein Link + + /* ── Neuer Thread Modal ─────────────────────────────────────── */ + window.wbfShowNewThread = function (catId) { + if (WBF.logged_in !== 'yes') { + $('#wbfAuthModal').addClass('active'); + return; + } + if (catId) $('#wbfThreadCat').val(catId); + $('#wbfNewThreadModal').addClass('active'); + }; + + $(document).on('click', '#wbfSubmitThread', function () { + var $btn = $(this).prop('disabled', true).html(''); + wbfPost('wbf_new_thread', { + category_id: $('#wbfThreadCat').val(), + title: $('#wbfThreadTitle').val(), + content: $('#wbfThreadContent').val(), + tags: $('#wbfThreadTags').val() + }, function (d) { + var base = WBF.forum_url || window.location.href.split('?')[0]; + var sep = base.indexOf('?') !== -1 ? '&' : '?'; + window.location.href = base + sep + 'forum_thread=' + d.thread_id; + }, function (d) { + showMsg($('#wbfThreadMsg'), d.message || 'Fehler', false); + $btn.prop('disabled', false).html(' Thread erstellen'); + }); + }); + + /* ══════════════════════════════════════════════════════════ + FEATURE: Tag-Input Widget + ══════════════════════════════════════════════════════════ */ + + var wbfTagList = []; // aktuell ausgewählte Tags + var wbfTagTimer = null; + + function wbfUpdateTagHidden() { + $('#wbfThreadTags').val(wbfTagList.join(', ')); + } + + function wbfAddTag(name) { + name = name.replace(/^#+/, '').trim().toLowerCase(); + if (!name || name.length < 2 || name.length > 30) return; + if (wbfTagList.length >= 10) { return; } + if (wbfTagList.indexOf(name) !== -1) return; + wbfTagList.push(name); + wbfUpdateTagHidden(); + wbfRenderTagPills(); + $('#wbfTagInput').val(''); + $('#wbfTagSuggest').hide().empty(); + } + + function wbfRemoveTag(name) { + wbfTagList = wbfTagList.filter(function(t){ return t !== name; }); + wbfUpdateTagHidden(); + wbfRenderTagPills(); + } + + function wbfRenderTagPills() { + var $pills = $('#wbfTagPills'); + $pills.empty(); + wbfTagList.forEach(function(tag) { + $pills.append( + $('') + .text('#' + tag) + .append($('').on('click', function(){ wbfRemoveTag(tag); })) + ); + }); + // Show/hide count hint + var remaining = 10 - wbfTagList.length; + if (remaining <= 3 && remaining > 0) { + $pills.append('' + remaining + ' übrig'); + } + } + + // Keydown on tag input + $(document).on('keydown', '#wbfTagInput', function(e) { + var val = $(this).val().trim(); + if (e.key === 'Enter' || e.key === ',' || e.key === ' ') { + e.preventDefault(); + if (val) wbfAddTag(val); + } else if (e.key === 'Backspace' && !val && wbfTagList.length) { + wbfRemoveTag(wbfTagList[wbfTagList.length - 1]); + } + }); + + // Autocomplete on input + $(document).on('input', '#wbfTagInput', function() { + var q = $(this).val().replace(/^#+/, '').trim(); + clearTimeout(wbfTagTimer); + if (q.length < 1) { $('#wbfTagSuggest').hide().empty(); return; } + wbfTagTimer = setTimeout(function() { + wbfPost('wbf_tag_suggest', { q: q }, function(d) { + var $s = $('#wbfTagSuggest'); + if (!d.tags || !d.tags.length) { $s.hide().empty(); return; } + $s.empty(); + d.tags.forEach(function(tag) { + if (wbfTagList.indexOf(tag.slug) !== -1) return; + $s.append( + $('
') + .html('' + $('').text(tag.name).html() + + '' + tag.use_count + '') + .on('click', function(){ wbfAddTag(tag.name); }) + ); + }); + $s.show(); + }); + }, 200); + }); + + // Click on tag input wrap focuses input + $(document).on('click', '#wbfTagInputWrap', function(e) { + if (!$(e.target).is('button')) $('#wbfTagInput').focus(); + }); + + // Reset tags when modal closes + $(document).on('click', '#wbfNewThreadModal .wbf-modal__close, #wbfNewThreadModal', function(e) { + if ($(e.target).hasClass('wbf-modal') || $(e.target).hasClass('wbf-modal__close')) { + wbfTagList = []; + wbfRenderTagPills(); + $('#wbfTagInput').val(''); + $('#wbfTagSuggest').hide(); + } + }); + + // Hide suggest on outside click + $(document).on('click', function(e) { + if (!$(e.target).closest('#wbfTagInputWrap').length) { + $('#wbfTagSuggest').hide(); + } + }); + + /* ── Antwort senden ─────────────────────────────────────────── */ + $(document).on('input', '#wbfReplyContent', function () { + $('#wbfReplyCounter').text($(this).val().length + ' Zeichen'); + }); + + $(document).on('click', '#wbfSubmitReply', function () { + var $btn = $(this).prop('disabled', true).html(''); + var threadId = $(this).data('thread'); + wbfPost('wbf_new_post', { + thread_id: threadId, + content: $('#wbfReplyContent').val() + }, function (d) { + $('#wbfPosts').append(d.html); + $('#wbfReplyContent').val(''); + $('#wbfReplyCounter').text('0 Zeichen'); + $btn.prop('disabled', false).html(' Antwort senden'); + $('html, body').animate({ scrollTop: $('#post-' + d.post_id).offset().top - 80 }, 400); + $(document).trigger('wbf:post_added', [d.post_id]); + }, function (d) { + alert(d.message || 'Fehler beim Senden.'); + $btn.prop('disabled', false).html(' Antwort senden'); + }); + }); + + /* ── Like ───────────────────────────────────────────────────── */ + $(document).on('click', '.wbf-like-btn', function () { + if (WBF.logged_in !== 'yes') { + $('#wbfAuthModal').addClass('active'); + return; + } + var $btn = $(this); + wbfPost('wbf_toggle_like', { + object_id: $btn.data('id'), + object_type: $btn.data('type') + }, function (d) { + $btn.find('.wbf-like-count').text(d.count); + $btn.toggleClass('wbf-liked', d.action === 'liked'); + }); + }); + + /* ── Mod-Aktionen ───────────────────────────────────────────── */ + $(document).on('click', '.wbf-mod-btn', function () { + var action = $(this).data('action'); + var id = $(this).data('id'); + var $btn = $(this); + + // Move modal — open inline, no AJAX yet + if (action === 'open_move') { + $('#wbfMoveThreadId').val(id); + $('#wbfMoveMsg').hide(); + $('#wbfMoveModal').addClass('active'); + return; + } + + var confirmMsgs = { + 'delete_thread': 'Thread wirklich löschen? Alle Antworten werden entfernt.', + 'delete_post': 'Post wirklich löschen?', + 'archive_thread': 'Thread archivieren? Er wird aus der Kategorie ausgeblendet.' + }; + if (confirmMsgs[action] && !confirm(confirmMsgs[action])) return; + + $btn.prop('disabled', true).css('opacity', '.5'); + + wbfPost('wbf_mod_action', { + mod_action: action, + object_id: id + }, function (d) { + if (d.action === 'deleted') { + window.location.href = window.location.pathname; + } else if (d.action === 'archived') { + // Redirect back — page.reload keeps the archived thread visible until refresh + history.back(); + } else if (d.action === 'post_deleted') { + $('#post-' + id).fadeOut(300, function () { $(this).remove(); }); + } else { + location.reload(); + } + }, function (d) { + alert(d.message || 'Aktion fehlgeschlagen.'); + $btn.prop('disabled', false).css('opacity', '1'); + }); + }); + + /* ── Thread verschieben ─────────────────────────────────────── */ + $(document).on('click', '#wbfSubmitMove', function () { + var $btn = $(this).prop('disabled', true).html(''); + var threadId = $('#wbfMoveThreadId').val(); + var catId = $('#wbfMoveCatSelect').val(); + + wbfPost('wbf_move_thread', { + thread_id: threadId, + category_id: catId + }, function (d) { + showMsg($('#wbfMoveMsg'), '✔ ' + (d.message || 'Verschoben!'), true); + $btn.prop('disabled', false).html(' Verschieben'); + setTimeout(function () { + $('#wbfMoveModal').removeClass('active'); + location.reload(); + }, 1200); + }, function (d) { + showMsg($('#wbfMoveMsg'), d.message || 'Fehler.', false); + $btn.prop('disabled', false).html(' Verschieben'); + }); + }); + + /* ── Profil speichern ───────────────────────────────────────── */ + $(document).on('click', '#wbfSaveProfile', function () { + var $btn = $(this).prop('disabled', true); + wbfPost('wbf_update_profile', { + display_name: $('#wbfEditName').val(), + bio: $('#wbfEditBio').val(), + signature: $('#wbfEditSignature').val(), + new_password: $('#wbfNewPassword').val() + }, function (d) { + showMsg($('#wbfProfileMsg'), d.message, true); + $btn.prop('disabled', false); + }, function (d) { + showMsg($('#wbfProfileMsg'), d.message || 'Fehler', false); + $btn.prop('disabled', false); + }); + }); + + /* ── Signatur Zeichenzähler ─────────────────────────────────── */ + $(document).on('input', '#wbfEditSignature', function () { + $('#wbfSigCount').text($(this).val().length); + }); + + /* ── Avatar Upload ──────────────────────────────────────────── */ + $(document).on('change', '#wbfAvatarFile', function () { + var file = this.files[0]; + if (!file) return; + var fd = new FormData(); + fd.append('action', 'wbf_upload_avatar'); + fd.append('nonce', WBF.nonce); + fd.append('avatar', file); + $.ajax({ + url: WBF.ajax_url, + type: 'POST', + data: fd, + processData: false, + contentType: false, + success: function (res) { + if (res.success) { + $('.wbf-profile-page__avatar').attr('src', res.data.avatar_url); + } + } + }); + }); + + /* ══════════════════════════════════════════════════════════ + FEATURE: Ungelesene Beiträge + ══════════════════════════════════════════════════════════ */ + + var WBF_STORAGE_KEY = 'wbf_last_seen'; + + function wbfGetLastSeen() { + try { return JSON.parse(localStorage.getItem(WBF_STORAGE_KEY) || '{}'); } catch (e) { return {}; } + } + function wbfSetLastSeen(data) { + try { localStorage.setItem(WBF_STORAGE_KEY, JSON.stringify(data)); } catch (e) {} + } + + function wbfMarkNewThreads() { + var lastSeen = wbfGetLastSeen(); + $('.wbf-thread-row[data-thread-id]').each(function () { + var $row = $(this); + var threadId = $row.data('thread-id').toString(); + var lastReply = $row.data('last-reply'); + if (!lastReply) return; + var seenAt = lastSeen[threadId]; + var isNew = !seenAt || new Date(lastReply) > new Date(seenAt); + if (isNew) { + $row.addClass('wbf-thread-row--has-new'); + $row.find('.wbf-new-badge').show(); + } + }); + } + + function wbfMarkNewPosts() { + var $container = $('[data-thread-view]'); + if (!$container.length) return; + var threadId = $container.data('thread-view').toString(); + var lastSeen = wbfGetLastSeen(); + var seenAt = lastSeen[threadId]; + $('.wbf-post[data-created]').each(function () { + var created = $(this).data('created'); + if (!created) return; + if (seenAt && new Date(created) > new Date(seenAt)) { + $(this).addClass('wbf-post--new'); + } + }); + lastSeen[threadId] = new Date().toISOString(); + wbfSetLastSeen(lastSeen); + } + + $(function () { + wbfMarkNewThreads(); + wbfMarkNewPosts(); + }); + + $(document).on('wbf:post_added', function (e, postId) { + $('#post-' + postId).addClass('wbf-post--new'); + var $container = $('[data-thread-view]'); + if (!$container.length) return; + var threadId = $container.data('thread-view').toString(); + var lastSeen = wbfGetLastSeen(); + lastSeen[threadId] = new Date().toISOString(); + wbfSetLastSeen(lastSeen); + }); + + /* ══════════════════════════════════════════════════════════ + FEATURE: Editor-Toolbar — Bold, Italic, Bild, Smilies + ══════════════════════════════════════════════════════════ */ + + function wbfInsertAtCursor($ta, text) { + var el = $ta[0]; + var start = el.selectionStart; + var end = el.selectionEnd; + var val = el.value; + el.value = val.slice(0, start) + text + val.slice(end); + el.selectionStart = el.selectionEnd = start + text.length; + $ta.trigger('input'); + el.focus(); + } + + function wbfWrapSelection($ta, before, after) { + var el = $ta[0]; + var sel = el.value.slice(el.selectionStart, el.selectionEnd) || 'Text'; + wbfInsertAtCursor($ta, before + sel + after); + } + + function wbfGetTargetTextarea($toolbar) { + return $('#' + $toolbar.data('target')); + } + + // ── BBCode-Wrap-Helfer ──────────────────────────────────────── + function wbfBBWrap($ta, tag) { + var el = $ta[0]; + var sel = el.value.slice(el.selectionStart, el.selectionEnd) || 'Text'; + wbfInsertAtCursor($ta, '[' + tag + ']' + sel + '[/' + tag + ']'); + } + + $(document).on('click', '.wbf-tb-btn', function (e) { + e.preventDefault(); + e.stopPropagation(); + + var $btn = $(this); + var action = $btn.data('action'); + var $toolbar = $btn.closest('.wbf-editor-toolbar'); + var $ta = wbfGetTargetTextarea($toolbar); + + // ── Standard BBCode wrap [tag]sel[/tag] ─────────────────── + if (action === 'bb') { + var bb = $btn.data('bb'); + if (bb === 'hr') { + wbfInsertAtCursor($ta, '\n[hr]\n'); + } else { + wbfBBWrap($ta, bb); + } + + // ── Dropdown-Toggle ─────────────────────────────────────── + } else if (action === 'dropdown') { + var panelId = 'wbf-' + $btn.data('target') + '-panel-' + $toolbar.data('target'); + var $panel = $('#' + panelId); + var wasOpen = $panel.is(':visible'); + $('.wbf-tb-dropdown__panel').hide(); + if (!wasOpen) $panel.show(); + + // ── Farbe ───────────────────────────────────────────────── + } else if (action === 'bb-color') { + var color = $btn.data('color'); + var el = $ta[0]; + var sel = el.value.slice(el.selectionStart, el.selectionEnd) || 'Text'; + wbfInsertAtCursor($ta, '[color=' + color + ']' + sel + '[/color]'); + $('.wbf-tb-dropdown__panel').hide(); + + // ── Größe ───────────────────────────────────────────────── + } else if (action === 'bb-size') { + var size = $btn.data('size'); + var el2 = $ta[0]; + var sel2 = el2.value.slice(el2.selectionStart, el2.selectionEnd) || 'Text'; + wbfInsertAtCursor($ta, '[size=' + size + ']' + sel2 + '[/size]'); + $('.wbf-tb-dropdown__panel').hide(); + + // ── Liste ───────────────────────────────────────────────── + } else if (action === 'bb-list') { + var ordered = $btn.data('ordered') ? '=1' : ''; + wbfInsertAtCursor($ta, '[list' + ordered + ']\n[*] Punkt 1\n[*] Punkt 2\n[/list]'); + + // ── Spoiler ─────────────────────────────────────────────── + } else if (action === 'bb-spoiler') { + var title = prompt('Spoiler-Titel (optional):', '') || ''; + var el3 = $ta[0]; + var sel3 = el3.value.slice(el3.selectionStart, el3.selectionEnd) || 'Inhalt hier'; + var tag3 = title ? '[spoiler=' + title + ']' : '[spoiler]'; + wbfInsertAtCursor($ta, tag3 + sel3 + '[/spoiler]'); + + // ── Link ────────────────────────────────────────────────── + } else if (action === 'bb-url') { + var href = prompt('URL eingeben:', 'https://'); + if (href && href.length > 7) { + var el4 = $ta[0]; + var sel4 = el4.value.slice(el4.selectionStart, el4.selectionEnd) || href; + wbfInsertAtCursor($ta, '[url=' + href + ']' + sel4 + '[/url]'); + } + + // ── Bild-URL ────────────────────────────────────────────── + } else if (action === 'bb-img') { + var imgUrl = prompt('Bild-URL eingeben:', 'https://'); + if (imgUrl && imgUrl.length > 8) { + wbfInsertAtCursor($ta, '[img]' + imgUrl + '[/img]'); + } + + // ── Bild hochladen ──────────────────────────────────────── + } else if (action === 'img-upload') { + $btn.find('.wbf-img-file-input').trigger('click'); + + // ── Emoji-Picker ────────────────────────────────────────── + } else if (action === 'emoji') { + var $picker = $toolbar.find('.wbf-emoji-picker'); + var wasOpen2 = $picker.is(':visible'); + $('.wbf-emoji-picker, .wbf-tb-dropdown__panel').hide(); + if (!wasOpen2) $picker.show(); + } + }); + + // Dropdown-Panel schließen bei Klick außerhalb + $(document).on('click', function (e) { + if (!$(e.target).closest('.wbf-tb-dropdown, .wbf-tb-dropdown__panel').length) { + $('.wbf-tb-dropdown__panel').hide(); + } + }); + + /* ── Bild hochladen ─────────────────────────────────────────── */ + $(document).on('change', '.wbf-img-file-input', function () { + var file = this.files[0]; + if (!file) return; + + var $input = $(this); + var $btn = $input.closest('.wbf-tb-btn'); + var $toolbar = $input.closest('.wbf-editor-toolbar'); + var $ta = wbfGetTargetTextarea($toolbar); + + $btn.addClass('wbf-tb-btn--loading'); + var $prog = $toolbar.find('.wbf-tb-upload-progress'); + if (!$prog.length) { + $prog = $(' Wird hochgeladen…'); + $toolbar.append($prog); + } + $prog.addClass('active'); + + var fd = new FormData(); + fd.append('action', 'wbf_upload_post_image'); + fd.append('nonce', WBF.nonce); + fd.append('image', file); + + $.ajax({ + url: WBF.ajax_url, + type: 'POST', + data: fd, + processData: false, + contentType: false, + success: function (res) { + if (res.success) { + wbfInsertAtCursor($ta, '[img]' + res.data.url + '[/img]'); + } else { + alert(res.data.message || 'Fehler beim Hochladen.'); + } + }, + error: function () { alert('Verbindungsfehler beim Hochladen.'); }, + complete: function () { + $btn.removeClass('wbf-tb-btn--loading'); + $prog.removeClass('active'); + $input.val(''); + } + }); + }); + + /* ── Emoji einfügen ─────────────────────────────────────────── */ + $(document).on('click', '.wbf-emoji-item', function (e) { + e.stopPropagation(); + var $toolbar = $(this).closest('.wbf-editor-toolbar'); + wbfInsertAtCursor(wbfGetTargetTextarea($toolbar), $(this).data('emoji')); + $toolbar.find('.wbf-emoji-picker').hide(); + }); + + $(document).on('click', function (e) { + if (!$(e.target).closest('.wbf-editor-toolbar').length) { + $('.wbf-emoji-picker').hide(); + } + }); + + /* ══════════════════════════════════════════════════════════ + FEATURE: Beitrag melden (auch eigene) + ══════════════════════════════════════════════════════════ */ + + $(document).on('click', '.wbf-report-btn', function (e) { + e.preventDefault(); + if (WBF.logged_in !== 'yes') { + $('#wbfAuthModal').addClass('active'); + return; + } + $('#wbfReportId').val($(this).data('id')); + $('#wbfReportType').val($(this).data('type') || 'post'); + $('#wbfReportReason').val(''); + $('#wbfReportNote').val(''); + $('#wbfReportMsg').hide(); + $('#wbfReportModal').addClass('active'); + }); + + $(document).on('click', '#wbfSubmitReport', function () { + var reason = $('#wbfReportReason').val(); + if (!reason) { + showMsg($('#wbfReportMsg'), 'Bitte einen Grund auswählen.', false); + return; + } + var $btn = $(this).prop('disabled', true).html(''); + + wbfPost('wbf_report_post', { + object_id: $('#wbfReportId').val(), + object_type: $('#wbfReportType').val(), + reason: reason, + note: $('#wbfReportNote').val() + }, function (d) { + showMsg($('#wbfReportMsg'), d.message, true); + var postId = $('#wbfReportId').val(); + $('.wbf-report-btn[data-id="' + postId + '"]') + .replaceWith(''); + setTimeout(function () { $('#wbfReportModal').removeClass('active'); }, 1800); + $btn.prop('disabled', false).html(' Melden'); + }, function (d) { + showMsg($('#wbfReportMsg'), d.message || 'Fehler beim Melden.', false); + $btn.prop('disabled', false).html(' Melden'); + }); + }); + + /* ══════════════════════════════════════════════════════════ + FEATURE: Beitrag inline bearbeiten + ══════════════════════════════════════════════════════════ */ + + $(document).on('click', '.wbf-edit-post-btn', function (e) { + e.preventDefault(); + var postId = $(this).data('id'); + $('#wbf-post-content-' + postId).hide(); + $('#wbf-post-edit-' + postId).show().find('textarea').focus(); + }); + + $(document).on('click', '.wbf-cancel-edit-btn', function () { + var postId = $(this).data('id'); + $('#wbf-post-content-' + postId).show(); + $('#wbf-post-edit-' + postId).hide(); + }); + + $(document).on('click', '.wbf-save-edit-btn', function () { + var $btn = $(this).prop('disabled', true).html(''); + var postId = $btn.data('id'); + var $wrap = $('#wbf-post-edit-' + postId); + var $msg = $wrap.find('.wbf-edit-msg'); + + wbfPost('wbf_edit_post', { + post_id: postId, + content: $wrap.find('textarea').val() + }, function (d) { + $('#wbf-post-content-' + postId).html(d.content).show(); + $wrap.hide(); + $btn.prop('disabled', false).html(' Speichern'); + $msg.css('color', '#56cf7e').text(d.message || 'Gespeichert!').show(); + setTimeout(function () { $msg.fadeOut(); }, 2500); + }, function (d) { + $msg.css('color', '#f05252').text(d.message || 'Fehler').show(); + $btn.prop('disabled', false).html(' Speichern'); + }); + }); + + /* ══════════════════════════════════════════════════════════ + FEATURE: Zitieren (BBCode) + ══════════════════════════════════════════════════════════ */ + + $(document).on('click', '.wbf-quote-btn', function () { + if (WBF.logged_in !== 'yes') { + $('#wbfAuthModal').addClass('active'); + return; + } + var sourceId = $(this).data('source'); + var author = $(this).data('author'); + var $content = $('#' + sourceId); + if (!$content.length) return; + + // Strip HTML tags to get plain text, skip nested blockquotes + var rawText = $content.clone().find('blockquote, .wbf-bb-quote').remove().end().text().trim(); + if (rawText.length > 600) rawText = rawText.substring(0, 600) + '…'; + + var quote = '[quote=' + author + ']\n' + rawText + '\n[/quote]\n\n'; + var $ta = $('#wbfReplyContent'); + var $replyBox = $('#wbfReplyBox'); + if (!$ta.length) return; + + var el = $ta[0]; + var start = el.selectionStart; + var end = el.selectionEnd; + var val = el.value; + el.value = val.slice(0, start) + quote + val.slice(end); + el.selectionStart = el.selectionEnd = start + quote.length; + $ta.trigger('input').focus(); + $('html, body').animate({ scrollTop: $replyBox.offset().top - 80 }, 350); + }); + + /* ══════════════════════════════════════════════════════════ + FEATURE: Bild-Lightbox + ══════════════════════════════════════════════════════════ */ + + $(document).on('click', '.wbf-post__content img', function () { + var $lb = $('
' + + '' + + '' + ($(this).attr('alt') || '') + '' + + '
'); + $('body').append($lb).css('overflow', 'hidden'); + }); + + $(document).on('click', '.wbf-lightbox', function (e) { + if ($(e.target).hasClass('wbf-lightbox') || $(e.target).hasClass('wbf-lightbox__close')) { + $(this).remove(); + $('body').css('overflow', ''); + } + }); + + $(document).on('keydown', function (e) { + if (e.key === 'Escape') { + $('.wbf-lightbox').remove(); + $('body').css('overflow', ''); + $('.wbf-emoji-picker').hide(); + $('.wbf-tb-dropdown__panel').hide(); + } + }); + + + /* ══════════════════════════════════════════════════════════ + FEATURE: Thread-Inhalt (OP) inline bearbeiten + ══════════════════════════════════════════════════════════ */ + + $(document).on('click', '.wbf-edit-thread-btn', function (e) { + e.preventDefault(); + var threadId = $(this).data('id'); + $('#wbf-thread-content-' + threadId).hide(); + $('#wbf-thread-edit-' + threadId).show().find('textarea').focus(); + }); + + $(document).on('click', '.wbf-cancel-thread-btn', function () { + var threadId = $(this).data('id'); + $('#wbf-thread-content-' + threadId).show(); + $('#wbf-thread-edit-' + threadId).hide(); + }); + + $(document).on('click', '.wbf-save-thread-btn', function () { + var $btn = $(this).prop('disabled', true).html(''); + var threadId = $btn.data('id'); + var $wrap = $('#wbf-thread-edit-' + threadId); + var $msg = $wrap.find('.wbf-edit-msg'); + + wbfPost('wbf_edit_thread', { + thread_id: threadId, + title: $wrap.find('.wbf-edit-title-input').val(), + content: $wrap.find('textarea').val() + }, function (d) { + $('#wbf-thread-content-' + threadId).html(d.content).show(); + // Titel im DOM aktualisieren + if (d.title) { + $('.wbf-thread-title').first().text(d.title); + } + $wrap.hide(); + $btn.prop('disabled', false).html(' Speichern'); + $msg.css('color', '#56cf7e').text(d.message || 'Gespeichert!').show(); + setTimeout(function () { $msg.fadeOut(); }, 2500); + }, function (d) { + $msg.css('color', '#f05252').text(d.message || 'Fehler').show(); + $btn.prop('disabled', false).html(' Speichern'); + }); + }); + + + /* ══════════════════════════════════════════════════════════ + FEATURE: Live-Suche + ══════════════════════════════════════════════════════════ */ + + var wbfSearchTimer = null; + + function wbfTimeAgo(dateStr) { + var diff = Math.floor((Date.now() - new Date(dateStr).getTime()) / 1000); + if (diff < 60) return 'Gerade eben'; + if (diff < 3600) return Math.floor(diff/60) + ' Min. ago'; + if (diff < 86400) return Math.floor(diff/3600) + ' Std. ago'; + return Math.floor(diff/86400) + ' Tage ago'; + } + + $(document).on('input', '#wbfSearchInput', function () { + var q = $(this).val().trim(); + var $dd = $('#wbfSearchDropdown'); + clearTimeout(wbfSearchTimer); + + if (q.length < 2) { $dd.hide().empty(); return; } + + wbfSearchTimer = setTimeout(function () { + $dd.html('
Suche…
').show(); + + wbfPost('wbf_search', { query: q }, function (d) { + if (!d.results || !d.results.length) { + $dd.html('
Keine Ergebnisse für „' + $('').text(q).html() + '“
'); + return; + } + var html = ''; + var shown = d.results.slice(0, 6); + shown.forEach(function (r) { + var isThread = r.result_type === 'thread'; + var base3 = WBF.forum_url || window.location.href.split('?')[0]; + var sep3 = base3.indexOf('?') !== -1 ? '&' : '?'; + var url = base3 + sep3 + 'forum_thread=' + r.id; + var preview = r.content ? r.content.replace(/<[^>]+>/g,'').substring(0,80) : ''; + var typeLabel = isThread + ? ' Thread' + : ' Antwort'; + html += '
' + + '
' + $('').text(r.title.substring(0,55)).html() + '
' + + '
' + typeLabel + + ' ' + $('').text(r.cat_name).html() + '' + + '' + $('').text(r.display_name).html() + '' + + '
' + + (preview ? '
' + $('').text(preview).html() + '…
' : '') + + '
'; + }); + if (d.results.length > 6) { + html += ''; + } + $dd.html(html).show(); + }, function () { + $dd.html('
Fehler bei der Suche.
'); + }); + }, 320); + }); + + // Alle Ergebnisse anzeigen → zur Suchseite + $(document).on('click', '.wbf-search-dd-footer', function () { + var q = $(this).data('query'); + window.location.href = window.location.pathname + '?forum_search=1&q=' + encodeURIComponent(q); + }); + + // Enter-Taste → Suchseite + $(document).on('keydown', '#wbfSearchInput', function (e) { + if (e.key === 'Enter') { + var q = $(this).val().trim(); + if (q.length >= 2) { + window.location.href = window.location.pathname + '?forum_search=1&q=' + encodeURIComponent(q); + } + } + if (e.key === 'Escape') { $('#wbfSearchDropdown').hide(); } + }); + + // Dropdown schließen bei Klick außerhalb + $(document).on('click', function (e) { + if (!$(e.target).closest('#wbfSearchForm').length) { + $('#wbfSearchDropdown').hide(); + } + }); + + /* ══════════════════════════════════════════════════════════ + FEATURE: Benachrichtigungen + ══════════════════════════════════════════════════════════ */ + + var wbfNotifLoaded = false; + + function wbfLoadNotifications() { + wbfPost('wbf_get_notifications', {}, function (d) { + var $list = $('#wbfNotifList'); + if (!d.notifications || !d.notifications.length) { + $list.html('

Keine Benachrichtigungen
'); + return; + } + var html = ''; + d.notifications.forEach(function (n) { + var isUnread = n.is_read == 0; + var avatar = n.actor_avatar || ''; + var base = WBF.forum_url || window.location.href.split('?')[0]; + var sep = base.indexOf('?') !== -1 ? '&' : '?'; + var actor = '' + $('').text(n.actor_name).html() + ''; + + // URL + Text je nach Typ + var url, text, sub; + if (n.type === 'message') { + url = base + sep + 'forum_dm=1'; + text = actor + ' hat dir eine Nachricht gesendet'; + sub = ''; + } else if (n.type === 'mention') { + url = base + sep + 'forum_thread=' + n.thread_id; + text = actor + ' hat dich erwähnt'; + sub = n.thread_title || ''; + } else if (n.type === 'like') { + url = base + sep + 'forum_thread=' + n.thread_id; + text = actor + ' hat deinen Beitrag geliket'; + sub = n.thread_title || ''; + } else { + // reply (default) + url = base + sep + 'forum_thread=' + n.thread_id; + text = actor + ' hat in deinem Thread geantwortet'; + sub = n.thread_title || ''; + } + + html += '' + + '
' + + '
' + + '
' + text + + (sub ? '
' + $('').text(sub).html() + '' : '') + + '
' + + '
' + wbfTimeAgo(n.created_at) + '
' + + '
' + + (isUnread ? '
' : '') + + '
'; + }); + $list.html(html); + + // Badge aktualisieren + var unread = d.unread || 0; + var $badge = $('#wbfNotifBadge'); + if (unread > 0) { $badge.text(Math.min(unread,99)).show(); } + else { $badge.hide(); } + }); + wbfNotifLoaded = true; + } + + // Glocke klicken → Dropdown öffnen + Nachrichten laden + $(document).on('click', '#wbfNotifBtn', function (e) { + e.stopPropagation(); + var $dd = $('#wbfNotifDropdown'); + if ($dd.is(':visible')) { + $dd.hide(); + } else { + $dd.show(); + if (!wbfNotifLoaded) wbfLoadNotifications(); + } + }); + + // Alle als gelesen markieren + $(document).on('click', '#wbfMarkAllRead', function (e) { + e.stopPropagation(); + wbfPost('wbf_mark_notifications_read', {}, function () { + $('#wbfNotifBadge').hide(); + $('#wbfNotifList .wbf-notif-item').removeClass('wbf-notif-item--unread'); + $('#wbfNotifList .wbf-notif-dot').remove(); + wbfNotifLoaded = false; // neu laden beim nächsten Öffnen + }); + }); + + // Benachrichtigung klicken → als gelesen markieren + navigieren + $(document).on('click', '.wbf-notif-item', function (e) { + e.preventDefault(); + var href = $(this).attr('href'); + wbfPost('wbf_mark_notifications_read', {}, function () { + window.location.href = href; + }); + }); + + // Dropdown schließen bei Klick außerhalb + $(document).on('click', function (e) { + if (!$(e.target).closest('#wbfNotifWrap').length) { + $('#wbfNotifDropdown').hide(); + } + }); + + // ── Unified Smart Polling ───────────────────────────────────────────────── + // Benachrichtigungen + DM-Badge + Live-Konversation in einem einzigen Interval + if (WBF.logged_in === 'yes') { + + var wbfLastMsgId = 0; + + function wbfPoll() { + // 1. Benachrichtigungs-Badge + wbfPost('wbf_get_notifications', {}, function(d) { + var $badge = $('#wbfNotifBadge'); + var unread = d.unread || 0; + if (unread > 0) { $badge.text(Math.min(unread,99)).show(); } + else { $badge.hide(); } + }); + + // 2. DM-Badge + Live-Nachrichten + wbfPost('wbf_get_inbox', {}, function(d) { + var unread = parseInt(d.unread) || 0; + var $badge = $('.wbf-dm-btn .wbf-notif-badge'); + if (unread > 0) { $badge.text(Math.min(unread,99)).css('display',''); } + else { $badge.css('display','none'); } + + // 3. Wenn Konversation offen: neue Nachrichten live nachladen + var $conv = $('#wbfDmConversation'); + if (!$conv.length || !wbfLastMsgId) return; + var partnerId = parseInt($conv.data('partner')); + if (!partnerId) return; + + wbfPost('wbf_get_new_messages', { partner_id: partnerId, since_id: wbfLastMsgId }, function(r) { + if (!r.messages || !r.messages.length) return; + var $msgs = $('#wbfDmMessages'); + var wasAtBottom = $msgs[0].scrollHeight - $msgs[0].scrollTop - $msgs[0].clientHeight < 60; + r.messages.forEach(function(m) { + if ($('[data-msg-id="' + m.id + '"]').length) return; // kein Duplikat + var isMine = parseInt(m.from_id) === parseInt(WBF.my_id); + var cls = isMine ? 'wbf-dm-msg wbf-dm-msg--out' : 'wbf-dm-msg wbf-dm-msg--in'; + var time = wbfTimeAgo(m.created_at); + var delBtn = ''; + var html = '
'; + if (!isMine) { + html += ''; + } + html += '
' + + $('').text(m.content).html().replace(/\n/g,'
') + + '
' + time + delBtn + '
'; + $msgs.append(html); + wbfLastMsgId = Math.max(wbfLastMsgId, parseInt(m.id)); + }); + if (wasAtBottom) $msgs[0].scrollTop = $msgs[0].scrollHeight; + wbfPost('wbf_mark_messages_read', { partner_id: partnerId }); + }); + }); + } + + // Nach dem Laden der Konversation: hoechste ID merken + var origConvLoad = window.wbfConvLoaded; + $(document).on('wbf:messages_loaded', function(e, msgs) { + if (msgs && msgs.length) { + wbfLastMsgId = Math.max.apply(null, msgs.map(function(m){ return parseInt(m.id)||0; })); + } + }); + + setTimeout(wbfPoll, 3000); + setInterval(wbfPoll, 15000); + } + + /* ══════════════════════════════════════════════════════════ + FEATURE: Auto-Logout bei Inaktivität + ══════════════════════════════════════════════════════════ */ + + if ( WBF.logged_in === 'yes' && WBF.auto_logout_minutes > 0 ) { + + var wbfIdleMs = WBF.auto_logout_minutes * 60 * 1000; + var wbfWarnMs = 30 * 1000; // 30 Sek. Vorwarnung + var wbfIdleTimer = null; + var wbfWarnTimer = null; + var wbfCountTimer = null; + var wbfWarning = false; + + // ── Toast-Element ──────────────────────────────────────── + var $wbfToast = $([ + '
', + '
', + '', + 'Sitzung läuft ab', + '
', + '

', + 'Du wirst in 30 Sekunden', + ' automatisch abgemeldet.', + '

', + '
', + '', + '', + '
', + '
' + ].join('')).appendTo('body'); + + function wbfDoLogout() { + clearTimeout(wbfIdleTimer); + clearTimeout(wbfWarnTimer); + clearInterval(wbfCountTimer); + $wbfToast.hide(); + wbfPost('wbf_logout', {}, function () { + location.reload(); + }); + } + + function wbfShowWarning() { + wbfWarning = true; + var secs = 30; + $('#wbfIdleCountdown').text(secs); + $wbfToast.fadeIn(200); + wbfCountTimer = setInterval(function () { + secs--; + $('#wbfIdleCountdown').text(secs); + if (secs <= 0) { + clearInterval(wbfCountTimer); + wbfDoLogout(); + } + }, 1000); + // Auto-logout after warning period + wbfIdleTimer = setTimeout(wbfDoLogout, wbfWarnMs); + } + + function wbfResetIdleTimer() { + if (wbfWarning) return; // Nutzer hat aktiv Warnung bestätigt — nicht resetten + clearTimeout(wbfIdleTimer); + clearTimeout(wbfWarnTimer); + // Warn 30 sec before timeout + wbfWarnTimer = setTimeout(wbfShowWarning, wbfIdleMs - wbfWarnMs); + } + + // "Bleiben" Button + $(document).on('click', '#wbfIdleStay', function () { + clearTimeout(wbfIdleTimer); + clearInterval(wbfCountTimer); + $wbfToast.fadeOut(200); + wbfWarning = false; + wbfResetIdleTimer(); + }); + + // "Abmelden" Button + $(document).on('click', '#wbfIdleLogout', function () { + wbfDoLogout(); + }); + + // Aktivitäts-Events überwachen + var wbfActivityEvents = 'mousemove keydown mousedown touchstart scroll click'; + $(document).on(wbfActivityEvents, function () { + if (!wbfWarning) wbfResetIdleTimer(); + }); + + // Start + wbfResetIdleTimer(); + } + + /* ── Login: Remember-Me ─────────────────────────────────── */ + $(document).on('click', '.wbf-login-submit-btn', function () { + var $btn = $(this).prop('disabled', true).html(''); + wbfPost('wbf_login', { + username: $(this).closest('.wbf-auth-box').find('.wbf-field-username').val(), + password: $(this).closest('.wbf-auth-box').find('.wbf-field-password').val(), + remember_me: $(this).closest('.wbf-auth-box').find('.wbf-field-remember').is(':checked') ? '1' : '' + }, function () { + location.reload(); + }, function (d) { + showMsg($btn.closest('.wbf-auth-box').find('.wbf-login-msg'), d.message || 'Fehler', false); + $btn.prop('disabled', false).html(' Einloggen'); + + }); + }); + + /* ══════════════════════════════════════════════════════════ + FEATURE: Reaktionen + ══════════════════════════════════════════════════════════ */ + + // Picker öffnen/schließen + $(document).on('click', '.wbf-reaction-trigger', function (e) { + e.stopPropagation(); + var $picker = $(this).next('.wbf-reaction-picker'); + var wasOpen = $picker.is(':visible'); + $('.wbf-reaction-picker').hide(); + if (!wasOpen) $picker.show(); + }); + + // Reaktion wählen (aus Picker oder Summary) + $(document).on('click', '.wbf-reaction-btn, .wbf-reaction-pill', function (e) { + e.stopPropagation(); + if (WBF.logged_in !== 'yes') { $('#wbfAuthModal').addClass('active'); return; } + var $bar = $(this).closest('.wbf-reaction-bar'); + var reaction = $(this).data('reaction'); + wbfPost('wbf_set_reaction', { + object_id: $bar.data('id'), + object_type: $bar.data('type'), + reaction: reaction + }, function (d) { + var $summary = $bar.find('.wbf-reaction-summary'); + var $picker = $bar.find('.wbf-reaction-picker'); + // Rebuild summary + var order = ['👍','❤️','😂','😮','😢','😡']; + var html = ''; + order.forEach(function(e) { + if (d.counts[e]) { + var active = (d.mine === e) ? ' wbf-reaction-active' : ''; + html += ''; + } + }); + if (!$summary.length) { + $bar.prepend('
' + html + '
'); + } else { + $summary.html(html || '').toggle(!!html); + } + // Update picker active states + $picker.find('.wbf-reaction-btn').each(function() { + $(this).toggleClass('wbf-reaction-active', $(this).data('reaction') === d.mine); + }); + $picker.hide(); + }); + }); + + // Close pickers on outside click + $(document).on('click', function() { $('.wbf-reaction-picker').hide(); }); + + /* ══════════════════════════════════════════════════════════ + FEATURE: @Erwähnungen Autocomplete im Reply-Textarea + ══════════════════════════════════════════════════════════ */ + + var wbfMentionTimer = null; + var wbfMentionActive = false; + var $wbfMentionDrop = null; + + function wbfCloseMention() { + if ($wbfMentionDrop) $wbfMentionDrop.remove(); + $wbfMentionDrop = null; + wbfMentionActive = false; + } + + $(document).on('input', '#wbfReplyContent, #wbfThreadContent', function () { + var $ta = $(this); + var val = $ta.val(); + var pos = $ta[0].selectionStart; + var before = val.slice(0, pos); + var match = before.match(/@([a-zA-Z0-9_]{0,30})$/); + + if (!match) { wbfCloseMention(); return; } + var q = match[1]; + wbfMentionActive = true; + clearTimeout(wbfMentionTimer); + wbfMentionTimer = setTimeout(function() { + wbfPost('wbf_user_suggest', { q: q }, function(d) { + if (!d.users || !d.users.length) { wbfCloseMention(); return; } + if ($wbfMentionDrop) $wbfMentionDrop.remove(); + var html = ''; + d.users.forEach(function(u) { + html += '
' + + '' + + '' + $('').text(u.display_name).html() + '' + + '@' + $('').text(u.username).html() + '' + + '
'; + }); + $wbfMentionDrop = $('
' + html + '
'); + $ta.closest('.wbf-reply-form__input, .wbf-form-row').append($wbfMentionDrop); + $wbfMentionDrop.show(); + }); + }, 200); + }); + + $(document).on('click', '.wbf-mention-item', function(e) { + e.stopPropagation(); + var username = $(this).data('username'); + var $ta = $('#wbfReplyContent:visible, #wbfThreadContent:visible').first(); + if (!$ta.length) return; + var val = $ta.val(), pos = $ta[0].selectionStart; + var before = val.slice(0, pos); + var after = val.slice(pos); + var newBefore = before.replace(/@([a-zA-Z0-9_]*)$/, '@' + username + ' '); + $ta.val(newBefore + after); + $ta[0].selectionStart = $ta[0].selectionEnd = newBefore.length; + wbfCloseMention(); + $ta.focus(); + }); + + $(document).on('click', function(e) { + if (!$(e.target).closest('.wbf-mention-dropdown').length) wbfCloseMention(); + }); + + /* ══════════════════════════════════════════════════════════ + FEATURE: Private Nachrichten (DM) + ══════════════════════════════════════════════════════════ */ + + // Helper: format messages in conversation + function wbfRenderMessages(msgs, myId) { + if (!msgs || !msgs.length) { + return '

Noch keine Nachrichten.

'; + } + var html = ''; + msgs.forEach(function(m) { + var isMine = parseInt(m.from_id) === parseInt(myId); + var cls = isMine ? 'wbf-dm-msg wbf-dm-msg--out' : 'wbf-dm-msg wbf-dm-msg--in'; + var time = wbfTimeAgo(m.created_at); + var delBtn = ''; + if (!isMine) { + html += '
' + + '' + + '
' + + $('').text(m.content).html().replace(/\n/g,'
') + + '
' + time + delBtn + '
'; + } else { + html += '
' + + '
' + + $('').text(m.content).html().replace(/\n/g,'
') + + '
' + time + delBtn + '
'; + } + }); + return html; + } + + // Render inbox list + function wbfRenderInbox(inbox, myId) { + if (!inbox || !inbox.length) { + return '
Keine Nachrichten.
'; + } + var html = ''; + inbox.forEach(function(conv) { + var href = window.location.pathname + '?forum_dm=inbox&with=' + conv.partner_id; + var unread = parseInt(conv.unread_cnt) > 0; + html += '' + + '' + + '
' + + '' + $('').text(conv.partner_name).html() + '' + + (unread ? '' + conv.unread_cnt + '' : '') + + '
'; + }); + return html; + } + + // Auto-load inbox if on DM page + if ($('#wbfDmInbox').length && WBF.logged_in === 'yes') { + wbfPost('wbf_get_inbox', {}, function(d) { + $('#wbfDmInbox').html(wbfRenderInbox(d.inbox, WBF.my_id)); + }); + + // Load conversation if partner given + var $conv = $('#wbfDmConversation'); + if ($conv.length) { + var partnerId = $conv.data('partner'); + wbfPost('wbf_get_conversation', { partner_id: partnerId }, function(d) { + // Header + var p = d.partner; + if (p) { + var backUrl = window.location.pathname + '?forum_dm=inbox'; + $('#wbfDmHeader').html( + '' + + '' + + '' + $('').text(p.display_name).html() + '' + + '@' + $('').text(p.username).html() + '' + ); + } + var html = wbfRenderMessages(d.messages, d.my_id); + var $msgs = $('#wbfDmMessages').html(html); + $msgs[0].scrollTop = $msgs[0].scrollHeight; + $(document).trigger('wbf:messages_loaded', [d.messages]); + // "Ältere laden" initialisieren — AJAX gibt total zurück + if (d.total !== undefined) { + $('#wbfDmLoadMore').data('offset', 0).data('partner', d.partner ? d.partner.id : 0); + wbfUpdateLoadMoreBtn(d.total, d.messages.length); + } + }); + } + } + + // Send reply in open conversation + $(document).on('click', '#wbfDmSendReply', function() { + var toId = $(this).data('to'); + var text = $('#wbfDmReplyText').val().trim(); + if (!text) return; + var $btn = $(this).prop('disabled', true); + wbfPost('wbf_send_message', { to_id: toId, content: text }, function(d) { + var delBtn = ''; + var html = '
' + + '
' + + $('').text(d.content).html().replace(/\n/g,'
') + + '
Gerade eben' + delBtn + '
'; + var $msgs = $('#wbfDmMessages'); + $msgs.append(html); + $msgs[0].scrollTop = $msgs[0].scrollHeight; + $('#wbfDmReplyText').val(''); + $btn.prop('disabled', false); + if (d.message_id) wbfLastMsgId = Math.max(wbfLastMsgId, parseInt(d.message_id)); + }, function(e) { + alert(e.message || 'Fehler'); + $btn.prop('disabled', false); + }); + }); + + // Delete message + $(document).on('click', '.wbf-dm-msg__del', function() { + var msgId = $(this).data('id'); + var $row = $(this).closest('[data-msg-id]'); + if (!confirm('Nachricht löschen?')) return; + wbfPost('wbf_delete_message', { message_id: msgId }, function() { + $row.fadeOut(200, function() { $(this).remove(); }); + }, function(e) { + alert(e.message || 'Fehler beim Löschen.'); + }); + }); + + // Enter to send (Shift+Enter = newline) + $(document).on('keydown', '#wbfDmReplyText', function(e) { + if (e.key === 'Enter' && !e.shiftKey) { + e.preventDefault(); + $('#wbfDmSendReply').trigger('click'); + } + }); + + // New DM button → open compose modal + $(document).on('click', '#wbfNewDmBtn, #wbfNewDmBtn2', function() { + $('#wbfDmRecipientInput').val(''); + $('#wbfDmToId').val(''); + $('#wbfDmComposeText').val(''); + $('#wbfDmComposeMsg').hide(); + $('#wbfDmComposeModal').addClass('active'); + }); + + // Recipient autocomplete in compose modal + var wbfDmSugTimer = null; + $(document).on('input', '#wbfDmRecipientInput', function() { + var q = $(this).val().trim(); + clearTimeout(wbfDmSugTimer); + if (!q) { $('#wbfDmSuggest').hide().empty(); return; } + wbfDmSugTimer = setTimeout(function() { + wbfPost('wbf_user_suggest', { q: q }, function(d) { + var $s = $('#wbfDmSuggest'); + if (!d.users || !d.users.length) { $s.hide().empty(); return; } + var html = ''; + d.users.forEach(function(u) { + html += '
' + + '' + + $('').text(u.display_name).html() + + '@' + $('').text(u.username).html() + '' + + '
'; + }); + $s.html(html).show(); + }); + }, 200); + }); + + $(document).on('click', '#wbfDmSuggest .wbf-tag-suggest-item', function() { + var id = $(this).data('id'); + var name = $(this).data('name'); + $('#wbfDmToId').val(id); + $('#wbfDmRecipientInput').val(name); + $('#wbfDmSuggest').hide().empty(); + }); + + // Send from compose modal + $(document).on('click', '#wbfDmComposeSend', function() { + var toId = $('#wbfDmToId').val(); + var text = $('#wbfDmComposeText').val().trim(); + var $btn = $(this).prop('disabled', true).html(''); + if (!toId) { showMsg($('#wbfDmComposeMsg'), 'Bitte Empfänger wählen.', false); $btn.prop('disabled', false).html(' Senden'); return; } + if (!text) { showMsg($('#wbfDmComposeMsg'), 'Nachricht leer.', false); $btn.prop('disabled', false).html(' Senden'); return; } + wbfPost('wbf_send_message', { to_id: toId, content: text }, function() { + showMsg($('#wbfDmComposeMsg'), '✔ Gesendet!', true); + setTimeout(function() { + $('#wbfDmComposeModal').removeClass('active'); + window.location.href = window.location.pathname + '?forum_dm=inbox&with=' + toId; + }, 800); + }, function(e) { + showMsg($('#wbfDmComposeMsg'), e.message || 'Fehler', false); + $btn.prop('disabled', false).html(' Senden'); + }); + }); + + /* ══════════════════════════════════════════════════════════ + FEATURE: Online-Nutzer (Notification polling erweitern) + ══════════════════════════════════════════════════════════ */ + + + + + /* ══════════════════════════════════════════════════════════ + FEATURE: Passwort vergessen + ══════════════════════════════════════════════════════════ */ + + // "Passwort vergessen?" → Panel wechseln + $(document).on('click', '.wbf-forgot-link', function(e) { + e.preventDefault(); + $('.wbf-auth-tab').removeClass('active'); + $('.wbf-auth-panel').removeClass('active'); + $('[data-panel="forgot"]').addClass('active'); + }); + + $(document).on('click', '.wbf-show-login', function(e) { + e.preventDefault(); + $('.wbf-auth-panel').removeClass('active'); + $('[data-tab="login"]').addClass('active'); + $('[data-panel="login"]').addClass('active'); + }); + + // Reset-Link anfordern + $(document).on('click', '.wbf-forgot-submit-btn', function() { + var $btn = $(this).prop('disabled', true).html(''); + wbfPost('wbf_forgot_password', { + email: $(this).closest('.wbf-auth-box').find('.wbf-field-forgot-email').val() + }, function(d) { + showMsg($btn.closest('.wbf-auth-box').find('.wbf-forgot-msg'), d.message, true); + $btn.prop('disabled', false).html(' Reset-Link senden'); + }, function(d) { + showMsg($btn.closest('.wbf-auth-box').find('.wbf-forgot-msg'), d.message || 'Fehler', false); + $btn.prop('disabled', false).html(' Reset-Link senden'); + }); + }); + + // Passwort-Reset Formular (separate Seite via ?wbf_reset_token=...) + $(document).on('click', '#wbfResetSubmit', function() { + var $btn = $(this).prop('disabled', true).html(''); + wbfPost('wbf_reset_password', { + token: $('#wbfResetToken').val(), + password: $('#wbfResetPass1').val(), + password2: $('#wbfResetPass2').val() + }, function(d) { + showMsg($('#wbfResetMsg'), d.message, true); + $btn.html(' Passwort geändert!'); + setTimeout(function() { + window.location.href = WBF.forum_url || window.location.pathname.split('?')[0]; + }, 2000); + }, function(d) { + showMsg($('#wbfResetMsg'), d.message || 'Fehler', false); + $btn.prop('disabled', false).html(' Passwort ändern'); + }); + }); + + /* ══════════════════════════════════════════════════════════ + FEATURE: Ältere Nachrichten laden (DM) + ══════════════════════════════════════════════════════════ */ + + // Wird nach dem ersten Laden der Konversation aufgerufen + function wbfUpdateLoadMoreBtn(total, currentCount) { + var $wrap = $('#wbfDmLoadMoreWrap'); + var $btn = $('#wbfDmLoadMore'); + if (total > currentCount) { + var remaining = total - currentCount; + $btn.html(' ' + remaining + ' ältere Nachrichten laden'); + $wrap.show(); + } else { + $wrap.hide(); + } + } + + $(document).on('click', '#wbfDmLoadMore', function() { + var $btn = $(this).prop('disabled', true).html(''); + var partnerId = $(this).data('partner'); + var offset = parseInt($(this).data('offset')) || 0; + var loadCount = 30; + var newOffset = offset + loadCount; + + wbfPost('wbf_load_more_messages', { + partner_id: partnerId, + offset: newOffset + }, function(d) { + if (!d.messages || !d.messages.length) { + $('#wbfDmLoadMoreWrap').hide(); + return; + } + // Ältere Nachrichten oben einfügen + var html = wbfRenderMessages(d.messages, d.my_id); + var $msgs = $('#wbfDmMessages'); + var oldHeight = $msgs[0].scrollHeight; + $msgs.prepend(html); + // Scroll-Position halten (nicht nach oben springen) + $msgs.scrollTop($msgs[0].scrollHeight - oldHeight); + + // Offset aktualisieren + $('#wbfDmLoadMore').data('offset', newOffset).prop('disabled', false); + + // Button update + var loaded = newOffset + d.messages.length; + wbfUpdateLoadMoreBtn(d.total, loaded); + }, function() { + $btn.prop('disabled', false).html(' Ältere laden'); + }); + }); + + +}(jQuery)); \ No newline at end of file