Skip to content

Commit

Permalink
Add placeholders to inputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmiegit committed Aug 2, 2023
1 parent 0ad004c commit d58238e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions web/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ const TRANSLATIONS = {
'auth-password': 'Password',
'attrib-label': 'Attribution',
'site-label': 'Site',
'site-placeholder': 'scp-jp',
'page-label': 'Page',
'page-placeholder': 'scp-001',
'admin-label': 'Administration',
'admin-password': 'Admin Password',
'password-type-regular': 'Regular',
Expand Down Expand Up @@ -262,12 +264,18 @@ function initializeMessages() {
document.getElementById(id).innerText = getMessage(messageKey || id);
}

function setPlaceholder(id, messageKey) {
document.getElementById(id).placeholder = getMessage(messageKey);
}

document.title = getMessage('title');
setMessage('auth-label');
setMessage('auth-password-label', 'auth-password');
setMessage('main-label', 'attrib-label');
setMessage('main-site-label', 'site-label');
setPlaceholder('main-site', 'site-placeholder');
setMessage('main-page-label', 'page-label');
setPlaceholder('main-page', 'page-placeholder');
setMessage('admin-label');
setMessage('admin-password-label', 'admin-password');
setMessage('admin-radio-regular-label', 'password-type-regular');
Expand Down

0 comments on commit d58238e

Please sign in to comment.