From b83e6f4bf9964b7453ad8c7be9eadf6b09b6e6a2 Mon Sep 17 00:00:00 2001 From: JaydenDev Date: Sun, 3 Apr 2022 11:14:39 -0500 Subject: [PATCH 1/3] init --- assets/icons/ggl.svg | 1 + assets/icons/plus.png | Bin 0 -> 948 bytes main/main.js | 133 +++++++++++++++++++++--------------------- pnpm-lock.yaml | 42 ++++++++++--- src/home.js | 38 ++++++++++++ src/welcome.html | 34 ++++++----- 6 files changed, 160 insertions(+), 88 deletions(-) create mode 100644 assets/icons/ggl.svg create mode 100644 assets/icons/plus.png create mode 100644 src/home.js diff --git a/assets/icons/ggl.svg b/assets/icons/ggl.svg new file mode 100644 index 00000000..c0669b38 --- /dev/null +++ b/assets/icons/ggl.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/plus.png b/assets/icons/plus.png new file mode 100644 index 0000000000000000000000000000000000000000..dfb554d5cc8c21351846779dd2f779ed03a44b57 GIT binary patch literal 948 zcmV;l155mgP)hF-ZFW;iZH$$VQwV);jL-FrJxn&N>5ue>m*%xb}aob@tk8@4Yr0 z;t;WL#E2&aTmc4wF5nb!3}^%jz;EC?una5!Z-H50+em+8^a5kR24ZNKX9IW&^i)v;3kTYO zEo8;+uB5{l5#z1|EF1v1t2|H238ruxvnbmGKdc-$r#wG^x*)+J+{VlTRt^9xD%Z8* zmq&d`yp|2!edt3Z1GFK0~u|X5;rG2Jex8>LhDGJwHhh4 zoC9sjwH73_twMn_9a&++9wEy;V|B+debLcnqkd{M5eK|(3u zrwVo&D7A9nyz;Cgg|a>PLueZq*WY&x6kFl8w&Td@ED$|Np5G*XI<**qcHDs`TSj&d zQ>r)@Q@Mo$4{(){iqVA(RUSEFM#T*9E=K=8=+3h$o8Uul>4gTL@n?_b*=y>;}Z5GB^IwXla5OmfHd$5 zSJvsXBJRhH#4=Jbvqm2-=2tK@-a`j&PV68Rvo-_XcHklI)@KfbusI0zNOtmWQ?`(z zQ|J_jY!7nEQ9x4VFfk@<7<3`?VHdYpEvi8`krH4Fax|?&R`hP*7H|)@G4n3@CV;cm zFx-!B;4xA$3ws7$2Obe(dr%5i7u|KhMc_IT8s0^>w*YRk|Dt;u_(%mCvqKyrVf+J@ W+!$GPEo3zS0000 { - createWindow(); + createWindow(); - app.on("activate", function () { - // 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 (BrowserWindow.getAllWindows().length === 0) createWindow(); - }); + app.on("activate", function() { + // 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 (BrowserWindow.getAllWindows().length === 0) createWindow(); + }); }); // Quit when all windows are closed, except on macOS. There, it's common // for applications and their menu bar to stay active until the user quits // explicitly with Cmd + Q. -app.on("window-all-closed", function () { - if (process.platform !== "darwin") app.quit(); +app.on("window-all-closed", function() { + if (process.platform !== "darwin") app.quit(); }); -app.on("web-contents-created", function (event, contents) { - if (contents.getType() === "webview") { - contents.on("new-window", function (newWindowEvent) { - newWindowEvent.preventDefault(); - }); - } +app.on("web-contents-created", function(event, contents) { + if (contents.getType() === "webview") { + contents.on("new-window", function(newWindowEvent) { + newWindowEvent.preventDefault(); + }); + } }); // 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. try { - require("electron-reloader")(module); + require("electron-reloader")(module); } catch {} async function checkForUpdate(windowToDialog) { - try { - const githubFetch = await fetch( - "https://api.github.com/repos/JaydenDev/Catalyst/releases" - ); - if (!githubFetch.ok) { - // this means that - return; - } - const releaseJSON = await githubFetch.json(); - const replacerRegex = /["."]/gm; - const appVersionStr = app.getVersion(); - const tagVersionInt = Number(appVersionStr.replace(replacerRegex, "")); - for (let i in releaseJSON) { - const release = releaseJSON[i]; - if (release.draft || release.prerelease) continue; - const replaced = release["tag_name"].replace(replacerRegex, ""); - if ( - tagVersionInt < - Number(replaced.startsWith("v") ? replaced.slice(1) : replaced) - ) { - dialog.showMessageBox(windowToDialog, { - message: "An update is available for Catalyst.", - detail: `Go to github.com/JaydenDev/Catalyst/releases to install Catalyst ${release["tag_name"]}`, - type: "info", - }); - return; - } - } - } catch (error) { - console.error(error); - } -} + try { + const githubFetch = await fetch( + "https://api.github.com/repos/JaydenDev/Catalyst/releases" + ); + if (!githubFetch.ok) { + // this means that + return; + } + const releaseJSON = await githubFetch.json(); + const replacerRegex = /["."]/gm; + const appVersionStr = app.getVersion(); + const tagVersionInt = Number(appVersionStr.replace(replacerRegex, "")); + for (let i in releaseJSON) { + const release = releaseJSON[i]; + if (release.draft || release.prerelease) continue; + const replaced = release["tag_name"].replace(replacerRegex, ""); + if ( + tagVersionInt < + Number(replaced.startsWith("v") ? replaced.slice(1) : replaced) + ) { + dialog.showMessageBox(windowToDialog, { + message: "An update is available for Catalyst.", + detail: `Go to github.com/JaydenDev/Catalyst/releases to install Catalyst ${release["tag_name"]}`, + type: "info", + }); + return; + } + } + } catch (error) { + console.error(error); + } +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fc6e6616..99394a8c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ specifiers: '@electron-forge/publisher-github': ^6.0.0-beta.61 concurrently: ^7.0.0 cross-fetch: ^3.1.5 - electron: ^17.0.1 + electron: ^18.0.1 electron-reloader: ^1.2.3 electron-squirrel-startup: ^1.0.0 tailwindcss: ^3.0.23 @@ -28,7 +28,7 @@ devDependencies: '@electron-forge/maker-zip': 6.0.0-beta.63 '@electron-forge/publisher-github': 6.0.0-beta.63 concurrently: 7.0.0 - electron: 17.3.1 + electron: 18.0.1 electron-reloader: 1.2.3 tailwindcss: 3.0.23 @@ -638,11 +638,12 @@ packages: /@types/minimatch/3.0.5: resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==} + requiresBuild: true dev: true optional: true - /@types/node/14.18.12: - resolution: {integrity: sha512-q4jlIR71hUpWTnGhXWcakgkZeHa3CCjcQcnuzU8M891BAWA2jHiziiWEPEkdS5pFsz7H9HJiy8BrK7tBRNrY7A==} + /@types/node/16.11.26: + resolution: {integrity: sha512-GZ7bu5A6+4DtG7q9GsoHXy3ALcgeIHP4NnL0Vv2wu0uUB/yQex26v0tf6/na1mm0+bS9Uw+0DFex7aaKr2qawQ==} dev: true /@types/node/17.0.23: @@ -742,6 +743,7 @@ packages: /ansi-regex/5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} + requiresBuild: true dev: true /ansi-styles/3.2.1: @@ -863,6 +865,7 @@ packages: /author-regex/1.0.0: resolution: {integrity: sha1-0IiFvmubv5Q5/gh8dihyRfCoFFA=} engines: {node: '>=0.8'} + requiresBuild: true dev: true /aws-sign2/0.7.0: @@ -875,6 +878,7 @@ packages: /balanced-match/1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + requiresBuild: true dev: true /base32-encode/1.2.0: @@ -935,6 +939,7 @@ packages: /brace-expansion/1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + requiresBuild: true dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 @@ -1169,6 +1174,7 @@ packages: /color-convert/2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} + requiresBuild: true dependencies: color-name: 1.1.4 dev: true @@ -1206,6 +1212,7 @@ packages: /commander/5.1.0: resolution: {integrity: sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==} engines: {node: '>= 6'} + requiresBuild: true dev: true /compare-version/0.1.2: @@ -1215,6 +1222,7 @@ packages: /concat-map/0.0.1: resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + requiresBuild: true dev: true /concat-stream/1.6.2: @@ -1673,14 +1681,14 @@ packages: dev: true optional: true - /electron/17.3.1: - resolution: {integrity: sha512-C5E3uvXo1cmI+xYtbiMCW8AAGhBL0HbLA6cqD7FJmBoPtY88W/3A/km5z8oPGORyBNgSe7tSoHx4a6jWJIR+og==} + /electron/18.0.1: + resolution: {integrity: sha512-8y3nxmK+v/tiuaR8yd4K83ApHxgomMIPAEl3J+2Jfv/D5G6M3KnvxNlNiNoTXI8uOegfmoqiDm5/2xlWFLzfLQ==} engines: {node: '>= 8.6'} hasBin: true requiresBuild: true dependencies: '@electron/get': 1.14.1 - '@types/node': 14.18.12 + '@types/node': 16.11.26 extract-zip: 1.7.0 transitivePeerDependencies: - supports-color @@ -1688,6 +1696,7 @@ packages: /emoji-regex/8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + requiresBuild: true dev: true /encode-utf8/1.0.3: @@ -1712,6 +1721,7 @@ packages: /end-of-stream/1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + requiresBuild: true dependencies: once: 1.4.0 dev: true @@ -1997,6 +2007,7 @@ packages: /fs.realpath/1.0.0: resolution: {integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=} + requiresBuild: true dev: true /fsevents/2.3.2: @@ -2377,6 +2388,7 @@ packages: /inflight/1.0.6: resolution: {integrity: sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=} + requiresBuild: true dependencies: once: 1.4.0 wrappy: 1.0.2 @@ -2452,6 +2464,7 @@ packages: /is-fullwidth-code-point/3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + requiresBuild: true dev: true /is-glob/4.0.3: @@ -2507,6 +2520,7 @@ packages: /is-stream/1.1.0: resolution: {integrity: sha1-EtSj3U5o4Lec6428hBc66A2RykQ=} engines: {node: '>=0.10.0'} + requiresBuild: true dev: true /is-typedarray/1.0.0: @@ -2547,6 +2561,7 @@ packages: /isexe/2.0.0: resolution: {integrity: sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=} + requiresBuild: true dev: true /isstream/0.1.2: @@ -2957,6 +2972,7 @@ packages: /nice-try/1.0.5: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} + requiresBuild: true dev: true /node-abi/3.8.0: @@ -3055,6 +3071,7 @@ packages: /npm-run-path/2.0.2: resolution: {integrity: sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=} engines: {node: '>=4'} + requiresBuild: true dependencies: path-key: 2.0.1 dev: true @@ -3166,6 +3183,7 @@ packages: /p-finally/1.0.0: resolution: {integrity: sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=} engines: {node: '>=4'} + requiresBuild: true dev: true /p-is-promise/2.1.0: @@ -3297,16 +3315,19 @@ packages: /path-is-absolute/1.0.1: resolution: {integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18=} engines: {node: '>=0.10.0'} + requiresBuild: true dev: true /path-key/2.0.1: resolution: {integrity: sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=} engines: {node: '>=4'} + requiresBuild: true dev: true /path-key/3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + requiresBuild: true dev: true /path-parse/1.0.7: @@ -3794,6 +3815,7 @@ packages: /shebang-command/1.2.0: resolution: {integrity: sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=} engines: {node: '>=0.10.0'} + requiresBuild: true dependencies: shebang-regex: 1.0.0 dev: true @@ -3801,6 +3823,7 @@ packages: /shebang-command/2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} + requiresBuild: true dependencies: shebang-regex: 3.0.0 dev: true @@ -3808,11 +3831,13 @@ packages: /shebang-regex/1.0.0: resolution: {integrity: sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=} engines: {node: '>=0.10.0'} + requiresBuild: true dev: true /shebang-regex/3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + requiresBuild: true dev: true /signal-exit/3.0.7: @@ -3987,6 +4012,7 @@ packages: /strip-eof/1.0.0: resolution: {integrity: sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=} engines: {node: '>=0.10.0'} + requiresBuild: true dev: true /strip-outer/1.0.1: @@ -4386,6 +4412,7 @@ packages: /wrap-ansi/7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} + requiresBuild: true dependencies: ansi-styles: 4.3.0 string-width: 4.2.3 @@ -4394,6 +4421,7 @@ packages: /wrappy/1.0.2: resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=} + requiresBuild: true dev: true /xmlbuilder/9.0.7: diff --git a/src/home.js b/src/home.js new file mode 100644 index 00000000..a237e4f2 --- /dev/null +++ b/src/home.js @@ -0,0 +1,38 @@ + // load area from local storage + function loadBtn() { + document.getElementById("area").innerHTML = localStorage.getItem("area"); + } + + loadBtn(); + + function loadSidebar() { + // remove class "hidden" from preferences-box + document.getElementById("preferences-box").classList.remove("hidden"); + } + + function createBtn() { + // create a button in the div with id area + var btn = document.createElement("a"); + btn.innerHTML = "Click me!"; + btn.className = 'rounded-3xl bg-gray-900 text-white p-3'; + // jquery create input with id name + var input = $("").attr("id", "name").attr("type", "text").attr("placeholder", "Enter your name"); + // append input to btn + btn.append(input); + // append btn to div with id area + document.getElementById("area").appendChild(btn); + } + // jquery stop function until the user presses enter in the input field + $(input).keypress(function(event) { + if (event.which == 13) { + event.preventDefault(); + // save the value of the input box to variable url + var url = $("#name").val(); + } + }); + btn.href = url; + document.getElementById("area").appendChild(btn); + // save the dom of area to local storage + localStorage.setItem("area", document.getElementById("area").innerHTML); + loadSidebar(); + } \ No newline at end of file diff --git a/src/welcome.html b/src/welcome.html index 683d06c9..9168e7f9 100644 --- a/src/welcome.html +++ b/src/welcome.html @@ -2,22 +2,26 @@ - - - - - Start - Catalyst + + + Document + + + - -
-

Catalyst

-

Welcome to the new Catalyst browser!

-

Surf the web with an awesome browser by entering a URL in the search field above.

-
-

-

Report bugs here

-
+ +

Your Page

+
+
+ + + + +
+
- + \ No newline at end of file From 56f6dde2d493526f14620960705c946d290687b3 Mon Sep 17 00:00:00 2001 From: JaydenDev Date: Tue, 12 Apr 2022 20:54:04 -0500 Subject: [PATCH 2/3] disable add button --- src/welcome.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/welcome.html b/src/welcome.html index 9168e7f9..5720767d 100644 --- a/src/welcome.html +++ b/src/welcome.html @@ -14,7 +14,7 @@

Your Page