Release cleanup and fix

- added auto-scroll to message to edit
- fixed style issues
pull/24/head
Trivernis 6 years ago
parent db5650e329
commit b723d2aa85

@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased] ## [0.2.0] - 2019-05-23
### Added ### Added

@ -6,7 +6,6 @@
const appInit = require('../app'); const appInit = require('../app');
const debug = require('debug')('whooshy:server'); const debug = require('debug')('whooshy:server');
const http = require('http');
const yaml = require('js-yaml'); const yaml = require('js-yaml');
const fsx = require('fs-extra'); const fsx = require('fs-extra');

@ -318,6 +318,8 @@ class ChatInput {
this.element.value = message.getAttribute('msg-raw'); this.element.value = message.getAttribute('msg-raw');
this.editId = Number(message.getAttribute('msg-id')); this.editId = Number(message.getAttribute('msg-id'));
let chatContent = document.querySelector('#chat-content');
chatContent.scrollTop = message.offsetTop;
} else { } else {
this.setNormal(); this.setNormal();
} }
@ -331,6 +333,8 @@ class ChatInput {
if (lastMessage) if (lastMessage)
lastMessage.classList.remove('selected'); lastMessage.classList.remove('selected');
this.editId = null; this.editId = null;
let chatContent = document.querySelector('#chat-content');
chatContent.scrollTop = chatContent.scrollHeight;
} }
} }
} }
@ -881,12 +885,10 @@ window.addEventListener("unhandledrejection", function (promiseRejectionEvent) {
// prevent ctrl + s // prevent ctrl + s
window.addEventListener("keydown", async (e) => { window.addEventListener("keydown", async (e) => {
if (e.which === 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) { if (e.which === 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey) && document.querySelector('#input-bingo-words')) {
if (document.querySelector('#input-bingo-words')) { e.preventDefault();
e.preventDefault(); let gridSize = document.querySelector('#input-grid-size').value || 3;
let gridSize = document.querySelector('#input-grid-size').value || 3; await statusWrap(async () => await BingoGraphqlHelper.setLobbySettings(getLobbyWords(), gridSize));
await statusWrap(async () => await BingoGraphqlHelper.setLobbySettings(getLobbyWords(), gridSize));
}
} }
if ([40, 38, 27].includes(e.which) && e.target === document.querySelector('#chat-Input')) { if ([40, 38, 27].includes(e.which) && e.target === document.querySelector('#chat-Input')) {
e.preventDefault(); e.preventDefault();

@ -1520,7 +1520,7 @@ async function resolvePlayer(playerWrapper, lobbyId) {
/** /**
* Resolves a fieldWrapper object * Resolves a fieldWrapper object
* @param fieldWrapper * @param fieldWrapper
* @returns {Promise<{submitted: (Object.submitted|*), column: *, bingo: boolean, row: (Object.grid_row|number|*)}>} * @returns {Promise<{submitted: (Object.submitted|*), column: *, bingo: boolean, row: (*)}>}
*/ */
async function resolveGridField(fieldWrapper) { async function resolveGridField(fieldWrapper) {
return { return {

@ -1,7 +1,6 @@
const express = require('express'), const express = require('express'),
router = express.Router(), router = express.Router(),
globals = require('../lib/globals'), globals = require('../lib/globals'),
fsx = require('fs-extra'),
mdEmoji = require('markdown-it-emoji'), mdEmoji = require('markdown-it-emoji'),
md = require('markdown-it')() md = require('markdown-it')()
.use(mdEmoji); .use(mdEmoji);

Loading…
Cancel
Save