Up to Main Index Up to Journal for May, 2019 JOURNAL FOR THURSDAY 16TH MAY, 2019 ______________________________________________________________________________ SUBJECT: More feedback, cottage tweaked… DATE: Thu 16 May 16:55:32 BST 2019 Still getting feedback on ‘The Cottage’ which has been, and is, amazing. I’ve made a number of further tweaks and fixes: - The Terminal buffer is now sized as intended. - During initialisation the ‘ ’ should be added after the buffer data and not into the buffer data itself. - Terminal.write loop has been simplified. - Player.move has been simplified and cleaned up. - The player’s input is now coloured (magenta) in the Terminal’s output. - Terminal output now sets white-space to pre-wrap instead of pre-line. The change to make the player’s input magenta is an example of writing arbitrary HTML into the output. I added this as I had a few people asking if such things were possible. Setting white-space to pre-wrap instead of pre-line allows the use of white space for laying out text. Before this change runs of white-space would collapse into a single white space. The online, playable version has been updated: cottage.html NOTE: There is only one copy of ‘The Cottage’ on this site at the moment, so previous posts will also be using the newest version. When I get the new section for ‘The Cottage’ up and running I’ll amend the journal entries to all point to a single copy there. There is now a git repository for ‘The Cottage’ available: git clone https://code.wolfmud.org/theCottage.git When writing this version of ‘The Cottage’ I actually dropped initial support for Internet Explorer 11. First I had issues with HTML layout, then input field events, then issues with unsupported JavaScript features. I wanted to stick with plain JavaScript. That meant no frameworks and no polyfills for missing features. As the code developed the frontend was rebuilt — and what do you know, suddenly it mostly worked in IE11! So I tweaked the front end until it worked in IE11 without making any compromises. I tweaked the JavaScript so it only used ES5 features[1] plus ‘const’ and ‘let’ from ES6 — thankfully IE11 mostly supports ‘const’ and ‘let’ at least! For the basic version of ‘The Cottage’ I’m going to carry on supporting IE11 unless it becomes a huge burden. However, I also plan on a more advanced version of ‘The Cottage’, maybe even try my hand at a PWA[2]… One supported implementation of ‘The Cottage’ that is conspicuous by it’s absence is a command line version. All I need is a JavaScript shell and a new Terminal implementation, or is that just wishful thinking? :s Once again it may seem that I have gone off on a tangent and I am ignoring my main WolfMUD development. However, I need to bulk up my skills and my résumé. Would you rather I went silent and worked on something just for myself, or produce something fun that everyone can use? -- Diddymus [1] Current browser JavaScript coverage[3]: ES5 ES6 Chrome: 100% 98% Firefox: 100% 98% Microsoft Edge: 100% 96% Safari: 99% 99% Internet Explorer 11: 99% 11% [2] A very handy JavaScript compatibility resource I found: http://kangax.github.io/compat-table/es5/ [3] Progressive Web Application — installable, full screen, can work off-line: https://developers.google.com/web/progressive-web-apps/ Up to Main Index Up to Journal for May, 2019