Skip to content

Commit

Permalink
Technically working options. Need CSS fix (plugin CSS not loaded) and…
Browse files Browse the repository at this point in the history
… data validation
  • Loading branch information
Murazaki committed May 23, 2024
1 parent 2bf8338 commit 57094a4
Show file tree
Hide file tree
Showing 16 changed files with 716 additions and 1,228 deletions.
1 change: 1 addition & 0 deletions assets/images/plus-square.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/images/x-square.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 1 addition & 14 deletions build-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,10 @@ function loadLocs() {
return r
}

function loadMustaches () {
// Loading mustache templates, dans filling constants.
const r = []
r['MUSTACHE_CONFIGURATION_HOME'] = loadMustache('client/common/configuration/templates/home.mustache')
r['MUSTACHE_CONFIGURATION_CHANNEL'] = loadMustache('client/common/configuration/templates/channel.mustache')
return r
}

function loadMustache (file) {
const filePath = path.resolve(__dirname, file)
return JSON.stringify(fs.readFileSync(filePath).toString())
}

const define = Object.assign({
PLUGIN_CHAT_PACKAGE_NAME: JSON.stringify(packagejson.name),
PLUGIN_CHAT_SHORT_NAME: JSON.stringify(packagejson.name.replace(/^peertube-plugin-/, ''))
}, loadLocs(), loadMustaches())
}, loadLocs())

const configs = clientFiles.map(f => ({
entryPoints: [ path.resolve(__dirname, 'client', f + '.ts') ],
Expand Down
3 changes: 2 additions & 1 deletion client/common/configuration/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ async function registerConfiguration (clientOptions: RegisterClientOptions): Pro
onMount: async ({ rootEl }) => {
const urlParams = new URLSearchParams(window.location.search)
const channelId = urlParams.get('channelId') ?? ''
render(html`<channel-configuration .registerClientOptions=${clientOptions}></channel-configuration>`, rootEl)
render(html`<channel-configuration .registerClientOptions=${clientOptions}
.channelId=${channelId}></channel-configuration>`, rootEl)
}
})

Expand Down
Loading

0 comments on commit 57094a4

Please sign in to comment.