diff options
| author | Kumar Priyansh <[email protected]> | 2020-07-18 01:02:26 +0530 |
|---|---|---|
| committer | Kumar Priyansh <[email protected]> | 2020-07-18 01:02:26 +0530 |
| commit | 796b7f3f1eeaee548a9df67e9a72bd849bc97afb (patch) | |
| tree | 81f994dc01ff213a11f640f1092950ffeec36385 /src/views/system | |
| parent | 61d76581dfd79af06da591305e2c8b2e01790b57 (diff) | |
| download | authorr-796b7f3f1eeaee548a9df67e9a72bd849bc97afb.tar.xz authorr-796b7f3f1eeaee548a9df67e9a72bd849bc97afb.zip | |
Rename Chapter Function: Event Handling
Diffstat (limited to 'src/views/system')
| -rw-r--r-- | src/views/system/chapterRename.html | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/views/system/chapterRename.html b/src/views/system/chapterRename.html new file mode 100644 index 0000000..28a6ee8 --- /dev/null +++ b/src/views/system/chapterRename.html @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Document</title> + <link rel="stylesheet" href="../../nativekit/css/all.css"> +</head> + +<body> + <div class="window"> + <footer class="statusbar titlebar draggable"> + <h1 class="window-title">Change Chapter Name</h1> + <div class="padded"> + <div class="form-group"> + <input type="text" class="form-control" id="newChapterName" placeholder="New Chapter Name"> + </div> + </div> + <div class="toolbars"> + <button id="ok" class="button button-blue pull-right">OK</button> + <button id="cancel" class="button button-default pull-right">Cancel</button> + </div> + </footer> + </div> +</body> +<script>window.$ = window.jQuery = require('jquery');</script> +<script> + $('#newChapterName').focus(); + $(document).on('keypress', function (e) { + if (e.which == 13) { + $('#ok').click(); + } + }) + const remote = require('electron').remote; + const { ipcRenderer } = require('electron'); + $('#cancel').click(function () { + var window = remote.getCurrentWindow(); + window.close(); + }); + $('#ok').click(function () { + ipcRenderer.send('renamedChapter', $('#newChapterName').val()); + }) + ipcRenderer.on('currentChapterName', (event, arg) => { + $('#newChapterName').val(arg); + }) +</script> + +</html>
\ No newline at end of file |
