Skip to content

Commit f63f972

Browse files
committed
testing
1 parent cbb64ae commit f63f972

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

docs/index.html

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ <h1 id="title">Mercury 2025</h1>
234234

235235
set value(newValue) {
236236
this.element.value = newValue;
237-
localStorage.setItem(this.id, newValue);
238-
this.updateOutlineColor();
237+
this.saveAndUpdateUI();
239238
}
240239

241240
get value() {
@@ -275,10 +274,12 @@ <h1 id="title">Mercury 2025</h1>
275274
}
276275

277276
addListener() {
278-
this.element.addEventListener('input', () => {
279-
localStorage.setItem(this.id, this.value);
280-
this.updateOutlineColor();
281-
});
277+
this.element.addEventListener('input', () => this.saveAndUpdateUI(this.value));
278+
}
279+
280+
saveAndUpdateUI(newValue) {
281+
localStorage.setItem(this.id, newValue);
282+
this.updateOutlineColor();
282283
}
283284

284285
updateOutlineColor() {
@@ -311,7 +312,7 @@ <h1 id="title">Mercury 2025</h1>
311312
static type = 'textBox';
312313

313314
isValid() {
314-
return this.value.length < 150;
315+
return this.value.length < 250;
315316
}
316317

317318
clear() {
@@ -322,7 +323,7 @@ <h1 id="title">Mercury 2025</h1>
322323
const container = super.createElement();
323324
container.classList.add('text_box_question');
324325
const textarea = document.createElement('textarea');
325-
textarea.maxLength = 150;
326+
textarea.maxLength = 250;
326327
container.appendChild(textarea);
327328
this.element = textarea;
328329
this.addListener();
@@ -345,9 +346,7 @@ <h1 id="title">Mercury 2025</h1>
345346
this._value = newValue;
346347
this.buttonMap.forEach(btn => btn.classList.remove('selected'));
347348
this.buttonMap.get(newValue)?.classList.add('selected');
348-
349-
localStorage.setItem(this.id, newValue);
350-
this.updateOutlineColor();
349+
this.saveAndUpdateUI(newValue);
351350
}
352351

353352
get value() {
@@ -431,8 +430,7 @@ <h1 id="title">Mercury 2025</h1>
431430

432431
set value(newValue) {
433432
this.element.textContent = String(newValue);
434-
localStorage.setItem(this.id, newValue);
435-
this.updateOutlineColor();
433+
this.saveAndUpdateUI(newValue);
436434
}
437435

438436
get value() {

0 commit comments

Comments
 (0)