diff options
| author | Shulhan <ms@kilabit.info> | 2021-08-28 20:23:24 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-08-28 21:12:26 +0700 |
| commit | 50c57f048eecab68570a0568f20922044935ecca (patch) | |
| tree | fe2f28401145e524fa09a0688ba59c50cf26dbaa /notif/example.html | |
| parent | cf678376a91bf58ff4d9c032f96662ca02bdc59b (diff) | |
| download | pakakeh.ts-50c57f048eecab68570a0568f20922044935ecca.tar.xz | |
all: refactoring to follow the coding style in README
* Use snake_case for field, variable, HTML ID, and CSS class names.
* Use camelCase for class, interface, type, function, or method names.
* An exported type or class. interface, type, method, or function name
MUST start with an upper-case letter.
* An exported class, type, interface, or function MUST be prefixed with
"Wui".
Diffstat (limited to 'notif/example.html')
| -rw-r--r-- | notif/example.html | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/notif/example.html b/notif/example.html index 681a951..e6b12c5 100644 --- a/notif/example.html +++ b/notif/example.html @@ -4,41 +4,37 @@ <meta charset="UTF-8" /> <title>WUI - notif</title> <style> - .test-1 { - width: 80%; + #input_msg { + width: calc(100% - 1em); height: 4em; - border: 2px solid salmon; - background-color: lightsalmon; - margin-bottom: 1em; - } - .test-2 { - width: 80%; - height: 4em; - border: 2px solid silver; - background-color: honeydew; - margin-bottom: 1em; } </style> </head> <body onload="main()"> - <input id="notif.msg"></input> + <textarea id="input_msg"></textarea> <button onclick="notifInfo()">Info</button> - <button onclick="notifError()">Error</button> - - <br/> - <br/> - <div class="test-1"></div> - <div class="test-2"></div> + <button onclick="notifError()">Error</button + <p></p> <script> var exports = {} - let inputMsg = document.getElementById("notif.msg") + let inputMsg = document.getElementById("input_msg") let wuiNotif = null </script> <script src="notif.js"></script> <script> function main() { wuiNotif = new WuiNotif() - inputMsg.value = `test <b>bold</b>` + inputMsg.value = `Hello world, this is a notification with HTML format using <b>bold</b> and <u>underline</u> words.` + + let previewError = document.createElement("div") + previewError.classList.add(`${WUI_NOTIF_CLASS_ERROR}`) + previewError.innerText = `Preview of error style`; + document.body.appendChild(previewError) + + let previewInfo = document.createElement("div") + previewInfo.classList.add(`${WUI_NOTIF_CLASS_INFO}`) + previewInfo.innerText = `Preview of info style`; + document.body.appendChild(previewInfo) } function notifInfo() { wuiNotif.Info(inputMsg.value) |
