The «open in new window» button is now optional.
This commit is contained in:
parent
3de4b36994
commit
5230aad30f
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
* Optional Builtin ConverseJS
|
* Optional Builtin ConverseJS
|
||||||
* Option for enabling live only on local videos
|
* Option for enabling live only on local videos
|
||||||
|
* The «open in new window» button is optional
|
||||||
|
|
||||||
## v0.0.8
|
## v0.0.8
|
||||||
|
|
||||||
|
@ -24,6 +24,12 @@ There are several options in the plugin settings page.
|
|||||||
|
|
||||||
If checked, the chat will be loaded as soon as you are on the video page.
|
If checked, the chat will be loaded as soon as you are on the video page.
|
||||||
|
|
||||||
|
### Show the «open in new window» button
|
||||||
|
|
||||||
|
If your webchat can be opened in a full window, you can add a button to do so.
|
||||||
|
|
||||||
|
NB: The builtin ConverseJS is compatible with this feature.
|
||||||
|
|
||||||
### Chats are only available for local videos
|
### Chats are only available for local videos
|
||||||
|
|
||||||
Peertube is a federated service. Plugins are only available on the server you are browsing.
|
Peertube is a federated service. Plugins are only available on the server you are browsing.
|
||||||
|
@ -76,7 +76,7 @@ function register ({ registerHook, peertubeHelpers }) {
|
|||||||
buttons.prepend(button)
|
buttons.prepend(button)
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayChatButtons (peertubeHelpers, uuid) {
|
function displayChatButtons (peertubeHelpers, uuid, showOpenBlank) {
|
||||||
logger.log('Adding buttons in the DOM...')
|
logger.log('Adding buttons in the DOM...')
|
||||||
const p = new Promise((resolve, reject) => {
|
const p = new Promise((resolve, reject) => {
|
||||||
Promise.all([
|
Promise.all([
|
||||||
@ -93,10 +93,12 @@ function register ({ registerHook, peertubeHelpers }) {
|
|||||||
if (!iframeUri) {
|
if (!iframeUri) {
|
||||||
return reject(new Error('No uri, cant display the buttons.'))
|
return reject(new Error('No uri, cant display the buttons.'))
|
||||||
}
|
}
|
||||||
displayButton(buttons, 'openblank', labelOpenBlank, () => {
|
if (showOpenBlank) {
|
||||||
closeChat()
|
displayButton(buttons, 'openblank', labelOpenBlank, () => {
|
||||||
window.open(iframeUri)
|
closeChat()
|
||||||
})
|
window.open(iframeUri)
|
||||||
|
})
|
||||||
|
}
|
||||||
displayButton(buttons, 'open', labelOpen, () => openChat())
|
displayButton(buttons, 'open', labelOpen, () => openChat())
|
||||||
displayButton(buttons, 'close', labelClose, () => closeChat())
|
displayButton(buttons, 'close', labelClose, () => closeChat())
|
||||||
|
|
||||||
@ -212,7 +214,7 @@ function register ({ registerHook, peertubeHelpers }) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
displayChatButtons(peertubeHelpers, uuid).then(() => {
|
displayChatButtons(peertubeHelpers, uuid, !!settings['chat-open-blank']).then(() => {
|
||||||
if (settings['chat-auto-display']) {
|
if (settings['chat-auto-display']) {
|
||||||
openChat()
|
openChat()
|
||||||
} else {
|
} else {
|
||||||
|
7
main.js
7
main.js
@ -19,6 +19,13 @@ async function register ({
|
|||||||
default: false,
|
default: false,
|
||||||
private: false
|
private: false
|
||||||
})
|
})
|
||||||
|
registerSetting({
|
||||||
|
name: 'chat-open-blank',
|
||||||
|
label: 'Show the «open in new window» button',
|
||||||
|
private: false,
|
||||||
|
type: 'input-checkbox',
|
||||||
|
default: false
|
||||||
|
})
|
||||||
registerSetting({
|
registerSetting({
|
||||||
name: 'chat-only-locals',
|
name: 'chat-only-locals',
|
||||||
label: 'Chats are only available for local videos.',
|
label: 'Chats are only available for local videos.',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user