Skip to content

Commit b2ef256

Browse files
committed
feat: 移除全局切换前缀显示按钮
1 parent 9038c0d commit b2ef256

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

web/src/main.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -256,32 +256,6 @@ function loadContent(language: LanguageType): void {
256256

257257
// 等待DOM完全加载后执行代码
258258
document.addEventListener('DOMContentLoaded', function() {
259-
// 创建全局前缀切换按钮
260-
function createGlobalPrefixToggleButton() {
261-
const buttonContainer = document.createElement('div');
262-
buttonContainer.className = 'prefix-toggle-container';
263-
buttonContainer.style.display = 'inline-block';
264-
buttonContainer.style.marginRight = '1rem';
265-
266-
const toggleButton = document.createElement('button');
267-
toggleButton.id = 'prefix-toggle-button';
268-
toggleButton.className = 'button';
269-
toggleButton.textContent = 'Show without prefix';
270-
toggleButton.addEventListener('click', function() {
271-
// 切换全局前缀模式
272-
const newMode = currentPrefixMode === 'with-prefix' ? 'without-prefix' : 'with-prefix';
273-
applyPrefixMode(newMode);
274-
});
275-
276-
buttonContainer.appendChild(toggleButton);
277-
278-
// 将按钮添加到下拉菜单旁边
279-
const languageDropdown = document.getElementById('language');
280-
if (languageDropdown && languageDropdown.parentNode) {
281-
languageDropdown.parentNode.insertBefore(buttonContainer, languageDropdown);
282-
}
283-
}
284-
285259
// 初始化主题选择器
286260
const hlStyleParam: StyleType = (getURLParameter('hl_style') as StyleType) || 'atom-one-dark';
287261
const hlStyleNameMap: Record<StyleType, string> = {
@@ -405,8 +379,7 @@ document.addEventListener('DOMContentLoaded', function() {
405379
}
406380
};
407381

408-
// 创建全局前缀切换按钮
409-
createGlobalPrefixToggleButton();
382+
410383

411384
// 初始加载内容
412385
loadContent(languageParam);

0 commit comments

Comments
 (0)