PageSourceSearch

https://contribuer.geotribu.fr/assets/document_dates/core/default.config.js

js geotribu.fr collected 2026-09-24 18:35:53 UTC 5,195 bytes, 166 lines download raw bytes

1/*
2    Tooltip 配置
3*/
4const ttDefaultConfig = {
5    // 可配置: light material, 或在 config.css 中自定义的主题
6    theme: {
7        light: 'light',
8        dark: 'material'
9    },
10    placement: 'bottom',    // 位置: top bottom left right auto
11    offset: [0, 12],        // 位置偏移: [horizontal, vertical]
12    allowHTML: true,        // 是否允许 HTML 内容
13    interactive: true,      // 是否允许内容交互
14    animation: 'scale',     // 动画类型: scale shift-away
15    inertia: true,          // 是否允许动画惯性
16    zIndex: 2,              // 控制 tooltip 元素的显示层级(z-index)
17    // arrow: false,           // 是否允许箭头
18    // animateFill: true,      // 背景填充颜色是否应为动画效果
19    // delay: [400, null],     // 动画延迟: [show, hide]: show 为 400 毫秒, hide 为 null 表示默认值
20};
21let tooltip_config = { ...ttDefaultConfig };
22function setConfig(newConfig) {
23    tooltip_config = {
24        ...ttDefaultConfig,
25        ...newConfig
26    };
27}
28window.TooltipConfig = { setConfig };
29
30
31
32/*
33    语言包配置
34*/
35// 通过 IIFE(立即执行的函数表达式)创建 TooltipLanguage
36window.TooltipLanguage = (function () {
37    const allLangs = new Map();
38
39    /*
40    用户 locale 值      匹配顺序(fallback 列表)
41    zh-Hans-CN         zh-Hans-CN → zh-Hans → zh → en
42    zh_CN              zh-CN → zh → en
43    fr-FR              fr-FR → fr → en
44    ko                 ko → en
45    */
46    // 生成 fallback 列表
47    function generateFallbacks(locale, defaultLocale = 'en') {
48        const normalized = locale.trim().replace(/_/g, '-');
49        const parts = normalized.split('-');
50        const fallbacks = [];
51        for (let i = parts.length - 1; i >= 2; i--) {
52            fallbacks.push(parts.slice(0, i).join('-'));
53        }
54        fallbacks.push(parts[0]);
55        if (!fallbacks.includes(defaultLocale)) {
56            fallbacks.push(defaultLocale);
57        }
58        return fallbacks;
59    }
60    return {
61        register(locale, data) {
62            // 合并数据,支持字段合并覆盖
63            const existingData = allLangs.get(locale) || {};
64            allLangs.set(locale, {
65                ...existingData,
66                ...data
67            });
68        },
69        get(locale) {
70            // 优先原值直接匹配
71            if (allLangs.has(locale)) return allLangs.get(locale);
72            // 进入降级匹配
73            const fallbacks = generateFallbacks(locale);
74            for (const fallbackLocale of fallbacks) {
75                const data = allLangs.get(fallbackLocale);
76                if (data) {
77                    return data;
78                }
79            }
80            return {};
81        }
82    };
83})();
84
85// 在 IIFE 内部注册默认语言包
86(function() {
87    const defaultLanguages = {
88        ar: {
89            created_time: "تاريخ الإنشاء",
90            updated_time: "تاريخ التعديل",
91            author: "المؤلف",
92            authors: "المؤلفون"
93        },
94        de: {
95            created_time: "Erstellungszeit",
96            updated_time: "Änderungszeit",
97            author: "Autor",
98            authors: "Autoren"
99        },
100        en: {
101            created_time: "Created",
102            updated_time: "Last Update",
103            author: "Author",
104            authors: "Authors"
105        },
106        es: {
107            created_time: "Fecha de creación",
108            updated_time: "Fecha de modificación",
109            author: "Autor",
110            authors: "Autores"
111        },
112        fr: {
113            created_time: "Date de création",
114            updated_time: "Date de modification",
115            author: "Auteur",
116            authors: "Auteurs"
117        },
118        ja: {
119            created_time: "作成日時",
120            updated_time: "更新日時",
121            author: "著者",
122            authors: "著者"
123        },
124        ko: {
125            created_time: "작성일",
126            updated_time: "수정일",
127            author: "작성자",
128            authors: "작성자"
129        },
130        nl: {
131            created_time: "Gecreëerd",
132            updated_time: "Laatst geüpdatet",
133            author: "Auteur",
134            authors: "Auteurs"            
135        },
136        pt: {
137            created_time: "Criado em",
138            updated_time: "Última atualização",
139            author: "Autor",
140            authors: "Autores"
141        },
142        ru: {
143            created_time: "Дата создания",
144            updated_time: "Дата изменения",
145            author: "Автор",
146            authors: "Авторы"
147        },
148        zh: {
149            created_time: "创建时间",
150            updated_time: "最后更新",
151            author: "作者",
152            authors: "作者"
153        },
154        zh_TW: {
155            created_time: "建立時間",
156            updated_time: "修改時間",
157            author: "作者",
158            authors: "作者"
159        }
160    };
161
162    // 统一注册默认语言
163    Object.entries(defaultLanguages).forEach(([locale, data]) => {
164        TooltipLanguage.register(locale, data);
165    });
166})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.