From 7537109c920f163257ef33be8dc297040b3cf345 Mon Sep 17 00:00:00 2001 From: Ryan Breen Date: Mon, 23 Jan 2023 22:38:42 -0500 Subject: [PATCH] Basic setup for an options page. --- Nostore.xcodeproj/project.pbxproj | 24 +++++++++++++ Shared (Extension)/Resources/manifest.json | 5 ++- Shared (Extension)/Resources/options.css | 0 Shared (Extension)/Resources/options.html | 14 ++++++++ Shared (Extension)/Resources/options.js | 0 Shared (Extension)/Resources/popup.html | 1 + build.js | 42 ++++++++++++---------- 7 files changed, 67 insertions(+), 19 deletions(-) create mode 100644 Shared (Extension)/Resources/options.css create mode 100644 Shared (Extension)/Resources/options.html create mode 100644 Shared (Extension)/Resources/options.js diff --git a/Nostore.xcodeproj/project.pbxproj b/Nostore.xcodeproj/project.pbxproj index bb8fb3a..359798a 100644 --- a/Nostore.xcodeproj/project.pbxproj +++ b/Nostore.xcodeproj/project.pbxproj @@ -71,6 +71,14 @@ 941B04342978CDF900CA291E /* Icon-16.png in Resources */ = {isa = PBXBuildFile; fileRef = 941B042F2978CDF900CA291E /* Icon-16.png */; }; 941B04352978CDF900CA291E /* Icon-64.png in Resources */ = {isa = PBXBuildFile; fileRef = 941B04302978CDF900CA291E /* Icon-64.png */; }; 941B04362978CDF900CA291E /* Icon-64.png in Resources */ = {isa = PBXBuildFile; fileRef = 941B04302978CDF900CA291E /* Icon-64.png */; }; + 948C69D9297F887600FB3574 /* options.html in Resources */ = {isa = PBXBuildFile; fileRef = 948C69D8297F887600FB3574 /* options.html */; }; + 948C69DA297F887600FB3574 /* options.html in Resources */ = {isa = PBXBuildFile; fileRef = 948C69D8297F887600FB3574 /* options.html */; }; + 948C69DD297F88A200FB3574 /* options.css in Resources */ = {isa = PBXBuildFile; fileRef = 948C69DB297F88A200FB3574 /* options.css */; }; + 948C69DE297F88A200FB3574 /* options.css in Resources */ = {isa = PBXBuildFile; fileRef = 948C69DB297F88A200FB3574 /* options.css */; }; + 948C69DF297F88A200FB3574 /* options.js in Resources */ = {isa = PBXBuildFile; fileRef = 948C69DC297F88A200FB3574 /* options.js */; }; + 948C69E0297F88A200FB3574 /* options.js in Resources */ = {isa = PBXBuildFile; fileRef = 948C69DC297F88A200FB3574 /* options.js */; }; + 948C69E2297F891F00FB3574 /* options.build.js in Resources */ = {isa = PBXBuildFile; fileRef = 948C69E1297F891F00FB3574 /* options.build.js */; }; + 948C69E3297F891F00FB3574 /* options.build.js in Resources */ = {isa = PBXBuildFile; fileRef = 948C69E1297F891F00FB3574 /* options.build.js */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -159,6 +167,10 @@ 941B042E2978CDF900CA291E /* Icon-32.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-32.png"; sourceTree = ""; }; 941B042F2978CDF900CA291E /* Icon-16.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-16.png"; sourceTree = ""; }; 941B04302978CDF900CA291E /* Icon-64.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-64.png"; sourceTree = ""; }; + 948C69D8297F887600FB3574 /* options.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = options.html; sourceTree = ""; }; + 948C69DB297F88A200FB3574 /* options.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = options.css; sourceTree = ""; }; + 948C69DC297F88A200FB3574 /* options.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = options.js; sourceTree = ""; }; + 948C69E1297F891F00FB3574 /* options.build.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = options.build.js; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -240,6 +252,10 @@ 941B03A2296FA90400CA291E /* Resources */ = { isa = PBXGroup; children = ( + 948C69E1297F891F00FB3574 /* options.build.js */, + 948C69DB297F88A200FB3574 /* options.css */, + 948C69DC297F88A200FB3574 /* options.js */, + 948C69D8297F887600FB3574 /* options.html */, 941B04162971138F00CA291E /* content.build.js */, 941B04152971138F00CA291E /* nostr.build.js */, 941B04172971138F00CA291E /* popup.build.js */, @@ -475,7 +491,10 @@ buildActionMask = 2147483647; files = ( 941B0413297110F100CA291E /* background.build.js in Resources */, + 948C69DF297F88A200FB3574 /* options.js in Resources */, + 948C69DD297F88A200FB3574 /* options.css in Resources */, 941B03F2296FA90400CA291E /* background.js in Resources */, + 948C69E2297F891F00FB3574 /* options.build.js in Resources */, 941B03F8296FA90400CA291E /* popup.css in Resources */, 941B04292977A28700CA291E /* Icon-128.png in Resources */, 941B04182971138F00CA291E /* nostr.build.js in Resources */, @@ -489,6 +508,7 @@ 941B041C2971139000CA291E /* popup.build.js in Resources */, 941B03EC296FA90400CA291E /* _locales in Resources */, 941B04222977A25700CA291E /* Icon-512.png in Resources */, + 948C69D9297F887600FB3574 /* options.html in Resources */, 941B03F4296FA90400CA291E /* content.js in Resources */, 941B04262977A25700CA291E /* Icon-1024.png in Resources */, 941B04352978CDF900CA291E /* Icon-64.png in Resources */, @@ -503,7 +523,10 @@ buildActionMask = 2147483647; files = ( 941B0414297110F100CA291E /* background.build.js in Resources */, + 948C69E0297F88A200FB3574 /* options.js in Resources */, + 948C69DE297F88A200FB3574 /* options.css in Resources */, 941B03F3296FA90400CA291E /* background.js in Resources */, + 948C69E3297F891F00FB3574 /* options.build.js in Resources */, 941B03F9296FA90400CA291E /* popup.css in Resources */, 941B042A2977A28700CA291E /* Icon-128.png in Resources */, 941B04192971138F00CA291E /* nostr.build.js in Resources */, @@ -517,6 +540,7 @@ 941B041D2971139000CA291E /* popup.build.js in Resources */, 941B03ED296FA90400CA291E /* _locales in Resources */, 941B04232977A25700CA291E /* Icon-512.png in Resources */, + 948C69DA297F887600FB3574 /* options.html in Resources */, 941B03F5296FA90400CA291E /* content.js in Resources */, 941B04272977A25700CA291E /* Icon-1024.png in Resources */, 941B04362978CDF900CA291E /* Icon-64.png in Resources */, diff --git a/Shared (Extension)/Resources/manifest.json b/Shared (Extension)/Resources/manifest.json index ab8fdfc..1b3e341 100644 --- a/Shared (Extension)/Resources/manifest.json +++ b/Shared (Extension)/Resources/manifest.json @@ -36,6 +36,9 @@ "72": "images/toolbar-72.png" } }, + "options_ui": { + "page": "options.html" + }, "permissions": [ "storage" ], @@ -58,4 +61,4 @@ "strict_min_version": "15.4" } } -} +} \ No newline at end of file diff --git a/Shared (Extension)/Resources/options.css b/Shared (Extension)/Resources/options.css new file mode 100644 index 0000000..e69de29 diff --git a/Shared (Extension)/Resources/options.html b/Shared (Extension)/Resources/options.html new file mode 100644 index 0000000..241916d --- /dev/null +++ b/Shared (Extension)/Resources/options.html @@ -0,0 +1,14 @@ + + + + + + + + + + +

Settings

+ + + \ No newline at end of file diff --git a/Shared (Extension)/Resources/options.js b/Shared (Extension)/Resources/options.js new file mode 100644 index 0000000..e69de29 diff --git a/Shared (Extension)/Resources/popup.html b/Shared (Extension)/Resources/popup.html index ec938fc..1d23ddf 100644 --- a/Shared (Extension)/Resources/popup.html +++ b/Shared (Extension)/Resources/popup.html @@ -61,6 +61,7 @@
+
diff --git a/build.js b/build.js index b0af100..88acb28 100755 --- a/build.js +++ b/build.js @@ -1,21 +1,27 @@ #!/usr/bin/env node -let watch = process.argv[2] === 'watch' ? { - onRebuild(error, result) { - if (error) console.error('watch rebuild failed: ', error) - else console.log('watch rebuild succeeded: ', result) - } -} : false; +let watch = + process.argv[2] === 'watch' + ? { + onRebuild(error, result) { + if (error) console.error('watch rebuild failed: ', error); + else console.log('watch rebuild succeeded: ', result); + }, + } + : false; -require('esbuild').build({ - entryPoints: { - 'background.build': './Shared (Extension)/Resources/background.js', - 'content.build': './Shared (Extension)/Resources/content.js', - 'nostr.build': './Shared (Extension)/Resources/nostr.js', - 'popup.build': './Shared (Extension)/Resources/popup.js', - }, - outdir: './Shared (Extension)/Resources', - sourcemap: 'inline', - bundle: true, - watch -}).catch(() => process.exit(1)) \ No newline at end of file +require('esbuild') + .build({ + entryPoints: { + 'background.build': './Shared (Extension)/Resources/background.js', + 'content.build': './Shared (Extension)/Resources/content.js', + 'nostr.build': './Shared (Extension)/Resources/nostr.js', + 'popup.build': './Shared (Extension)/Resources/popup.js', + 'options.build': './Shared (Extension)/Resources/options.js', + }, + outdir: './Shared (Extension)/Resources', + sourcemap: 'inline', + bundle: true, + watch, + }) + .catch(() => process.exit(1));