jonasknobloch commited on
Commit
d587967
·
verified ·
1 Parent(s): b298326

Upload index.html

Browse files
Files changed (1) hide show
  1. index.html +15 -1
index.html CHANGED
@@ -13,6 +13,14 @@
13
  go.run(result.instance);
14
  });
15
 
 
 
 
 
 
 
 
 
16
  async function tokenizeText() {
17
  const input = document.getElementById("textInput").value.trim();
18
  const modelChoice = document.getElementById("modelSelect").value;
@@ -139,6 +147,12 @@
139
  background: #0056b3;
140
  }
141
 
 
 
 
 
 
 
142
  #modelSelect {
143
  width: 80px;
144
  }
@@ -198,7 +212,7 @@
198
  <option value="131072" selected>2¹⁷ (128K)</option>
199
  </select>
200
  <input type="text" id="textInput" placeholder="Enter text here" value="airsickness">
201
- <button onclick="tokenizeText()">Tokenize</button>
202
  </div>
203
  <div id="wordTabs" class="word-tabs"></div>
204
  <code id="code" style="display: none;"></code>
 
13
  go.run(result.instance);
14
  });
15
 
16
+ document.addEventListener("DOMContentLoaded", function () {
17
+ const tokenizeButton = document.querySelector("button[onclick='tokenizeText()']");
18
+
19
+ window.onload = function () {
20
+ tokenizeButton.disabled = false;
21
+ };
22
+ });
23
+
24
  async function tokenizeText() {
25
  const input = document.getElementById("textInput").value.trim();
26
  const modelChoice = document.getElementById("modelSelect").value;
 
147
  background: #0056b3;
148
  }
149
 
150
+ button:disabled {
151
+ background: #ccc;
152
+ color: #666;
153
+ cursor: not-allowed;
154
+ }
155
+
156
  #modelSelect {
157
  width: 80px;
158
  }
 
212
  <option value="131072" selected>2¹⁷ (128K)</option>
213
  </select>
214
  <input type="text" id="textInput" placeholder="Enter text here" value="airsickness">
215
+ <button onclick="tokenizeText()" disabled>Tokenize</button>
216
  </div>
217
  <div id="wordTabs" class="word-tabs"></div>
218
  <code id="code" style="display: none;"></code>