This commit is contained in:
2026-09-13 06:12:37 +02:00
parent 33c6d0e76d
commit 466d3c4f28
20 changed files with 2156 additions and 134 deletions
+499 -3
View File
@@ -12521,10 +12521,10 @@ body > nav.navbar {
@media (max-width: 467px) {
.nav-avatar-name,
/* .nav-avatar-name,
.nav-avatar-caret {
display: none;
}
} */
}
@@ -12667,7 +12667,14 @@ input:checked+.slider:before {
.rating-toggle-btn.locked {
cursor: not-allowed !important;
pointer-events: none !important;
opacity: 0.85 !important;
}
.rating-toggle-btn.locked:not(.active) {
opacity: 0.45 !important;
}
.rating-toggle-btn.locked.active {
opacity: 1 !important;
}
/* Per-rating active colours */
@@ -20221,4 +20228,493 @@ div#flash,
#onara-modal:fullscreen .onara-modal-content {
overflow: hidden !important;
padding: 0 !important;
}
/* ==========================================================================
Bulk Item Selection & Operations (Themed: No rounded corners, no box shadows)
========================================================================== */
/* Square checkbox indicator on thumbnails */
.thumb-select-check {
position: absolute;
top: 4px;
right: 4px;
width: 18px;
height: 18px;
border-radius: 0 !important;
background: var(--bg, #111);
border: 1px solid var(--accent, #9f0);
color: var(--accent, #9f0);
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
font-family: var(--font, monospace);
z-index: 25;
pointer-events: none;
opacity: 0;
box-shadow: none !important;
transition: opacity 0.15s ease;
}
.bulk-selection-active .thumb .thumb-select-check {
opacity: 0.85;
}
.thumb.bulk-selected .thumb-select-check {
opacity: 1 !important;
background: var(--accent, #9f0) !important;
color: var(--black, #000) !important;
font-weight: bold !important;
}
/* Selected thumbnail outline: theme-colored border, no shadows, no transform */
.thumb.bulk-selected {
outline: 2px solid var(--accent, #9f0) !important;
outline-offset: -2px !important;
box-shadow: none !important;
transform: none !important;
filter: none !important;
}
/* Long-press holding indicator: dashed border */
.thumb.thumb-longpressing {
outline: 1px dashed var(--accent, #9f0) !important;
outline-offset: -1px !important;
box-shadow: none !important;
transform: none !important;
}
/* Floating Bulk Action Bar (fixed to bottom, themed border and background) */
#bulk-action-bar {
position: fixed;
bottom: 0;
left: 50%;
transform: translateX(-50%) translateY(100%);
z-index: 99999;
display: flex;
align-items: center;
gap: 8px;
background: var(--dropdown-bg, #232323) !important;
border-top: 2px solid var(--accent, #9f0) !important;
border-left: 1px solid var(--accent, #9f0) !important;
border-right: 1px solid var(--accent, #9f0) !important;
border-bottom: none !important;
border-radius: 0 !important;
padding: 6px 12px;
box-shadow: none !important;
opacity: 0;
pointer-events: none;
transition: transform 0.2s ease, opacity 0.2s ease;
user-select: none;
font-family: var(--font, monospace) !important;
max-width: 100vw;
}
#bulk-action-bar.visible {
transform: translateX(-50%) translateY(0);
opacity: 1;
pointer-events: auto;
}
.bulk-count-box {
display: flex;
align-items: center;
gap: 6px;
font-weight: bold;
font-size: 12px;
color: var(--white, #fff);
padding-right: 10px;
border-right: 1px solid var(--nav-border-color, #444);
white-space: nowrap;
font-family: var(--font, monospace);
}
.bulk-count-num {
background: var(--bg, #111);
color: var(--accent, #9f0);
border: 1px solid var(--accent, #9f0);
border-radius: 0 !important;
padding: 1px 6px;
font-size: 11px;
font-weight: bold;
box-shadow: none !important;
}
.bulk-actions-group {
display: flex;
align-items: center;
gap: 6px;
flex-wrap: nowrap;
}
.bulk-btn {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 5px 10px;
border-radius: 0 !important;
font-size: 12px;
font-family: var(--font, monospace) !important;
border: 1px solid var(--nav-border-color, #444);
background: var(--nav-bg, #2b2b2b);
color: var(--white, #fff);
cursor: pointer;
box-shadow: none !important;
transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
white-space: nowrap;
}
.bulk-btn:hover {
background: var(--nav-link-hover-bg, #333);
color: var(--accent, #9f0);
border-color: var(--accent, #9f0);
transform: none !important;
}
.bulk-btn:active {
transform: none !important;
}
.bulk-btn-primary {
background: var(--accent, #9f0) !important;
color: var(--black, #000) !important;
border: 1px solid var(--accent, #9f0) !important;
font-weight: bold !important;
box-shadow: none !important;
}
.bulk-btn-primary:hover {
filter: brightness(1.15);
}
.bulk-btn-close {
padding: 5px 8px;
background: var(--nav-bg, #2b2b2b);
color: var(--white, #fff);
border: 1px solid var(--nav-border-color, #444);
}
.bulk-btn-close:hover {
background: #ff4444 !important;
color: #fff !important;
border-color: #ff4444 !important;
}
/* Bulk rating dropdown wrapper */
.bulk-dropdown-wrap {
position: relative;
}
.bulk-dropdown-menu {
position: absolute;
bottom: calc(100% + 4px);
left: 0;
background: var(--dropdown-bg, #232323);
border: 1px solid var(--accent, #9f0);
border-radius: 0 !important;
padding: 4px;
display: none;
flex-direction: column;
gap: 2px;
box-shadow: none !important;
min-width: 120px;
z-index: 100000;
font-family: var(--font, monospace);
}
.bulk-dropdown-menu.show {
display: flex;
}
.bulk-menu-item {
display: flex;
align-items: center;
gap: 6px;
padding: 5px 8px;
border-radius: 0 !important;
font-size: 11.5px;
font-family: var(--font, monospace);
background: transparent;
border: none;
color: var(--white, #fff);
cursor: pointer;
text-align: left;
box-shadow: none !important;
transition: background 0.1s ease, color 0.1s ease;
white-space: nowrap;
}
.bulk-menu-item:hover {
background: var(--nav-link-hover-bg, #333);
color: var(--accent, #9f0);
}
.bulk-menu-item.rating-sfw {
border-left: 3px solid var(--badge-sfw, #02500b);
}
.bulk-menu-item.rating-sfw:hover {
background: var(--badge-sfw, #02500b);
color: #fff;
}
.bulk-menu-item.rating-nsfw {
border-left: 3px solid var(--badge-nsfw, #E10DC3);
}
.bulk-menu-item.rating-nsfw:hover {
background: var(--badge-nsfw, #E10DC3);
color: #fff;
}
.bulk-menu-item.rating-nsfl {
border-left: 3px solid var(--badge-nsfl, #660000);
}
.bulk-menu-item.rating-nsfl:hover {
background: var(--badge-nsfl, #660000);
color: #fff;
}
/* Bulk Modals (Add Tags / Remove Tags) */
.bulk-modal-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.85);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
z-index: 100300;
display: none;
align-items: center;
justify-content: center;
padding: 16px;
}
.bulk-modal-overlay.visible {
display: flex;
}
.bulk-modal-card {
background: var(--bg, #111);
border: 1px solid var(--accent, #9f0);
border-radius: 0 !important;
padding: 18px;
width: 100%;
max-width: 440px;
box-shadow: none !important;
color: var(--white, #fff);
font-family: var(--font, monospace);
position: relative;
}
.bulk-modal-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
border-bottom: 1px solid var(--nav-border-color, #444);
padding-bottom: 8px;
}
.bulk-modal-header h3 {
margin: 0;
font-size: 14px;
font-weight: bold;
font-family: var(--font, monospace);
display: flex;
align-items: center;
gap: 6px;
color: var(--accent, #9f0);
}
.bulk-modal-close {
background: none;
border: none;
color: var(--white, #fff);
font-size: 16px;
cursor: pointer;
padding: 2px 6px;
border-radius: 0 !important;
font-family: var(--font, monospace);
}
.bulk-modal-close:hover {
color: #ff4444;
}
.bulk-modal-desc {
font-size: 12px;
color: #aaa;
margin-bottom: 12px;
line-height: 1.4;
font-family: var(--font, monospace);
}
.bulk-tag-chips-wrap {
display: flex;
flex-wrap: wrap;
gap: 4px;
margin-bottom: 10px;
min-height: 24px;
}
.bulk-tag-chip {
background: var(--badge-bg, #171717);
border: 1px solid var(--accent, #9f0);
color: var(--white, #fff);
border-radius: 0 !important;
padding: 2px 8px;
font-size: 11px;
font-family: var(--font, monospace);
display: inline-flex;
align-items: center;
gap: 5px;
box-shadow: none !important;
}
.bulk-tag-chip .remove-chip-btn {
cursor: pointer;
opacity: 0.7;
font-size: 10px;
}
.bulk-tag-chip .remove-chip-btn:hover {
opacity: 1;
color: #ff4444;
}
.bulk-input-container {
position: relative;
margin-bottom: 14px;
}
.bulk-text-input {
width: 100%;
background: rgba(255, 255, 255, 0.05);
border: 1px solid var(--nav-border-color, #444);
border-radius: 0 !important;
box-shadow: none !important;
padding: 8px 10px;
color: var(--white, #fff);
font-size: 13px;
font-family: var(--font, monospace);
outline: none;
box-sizing: border-box;
}
.bulk-text-input:focus {
border-color: var(--accent, #9f0);
outline: none;
box-shadow: none !important;
}
.bulk-tag-suggestions {
position: absolute;
top: 100%;
left: 0;
right: 0;
background: var(--dropdown-bg, #232323);
border: 1px solid var(--accent, #9f0);
border-radius: 0 !important;
max-height: 160px;
overflow-y: auto;
z-index: 100310;
box-shadow: none !important;
display: none;
font-family: var(--font, monospace);
}
.bulk-suggestion-item {
padding: 6px 10px;
font-size: 12px;
font-family: var(--font, monospace);
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
color: var(--white, #fff);
border-radius: 0 !important;
}
.bulk-suggestion-item:hover,
.bulk-suggestion-item.highlighted {
background: var(--accent, #9f0);
color: var(--black, #000);
font-weight: bold;
}
.bulk-suggestion-count {
font-size: 10px;
opacity: 0.7;
}
.bulk-modal-actions {
display: flex;
justify-content: flex-end;
gap: 8px;
}
.bulk-modal-btn {
padding: 6px 14px;
border-radius: 0 !important;
font-size: 12px;
font-family: var(--font, monospace) !important;
cursor: pointer;
border: 1px solid var(--nav-border-color, #444);
background: var(--nav-bg, #2b2b2b);
color: var(--white, #fff);
box-shadow: none !important;
transition: all 0.12s ease;
}
.bulk-modal-btn:hover {
background: var(--nav-link-hover-bg, #333);
color: var(--accent, #9f0);
border-color: var(--accent, #9f0);
}
.bulk-modal-btn-submit {
background: var(--accent, #9f0) !important;
color: var(--black, #000) !important;
font-weight: bold !important;
border: 1px solid var(--accent, #9f0) !important;
box-shadow: none !important;
}
.bulk-modal-btn-submit:hover {
filter: brightness(1.15);
}
.bulk-modal-btn-submit:disabled {
opacity: 0.5;
cursor: not-allowed;
filter: none;
}
/* Responsive tweaks for mobile devices */
@media (max-width: 768px) {
#bulk-action-bar {
width: 100vw;
padding: 6px 8px;
justify-content: space-between;
gap: 4px;
}
.bulk-count-box {
padding-right: 6px;
font-size: 11.5px;
gap: 4px;
}
.bulk-btn {
padding: 5px 7px;
font-size: 11.5px;
gap: 3px;
}
.bulk-btn .btn-text-full {
display: none;
}
.bulk-modal-card {
padding: 14px;
}
}
+15
View File
@@ -50,6 +50,7 @@
const tagsContainer = document.querySelector("#tags");
if (!tagsContainer) return;
const inner = tagsContainer.querySelector(".tags-inner") || tagsContainer;
const activePostId = tagsContainer.dataset.itemId || (typeof window.getCurrentItemId === 'function' ? window.getCurrentItemId() : null);
const canManage = !!(
document.querySelector('#tags[data-can-manage="true"]') ||
@@ -96,6 +97,7 @@
if (isRating) {
span.classList.add('rating-tag', `is-${tag.normalized}`);
span.dataset.rating = tag.normalized;
if (activePostId) span.dataset.itemId = activePostId;
if (canManage) {
span.classList.add('can-cycle');
}
@@ -124,6 +126,7 @@
const untaggedSpan = document.createElement("span");
untaggedSpan.className = `badge badge-untagged rating-tag is-untagged${canManage ? ' can-cycle' : ''}`;
untaggedSpan.dataset.rating = 'untagged';
if (activePostId) untaggedSpan.dataset.itemId = activePostId;
const lbl = document.createElement("span");
lbl.className = "rating-label";
lbl.textContent = "untagged";
@@ -139,6 +142,18 @@
}
}
// Update thumbnail data-mode in background grid (ensures div.posts > a > p::before updates in Onara)
if (activePostId) {
const modeAttr = lastRatingTag ? lastRatingTag.normalized : 'null';
document.querySelectorAll(`.posts > a.thumb[data-item-id="${activePostId}"], .posts a[data-item-id="${activePostId}"], .posts a[href$="/${activePostId}"]`).forEach(th => {
th.setAttribute('data-mode', modeAttr);
});
if (document.body.classList.contains('onara-modal-open')) {
const onaraThumb = document.querySelector('.posts > a.thumb.onara-active');
if (onaraThumb) onaraThumb.setAttribute('data-mode', modeAttr);
}
}
// Handle show more/less toggle visibility and count
const allBadges = [...inner.querySelectorAll(".badge")];
const realTags = allBadges.filter(b => !b.querySelector('#a_addtag') && !b.querySelector('#a_toggle') && !b.classList.contains('tag-ac-wrapper'));
+21 -4
View File
@@ -645,11 +645,16 @@
if (data.success) {
this.isSessionReady = true;
if (data.csrf_token) {
if (window.f0ckSession) window.f0ckSession.csrf_token = data.csrf_token;
const metaCsrf = document.querySelector('meta[name="csrf-token"]');
if (metaCsrf) metaCsrf.content = data.csrf_token;
if (window.f0ckSession) {
window.f0ckSession.user = 'anonymous';
window.f0ckSession.is_anon = true;
window.f0ckSession.logged_in = true;
window.f0ckSession.id = data.user_id;
window.f0ckSession.user_id = data.user_id;
if (data.csrf_token) window.f0ckSession.csrf_token = data.csrf_token;
}
const metaCsrf = document.querySelector('meta[name="csrf-token"]');
if (metaCsrf && data.csrf_token) metaCsrf.content = data.csrf_token;
window.f0ckAnonIdentity = {
userId: data.user_id,
fingerprint: data.fingerprint,
@@ -657,6 +662,9 @@
hwFingerprint: data.hw_fingerprint || hwFingerprint
};
window.dispatchEvent(new CustomEvent('f0ck:anon_session_ready', { detail: window.f0ckAnonIdentity }));
if (typeof window.syncRatingButtonUI === 'function') {
window.syncRatingButtonUI();
}
}
} catch (err) {
console.warn('[ANON_SSH] Session handshake failed:', err);
@@ -870,6 +878,15 @@
const guestFavsLink = document.getElementById('nav-guest-favs-link');
if (guestFavsNav) guestFavsNav.style.display = isAnon ? '' : 'none';
if (guestFavsLink) guestFavsLink.style.display = isAnon ? '' : 'none';
if (isAnon && window.f0ckSession) {
window.f0ckSession.user = window.f0ckSession.user || 'anonymous';
window.f0ckSession.is_anon = true;
window.f0ckSession.logged_in = true;
}
if (typeof window.syncRatingButtonUI === 'function') {
window.syncRatingButtonUI();
}
}
/**
+1084 -48
View File
File diff suppressed because it is too large Load Diff
+50 -1
View File
@@ -97,11 +97,34 @@
let autoNextLoops = Math.max(0, parseInt(prefs.autoNextLoops ?? 1, 10));
let leftHandEnabled = prefs.leftHand === true;
const getIsScrollerGuest = () => {
if (!window.f0ckSession) return true;
if (window.f0ckSession.user && !window.f0ckSession.is_anon) return false;
if (window.f0ckSession.is_anon && (window.f0ckSession.logged_in || window.f0ckSession.user)) return false;
if (window.f0ckAnonSSH && (window.f0ckAnonSSH.isSessionReady || window.f0ckAnonSSH.pubkey)) return false;
if (typeof localStorage !== 'undefined' && localStorage.getItem('f0ck_anon_ssh_pub')) return false;
return !window.f0ckSession.logged_in;
};
const isScrollerGuest = getIsScrollerGuest();
const isScrollerAnon = !(window.f0ckSession && window.f0ckSession.user && !window.f0ckSession.is_anon);
const scrollerAllowedMimes = window.f0ckSession?.anon_permissions?.allowed_mimes;
const scrollerSingleMime = (isScrollerAnon && Array.isArray(scrollerAllowedMimes) && scrollerAllowedMimes.length === 1) ? scrollerAllowedMimes[0] : null;
let applied = { mode: defaultMode, mime: scrollerSingleMime || '', order: 'random', tags: [], externalUrl: null };
const scrollerAllowedModes = isScrollerGuest ? ['sfw'] : window.f0ckSession?.anon_permissions?.allowed_modes;
const scrollerModeNames = ['sfw', 'nsfw', 'untagged', 'all', 'nsfl'];
let effectiveScrollerMode = defaultMode;
if (isScrollerGuest) {
effectiveScrollerMode = 0;
} else if (isScrollerAnon && Array.isArray(scrollerAllowedModes)) {
const curName = scrollerModeNames[effectiveScrollerMode] || 'sfw';
if (!scrollerAllowedModes.includes(curName)) {
const fallbackName = scrollerAllowedModes[0] || 'sfw';
const fallbackIdx = scrollerModeNames.indexOf(fallbackName);
effectiveScrollerMode = fallbackIdx >= 0 ? fallbackIdx : 0;
}
}
let applied = { mode: effectiveScrollerMode, mime: scrollerSingleMime || '', order: 'random', tags: [], externalUrl: null };
let pending = { ...applied, tags: [] };
// Volume / mute
@@ -3039,6 +3062,19 @@
});
function syncPanelUI() {
const isGuest = getIsScrollerGuest();
if (isGuest) {
pending.mode = 0;
applied.mode = 0;
} else {
document.querySelectorAll('#mode-pills .filter-pill').forEach(pill => {
pill.classList.remove('locked');
pill.disabled = false;
pill.style.cursor = '';
pill.style.opacity = '';
pill.querySelectorAll('.fa-lock').forEach(i => i.remove());
});
}
if (scrollerSingleMime) {
pending.mime = scrollerSingleMime;
applied.mime = scrollerSingleMime;
@@ -3055,6 +3091,10 @@
if (!el) return;
el.querySelectorAll('.filter-pill').forEach(pill => {
pill.addEventListener('click', (e) => {
if (groupId === 'mode-pills' && (getIsScrollerGuest() || pill.classList.contains('locked') || pill.disabled)) {
e.preventDefault();
return;
}
if (groupId === 'mime-pills' && scrollerSingleMime) {
e.preventDefault();
return;
@@ -3064,6 +3104,15 @@
});
});
}
window.addEventListener('f0ck:anon_session_ready', () => {
if (window.f0ckSession) {
window.f0ckSession.user = 'anonymous';
window.f0ckSession.is_anon = true;
window.f0ckSession.logged_in = true;
}
syncPanelUI();
});
makePillListener('mode-pills', 'mode', v => +v);
makePillListener('mime-pills', 'mime', v => v);
makePillListener('order-pills', 'order', v => v);
+10 -5
View File
@@ -1515,12 +1515,17 @@
const getCurrentItemIdentifiers = () => {
const ids = new Set();
// 1. From DOM elements on the page (primary/direct)
const idElem = document.querySelector('[data-item-id]');
if (idElem && idElem.dataset.itemId) {
ids.add(String(idElem.dataset.itemId).trim());
// 1. From active item on the page (never match background grid thumbnails)
if (typeof window.getCurrentItemId === 'function') {
const currentId = window.getCurrentItemId();
if (currentId) ids.add(String(currentId).trim());
} else {
const idElem = document.querySelector('#onara-item-mount [data-item-id], .item-layout-container[data-item-id], #comments-container[data-item-id]');
if (idElem?.dataset?.itemId) {
ids.add(String(idElem.dataset.itemId).trim());
}
}
const idLink = document.querySelector('.id-link');
const idLink = document.querySelector('#onara-item-mount .id-link, .item-layout-container .id-link, #main.item-view .id-link');
if (idLink) {
if (idLink.dataset.itemId) ids.add(String(idLink.dataset.itemId).trim());
const txt = idLink.textContent.trim();
+16 -1
View File
@@ -46,6 +46,7 @@
const tagsContainer = document.querySelector("#tags");
if (!tagsContainer) return;
const inner = tagsContainer.querySelector(".tags-inner") || tagsContainer;
const activePostId = tagsContainer.dataset.itemId || (typeof window.getCurrentItemId === 'function' ? window.getCurrentItemId() : null);
const canManage = !!(
document.querySelector('#tags[data-can-manage="true"]') ||
@@ -76,7 +77,7 @@
contentEl.textContent = tag.tag;
} else {
contentEl = document.createElement("a");
contentEl.href = `/tag/${tag.normalized}`;
contentEl.href = "/tag/" + tag.normalized;
contentEl.style = "color: inherit !important";
contentEl.textContent = tag.tag;
}
@@ -92,6 +93,7 @@
if (isRating) {
span.classList.add('rating-tag', `is-${tag.normalized}`);
span.dataset.rating = tag.normalized;
if (activePostId) span.dataset.itemId = activePostId;
if (canManage) {
span.classList.add('can-cycle');
}
@@ -120,6 +122,7 @@
const untaggedSpan = document.createElement("span");
untaggedSpan.className = `badge badge-untagged rating-tag is-untagged${canManage ? ' can-cycle' : ''}`;
untaggedSpan.dataset.rating = 'untagged';
if (activePostId) untaggedSpan.dataset.itemId = activePostId;
const lbl = document.createElement("span");
lbl.className = "rating-label";
lbl.textContent = "untagged";
@@ -135,6 +138,18 @@
}
}
// Update thumbnail data-mode in background grid (ensures div.posts > a > p::before updates in Onara)
if (activePostId) {
const modeAttr = lastRatingTag ? lastRatingTag.normalized : 'null';
document.querySelectorAll(`.posts > a.thumb[data-item-id="${activePostId}"], .posts a[data-item-id="${activePostId}"], .posts a[href$="/${activePostId}"]`).forEach(th => {
th.setAttribute('data-mode', modeAttr);
});
if (document.body.classList.contains('onara-modal-open')) {
const onaraThumb = document.querySelector('.posts > a.thumb.onara-active');
if (onaraThumb) onaraThumb.setAttribute('data-mode', modeAttr);
}
}
// Handle show more/less toggle visibility and count
const allBadges = [...inner.querySelectorAll(".badge")];
const realTags = allBadges.filter(b => !b.querySelector('#a_addtag') && !b.querySelector('#a_toggle') && !b.classList.contains('tag-ac-wrapper'));