Update hello world
This commit is contained in:
parent
60432bdf25
commit
6954e782ff
@ -0,0 +1,16 @@
|
||||
function register ({ registerHook }) {
|
||||
registerHook({
|
||||
target: 'action:admin-plugin-settings.init',
|
||||
handler: ({ npmName }) => {
|
||||
console.log('loaded admin plugin settings %s', npmName)
|
||||
|
||||
const div = document.createElement('div')
|
||||
div.innerHTML = '<p>Just after the user name</p>'
|
||||
document.querySelector('#user-name-wrapper').appendChild(div)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
register
|
||||
}
|
@ -6,7 +6,15 @@ function register ({ registerHook, registerSettingsScript, peertubeHelpers }) {
|
||||
|
||||
registerHook({
|
||||
target: 'action:auth-user.information-loaded',
|
||||
handler: ({ user }) => console.log('User information loaded.', user)
|
||||
handler: ({ user }) => {
|
||||
console.log('User information loaded.', user)
|
||||
|
||||
fetch('/api/v1/users/me', {
|
||||
method: 'GET',
|
||||
headers: peertubeHelpers.getAuthHeader()
|
||||
}).then(res => res.json())
|
||||
.then(data => console.log('Hi %s.', data.username))
|
||||
}
|
||||
})
|
||||
|
||||
registerHook({
|
||||
|
@ -105,7 +105,7 @@ async function register ({
|
||||
|
||||
registerSetting({
|
||||
type: 'html',
|
||||
html: '<strong>coucou</strong><br /><br />'
|
||||
html: '<strong class="toto">coucou</strong><br /><br />'
|
||||
})
|
||||
|
||||
registerSetting({
|
||||
|
@ -44,9 +44,13 @@
|
||||
{
|
||||
"script": "client/video-edit-client-plugin.js",
|
||||
"scopes": [ "video-edit" ]
|
||||
},
|
||||
{
|
||||
"script": "client/admin-plugin-client-plugin.js",
|
||||
"scopes": [ "admin-plugin" ]
|
||||
}
|
||||
],
|
||||
"translations": {
|
||||
"fr-FR": "./languages/fr.json"
|
||||
"fr": "./languages/fr.json"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user