diff --git a/freechat-client/pages/index.html b/freechat-client/pages/index.html index 158f617..d11ec73 100644 --- a/freechat-client/pages/index.html +++ b/freechat-client/pages/index.html @@ -44,15 +44,15 @@
-
-
- - -
-
+
+ +
+ +
+
+
- - - - - @@ -110,21 +96,6 @@ - + diff --git a/freechat-client/sass/message-box.scss b/freechat-client/sass/message-box.scss new file mode 100644 index 0000000..30d101a --- /dev/null +++ b/freechat-client/sass/message-box.scss @@ -0,0 +1,14 @@ +// Now the message box which must be pinned at the bottom +#send-container { + position: absolute; + bottom: 0; + height: 60px; +} + +#message-box { + margin-top: auto; +} + +#message-area { + width: 50vw; +} diff --git a/freechat-client/sass/style.scss b/freechat-client/sass/style.scss index 5518697..fcaff0c 100644 --- a/freechat-client/sass/style.scss +++ b/freechat-client/sass/style.scss @@ -3,6 +3,7 @@ @import 'join-modal'; @import 'channels'; @import 'settings-modal'; +@import 'message-box'; body { color: $text; @@ -113,20 +114,4 @@ ul ul a { max-height: 1005px; // 1080 - $send-container-height } -// Now the message box which must be pinned at the bottom -#send-container { - position: absolute; - bottom: 0; - height: 50px; - width: 100vw; -} - -#message-box { - padding-right: 25px; -} - -#message-submit { - padding-left: 25px; - width: 25px; -} diff --git a/freechat-client/src/init.js b/freechat-client/src/init.js new file mode 100644 index 0000000..2344d17 --- /dev/null +++ b/freechat-client/src/init.js @@ -0,0 +1,24 @@ +const { ipcRenderer } = require('electron') +const $ = require('jquery') + + +// Path is from pages/index.html +const auth = require('../src/auth.js') +const { add_to_server_config } = require('../src/settings.js') +const message = require('../src/messages.js') + + +$('#add-admin-json').click(async () => { await add_server_to_config() } ) +$('#message-box').on('keypress', async (event) => { + if(event.keyCode == 13 && !event.shiftKey ) { + await message.send() + } +}) + +$('#message-btn').on('click', () => console.log('submitting')) + +auth.init() +.then( + value => console.log('Got config', value), + reason => console.log('Failure in IPC call', reason) +)