feat: implémenter modal confirmation actions bulk avec preview liste liens (ID + titre), styles dédiés (max-width 520px, list scrollable 320px, boutons colorés par action delete/public/private), synchronisation mode thème vers bookmark via fetch/POST formulaire, refactoring actions bulk (delete/visibility) avec URLs GET params au lieu de forms POST, ajout token shaarli dans includes.html, correction tag config bookmark (shaarit_config→themes), et support fermeture modal ESC/overlay-click
This commit is contained in:
@@ -10,10 +10,22 @@
|
||||
<!-- Prevent dark mode flash (FOUC) - must run before CSS loads -->
|
||||
<script>
|
||||
(function() {
|
||||
// Try to load theme config from bookmark first, fallback to localStorage
|
||||
var themeMode = localStorage.getItem('theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var themeId = localStorage.getItem('shaarit_theme_id') || 'DEFAULT';
|
||||
|
||||
// Try to fetch theme config from bookmark (async, but we'll use localStorage as fallback)
|
||||
// This is a simplified check - the full sync happens in script.js
|
||||
var bookmarkConfig = sessionStorage.getItem('themes_config');
|
||||
if (bookmarkConfig) {
|
||||
try {
|
||||
var config = JSON.parse(bookmarkConfig);
|
||||
if (config.default) themeId = config.default;
|
||||
if (config.mode) themeMode = config.mode;
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
// Disable light mode for dark-only themes
|
||||
var darkOnlyThemes = ['LINEAR', 'SPOTIFY', 'NOTION', 'DISCORD', 'DRACULA', 'ONE_DARK_PRO', 'TOKYO_NIGHT', 'NORD', 'NIGHT_OWL', 'ANTHRACITE', 'CYBERPUNK', 'NAVY_ELEGANCE', 'EARTHY'];
|
||||
if (darkOnlyThemes.indexOf(themeId) !== -1) {
|
||||
@@ -74,6 +86,7 @@ var shaarli = {
|
||||
basePath: '{$base_path}',
|
||||
rootPath: '{$root_path}',
|
||||
assetPath: '{$base_path}{$asset_path}',
|
||||
token: '{$token}',
|
||||
isAuth: (function(){/*{if="$is_logged_in"}*/return true;/*{else}*/return false;/*{/if}*/})(),
|
||||
pageName: '{$pageName}',
|
||||
visibility: '{$visibility}',
|
||||
|
||||
Reference in New Issue
Block a user