-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsidebar.html
More file actions
150 lines (143 loc) · 7.1 KB
/
sidebar.html
File metadata and controls
150 lines (143 loc) · 7.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Japanese Grammar Checker</title>
<link rel="stylesheet" href="css/sidebar.css">
<!-- Remove the TailwindCSS CDN as it violates CSP -->
</head>
<body>
<div class="container">
<div class="tab-navigation">
<button class="tab-button active" data-tab="grammar">文法チェック</button>
<button class="tab-button" data-tab="translation">翻訳</button>
<button class="tab-button" data-tab="ai-chat">AIチャット</button>
<button id="settingsButton" class="icon-button settings-button" title="設定">⚙️</button>
</div>
<!-- Settings Menu Dropdown -->
<div id="settingsMenuDropdown" class="dropdown-menu settings-dropdown hidden">
<button id="importSettingsButton" class="dropdown-item">
<span class="menu-icon">📥</span>
<span class="menu-text">設定をインポート</span>
</button>
<button id="exportSettingsButton" class="dropdown-item">
<span class="menu-icon">📤</span>
<span class="menu-text">設定をエクスポート</span>
</button>
<button id="setApiKeyButton" class="dropdown-item">
<span class="menu-icon">🔑</span>
<span class="menu-text">APIキーを設定</span>
</button>
</div>
<!-- Grammar Check Tab -->
<div class="tab-content active" id="grammar-tab">
<textarea id="inputText" placeholder="ここに日本語を入力してください..." maxlength="10000"></textarea>
<div class="char-count" id="grammarCharCount">0 / 10000文字</div>
<div class="button-container">
<button id="checkButton">チェック</button>
<button id="clearButton" class="cancel-button" title="入力をクリア">
✕ 重置
</button>
</div>
<div id="loadingSpinner" class="hidden">
<div class="spinner"></div>
</div>
<div id="resultContainer" class="hidden">
<div id="result"></div>
<button id="copyButton" class="copy-button">
<span class="copy-text">コピー</span>
<span class="copied-text">Copied!</span>
</button>
</div>
<!-- History section (only for grammar check) -->
<div id="historyContainer" class="history-container">
<div class="history-header">
<h3>履歴</h3>
<div class="history-menu">
<button id="historyMenuButton" class="menu-button" title="履歴メニュー">
⋮
</button>
<div id="historyMenuDropdown" class="dropdown-menu hidden">
<button id="history-import-button" class="dropdown-item">
<span class="menu-icon">📥</span>
<span class="menu-text">履歴をインポート</span>
</button>
<button id="history-export-button" class="dropdown-item">
<span class="menu-icon">📤</span>
<span class="menu-text">履歴をエクスポート</span>
</button>
<button id="history-clear-button" class="dropdown-item">
<span class="menu-icon">🗑️</span>
<span class="menu-text">履歴を削除</span>
</button>
</div>
</div>
<input type="file" id="history-import-file" accept=".json" class="hidden">
</div>
<!-- Filter container (hidden, only for grammar type) -->
<div id="history-filter-container" class="history-filter-container" style="display: none;"></div>
<ul id="history-list" class="history-list"></ul>
</div>
</div>
<!-- Translation Tab -->
<div class="tab-content" id="translation-tab">
<textarea id="translationInput" placeholder="翻訳したいテキストを入力してください..." maxlength="10000"></textarea>
<div class="char-count" id="translationCharCount">0 / 10000文字</div>
<div class="translation-options">
<select id="sourceLanguage">
<option value="ja">日本語</option>
<option value="en">英語</option>
<option value="zh">中国語</option>
<option value="ko">韓国語</option>
</select>
<select id="targetLanguage">
<option value="en">英語</option>
<option value="ja">日本語</option>
<option value="zh">中国語</option>
<option value="ko">韓国語</option>
</select>
</div>
<div class="button-container">
<button id="translateButton">翻訳</button>
<button id="clearTranslationButton" class="cancel-button" title="入力をクリア">
✕ 重置
</button>
</div>
<div id="translationLoadingSpinner" class="hidden">
<div class="spinner"></div>
</div>
<div id="translationResultContainer" class="hidden">
<div id="translationResult"></div>
<button id="copyTranslationButton" class="copy-button">
<span class="copy-text">コピー</span>
<span class="copied-text">Copied!</span>
</button>
</div>
</div>
<!-- AI Chat Tab -->
<div class="tab-content" id="ai-chat-tab">
<textarea id="aiChatInput" placeholder="AIに質問してください..." maxlength="10000"></textarea>
<div class="char-count" id="aiChatCharCount">0 / 10000文字</div>
<div class="button-container">
<button id="sendAiChatButton">送信</button>
<button id="clearAiChatButton" class="icon-button" title="入力をクリア">
✕
</button>
</div>
<div id="aiChatLoadingSpinner" class="hidden">
<div class="spinner"></div>
</div>
<div id="aiChatResultContainer" class="hidden">
<div id="aiChatResult"></div>
<button id="copyAiChatButton" class="copy-button">
<span class="copy-text">コピー</span>
<span class="copied-text">Copied!</span>
</button>
</div>
</div>
</div>
<!-- Hidden file input for settings import -->
<input type="file" id="importSettingsFile" accept=".json" class="hidden">
<script src="js/sidebar.js" type="module"></script>
</body>
</html>