Skip to content

Commit 1551ade

Browse files
committed
[ poncho wonky ] app renamed
1 parent bcbf4ad commit 1551ade

7 files changed

Lines changed: 183 additions & 173 deletions

File tree

docs/custom-scripts/worm-blossom-music.lua

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ Auxiliary functions
77
]]
88

99
function string:contains(sub)
10-
return self:find(sub, 1, true) ~= nil
10+
return self:find(sub, 1, true) ~= nil
1111
end
1212

1313
function string:startswith(start)
14-
local sub = self:sub(1, #start) == start
15-
return sub
14+
local sub = self:sub(1, #start) == start
15+
return sub
1616
end
1717

1818
function string:endswith(ending)
19-
return ending == "" or self:sub(-#ending) == ending
19+
return ending == "" or self:sub(- #ending) == ending
2020
end
2121

2222
local function extractWormBlossomURL(text)
@@ -38,15 +38,15 @@ The action function is called if the user press the button.
3838
]]
3939

4040
function wbMusic.button(msg)
41-
if msg == nil then
41+
if msg == nil then
4242
return false, "no message"
4343
end
4444

4545
if msg.value.content.type ~= "post" then
4646
return false, "message is not post"
4747
end
4848

49-
local text = msg.value.content.text
49+
local text = msg.value.content.text
5050
local url = extractWormBlossomURL(text)
5151

5252
if url then
@@ -57,7 +57,7 @@ function wbMusic.button(msg)
5757
end
5858

5959
function wbMusic.buttonAction(msg)
60-
local text = msg.value.content.text
60+
local text = msg.value.content.text
6161
local url = extractWormBlossomURL(text)
6262

6363
local co = coroutine.create(function() -- must wrapped in a coroutine because fetch is async
@@ -66,7 +66,7 @@ function wbMusic.buttonAction(msg)
6666
local iframe = querySelect(content, "iframe")
6767
local src = getAttribute(iframe, "src")
6868
local song = getParam(src, "song")
69-
openWindowFromAssets("worm-blossom-music/start.js", {
69+
openFileInWebView("worm-blossom-music/start.js", {
7070
data = song,
7171
width = 400,
7272
height = 300
@@ -80,20 +80,12 @@ end
8080
Menu adds a menu item to the "MORE" button.
8181
]]
8282

83-
function wbMusic.menuAction()
83+
function wbMusic.menu()
8484
return "All Worm Blossom Music"
8585
end
8686

87-
function wbMusic.menu()
88-
89-
local rootsData = query(opts)
90-
local roots = filter(rootsData, filterFunc)
91-
92-
local latestData = query(opts2)
93-
local latest = filter(latestData, filterFunc)
94-
95-
return rollup(roots, latest)
96-
end
87+
function wbMusic.menuAction()
9788

89+
end
9890

99-
return wbMusic
91+
return wbMusic

electron-builder.config.js

Lines changed: 41 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,37 @@
33
//
44
// SPDX-License-Identifier: CC0-1.0
55

6-
const path = require('path');
7-
const rimraf = require('rimraf');
8-
const packageJSON = require('./package.json');
6+
const path = require("path");
7+
const rimraf = require("rimraf");
8+
const packageJSON = require("./package.json");
99

1010
const copyrightYear = new Date().getFullYear();
11-
const AUTHOR = 'The Scuttlebutt Consortium';
12-
const NAME_HUMAN = 'Patchwork';
13-
const NAME_COMPUTER = 'Patchwork';
11+
const AUTHOR = "The Scuttlebutt Consortium";
12+
const NAME_HUMAN = "Poncho Wonky";
13+
const NAME_COMPUTER = "ponchowonky";
1414

1515
module.exports = {
1616
// Metadata ------------------------------------------------------------------
17-
appId: 'org.ssbc.patchwork',
17+
appId: "org.ssbc.ponchowonky",
1818
productName: NAME_HUMAN,
1919
copyright: `${copyrightYear} ${AUTHOR}`,
2020
buildVersion: packageJSON.version,
2121
extraMetadata: {
2222
name: NAME_COMPUTER,
2323
version: packageJSON.version,
24-
description: 'A social network for the rest of us',
24+
description: "A social network for the rest of us",
2525
author: AUTHOR,
26-
homepage: 'https://scuttlebutt.nz',
27-
license: 'AGPL-3.0',
28-
repository: 'https://github.com/soapdog/patchwork/',
26+
homepage: "https://scuttlebutt.nz",
27+
license: "AGPL-3.0",
28+
repository: "https://github.com/soapdog/patchwork/",
2929
},
30-
protocols: [{name: 'ssb', schemes: ['ssb']}],
30+
protocols: [{ name: "ssb", schemes: ["ssb"] }],
3131

3232
// Files section
3333
files: [
34-
'!*.p12',
35-
'!*.sh',
36-
'!*.lua'
34+
"!*.p12",
35+
"!*.sh",
36+
"!*.lua",
3737
],
3838

3939
// Electron-builder options --------------------------------------------------
@@ -44,31 +44,30 @@ module.exports = {
4444
// All things files and directories ------------------------------------------
4545
directories: {
4646
app: __dirname,
47-
buildResources: path.join(__dirname, 'build'),
48-
output: path.join(__dirname, 'dist'),
47+
buildResources: path.join(__dirname, "build"),
48+
output: path.join(__dirname, "dist"),
4949
},
5050

5151
// Linux-specific configurations ---------------------------------------------
5252
linux: {
53-
icon: path.join(__dirname, 'build', '512x512.png'),
53+
icon: path.join(__dirname, "build", "512x512.png"),
5454
target: [
55-
{target: 'deb', arch: ['x64', 'arm64']},
56-
{target: 'tar.gz', arch: ['x64', 'arm64']},
57-
{target: 'AppImage', arch: ['x64', 'arm64']},
55+
{ target: "deb", arch: ["x64", "arm64"] },
56+
{ target: "tar.gz", arch: ["x64", "arm64"] },
57+
{ target: "AppImage", arch: ["x64", "arm64"] },
5858
],
59-
category: 'Network',
59+
category: "Network",
6060
maintainer: "André Alves Garzia <andre@andregarzia.com>",
6161
},
6262

6363
deb: {
64-
packageCategory: 'net',
65-
priority: 'optional',
64+
packageCategory: "net",
65+
priority: "optional",
6666
depends: [
67-
'libnotify4',
68-
'libxtst6',
69-
'libnss3',
70-
'libc6 >= 2.28',
71-
67+
"libnotify4",
68+
"libxtst6",
69+
"libnss3",
70+
"libc6 >= 2.28",
7271
// Disabled to support KDE:
7372
// 'gconf2',
7473
// 'gconf-service',
@@ -79,43 +78,41 @@ module.exports = {
7978
},
8079

8180
appImage: {
82-
artifactName: '${name}-${version}-linux-${arch}.${ext}',
81+
artifactName: "${name}-${version}-linux-${arch}.${ext}",
8382
},
8483

8584
// Mac-specific configurations -----------------------------------------------
8685
mac: {
87-
icon: path.join(__dirname, 'build', '512x512.png'),
88-
category: 'public.app-category.social-networking',
86+
icon: path.join(__dirname, "build", "512x512.png"),
87+
category: "public.app-category.social-networking",
8988
darkModeSupport: true,
90-
target: [{target: 'dmg', arch: 'x64'},{target: 'dmg', arch: 'arm64'}],
89+
target: [{ target: "dmg", arch: "x64" }, { target: "dmg", arch: "arm64" }],
9190
hardenedRuntime: true,
92-
type: 'distribution',
91+
type: "distribution",
9392
entitlements: "build/entitlements.mac.plist",
9493
entitlementsInherit: "build/entitlements.mac.plist",
95-
x64ArchFiles: '**/*.node'
94+
x64ArchFiles: "**/*.node",
9695
},
9796

9897
dmg: {
99-
icon: path.join(__dirname, 'build', '512x512.png'),
98+
icon: path.join(__dirname, "build", "512x512.png"),
10099
// background: path.join(__dirname, 'build', 'dmg-background.png'),
101100
},
102101

103102
// Windows-specific configurations -------------------------------------------
104103

105-
106104
nsis: {
107-
artifactName: '${name}-${version}-windows-${arch}-nsis-installer.${ext}',
105+
artifactName: "${name}-${version}-windows-${arch}-nsis-installer.${ext}",
108106
oneClick: false,
109107
perMachine: false,
110108
},
111109

112-
113110
// Publish options -----------------------------------------------------------
114111
publish: {
115-
provider: 'github',
116-
protocol: 'https',
117-
owner: 'soapdog',
118-
repo: 'patchwork',
119-
releaseType: 'release',
112+
provider: "github",
113+
protocol: "https",
114+
owner: "soapdog",
115+
repo: "patchwork",
116+
releaseType: "release",
120117
},
121118
};

index.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,26 @@ require("@electron/remote/main").initialize();
2020

2121
// FEATURES
2222
initializeFeatureFile();
23+
2324
disableFeature("custom-scripts");
25+
enableFeature("multiple-identities");
26+
2427
if (process.argv.includes("--enable-multiple-identities")) {
2528
enableFeature("multiple-identities");
26-
} else {
29+
} else if (process.argv.includes("--disable-multiple-identities")) {
2730
disableFeature("multiple-identities");
2831
}
32+
33+
if (process.argv.includes("--enable-single-identity")) {
34+
disableFeature("multiple-identities");
35+
}
36+
37+
if (process.argv.includes("--disable-custom-scripts")) {
38+
disableFeature("custom-scripts");
39+
} else if (process.argv.includes("--enable-custom-scripts")) {
40+
enableFeature("custom-scripts");
41+
}
42+
2943
// END OF FEATURES;
3044

3145
if (isFeatureEnabled("multiple-identities")) {

0 commit comments

Comments
 (0)