From 8f4eb50d12fb5efb82de92fd88186fe0b337356c Mon Sep 17 00:00:00 2001 From: Kenny Carlile Date: Thu, 28 Apr 2022 16:41:00 -0700 Subject: [PATCH 01/10] Preparing next release in changelog.md. --- CHANGELOG.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97cdf35..aecc387 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,21 @@ --- +## Release 1.8 + +Tag: v1.8 +Date: Month DD, 2022 +URL: +Commit: <> + +- ...next change. + ## Release 1.7 Tag: v1.7 Date: April 28, 2022 URL: -Commit: +Commit: - Add the option to display inversions/slash chords with bass notes. - Added debug mode and logging. From 47a0cfe3588999553bc7bdc82703b5c51a218b76 Mon Sep 17 00:00:00 2001 From: Kenny Carlile Date: Thu, 26 May 2022 13:06:30 -0700 Subject: [PATCH 02/10] Fixing dbg check. --- components/head.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/head.php b/components/head.php index ba3694f..c3193c2 100644 --- a/components/head.php +++ b/components/head.php @@ -9,7 +9,7 @@ function gtag(){dataLayer.push(arguments);} Practice chords, scales, or arpeggios with an endless stream of randomized chords | Flash Chord @@ -92,7 +95,7 @@
- +
diff --git a/js/flashchord.js b/js/flashchord.js index f67c142..7a50990 100644 --- a/js/flashchord.js +++ b/js/flashchord.js @@ -1,4 +1,4 @@ -/* global $current_beat:true, $current_bar:true, $downbeat_beep, $beat_beep, $quality:true, $extensions, $slash:true, $key:true, $keys, $chord_keys:true, $slash_degree:true, $root:true, logger, flatten, sharpen, setupBarsPerChord, setupBarsPerMeasure, setupBeatsPerMeasure, increment_beat, update_bars_progress, logger_new, logger_break, getRandom, $slash_degrees, $slash_note:true, $theoretical_keys, $all_chords, getHarmonicQualityMinor, getHarmonicQualityMajor, $extension:true, $chromatic, replaceRareEnharmonic, getTempo */ +/* global $current_beat:true, $current_bar:true, $downbeat_beep, $beat_beep, $quality:true, $extensions, $slash:true, $key:true, $keys, $chord_keys:true, $slash_degree:true, $root:true, logger, flatten, sharpen, setupBarsPerChord, setupBarsPerMeasure, setupBeatsPerMeasure, increment_beat, update_bars_progress, logger_new, logger_break, getRandom, $slash_degrees, $slash_note:true, $theoretical_keys, $all_chords, getHarmonicQualityMinor, getHarmonicQualityMajor, $extension:true, $chromatic, replaceRareEnharmonic, getTempo, $major_chords, $minor_chords, $dominant_chords, $diminished_chords, $augmented_chords, logger, PAGE_NAME */ // Safari audio lag fix // No idea why this works, but someone online said this fixed the problem and it did! :) @@ -17,7 +17,7 @@ $(document).ready(function() { // Init // ------------------------------------------------------------ // first, make sure we're on the home page before doing any of the chord stuff - if ($("#chord_name").length) { + if (PAGE_NAME == "homepage") { $chord = $next_chord ? $next_chord : getChord(); $next_chord = getChord(); @@ -91,7 +91,7 @@ function getChord() { $extension = getExtension(); $slash = getSlash($root, $quality); - $new_chord = $root + $quality + $extension + $slash; + $new_chord = buildChord($root, $quality, $extension, $slash); } while($next_chord == $new_chord); logger_break(); @@ -103,6 +103,22 @@ function getChord() { return $new_chord; } +// assemble the chord for display, handling any special situations +function buildChord($root, $quality, $extension, $slash) { + // handle simplified qualities for °, °7, and m7♭5 + if ($diminished_chords.includes($quality)) { + if ( + ( ($quality == "°") && ($("input[name=chord_type_dim]").is(":not(:checked)")) ) || + ( ($quality == "°7") && ($("input[name=chord_type_dim7]").is(":not(:checked)")) ) || + ( ($quality == "m7♭5") && ($("input[name=chord_type_m7b5]").is(":not(:checked)")) ) ) + { + $quality = "m"; + } + } + + return $root + $quality + $extension + $slash; +} + // get root of the chord based on selected settings function getRoot() { // get selected key @@ -154,7 +170,7 @@ function getChordQuality() { // minor $chord_types = getHarmonicQualityMinor($key.indexOf($root)); } else { - $chord_types = $all_chords; + $chord_types = $selected_chord_types; } // remove empty elements @@ -163,6 +179,7 @@ function getChordQuality() { logger("Chord types: " + $chord_types); // filter out chord types disabled by user + // FIX THIS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $chord_types = $chord_types.filter(function(chord) { return $selected_chord_types.includes(chord); }); @@ -172,9 +189,9 @@ function getChordQuality() { // get chord quality $quality = getRandom($chord_types); - // if the type returned is undefined because the user has eliminated the type... - // just default to major - if (!$quality) { + // if the type returned is undefined because the user has eliminated the type, just default to major + // also, if you get "M" as in major, just wipe the symbol (this is necessary as an empty value causes other problems) + if (!$quality || $quality == "M") { $quality = ""; } From 47a93e2764a6535c637eb5e3cf805328ec8ea47a Mon Sep 17 00:00:00 2001 From: Kenny Carlile Date: Tue, 31 May 2022 23:41:45 -0700 Subject: [PATCH 05/10] Create codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 72 +++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..860a63b --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,72 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ develop, master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ develop ] + schedule: + - cron: '42 23 * * 1' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 From 7ed0d4a16024aaa4fec81e9ea098f3607609418e Mon Sep 17 00:00:00 2001 From: Kenny Carlile Date: Tue, 2 May 2023 20:37:40 -0700 Subject: [PATCH 06/10] Updating Google Analytics tag for GA4 --- components/head.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/components/head.php b/components/head.php index c3193c2..95862bf 100644 --- a/components/head.php +++ b/components/head.php @@ -1,10 +1,11 @@ - - + + Date: Tue, 2 May 2023 21:05:26 -0700 Subject: [PATCH 07/10] Adding supporters to README.md and fixing some typos. --- CHANGELOG.md | 4 ++-- README.md | 22 ++++++++++++++++------ components/head.php | 8 ++++---- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e071deb..43a2814 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,12 @@ ## Release 1.8 Tag: v1.8 -Date: Month DD, 2022 +Date: May 2, 2023 URL: Commit: <> - Fixed bug in debugging-enabled check (no issue). -- +- Updated Google Analytics code to GA4. ## Release 1.7 diff --git a/README.md b/README.md index 08d6f80..d344988 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# FlashChord +# Flash Chord ## Functional @@ -10,7 +10,7 @@ Preview new features and test new development at [http://dev.flashchord.com](htt ### Logging and Debugging -Enable debugging in the browser console by adding `?dbg=1` to the URL. This will tell Flashchord to send logged messages to the console for viewing. Then, use the brower's console to view logging statements. +Enable debugging in the browser console by adding `?dbg=1` to the URL. This will tell Flash Chord to send logged messages to the console for viewing. Then, use the browser's console to view logging statements. For logging functionality, see the `js/utils.js` file and look at the following functions: @@ -33,12 +33,22 @@ For logging functionality, see the `js/utils.js` file and look at the following Kenny Carlile - GitHub: @KCarlile -- [http://www.kennycarlile.com/](http://www.kennycarlile.com/) +- [http://www.kcarlile.com/](http://www.kcarlile.com/) -## Contributions +## Code Contributions -If you'd like to contribute, please contact Kenny Carlile through GitHub or his website. Forks and PRs are welcome, but planned contributions are preferred. +If you'd like to contribute code to Flash Chord, please contact Kenny Carlile through GitHub or his website. Forks and PRs are welcome, but planned contributions are preferred. -## Contributors +### Code Contributors - _Your name here!_ + +## Supporters + +Flash Chord would like to extend a special thanks to our supporters who have made kind and generous donations. + +- Matt Godwin +- Marco Valenti +- Yohaan Pissurlenker +- Michael Jacobson +- Andrew Hawkes diff --git a/components/head.php b/components/head.php index 95862bf..b934ebf 100644 --- a/components/head.php +++ b/components/head.php @@ -1,11 +1,11 @@ Date: Tue, 2 May 2023 21:11:27 -0700 Subject: [PATCH 08/10] Adding Docker support for local development. --- Dockerfile | 3 +++ docker-compose.yml | 10 ++++++++++ server | 3 +++ 3 files changed, 16 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100755 server diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5b98ce1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM php:8.1.9-apache + +RUN a2enmod rewrite diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7110d08 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3.9' +services: + flashchord-php-apache: + build: . + image: php:8.1.9-apache + volumes: + - ./:/var/www/html/ + container_name: flashchord-php-apache + ports: + - 80:80 diff --git a/server b/server new file mode 100755 index 0000000..8b11d3d --- /dev/null +++ b/server @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose up --build \ No newline at end of file From 6670c2e151c1d04ff8b893d020c41c3f4256e33a Mon Sep 17 00:00:00 2001 From: Kenny Carlile Date: Tue, 2 May 2023 21:12:39 -0700 Subject: [PATCH 09/10] Adding Docker support for local development. --- CHANGELOG.md | 1 + README.md | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43a2814..4546ff2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Commit: <> - Fixed bug in debugging-enabled check (no issue). - Updated Google Analytics code to GA4. +- Added Docker support for local development. ## Release 1.7 diff --git a/README.md b/README.md index d344988..beb1c3a 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,18 @@ For logging functionality, see the `js/utils.js` file and look at the following - jQuery - PHP +### Docker + +Docker is used for local development, although you're welcome to setup your own development hosting stack yourself using Apache and PHP. The `/Dockerfile` and `/docker-composer.yml` files define the images and behaviors required to launch the local development containers. + +You'll need to modify your `/etc/localhost` file to include: `127.0.0.1 flashchord.com.local` to `/etc/hosts` + +To run this container (i.e. launch the "server"), follow these steps: + +- `$ docker compose up --build` rebuilds and launches the container + - Or run `$ ./server` from the root of the project folder +- to access + ## Creator Kenny Carlile From e48de926c86f526a1eacf643a337a6907e482704 Mon Sep 17 00:00:00 2001 From: Kenny Carlile Date: Tue, 2 May 2023 21:16:08 -0700 Subject: [PATCH 10/10] Adding Docker support for local development. --- server | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server b/server index 8b11d3d..651bf6c 100755 --- a/server +++ b/server @@ -1,3 +1,3 @@ #!/bin/bash -docker compose up --build \ No newline at end of file +docker compose up --build