From 3464d64107ae4a20fe81144ad45599324da40b68 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 19:14:13 -0600 Subject: [PATCH 01/50] Create find-strat.node.js A nodeJS file that will use SQLite to find strats stored in a database. --- find-strat.node.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 find-strat.node.js diff --git a/find-strat.node.js b/find-strat.node.js new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/find-strat.node.js @@ -0,0 +1 @@ + From a4098bf0d40fbca62b4be7d574dd346d53486733 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 19:18:13 -0600 Subject: [PATCH 02/50] Create strats.csv --- data/strats.csv | 1 + 1 file changed, 1 insertion(+) create mode 100644 data/strats.csv diff --git a/data/strats.csv b/data/strats.csv new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/data/strats.csv @@ -0,0 +1 @@ + From c0d10caba4691acbaea3e22c55d3441a55ed9086 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 19:21:18 -0600 Subject: [PATCH 03/50] Update strats.csv --- data/strats.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/strats.csv b/data/strats.csv index 8b13789..cdddade 100644 --- a/data/strats.csv +++ b/data/strats.csv @@ -1 +1,2 @@ - +1,Test +2,test From 9b7e3f592eb6e9dfc7b3fca30815b8d811c590cf Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 19:22:07 -0600 Subject: [PATCH 04/50] Added header header can be used as template --- data/strats.csv | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/strats.csv b/data/strats.csv index cdddade..b706f47 100644 --- a/data/strats.csv +++ b/data/strats.csv @@ -1,2 +1 @@ -1,Test -2,test +id,strat From 52e04700e487c2a11fea56f03499219ebb15b3c5 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 20:22:02 -0600 Subject: [PATCH 05/50] Removed python find strat file --- find-strat.py | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 find-strat.py diff --git a/find-strat.py b/find-strat.py deleted file mode 100644 index 5c2b867..0000000 --- a/find-strat.py +++ /dev/null @@ -1,14 +0,0 @@ -import sys -import random -import json - -filePath = "../data/strats.txt" -count = len(open(filePath).readlines( )) -lineNum = randint(1, count) -lines = [0] -with open(filePath) as strats_file: - while strats_file.readline(): - lines.append(strats_file.tell()) - strats_file.seek(lines[lineNum]) - line = strats_file.readline() -return line From e7a2c6235adcae50ac75cc6ca4cf587b0a520c49 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 20:23:28 -0600 Subject: [PATCH 06/50] renamed strats to strats-table more descriptive. This wil be a csv file that contains the data. It will be imported every time the sqlite3-node find strat command fires. --- data/{strats.csv => strats-table.csv} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename data/{strats.csv => strats-table.csv} (100%) diff --git a/data/strats.csv b/data/strats-table.csv similarity index 100% rename from data/strats.csv rename to data/strats-table.csv From 84c08a48d9c531d23d011aed40a195d22fd9636f Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 20:24:01 -0600 Subject: [PATCH 07/50] Transfered strats from text file to table (csv) file --- data/strats-table.csv | 3 +++ data/strats.txt | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 data/strats.txt diff --git a/data/strats-table.csv b/data/strats-table.csv index b706f47..c74f915 100644 --- a/data/strats-table.csv +++ b/data/strats-table.csv @@ -1 +1,4 @@ id,strat +1,Use a pistol while crouching the entire game. If dual pistols are avalible, use dual pistols. +2,Kill using only melee attacks and grenades (throwable weapons) +3,Fire your gun until there is only one round in the current clip. Start every battle this way. \ No newline at end of file diff --git a/data/strats.txt b/data/strats.txt deleted file mode 100644 index f6a31f6..0000000 --- a/data/strats.txt +++ /dev/null @@ -1,3 +0,0 @@ -Use a pistol while crouching the entire game. If dual pistols are avalible, use dual pistols. -Kill using only melee attacks and grenades (throwable weapons) -Fire your gun until there is only one round in the current clip. Start every battle this way. \ No newline at end of file From bfcb7c08093f3876469b2bbf7a0585ec790340d7 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 20:24:16 -0600 Subject: [PATCH 08/50] create strats database file --- data/strats.db | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 data/strats.db diff --git a/data/strats.db b/data/strats.db new file mode 100644 index 0000000..e69de29 From 0246820e023ae12416f3027b4f9c74f0ee14582b Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 20:25:37 -0600 Subject: [PATCH 09/50] Added sqlite3-node file skeleton This skeleton includes the open and close connection statements, import statements, and the wrapper for the database queries. --- find-strat.node.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/find-strat.node.js b/find-strat.node.js index 8b13789..0f0d97c 100644 --- a/find-strat.node.js +++ b/find-strat.node.js @@ -1 +1,18 @@ +const sqlite3 = require('sqlite3'); +let db = new sqlite3.Database('./data/strats.db', sqlite3.OPEN_READONLY, (err) => { + if (err) { + console.error(err); + } + console.log("Connected to the Strats Database") +}); +db.serialize(() => { + // Database queries go here +}) + +db.close((err) => { + if (err) { + console.error(err.message); + } + console.log('Disconnected from the Strats Database'); +}); \ No newline at end of file From d2b7384e1e7b067baa3de272aa6269c3b5b52bf2 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 23:14:36 -0600 Subject: [PATCH 10/50] Rename strats table to strats --- data/{strats-table.csv => strats.csv} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename data/{strats-table.csv => strats.csv} (100%) diff --git a/data/strats-table.csv b/data/strats.csv similarity index 100% rename from data/strats-table.csv rename to data/strats.csv From 1b460ae4fd558b2e3921ddfc97990490a241b2b7 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 23:14:49 -0600 Subject: [PATCH 11/50] delete strats database --- data/strats.db | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 data/strats.db diff --git a/data/strats.db b/data/strats.db deleted file mode 100644 index e69de29..0000000 From 4aa3dd5fd7185716d597fe06ae2763c24df4578a Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 23:15:20 -0600 Subject: [PATCH 12/50] renamed find-strat to fetch (module revived modules --- find-strat.node.js | 18 ------------------ modules/Fetch.js | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 find-strat.node.js create mode 100644 modules/Fetch.js diff --git a/find-strat.node.js b/find-strat.node.js deleted file mode 100644 index 0f0d97c..0000000 --- a/find-strat.node.js +++ /dev/null @@ -1,18 +0,0 @@ -const sqlite3 = require('sqlite3'); -let db = new sqlite3.Database('./data/strats.db', sqlite3.OPEN_READONLY, (err) => { - if (err) { - console.error(err); - } - console.log("Connected to the Strats Database") -}); - -db.serialize(() => { - // Database queries go here -}) - -db.close((err) => { - if (err) { - console.error(err.message); - } - console.log('Disconnected from the Strats Database'); -}); \ No newline at end of file diff --git a/modules/Fetch.js b/modules/Fetch.js new file mode 100644 index 0000000..4d35900 --- /dev/null +++ b/modules/Fetch.js @@ -0,0 +1,19 @@ +module.exports.fetchStrat = (id) => { + const sqlite3 = require('sqlite3'); + let db = new sqlite3.Database(':memory:', sqlite3.OPEN_READONLY, (err) => { + if (err) { + console.error(err); + } + console.log("Connected to the Strats Database") + }); + db.serialize(() => { + // Database queries go here + }) + + db.close((err) => { + if (err) { + console.error(err.message); + } + console.log('Disconnected from the Strats Database'); + }); +} \ No newline at end of file From 050dfa9cba909f3f1f2934af909726abda742093 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 23:15:34 -0600 Subject: [PATCH 13/50] Added support for write module --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index e365a9d..8e1e5ee 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@
-
+
From 3d5566b962eb51f2550b321227ddc3ad52b0d832 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 23:15:56 -0600 Subject: [PATCH 14/50] Added random number and write modules --- modules/RandNum.js | 14 ++++++++++++++ modules/Write.js | 12 ++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 modules/RandNum.js create mode 100644 modules/Write.js diff --git a/modules/RandNum.js b/modules/RandNum.js new file mode 100644 index 0000000..cceddad --- /dev/null +++ b/modules/RandNum.js @@ -0,0 +1,14 @@ +generateRandNum = (min, max) => { + let randomNumber = Math.round((max - min) * Math.random() + min); + return randomNumber; +} + +testConnection = () => { + console.log("Connection confirmed: RandNum") +} + + +export { + generateRandNum, + testConnection +}; \ No newline at end of file diff --git a/modules/Write.js b/modules/Write.js new file mode 100644 index 0000000..d10218c --- /dev/null +++ b/modules/Write.js @@ -0,0 +1,12 @@ +write = (text) => { + $(".write-WriteTo").text(text); + console.log("\"" + text + "\" " + "was written on the page"); +} +testConnection = () => { + console.log("Connection confirmed: Write") +} + +export { + write, + testConnection +} \ No newline at end of file From 91148b5831d7159e3cf0f677213f40f9a2a05297 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 23:16:25 -0600 Subject: [PATCH 15/50] added highest id node module --- modules/HighestID.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 modules/HighestID.js diff --git a/modules/HighestID.js b/modules/HighestID.js new file mode 100644 index 0000000..4d0c01a --- /dev/null +++ b/modules/HighestID.js @@ -0,0 +1,23 @@ +module.exports.getHighestID = () => { + const sqlite3 = require('sqlite3'); + let db = new sqlite3.Database(':memory:', sqlite3.OPEN_READONLY, (err) => { + if (err) { + console.error(err); + } + console.log("Connected to the Strats Database") + }); + + db.get('SELECT MAX(id) AS max_id FROM Strats', (err, row) => { + if (err) { + console.error(err); + } + return row.max_id; + }) + + db.close((err) => { + if (err) { + console.error(err.message); + } + console.log('Disconnected from the Strats Database'); + }); +} \ No newline at end of file From 2fde799f906047a2df5197c1b32872a33385115b Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 23:17:14 -0600 Subject: [PATCH 16/50] added better import statements --- main.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 505c097..ec566cc 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,14 @@ $(document).ready(function () { - import Write from "https://gist.github.com/Spaceface16518/f91d67bf0745cead14dc6f81d015e187.js"; +import { + write, + testConnection +} from "./modules/Write.js"; +import { + generateRandNum, + testConnection +} from "./modules/RandNum.js"; +const fetch = require("./modules/Fetch.js"); +const highestID = require("./modules/HighestID.js") function fetchPython() { $.ajax({ From ca7cb3a63f33f817e5662be4f74bf7eb75dc0d2e Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 23:17:53 -0600 Subject: [PATCH 17/50] replaced python function with new fetch strat node function --- main.js | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/main.js b/main.js index ec566cc..9cd9429 100644 --- a/main.js +++ b/main.js @@ -1,4 +1,3 @@ -$(document).ready(function () { import { write, testConnection @@ -10,20 +9,16 @@ import { const fetch = require("./modules/Fetch.js"); const highestID = require("./modules/HighestID.js") - function fetchPython() { - $.ajax({ - type: "POST", - url: "./modules/find-strat.py", - data: { - param: text - } - }).done(function (result) { - console.log(line); - }); +$(document).ready(function () { + function fetchStrat() { + let cap = highestID.getHighestID(); + let id = generateRandNum(1, cap); + let strat = fetch.fetchStrat(id) } - function displayStrat() { - let strat = fetchPython(); - write(strat); + function displayStrat(strat) { + console.log("Displaying strat: " + strat); + write(strat) } + }) \ No newline at end of file From d37a75871c8a9508e23ad17262dc4f84e82cb20f Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Fri, 12 Jan 2018 09:36:04 -0600 Subject: [PATCH 18/50] Update and rename strats.csv to strats.tsv --- data/strats.csv | 4 ---- data/strats.tsv | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 data/strats.csv create mode 100644 data/strats.tsv diff --git a/data/strats.csv b/data/strats.csv deleted file mode 100644 index c74f915..0000000 --- a/data/strats.csv +++ /dev/null @@ -1,4 +0,0 @@ -id,strat -1,Use a pistol while crouching the entire game. If dual pistols are avalible, use dual pistols. -2,Kill using only melee attacks and grenades (throwable weapons) -3,Fire your gun until there is only one round in the current clip. Start every battle this way. \ No newline at end of file diff --git a/data/strats.tsv b/data/strats.tsv new file mode 100644 index 0000000..5622951 --- /dev/null +++ b/data/strats.tsv @@ -0,0 +1,4 @@ +id,strat +1 Use a pistol while crouching the entire game. If dual pistols are avalible use dual, pistols. +2 Kill using only melee attacks and grenades (throwable weapons) +3 Fire your gun until there is only one round in the current clip. Start every battle this way. From 14fcc0bea0e93497f718b8e188630adfcb2e7e06 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Fri, 12 Jan 2018 09:36:45 -0600 Subject: [PATCH 19/50] Update strats.tsv --- data/strats.tsv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/strats.tsv b/data/strats.tsv index 5622951..1f07e65 100644 --- a/data/strats.tsv +++ b/data/strats.tsv @@ -1,4 +1,4 @@ id,strat -1 Use a pistol while crouching the entire game. If dual pistols are avalible use dual, pistols. -2 Kill using only melee attacks and grenades (throwable weapons) -3 Fire your gun until there is only one round in the current clip. Start every battle this way. +1 Use a pistol while crouching the entire game. If dual pistols are avalible use dual, pistols. +2 Kill using only melee attacks and grenades (throwable weapons) +3 Fire your gun until there is only one round in the current clip. Start every battle this way. From bd45b176d8a969f8f738fa2bcb60da00f1f06b50 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Fri, 12 Jan 2018 09:37:15 -0600 Subject: [PATCH 20/50] Update strats.tsv --- data/strats.tsv | 1 - 1 file changed, 1 deletion(-) diff --git a/data/strats.tsv b/data/strats.tsv index 1f07e65..1b60c75 100644 --- a/data/strats.tsv +++ b/data/strats.tsv @@ -1,4 +1,3 @@ -id,strat 1 Use a pistol while crouching the entire game. If dual pistols are avalible use dual, pistols. 2 Kill using only melee attacks and grenades (throwable weapons) 3 Fire your gun until there is only one round in the current clip. Start every battle this way. From 836d38a175cf51d3b741307b7706001e2a828d54 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Fri, 12 Jan 2018 12:56:37 -0600 Subject: [PATCH 21/50] Rename LICENSE to LICENSE.txt Edited the title because not putting a file ending was causing some trouble for text editors. --- LICENSE => LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename LICENSE => LICENSE.txt (99%) diff --git a/LICENSE b/LICENSE.txt similarity index 99% rename from LICENSE rename to LICENSE.txt index 4db44fb..350c919 100644 --- a/LICENSE +++ b/LICENSE.txt @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. From 929b0e20e1eaf6982fb594b7aa57b7bd2fd639e6 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sat, 13 Jan 2018 01:16:22 -0600 Subject: [PATCH 22/50] Remove strats tsv --- data/strats.tsv | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 data/strats.tsv diff --git a/data/strats.tsv b/data/strats.tsv deleted file mode 100644 index 1b60c75..0000000 --- a/data/strats.tsv +++ /dev/null @@ -1,3 +0,0 @@ -1 Use a pistol while crouching the entire game. If dual pistols are avalible use dual, pistols. -2 Kill using only melee attacks and grenades (throwable weapons) -3 Fire your gun until there is only one round in the current clip. Start every battle this way. From bb5904f5c84c5123163cbeee95eea9374d5d928c Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sat, 13 Jan 2018 01:31:44 -0600 Subject: [PATCH 23/50] Changed database location --- modules/Fetch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Fetch.js b/modules/Fetch.js index 4d35900..d68e692 100644 --- a/modules/Fetch.js +++ b/modules/Fetch.js @@ -1,6 +1,6 @@ module.exports.fetchStrat = (id) => { const sqlite3 = require('sqlite3'); - let db = new sqlite3.Database(':memory:', sqlite3.OPEN_READONLY, (err) => { + let db = new sqlite3.Database('../data/strats.db', sqlite3.READ_ONLY, (err) => { if (err) { console.error(err); } From ea11214ab8791a9fa57a0f324989be8e7517b2ea Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sat, 13 Jan 2018 01:32:02 -0600 Subject: [PATCH 24/50] Initial fetch function completed --- modules/Fetch.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/Fetch.js b/modules/Fetch.js index d68e692..7624973 100644 --- a/modules/Fetch.js +++ b/modules/Fetch.js @@ -1,13 +1,23 @@ -module.exports.fetchStrat = (id) => { +module.exports.fetchStrat = (paramID) => { const sqlite3 = require('sqlite3'); + let id = paramID // id(variable) = id(parameter) let db = new sqlite3.Database('../data/strats.db', sqlite3.READ_ONLY, (err) => { if (err) { console.error(err); } console.log("Connected to the Strats Database") }); - db.serialize(() => { - // Database queries go here + + db.serialize((id) => { +db.get('SELECT * FROM Strats WHERE id === $ID_place_holder', +{ + $ID_place_holder = id +}, (err, rows) => { + if (err) { + console.error(err); + } + return rows; +}) }) db.close((err) => { From 092104d1ecf6488dc8f1b3d9ab71efa8755c1c29 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sat, 13 Jan 2018 22:43:39 -0600 Subject: [PATCH 25/50] Create strats.db --- data/strats.db | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 data/strats.db diff --git a/data/strats.db b/data/strats.db new file mode 100644 index 0000000..e69de29 From 8f8feae53d39cc0257f0179fea0c422f53775fad Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sun, 14 Jan 2018 16:26:33 -0600 Subject: [PATCH 26/50] Corrected database startup statement --- modules/Fetch.js | 2 +- modules/HighestID.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Fetch.js b/modules/Fetch.js index 7624973..199c7c7 100644 --- a/modules/Fetch.js +++ b/modules/Fetch.js @@ -1,7 +1,7 @@ module.exports.fetchStrat = (paramID) => { const sqlite3 = require('sqlite3'); let id = paramID // id(variable) = id(parameter) - let db = new sqlite3.Database('../data/strats.db', sqlite3.READ_ONLY, (err) => { + let db = new sqlite3.Database('../data/strats.db', (err) => { if (err) { console.error(err); } diff --git a/modules/HighestID.js b/modules/HighestID.js index 4d0c01a..4160e4c 100644 --- a/modules/HighestID.js +++ b/modules/HighestID.js @@ -1,6 +1,6 @@ module.exports.getHighestID = () => { const sqlite3 = require('sqlite3'); - let db = new sqlite3.Database(':memory:', sqlite3.OPEN_READONLY, (err) => { + let db = new sqlite3.Database('../data/strats.db', (err) => { if (err) { console.error(err); } From 44011ae80b3f6a7b4c48530c093581713f70d53e Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sun, 14 Jan 2018 16:41:19 -0600 Subject: [PATCH 27/50] Fixed error message in highest ID module --- modules/HighestID.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/HighestID.js b/modules/HighestID.js index 4160e4c..1cd3133 100644 --- a/modules/HighestID.js +++ b/modules/HighestID.js @@ -16,7 +16,7 @@ module.exports.getHighestID = () => { db.close((err) => { if (err) { - console.error(err.message); + console.error(err); } console.log('Disconnected from the Strats Database'); }); From 1ee611eaf69bfe88f625caa9c69c3e1d1ed49a6f Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sun, 14 Jan 2018 16:42:15 -0600 Subject: [PATCH 28/50] Write module: added and exported clear function - also fixed log statement in write function --- modules/Write.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/Write.js b/modules/Write.js index d10218c..55da29f 100644 --- a/modules/Write.js +++ b/modules/Write.js @@ -1,12 +1,17 @@ write = (text) => { $(".write-WriteTo").text(text); - console.log("\"" + text + "\" " + "was written on the page"); + console.log("Write: " + "\"" + text + "\" " + "was written on the page"); } testConnection = () => { console.log("Connection confirmed: Write") } - +clear = () => { + let html = $(".write-WriteTo").html() + $(".write-WriteTo").text(""); + console.log("Write: " + "Cleared " + html) +} export { write, - testConnection + testConnection, + clear } \ No newline at end of file From f71550aa994f9aef02107744ffd525c0f9f39249 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sun, 14 Jan 2018 16:49:28 -0600 Subject: [PATCH 29/50] add support for clear function. --- main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 9cd9429..dbca48f 100644 --- a/main.js +++ b/main.js @@ -1,6 +1,7 @@ import { write, - testConnection + testConnection, + clear } from "./modules/Write.js"; import { generateRandNum, @@ -21,4 +22,7 @@ $(document).ready(function () { write(strat) } + function clearStrat() { + clear() + } }) \ No newline at end of file From 0c319e01b14aec1b1e8e65e6a8383829311c3dd5 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sun, 14 Jan 2018 16:52:07 -0600 Subject: [PATCH 30/50] Format corrected - also renamed variable cap to highestID --- main.js | 27 +++++++++++++-------------- modules/Fetch.js | 17 ++++++++--------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/main.js b/main.js index dbca48f..416762e 100644 --- a/main.js +++ b/main.js @@ -10,19 +10,18 @@ import { const fetch = require("./modules/Fetch.js"); const highestID = require("./modules/HighestID.js") -$(document).ready(function () { - function fetchStrat() { - let cap = highestID.getHighestID(); - let id = generateRandNum(1, cap); - let strat = fetch.fetchStrat(id) - } - function displayStrat(strat) { - console.log("Displaying strat: " + strat); - write(strat) - } +function fetchStrat() { + let highestID = highestID.getHighestID(); + let id = generateRandNum(1, highestID); + let strat = fetch.fetchStrat(id) +} - function clearStrat() { - clear() - } -}) \ No newline at end of file +function displayStrat(strat) { + console.log("Displaying strat: " + strat); + write(strat) +} + +function clearStrat() { + clear() +} \ No newline at end of file diff --git a/modules/Fetch.js b/modules/Fetch.js index 199c7c7..b80fbd4 100644 --- a/modules/Fetch.js +++ b/modules/Fetch.js @@ -9,15 +9,14 @@ module.exports.fetchStrat = (paramID) => { }); db.serialize((id) => { -db.get('SELECT * FROM Strats WHERE id === $ID_place_holder', -{ - $ID_place_holder = id -}, (err, rows) => { - if (err) { - console.error(err); - } - return rows; -}) + db.get('SELECT * FROM Strats WHERE id === $ID_place_holder', { + $ID_place_holder = id + }, (err, rows) => { + if (err) { + console.error(err); + } + return rows; + }) }) db.close((err) => { From 2a9c14e3b591e7a01e166d8cc24301aa4bc9ea6f Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Mon, 15 Jan 2018 02:46:51 -0600 Subject: [PATCH 31/50] Add cvs>database websit --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3179f3f..59af8e1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # Strat-Roulette -A roulette style game type picker for FPS games. +A roulette style game type picker for FPS game + +[Here](http://www.sqlitetutorial.net/sqlite-import-csv/) is a website explaining how to upload `csv` into a database. From 89c774e0be22eb78c5715a1534aa01cea70791f5 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Mon, 15 Jan 2018 02:49:20 -0600 Subject: [PATCH 32/50] Patched spelling error from last commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59af8e1..35c0e37 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Strat-Roulette -A roulette style game type picker for FPS game +A roulette style game type picker for FPS games. [Here](http://www.sqlitetutorial.net/sqlite-import-csv/) is a website explaining how to upload `csv` into a database. From 06eace71d189ec73ca4f43504f2b3b287438416d Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Wed, 24 Jan 2018 09:01:38 -0600 Subject: [PATCH 33/50] Rename index.html to src/index.html --- index.html => src/index.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename index.html => src/index.html (100%) diff --git a/index.html b/src/index.html similarity index 100% rename from index.html rename to src/index.html From 295320c20493f10dff8eb38e83fc22bb4de85077 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Wed, 24 Jan 2018 09:02:09 -0600 Subject: [PATCH 34/50] Rename main.js to src/index.js --- main.js => src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename main.js => src/index.js (99%) diff --git a/main.js b/src/index.js similarity index 99% rename from main.js rename to src/index.js index 416762e..98dea9b 100644 --- a/main.js +++ b/src/index.js @@ -24,4 +24,4 @@ function displayStrat(strat) { function clearStrat() { clear() -} \ No newline at end of file +} From 007447cedd1362bacc01e5cfc2918d873f31f716 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Wed, 24 Jan 2018 09:02:40 -0600 Subject: [PATCH 35/50] Rename style.css to assets/css/index.css --- style.css => assets/css/index.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename style.css => assets/css/index.css (91%) diff --git a/style.css b/assets/css/index.css similarity index 91% rename from style.css rename to assets/css/index.css index d74910a..9dac796 100644 --- a/style.css +++ b/assets/css/index.css @@ -8,4 +8,4 @@ body {} .stand-out {} -h1 {} \ No newline at end of file +h1 {} From cf775c9d738fa24c7669e5d62d746ab5c376b8e9 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Wed, 24 Jan 2018 09:03:06 -0600 Subject: [PATCH 36/50] Rename data/strats.db to assets/data/strats.db --- assets/data/strats.db | 1 + data/strats.db | 0 2 files changed, 1 insertion(+) create mode 100644 assets/data/strats.db delete mode 100644 data/strats.db diff --git a/assets/data/strats.db b/assets/data/strats.db new file mode 100644 index 0000000..d3f5a12 --- /dev/null +++ b/assets/data/strats.db @@ -0,0 +1 @@ + diff --git a/data/strats.db b/data/strats.db deleted file mode 100644 index e69de29..0000000 From 94d3d8b852912e3331540a6cafb6388e50dcf05e Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Wed, 24 Jan 2018 09:03:33 -0600 Subject: [PATCH 37/50] Rename modules/Fetch.js to assets/modules/Fetch.js --- {modules => assets/modules}/Fetch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {modules => assets/modules}/Fetch.js (99%) diff --git a/modules/Fetch.js b/assets/modules/Fetch.js similarity index 99% rename from modules/Fetch.js rename to assets/modules/Fetch.js index b80fbd4..e4f30a8 100644 --- a/modules/Fetch.js +++ b/assets/modules/Fetch.js @@ -25,4 +25,4 @@ module.exports.fetchStrat = (paramID) => { } console.log('Disconnected from the Strats Database'); }); -} \ No newline at end of file +} From 7c85bbc202a1557e4f6e4f930aef6899715ed1cb Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Wed, 24 Jan 2018 09:03:58 -0600 Subject: [PATCH 38/50] Rename modules/HighestID.js to assets/modules/HighestID.js --- {modules => assets/modules}/HighestID.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {modules => assets/modules}/HighestID.js (99%) diff --git a/modules/HighestID.js b/assets/modules/HighestID.js similarity index 99% rename from modules/HighestID.js rename to assets/modules/HighestID.js index 1cd3133..5da4d4c 100644 --- a/modules/HighestID.js +++ b/assets/modules/HighestID.js @@ -20,4 +20,4 @@ module.exports.getHighestID = () => { } console.log('Disconnected from the Strats Database'); }); -} \ No newline at end of file +} From 1f3e58e945e66b607b122402c257a8b6a0615c1d Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Wed, 24 Jan 2018 09:04:25 -0600 Subject: [PATCH 39/50] Rename modules/RandNum.js to assets/modules/RandNum.js --- {modules => assets/modules}/RandNum.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {modules => assets/modules}/RandNum.js (98%) diff --git a/modules/RandNum.js b/assets/modules/RandNum.js similarity index 98% rename from modules/RandNum.js rename to assets/modules/RandNum.js index cceddad..5e381a1 100644 --- a/modules/RandNum.js +++ b/assets/modules/RandNum.js @@ -11,4 +11,4 @@ testConnection = () => { export { generateRandNum, testConnection -}; \ No newline at end of file +}; From a24cf779b831e8a4053aa89f313e01890b204142 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Wed, 24 Jan 2018 09:04:51 -0600 Subject: [PATCH 40/50] Rename modules/Write.js to assets/modules/Write.js --- {modules => assets/modules}/Write.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {modules => assets/modules}/Write.js (99%) diff --git a/modules/Write.js b/assets/modules/Write.js similarity index 99% rename from modules/Write.js rename to assets/modules/Write.js index 55da29f..5d51d5f 100644 --- a/modules/Write.js +++ b/assets/modules/Write.js @@ -14,4 +14,4 @@ export { write, testConnection, clear -} \ No newline at end of file +} From 74cc84ec2cf7be204c0f6538dbc9e3eebf17996a Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Wed, 24 Jan 2018 09:18:24 -0600 Subject: [PATCH 41/50] Added electron skeleton --- main.js | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 main.js diff --git a/main.js b/main.js new file mode 100644 index 0000000..cbd40a3 --- /dev/null +++ b/main.js @@ -0,0 +1,55 @@ +const {app, BrowserWindow} = require('electron') +const path = require('path') +const url = require('url') + +// Keep a global reference of the window object, if you don't, the window will +// be closed automatically when the JavaScript object is garbage collected. +let win + +function createWindow () { + // Create the browser window. + win = new BrowserWindow({width: 800, height: 600}) + + // and load the index.html of the app. + win.loadURL(url.format({ + pathname: path.join(__dirname, 'index.html'), + protocol: 'file:', + slashes: true + })) + + // Open the DevTools. + win.webContents.openDevTools() + + // Emitted when the window is closed. + win.on('closed', () => { + // Dereference the window object, usually you would store windows + // in an array if your app supports multi windows, this is the time + // when you should delete the corresponding element. + win = null + }) +} + +// This method will be called when Electron has finished +// initialization and is ready to create browser windows. +// Some APIs can only be used after this event occurs. +app.on('ready', createWindow) + +// Quit when all windows are closed. +app.on('window-all-closed', () => { + // On macOS it is common for applications and their menu bar + // to stay active until the user quits explicitly with Cmd + Q + if (process.platform !== 'darwin') { + app.quit() + } +}) + +app.on('activate', () => { + // On macOS it's common to re-create a window in the app when the + // dock icon is clicked and there are no other windows open. + if (win === null) { + createWindow() + } +}) + +// In this file you can include the rest of your app's specific main process +// code. You can also put them in separate files and require them here. From 3ff6d4302c2e4716d7850d8e81368cdd4aed6235 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Wed, 24 Jan 2018 09:22:31 -0600 Subject: [PATCH 42/50] Fixed script and stylesheet souces --- src/index.html | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/index.html b/src/index.html index 8e1e5ee..7f0ea00 100644 --- a/src/index.html +++ b/src/index.html @@ -6,14 +6,10 @@ Strat Roulette - + - + - From 899eeb2f95f159e929badc5d031000992fa9647e Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sun, 28 Jan 2018 20:02:54 -0600 Subject: [PATCH 43/50] Remove internal css page Mainly use w3.css --- assets/css/index.css | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/assets/css/index.css b/assets/css/index.css index 9dac796..e69de29 100644 --- a/assets/css/index.css +++ b/assets/css/index.css @@ -1,11 +0,0 @@ -* { - box-sizing: border-box -} - -body {} - -#result {} - -.stand-out {} - -h1 {} From 0a4ba1656d4871be664c89a846b68b816fa72638 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sun, 28 Jan 2018 20:03:06 -0600 Subject: [PATCH 44/50] Update strats database --- assets/data/strats.db | Bin 2 -> 8192 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/data/strats.db b/assets/data/strats.db index d3f5a12faa99758192ecc4ed3fc22c9249232e86..ffde73b5a2e3c8437402419c402b5e23e75822f9 100644 GIT binary patch literal 8192 zcmeHL&vP3|8MR|6i5=U@kOi;FE@>ybn>D*0TashPa3HqhMBc=)u@pjTt6*EBwx;pS z^rX8-ik1T>tyvMIG0%HWm2#gUJBQQo_jKCOyF#=-*#t4iN7$Y!7;B^G}fMlw2?S>-V!FzGPP1A`PG?a z`fmQt)XRy|uSyT*|2+Sj`4{u|=C96uHuuTwzh=Lf{pD;hTe|YcD?h(-F!P7$zfZq) z`4^X`E=3pra`E>Ue{}J^;y;VOF3uMIR`^}v-qe4l{)#~3*BF5@0$+*1C+`%!>-}&DW9{Fc|LI6*`aO|xI%kPu zCQzwh&CDVfV+C(9b%LeHB%xr)kCJjZ_K*w>&_zuVBY7hHbyo1Me_X8`WJU%&8fNTp zvOGGa*)K9>0ndq6F*7P@8-Mi%(tB7f*La%tkYbz)O`i-ubefcR^T&2W6%C;57rs^W zZuGP2T6t{^`2jO}RGb;hbe1pziB{UB(x^ctM2uRwXkBSTg&euHzz>=EZ2yE&M#v-x z-TZu}(yS$g8;TLjSg!2|1OEqa7ronkud-DSC1>?ar&=1ZZH#Outg^l}s%1 zMJ#R%-ZJ52?1u5A#Zu6T3dos>Y1uJP{jIkO-qMdNchN0?4{HdHcayjCDzj4=Mc{@= zC?g76U1LTBDrp&i<2tzXab>d}sV*bNHZq;i`ZcB`Mq1gCwg*N4)N?5L2j47sn=dLG zkCi%Q2P%$xOYDgP(-3s2rlM9JLyH*2V@(034K9VmlGnMuyjbwcs})dM>J~c!YCTqu zQKqFvZU6W_JK8>OJZJTT?Ru^6y$OMxU8}4=5s-~EdsG520Nh|fsFVR&I76~Dn5)PY znqa_#!I8mag7f^jV_hrLLs1ZK2loT>L|Np)T)`FAuWy^tL;7zl6t69wEzVV{zyc!P zBY80^A#S3Hd$hrbO7aUK?+9XAmrLtPLV!R*sR%4<6C)FepY2g~nngAD*PV3_BC{sluvTLnY^uqO^Q=UnRF~{xnd^0C>xWLTL)Z@Jk{5{`A+2-b(*PrQARc zPk=1|e1>v-j~vn^_L1|!9T1aFfgQ;`Cwrt+>N7{qEOnDRD#|b=QW;TOW$h5tF@pNS zh++aJ&JwtaLlH>H7#?RNvhw?TZxp?Sv!7Mgjs>)L2s{X50ZYz(I2SoBR10_nhbM;^ zGD3Ga#EF$)Xn2N10pU3}rMt=Ib7a3Xs@SOzc>-=0k7Ng6!cLGectWtrK{FV|A23(M zMnoM9!W2zN00Sc6}HU2sIw=g4_OYEx0U3 z9sP&&)xyGv=))#D8+V!u7zsGDLj)F6GRe=5iojUFHOSD{_#BZp6T-X zZYYCOkpSCvXzSF_UbW3pgXxA6;zu1ZwKZr(kQzz?+Zf5{!?}X@!FS8mBkEYL+;y^n zBP{}H$h*3Nr_{Jy<@{On`onUi4tr~SnjL3`$^gech5B3sA|vF>opJihR|?+pX1QEX zHT;2=c7y{one_GezMcVb`j5(M)Pjb5aqt3FMjgj7$Pt3)`w_aEmWKjkdkF^YU|)i2MG`<_ zOP4!Xtl(SNj1ePTBl9m6O1Jhmok6S^B-zSIMh-vp_w&46y@>gbHlC(5cZI0FpMZb} ziuE9{+auTzds1V;DC56ZEO?9Cb9cy!f?gdmqpgu*kvoSUC)l1u#$PWW@YD63d{6LP zWlM*&Ep~mY3BplQ|GOK`ri!I<|6!GE3WcMzcHx285R*ydtD(l3VF&FtbGQg7Tu-MJ zYn1`O!JR>-HF9-Q@$n^_c4?%p9&6@UIvAlV|Dy}V(qezQvP(X<^oX_)*s4MYE^sU& zL6jw(*Oq`h)p+95Un`E+hAl46)7+`~L+o_lTGP literal 2 Jcmd<(0ssIe02lxO From efbd31e717c59e94a22e93751023ee1305696905 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sun, 28 Jan 2018 20:03:21 -0600 Subject: [PATCH 45/50] Fix sqlite import --- assets/modules/Fetch.js | 8 ++++---- assets/modules/HighestID.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/modules/Fetch.js b/assets/modules/Fetch.js index e4f30a8..faa7ef2 100644 --- a/assets/modules/Fetch.js +++ b/assets/modules/Fetch.js @@ -1,7 +1,7 @@ module.exports.fetchStrat = (paramID) => { - const sqlite3 = require('sqlite3'); - let id = paramID // id(variable) = id(parameter) - let db = new sqlite3.Database('../data/strats.db', (err) => { + const sqlite = require('sqlite'); + let id = paramID; + let db = new sqlite.Database('../data/strats.db', (err) => { if (err) { console.error(err); } @@ -10,7 +10,7 @@ module.exports.fetchStrat = (paramID) => { db.serialize((id) => { db.get('SELECT * FROM Strats WHERE id === $ID_place_holder', { - $ID_place_holder = id + $ID_place_holder: id }, (err, rows) => { if (err) { console.error(err); diff --git a/assets/modules/HighestID.js b/assets/modules/HighestID.js index 5da4d4c..0aa9df0 100644 --- a/assets/modules/HighestID.js +++ b/assets/modules/HighestID.js @@ -1,6 +1,6 @@ module.exports.getHighestID = () => { - const sqlite3 = require('sqlite3'); - let db = new sqlite3.Database('../data/strats.db', (err) => { + const sqlite = require('sqlite'); + let db = new sqlite.Database('../data/strats.db', (err) => { if (err) { console.error(err); } From 471ef55d4609881380d82be8c9f17522fd6a715d Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sun, 28 Jan 2018 20:04:24 -0600 Subject: [PATCH 46/50] Remove Electron skeleton Going for browser based instead of desktop app --- main.js | 55 ------------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 main.js diff --git a/main.js b/main.js deleted file mode 100644 index cbd40a3..0000000 --- a/main.js +++ /dev/null @@ -1,55 +0,0 @@ -const {app, BrowserWindow} = require('electron') -const path = require('path') -const url = require('url') - -// Keep a global reference of the window object, if you don't, the window will -// be closed automatically when the JavaScript object is garbage collected. -let win - -function createWindow () { - // Create the browser window. - win = new BrowserWindow({width: 800, height: 600}) - - // and load the index.html of the app. - win.loadURL(url.format({ - pathname: path.join(__dirname, 'index.html'), - protocol: 'file:', - slashes: true - })) - - // Open the DevTools. - win.webContents.openDevTools() - - // Emitted when the window is closed. - win.on('closed', () => { - // Dereference the window object, usually you would store windows - // in an array if your app supports multi windows, this is the time - // when you should delete the corresponding element. - win = null - }) -} - -// This method will be called when Electron has finished -// initialization and is ready to create browser windows. -// Some APIs can only be used after this event occurs. -app.on('ready', createWindow) - -// Quit when all windows are closed. -app.on('window-all-closed', () => { - // On macOS it is common for applications and their menu bar - // to stay active until the user quits explicitly with Cmd + Q - if (process.platform !== 'darwin') { - app.quit() - } -}) - -app.on('activate', () => { - // On macOS it's common to re-create a window in the app when the - // dock icon is clicked and there are no other windows open. - if (win === null) { - createWindow() - } -}) - -// In this file you can include the rest of your app's specific main process -// code. You can also put them in separate files and require them here. From 1375230e0f2dfa69fd1a7f2eb2f51a1314a9da58 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sun, 28 Jan 2018 20:04:47 -0600 Subject: [PATCH 47/50] Implement w3.css on current objects --- src/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.html b/src/index.html index 7f0ea00..1d81dc6 100644 --- a/src/index.html +++ b/src/index.html @@ -13,10 +13,10 @@ - +
- -
+ +
From 519369e5f60ce922497b59f613f148a1bcf1ebe8 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sun, 28 Jan 2018 20:05:32 -0600 Subject: [PATCH 48/50] Import statments on one line --- src/index.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/index.js b/src/index.js index 98dea9b..bc599e8 100644 --- a/src/index.js +++ b/src/index.js @@ -1,12 +1,5 @@ -import { - write, - testConnection, - clear -} from "./modules/Write.js"; -import { - generateRandNum, - testConnection -} from "./modules/RandNum.js"; +import { write, testConnection, clear } from "../assets/modules/Write.js"; +import { generateRandNum, testConnection } from "../assets/modules/RandNum.js"; const fetch = require("./modules/Fetch.js"); const highestID = require("./modules/HighestID.js") From 6cfe3169dde5b3f6a24ad8c2898f0327c19aab99 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sun, 28 Jan 2018 20:05:51 -0600 Subject: [PATCH 49/50] Add button click detectors --- src/index.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/index.js b/src/index.js index bc599e8..ab37b87 100644 --- a/src/index.js +++ b/src/index.js @@ -18,3 +18,17 @@ function displayStrat(strat) { function clearStrat() { clear() } + +$(document).ready(function(){ + $("#chooseButton").click(function(){ + console.log("Choose button clicked") + let strat = fetchStrat(); + displayStrat(strat); + }); + $("#resetButton").click(function(){ + console.log("reset button clicked"); + clearStrat(); + }); +}) + +console.log("Init") From 9af9a4dbdf0bbd9b3560fc2c65959621913a1756 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Sun, 28 Jan 2018 20:06:15 -0600 Subject: [PATCH 50/50] Add return value to fetch function --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index ab37b87..e37cea5 100644 --- a/src/index.js +++ b/src/index.js @@ -3,11 +3,11 @@ import { generateRandNum, testConnection } from "../assets/modules/RandNum.js"; const fetch = require("./modules/Fetch.js"); const highestID = require("./modules/HighestID.js") - function fetchStrat() { let highestID = highestID.getHighestID(); let id = generateRandNum(1, highestID); let strat = fetch.fetchStrat(id) + return strat } function displayStrat(strat) {