parent
11cd6b8321
commit
306b9fdd71
@ -10,18 +10,11 @@ import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
|
|||||||
const { Strophe, $iq } = converse.env;
|
const { Strophe, $iq } = converse.env;
|
||||||
const u = converse.env.utils;
|
const u = converse.env.utils;
|
||||||
|
|
||||||
const i18n_hide = __('Hide');
|
|
||||||
const i18n_choose_service = __('On which entity do you want to run commands?');
|
|
||||||
const i18n_choose_service_instructions = __(
|
|
||||||
'Certain XMPP services and entities allow privileged users to execute ad-hoc commands on them.');
|
|
||||||
const i18n_commands_found = __('Commands found');
|
|
||||||
const i18n_fetch_commands = __('List available commands');
|
|
||||||
const i18n_jid_placeholder = __('XMPP Address');
|
|
||||||
const i18n_no_commands_found = __('No commands found');
|
|
||||||
const i18n_run = __('Execute');
|
|
||||||
|
|
||||||
|
const tpl_command_form = (o, command) => {
|
||||||
const tpl_command_form = (o, command) => html`
|
const i18n_hide = __('Hide');
|
||||||
|
const i18n_run = __('Execute');
|
||||||
|
return html`
|
||||||
<form @submit=${o.runCommand}>
|
<form @submit=${o.runCommand}>
|
||||||
${ command.alert ? html`<div class="alert alert-${command.alert_type}" role="alert">${command.alert}</div>` : '' }
|
${ command.alert ? html`<div class="alert alert-${command.alert_type}" role="alert">${command.alert}</div>` : '' }
|
||||||
<fieldset class="form-group">
|
<fieldset class="form-group">
|
||||||
@ -37,7 +30,8 @@ const tpl_command_form = (o, command) => html`
|
|||||||
<input type="button" class="btn btn-secondary button-cancel" value="${i18n_hide}" @click=${o.hideCommandForm}>
|
<input type="button" class="btn btn-secondary button-cancel" value="${i18n_hide}" @click=${o.hideCommandForm}>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
`;
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const tpl_command = (o, command) => html`
|
const tpl_command = (o, command) => html`
|
||||||
@ -62,7 +56,15 @@ async function getAutoCompleteList () {
|
|||||||
return jids;
|
return jids;
|
||||||
}
|
}
|
||||||
|
|
||||||
const tpl_adhoc = (o) => html`
|
const tpl_adhoc = (o) => {
|
||||||
|
const i18n_choose_service = __('On which entity do you want to run commands?');
|
||||||
|
const i18n_choose_service_instructions = __(
|
||||||
|
'Certain XMPP services and entities allow privileged users to execute ad-hoc commands on them.');
|
||||||
|
const i18n_commands_found = __('Commands found');
|
||||||
|
const i18n_fetch_commands = __('List available commands');
|
||||||
|
const i18n_jid_placeholder = __('XMPP Address');
|
||||||
|
const i18n_no_commands_found = __('No commands found');
|
||||||
|
return html`
|
||||||
${ o.alert ? html`<div class="alert alert-${o.alert_type}" role="alert">${o.alert}</div>` : '' }
|
${ o.alert ? html`<div class="alert alert-${o.alert_type}" role="alert">${o.alert}</div>` : '' }
|
||||||
<form class="converse-form" @submit=${o.fetchCommands}>
|
<form class="converse-form" @submit=${o.fetchCommands}>
|
||||||
<fieldset class="form-group">
|
<fieldset class="form-group">
|
||||||
@ -88,7 +90,8 @@ const tpl_adhoc = (o) => html`
|
|||||||
: '' }
|
: '' }
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
`;
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async function fetchCommandForm (command) {
|
async function fetchCommandForm (command) {
|
||||||
|
@ -16,11 +16,6 @@ import { renderAvatar } from './../templates/directives/avatar';
|
|||||||
const { Strophe } = converse.env;
|
const { Strophe } = converse.env;
|
||||||
const u = converse.env.utils;
|
const u = converse.env.utils;
|
||||||
|
|
||||||
const i18n_edited = __('This message has been edited');
|
|
||||||
const i18n_show = __('Show more');
|
|
||||||
const i18n_show_less = __('Show less');
|
|
||||||
const i18n_uploading = __('Uploading file:');
|
|
||||||
|
|
||||||
|
|
||||||
export default class Message extends CustomElement {
|
export default class Message extends CustomElement {
|
||||||
|
|
||||||
@ -112,6 +107,7 @@ export default class Message extends CustomElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderFileProgress () {
|
renderFileProgress () {
|
||||||
|
const i18n_uploading = __('Uploading file:');
|
||||||
const filename = this.model.file.name;
|
const filename = this.model.file.name;
|
||||||
const size = filesize(this.model.file.size);
|
const size = filesize(this.model.file.size);
|
||||||
return html`
|
return html`
|
||||||
@ -214,7 +210,11 @@ export default class Message extends CustomElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderMessageText () {
|
renderMessageText () {
|
||||||
|
const i18n_edited = __('This message has been edited');
|
||||||
|
const i18n_show = __('Show more');
|
||||||
const is_groupchat_message = (this.message_type === 'groupchat');
|
const is_groupchat_message = (this.message_type === 'groupchat');
|
||||||
|
const i18n_show_less = __('Show less');
|
||||||
|
|
||||||
const tpl_spoiler_hint = html`
|
const tpl_spoiler_hint = html`
|
||||||
<div class="chat-msg__spoiler-hint">
|
<div class="chat-msg__spoiler-hint">
|
||||||
<span class="spoiler-hint">${this.spoiler_hint}</span>
|
<span class="spoiler-hint">${this.spoiler_hint}</span>
|
||||||
|
@ -7,13 +7,6 @@ import { until } from 'lit-html/directives/until.js';
|
|||||||
|
|
||||||
const Strophe = converse.env.Strophe
|
const Strophe = converse.env.Strophe
|
||||||
|
|
||||||
const i18n_chars_remaining = __('Message characters remaining');
|
|
||||||
const i18n_choose_file = __('Choose a file to send')
|
|
||||||
const i18n_hide_occupants = __('Hide occupants');
|
|
||||||
const i18n_send_message = __('Send the message');
|
|
||||||
const i18n_show_occupants = __('Show occupants');
|
|
||||||
const i18n_start_call = __('Start a call');
|
|
||||||
|
|
||||||
|
|
||||||
export class ChatToolbar extends CustomElement {
|
export class ChatToolbar extends CustomElement {
|
||||||
|
|
||||||
@ -35,6 +28,7 @@ export class ChatToolbar extends CustomElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
const i18n_send_message = __('Send the message');
|
||||||
return html`
|
return html`
|
||||||
${ this.show_toolbar ? html`<span class="toolbar-buttons">${until(this.getButtons(), '')}</span>` : '' }
|
${ this.show_toolbar ? html`<span class="toolbar-buttons">${until(this.getButtons(), '')}</span>` : '' }
|
||||||
${ this.show_send_button ? html`<button type="submit" class="btn send-button fa fa-paper-plane" title="${ i18n_send_message }"></button>` : '' }
|
${ this.show_send_button ? html`<button type="submit" class="btn send-button fa fa-paper-plane" title="${ i18n_send_message }"></button>` : '' }
|
||||||
@ -49,12 +43,14 @@ export class ChatToolbar extends CustomElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.show_call_button) {
|
if (this.show_call_button) {
|
||||||
|
const i18n_start_call = __('Start a call');
|
||||||
buttons.push(html`
|
buttons.push(html`
|
||||||
<button class="toggle-call" @click=${this.toggleCall} title="${i18n_start_call}">
|
<button class="toggle-call" @click=${this.toggleCall} title="${i18n_start_call}">
|
||||||
<converse-icon class="fa fa-phone" path-prefix="/dist" size="1em"></converse-icon>
|
<converse-icon class="fa fa-phone" path-prefix="/dist" size="1em"></converse-icon>
|
||||||
</button>`
|
</button>`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
const i18n_chars_remaining = __('Message characters remaining');
|
||||||
const message_limit = api.settings.get('message_limit');
|
const message_limit = api.settings.get('message_limit');
|
||||||
if (message_limit) {
|
if (message_limit) {
|
||||||
buttons.push(html`<span class="right message-limit" title="${i18n_chars_remaining}">${this.message_limit}</span>`);
|
buttons.push(html`<span class="right message-limit" title="${i18n_chars_remaining}">${this.message_limit}</span>`);
|
||||||
@ -68,6 +64,8 @@ export class ChatToolbar extends CustomElement {
|
|||||||
buttons.push(html`${until(http_upload_promise.then(is_supported => this.getHTTPUploadButton(is_supported)),'')}`);
|
buttons.push(html`${until(http_upload_promise.then(is_supported => this.getHTTPUploadButton(is_supported)),'')}`);
|
||||||
|
|
||||||
if (this.show_occupants_toggle) {
|
if (this.show_occupants_toggle) {
|
||||||
|
const i18n_hide_occupants = __('Hide participants');
|
||||||
|
const i18n_show_occupants = __('Show participants');
|
||||||
buttons.push(html`
|
buttons.push(html`
|
||||||
<button class="toggle_occupants right"
|
<button class="toggle_occupants right"
|
||||||
title="${this.hidden_occupants ? i18n_show_occupants : i18n_hide_occupants}"
|
title="${this.hidden_occupants ? i18n_show_occupants : i18n_hide_occupants}"
|
||||||
@ -85,9 +83,9 @@ export class ChatToolbar extends CustomElement {
|
|||||||
return _converse.api.hook('getToolbarButtons', this, buttons);
|
return _converse.api.hook('getToolbarButtons', this, buttons);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getHTTPUploadButton (is_supported) {
|
getHTTPUploadButton (is_supported) {
|
||||||
if (is_supported) {
|
if (is_supported) {
|
||||||
|
const i18n_choose_file = __('Choose a file to send')
|
||||||
return html`
|
return html`
|
||||||
<button title="${i18n_choose_file}" @click=${this.toggleFileUpload}>
|
<button title="${i18n_choose_file}" @click=${this.toggleFileUpload}>
|
||||||
<converse-icon class="fa fa-paperclip"
|
<converse-icon class="fa fa-paperclip"
|
||||||
|
@ -313,7 +313,7 @@ converse.plugins.add('converse-muc-views', {
|
|||||||
} else if (state === 'op') {
|
} else if (state === 'op') {
|
||||||
return `${result}${__("%1$s are now moderators", actors[0])}\n`;
|
return `${result}${__("%1$s are now moderators", actors[0])}\n`;
|
||||||
} else if (state === 'deop') {
|
} else if (state === 'deop') {
|
||||||
return `${result}${__("%1$s are no longer moderator", actors[0])}\n`;
|
return `${result}${__("%1$s are no longer moderators", actors[0])}\n`;
|
||||||
} else if (state === 'voice') {
|
} else if (state === 'voice') {
|
||||||
return `${result}${__("%1$s have been given voices", actors[0])}\n`;
|
return `${result}${__("%1$s have been given voices", actors[0])}\n`;
|
||||||
} else if (state === 'mute') {
|
} else if (state === 'mute') {
|
||||||
|
Loading…
Reference in New Issue
Block a user