From e77f539a2df8efaf4dee129d68759654f1935589 Mon Sep 17 00:00:00 2001 From: Cavell Blood Date: Sun, 26 Sep 2021 15:04:42 -0500 Subject: [PATCH 1/7] Remove console logs --- src/js/main.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/js/main.js b/src/js/main.js index 9968477..206f094 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -88,7 +88,6 @@ const renderMessage = (opening) => { formatTimes(openingElements, opening) if (userFullTemplate) { - console.log('full user template') let messageContainer = messageTemplate.querySelector('.sts-full-message__container'); while (messageContainer.firstElementChild) { @@ -98,7 +97,6 @@ const renderMessage = (opening) => { messageContainer.insertBefore(message, null) } else if (userSimpleTemplate) { - console.log('simple user template') const messageArea = messageTemplate.querySelector('.sts-message-area'); messageArea.insertBefore(message, null) } From f176e4707cf5a974653ea8534fdddfc79a7ba7d0 Mon Sep 17 00:00:00 2001 From: Cavell Blood Date: Sun, 26 Sep 2021 15:04:58 -0500 Subject: [PATCH 2/7] Update comment --- src/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/main.js b/src/js/main.js index 206f094..45e427d 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -105,7 +105,7 @@ const renderMessage = (opening) => { const html = document.getElementsByTagName('html')[0] html.classList.add('sts-during-sabbath') - // Insert the messageTemplate as the last item on the page. + // Insert the messageTemplate as the first item on the page. document.body.insertBefore(messageTemplate, document.body.firstChild) } From 029d14c64d319e311f136f59331586232557e671 Mon Sep 17 00:00:00 2001 From: Cavell Blood Date: Sun, 26 Sep 2021 15:07:55 -0500 Subject: [PATCH 3/7] Close #3 --- CHANGELOG.md | 4 ++++ src/js/main.js | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7b1867..b2874c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## Unreleased +### Fixed +- Fix an issue where the opening times were being set too soon on the full message template and subsequently not being rendered. ([#3](https://github.com/cavellblood/sunset-to-sunset/issues/3)) + ## 1.0.0 ### Changed - Initial Release diff --git a/src/js/main.js b/src/js/main.js index 45e427d..c96d0bc 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -83,10 +83,6 @@ const renderMessage = (opening) => { const messageTemplate = template.content.cloneNode(true) - // Find all opening elements and add formatted times - const openingElements = messageTemplate.querySelectorAll('.sts-opening-time') - formatTimes(openingElements, opening) - if (userFullTemplate) { let messageContainer = messageTemplate.querySelector('.sts-full-message__container'); @@ -104,6 +100,10 @@ const renderMessage = (opening) => { const html = document.getElementsByTagName('html')[0] html.classList.add('sts-during-sabbath') + + // Find all opening elements and add formatted times + const openingElements = messageTemplate.querySelectorAll('.sts-opening-time') + formatTimes(openingElements, opening) // Insert the messageTemplate as the first item on the page. document.body.insertBefore(messageTemplate, document.body.firstChild) From 3b0c84eef7f25d84d3c5b130bd6fec46f203acf8 Mon Sep 17 00:00:00 2001 From: Cavell Blood Date: Sun, 26 Sep 2021 15:08:05 -0500 Subject: [PATCH 4/7] Add prettier code config --- prettier.config.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 prettier.config.js diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 0000000..c2b3a0d --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,3 @@ +module.exports = { + useTabs: true +} \ No newline at end of file From 445bb7294347ed6e5a4ca93ae2a7de0a593f1063 Mon Sep 17 00:00:00 2001 From: Cavell Blood Date: Sun, 26 Sep 2021 15:08:48 -0500 Subject: [PATCH 5/7] Format config --- vite.config.js | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/vite.config.js b/vite.config.js index 486ae0a..52d0f6f 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,10 +1,10 @@ -import legacy from '@vitejs/plugin-legacy' -import { nodeResolve } from '@rollup/plugin-node-resolve'; -import path from 'path'; +import legacy from "@vitejs/plugin-legacy"; +import { nodeResolve } from "@rollup/plugin-node-resolve"; +import path from "path"; // https://vitejs.dev/config/ export default ({ command }) => ({ - root: path.resolve(__dirname, "src"), + root: path.resolve(__dirname, "src"), build: { emptyOutDir: true, manifest: true, @@ -12,25 +12,23 @@ export default ({ command }) => ({ rollupOptions: { input: { "sunset-to-sunset": "./src/js/main.js", - test: "./src/tests/index.html" + test: "./src/tests/index.html", }, output: { sourcemap: true, entryFileNames: `assets/[name].min.js`, chunkFileNames: `assets/[name].js`, - assetFileNames: `assets/[name].[ext]` + assetFileNames: `assets/[name].[ext]`, }, }, }, - publicDir: './src/tests', - plugins: [ - legacy({ - targets: ['defaults', 'not IE 11'] - }), - nodeResolve({ - moduleDirectories: [ - path.resolve('./node_modules'), - ], - }), - ], -}) \ No newline at end of file + publicDir: "./src/tests", + plugins: [ + legacy({ + targets: ["defaults", "not IE 11"], + }), + nodeResolve({ + moduleDirectories: [path.resolve("./node_modules")], + }), + ] +}); From c77ac29787c0337b823ed6b6ebdd69a27cd6790a Mon Sep 17 00:00:00 2001 From: Cavell Blood Date: Sun, 26 Sep 2021 15:09:57 -0500 Subject: [PATCH 6/7] Specify Vite port number so that it doesn't conflict with other test projects running on port `3000`. --- CHANGELOG.md | 2 ++ vite.config.js | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2874c5..3b07836 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## Unreleased +### Changed +- Specify Vite port number so that it doesn't conflict with other test projects running on port `3000`. ### Fixed - Fix an issue where the opening times were being set too soon on the full message template and subsequently not being rendered. ([#3](https://github.com/cavellblood/sunset-to-sunset/issues/3)) diff --git a/vite.config.js b/vite.config.js index 52d0f6f..a39145d 100644 --- a/vite.config.js +++ b/vite.config.js @@ -30,5 +30,8 @@ export default ({ command }) => ({ nodeResolve({ moduleDirectories: [path.resolve("./node_modules")], }), - ] + ], + server: { + port: 3100 + } }); From fe6d0ec04e427ac87240c452d6db73b28ffa0f68 Mon Sep 17 00:00:00 2001 From: Cavell Blood Date: Sun, 26 Sep 2021 15:13:23 -0500 Subject: [PATCH 7/7] Version 1.0.1 --- CHANGELOG.md | 9 +++++---- package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b07836..9ee982d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,21 +4,22 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## Unreleased +## 1.0.1 - - 2021-09-26 ### Changed - Specify Vite port number so that it doesn't conflict with other test projects running on port `3000`. + ### Fixed - Fix an issue where the opening times were being set too soon on the full message template and subsequently not being rendered. ([#3](https://github.com/cavellblood/sunset-to-sunset/issues/3)) -## 1.0.0 +## 1.0.0 - 2021-09-23 ### Changed - Initial Release -## 1.0.0-beta.2 +## 1.0.0-beta.2 - 2021-09-23 ### Fixed - Added build files. -## 1.0.0-beta.1 +## 1.0.0-beta.1 - 2021-09-23 ### Added - Added a default banner template if no template is defined. - Allow multiple closing and opening elements to be added to the banner. diff --git a/package.json b/package.json index cba65b8..e377ee1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sunset-to-sunset", - "version": "1.0.0", + "version": "1.0.1", "description": "", "main": "src/js/main.js", "author": "Cavell Blood",