From 76ef0ac10f8d7acd3c901bae54a2119d7c6ee18f Mon Sep 17 00:00:00 2001 From: Oliver Kogel Date: Wed, 15 Jan 2020 18:14:04 +0100 Subject: [PATCH 01/20] update electron and electron-builder --- .gitignore | 1 + package.json | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 52d0ff8..456e08e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules dist package-lock.json.2996981966 +package-lock.json diff --git a/package.json b/package.json index fc2449e..86c78e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tracklister", - "version": "1.6.1", + "version": "1.6.2", "description": "Generating tracklists from .m3u8 and .nml files.", "main": "main.js", "scripts": { @@ -10,8 +10,8 @@ "author": "Oliver Kogel", "license": "CC0-1.0", "devDependencies": { - "electron": "^5.0.6", - "electron-builder": "^20.44.4", + "electron": "^7.1.9", + "electron-builder": "^22.2.0", "electron-winstaller": "^3.0.4" }, "dependencies": { From 9eb820c07357e549487059f9b96793764ca08745 Mon Sep 17 00:00:00 2001 From: Oliver Kogel Date: Thu, 16 Jan 2020 21:10:42 +0100 Subject: [PATCH 02/20] Revert "update electron and electron-builder" This reverts commit 76ef0ac10f8d7acd3c901bae54a2119d7c6ee18f. --- .gitignore | 1 - package.json | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 456e08e..52d0ff8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ node_modules dist package-lock.json.2996981966 -package-lock.json diff --git a/package.json b/package.json index 86c78e7..fc2449e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tracklister", - "version": "1.6.2", + "version": "1.6.1", "description": "Generating tracklists from .m3u8 and .nml files.", "main": "main.js", "scripts": { @@ -10,8 +10,8 @@ "author": "Oliver Kogel", "license": "CC0-1.0", "devDependencies": { - "electron": "^7.1.9", - "electron-builder": "^22.2.0", + "electron": "^5.0.6", + "electron-builder": "^20.44.4", "electron-winstaller": "^3.0.4" }, "dependencies": { From c7c6f2b8d84d2ab6b9562c1819a04b0dbb386011 Mon Sep 17 00:00:00 2001 From: Oliver Kogel Date: Thu, 16 Jan 2020 21:26:35 +0100 Subject: [PATCH 03/20] update version number to 1.6.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d262144..a9d309c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tracklister", - "version": "1.6.1", + "version": "1.6.2", "description": "Generating tracklists from .m3u8 and .nml files.", "main": "main.js", "scripts": { From 697c64bba68da1f7a9b83546076040929708e894 Mon Sep 17 00:00:00 2001 From: Oliver Kogel Date: Thu, 16 Jan 2020 21:30:39 +0100 Subject: [PATCH 04/20] update bulma to 0.8.0 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 48f0a69..abd434f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tracklister", - "version": "1.6.1", + "version": "1.6.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -349,9 +349,9 @@ } }, "bulma": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/bulma/-/bulma-0.7.5.tgz", - "integrity": "sha512-cX98TIn0I6sKba/DhW0FBjtaDpxTelU166pf7ICXpCCuplHWyu6C9LYZmL5PEsnePIeJaiorsTEzzNk3Tsm1hw==" + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/bulma/-/bulma-0.8.0.tgz", + "integrity": "sha512-nhf3rGyiZh/VM7FrSJ/5KeLlfaFkXz0nYcXriynfPH4vVpnxnqyEwaNGdNCVzHyyCA3cHgkQAMpdF/SFbFGZfA==" }, "cacheable-request": { "version": "6.1.0", diff --git a/package.json b/package.json index a9d309c..0c60990 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "dependencies": { "@fortawesome/fontawesome-free": "^5.11.2", "array-move": "^2.2.0", - "bulma": "^0.7.5", + "bulma": "^0.8.0", "electron-json-storage": "^4.1.8", "firstline": "^2.0.2", "music-metadata": "^4.8.2", From 7fae2866f38b28dfce9a0e36eb90ffe26839981a Mon Sep 17 00:00:00 2001 From: Oliver Kogel Date: Fri, 17 Jan 2020 14:44:51 +0100 Subject: [PATCH 05/20] fix edit input border radius --- src/style.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/style.css b/src/style.css index 37c628b..99734e0 100644 --- a/src/style.css +++ b/src/style.css @@ -22,6 +22,16 @@ html { height: 100%; overflow:auto; } font-family: monospace; } +#edit_submit { + border-top-left-radius: 0%; + border-top-right-radius: 0%; +} + +#edit_input { + border-bottom-left-radius: 0%; + border-bottom-right-radius: 0%; +} + .footer { position: absolute; bottom: 0; From 184cb2208b737cb987ed619b785c5f2d3e641fbd Mon Sep 17 00:00:00 2001 From: Oliver Kogel Date: Fri, 17 Jan 2020 18:33:03 +0100 Subject: [PATCH 06/20] add a confirmation dialogue when dropping playlist file --- src/index.html | 17 +++++++++++++++ src/modules/DOM.js | 45 +++++++++++++++++++++++++++++++++------- src/modules/converter.js | 1 - src/style.css | 4 ++++ 4 files changed, 58 insertions(+), 9 deletions(-) diff --git a/src/index.html b/src/index.html index 07764da..1a3887a 100644 --- a/src/index.html +++ b/src/index.html @@ -139,6 +139,7 @@ + + + + +
+
+ Single audio files + .wav + .mp3 + .flac + .aiff + .aif + .aac + .ogg + .wma +
+

Settings Guide

Promo Syntax

This is what the entry will be changed to when pressing the "Set To Promo" button.
- Usually people use Unknown Artist - Unknown Title or ID - ID + Usually people use Unknown Artist - Unknown Title or ID - ID


Ignore List

@@ -131,9 +144,14 @@ Especially if your - seperator is not spaced or does not exist.
Tag your tracks, folks!

+

Beatport-Link Integration

+

+ Since creating tracklists with Beatport-Link tracks is an absolute pain,
+ Tracklister will, when enabled, attempt to somewhat automate that process +


- Please be adviced that when disabling options that remove content, + Please be adviced that when disabling options that alter content, you will have to reload your source file, in order to restore that content.


@@ -159,7 +177,7 @@

Start fresh?


- +
From f3d67cbd121684ac244eb7a67ee7b4713f2f5209 Mon Sep 17 00:00:00 2001 From: Oliver Kogel Date: Sat, 18 Jan 2020 14:26:16 +0100 Subject: [PATCH 16/20] disable bpl integration for 1.6.2 release --- src/tracklister.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tracklister.js b/src/tracklister.js index 2bbb604..7e78ba0 100644 --- a/src/tracklister.js +++ b/src/tracklister.js @@ -15,8 +15,8 @@ Settings.Start(); if (REMOTE.process.platform == 'win32') { // Currently beatport-link functionality only works on Windows try { - const BeatportLink = require('./modules/beatport-link'); - BeatportLink.Start(); + // const BeatportLink = require('./modules/beatport-link'); + // BeatportLink.Start(); } catch (err) { console.log("BeatportLink integration could not be initialised: " + err); From 2dbf4480679d580f90ff4b1d9bd135252cb76752 Mon Sep 17 00:00:00 2001 From: Oliver Kogel Date: Sat, 18 Jan 2020 14:26:33 +0100 Subject: [PATCH 17/20] more consistent shortcut support --- src/modules/key.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/key.js b/src/modules/key.js index 89e08ed..cd07212 100644 --- a/src/modules/key.js +++ b/src/modules/key.js @@ -8,10 +8,15 @@ document.addEventListener('keyup', function(e) { }); } if (e.key === "Enter") { + let counter = 0; Array.from(document.getElementsByClassName('modal')).forEach(function(elem) { if (elem.classList.contains('is-active')) { + counter++; elem.getElementsByClassName('submit')[0].click(); } }); + if (counter == 0) { + Editor.Add.Append('new'); + } } }); \ No newline at end of file From e82c0fe3d810ed3da3db749b2f19e149723dd787 Mon Sep 17 00:00:00 2001 From: Oliver Kogel Date: Sat, 18 Jan 2020 14:35:46 +0100 Subject: [PATCH 18/20] change prom button to blue, yellow was unreadable --- src/modules/DOM.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/DOM.js b/src/modules/DOM.js index b49f368..d31e18d 100644 --- a/src/modules/DOM.js +++ b/src/modules/DOM.js @@ -89,7 +89,7 @@ Write = { Delete - + Set to Promo From ff84cee4fc949684eff31a519f00c793c53893f7 Mon Sep 17 00:00:00 2001 From: Oliver Kogel Date: Sat, 18 Jan 2020 14:50:40 +0100 Subject: [PATCH 19/20] new context moving concept, no implementation yet --- src/modules/DOM.js | 35 +++++++++++++++++++++++++++++------ src/modules/editor.js | 1 + 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/modules/DOM.js b/src/modules/DOM.js index d31e18d..983d336 100644 --- a/src/modules/DOM.js +++ b/src/modules/DOM.js @@ -95,13 +95,36 @@ Write = { Edit + - - Move Up - - - Move Down - + +
+

+ + + + + +

+

+ + + + + +

+

+ +

+

+ + + + + +

+
+ Insert 1 above diff --git a/src/modules/editor.js b/src/modules/editor.js index af90206..172cb69 100644 --- a/src/modules/editor.js +++ b/src/modules/editor.js @@ -62,6 +62,7 @@ function addAbove(id) { function addBelow(id) { State.Adding.Below.Set(true); + addTrack(id); } From 54bce0526cd6b9c372c83ace7271537e3b6535eb Mon Sep 17 00:00:00 2001 From: Oliver Kogel Date: Sat, 18 Jan 2020 16:17:52 +0100 Subject: [PATCH 20/20] extremely nice context move implementation --- src/modules/DOM.js | 11 ++++--- src/modules/editor.js | 71 ++++++++++++++++++++++++++++++++++--------- src/modules/key.js | 19 ++++++++++-- 3 files changed, 78 insertions(+), 23 deletions(-) diff --git a/src/modules/DOM.js b/src/modules/DOM.js index 983d336..fe056db 100644 --- a/src/modules/DOM.js +++ b/src/modules/DOM.js @@ -100,24 +100,24 @@ Write = {

- - + +

- +

- +

- + @@ -235,6 +235,7 @@ document.getElementById('erase_btn').addEventListener('click', function() { }); + // NOT IMPLEMENTED YET // dragover function (no implementation yet) diff --git a/src/modules/editor.js b/src/modules/editor.js index 172cb69..758f147 100644 --- a/src/modules/editor.js +++ b/src/modules/editor.js @@ -14,11 +14,17 @@ module.exports = { } }, Move: { - Up: function(element, id) { - moveUp(element, id) + Up: function(id) { + moveUp(id) }, - Down: function(element, id) { - moveDown(element, id); + Down: function(id) { + moveDown(id); + }, + Check: function(element) { + moveCheck(element); + }, + To: function(id) { + moveTo(id); } }, Delete: function(element, id) { @@ -62,31 +68,66 @@ function addAbove(id) { function addBelow(id) { State.Adding.Below.Set(true); - + addTrack(id); } // if called, it shifts the track one position up in the array // => refresh the UI afterwards -function moveUp(element, id) { +function moveUp(id) { // make sure the element isn't the first - if (id-1 < 1) {} - else { - Data.Tracks = ARRAY_MOVE(Data.Tracks, id-1, id-2); - DOM.UI.Update(); + // if (id-1 < 1) {} + // else { + // Data.Tracks = ARRAY_MOVE(Data.Tracks, id-1, id-2); + // DOM.UI.Update(); + // } + + let value = document.getElementById(id).value; + if (value < Data.Tracks.length) { + value++; } + + document.getElementById(id).value = value; } // if called, it shifts the track one position down in the array // => refresh the UI afterwards -function moveDown(element, id) { +function moveDown(id) { // make sure the element isn't the last - if (id-1 > Data.Tracks.length-1) {} - else { - Data.Tracks = ARRAY_MOVE(Data.Tracks, id-1, id); - DOM.UI.Update(); + // if (id-1 > Data.Tracks.length-1) {} + // else { + // Data.Tracks = ARRAY_MOVE(Data.Tracks, id-1, id); + // DOM.UI.Update(); + // } + + let value = document.getElementById(id).value; + if (value > 1) { + value--; } + document.getElementById(id).value = value; } +function moveCheck(element) { + + if (element.value > Data.Tracks.length && element.value != '') { + element.value = Data.Tracks.length; + } + if (element.value < 1 && element.value != '') { + element.value = 1; + } + +} + +function moveTo(id) { + let currentPos = document.getElementById(id).getAttribute('data-pos'); + let desiredPos = document.getElementById(id).value; + + console.log(currentPos + " " + desiredPos); + + Data.Tracks = ARRAY_MOVE(Data.Tracks, currentPos-1, desiredPos-1); + DOM.UI.Update(); +} + + // populates the edit modal form with values and opens it // sets is_editing to the id of the counter of the track that is being edited, // this just makes saving the data easier diff --git a/src/modules/key.js b/src/modules/key.js index cd07212..f885dae 100644 --- a/src/modules/key.js +++ b/src/modules/key.js @@ -8,15 +8,28 @@ document.addEventListener('keyup', function(e) { }); } if (e.key === "Enter") { - let counter = 0; + let modals = 0; + let contextMenus = 0; + Array.from(document.getElementsByClassName('modal')).forEach(function(elem) { if (elem.classList.contains('is-active')) { - counter++; + modals++; elem.getElementsByClassName('submit')[0].click(); + return; } }); - if (counter == 0) { + + Array.from(document.getElementsByClassName('dropdown')).forEach( (element) => { + if (element.classList.contains('is-active')) { + contextMenus++; + element.getElementsByClassName('submit')[0].click(); + return; + } + }); + + if (modals == 0 && contextMenus == 0) { Editor.Add.Append('new'); + return; } } }); \ No newline at end of file