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.