|
@@ -2,17 +2,19 @@ import { html } from "lit";
|
|
import { __ } from 'i18n';
|
|
import { __ } from 'i18n';
|
|
|
|
|
|
|
|
|
|
-export default (o) => {
|
|
|
|
- const name = o.bookmark?.get('name') ?? o.name;
|
|
|
|
- const nick = o.bookmark?.get('nick') ?? o.nick;
|
|
|
|
|
|
+export default (el) => {
|
|
|
|
+ const name = el.model.getDisplayName();
|
|
|
|
+ const nick = el.bookmark?.get('nick') ?? el.model.get('nick');
|
|
|
|
+
|
|
const i18n_heading = __('Bookmark for "%1$s"', name);
|
|
const i18n_heading = __('Bookmark for "%1$s"', name);
|
|
const i18n_autojoin = __('Would you like this groupchat to be automatically joined upon startup?');
|
|
const i18n_autojoin = __('Would you like this groupchat to be automatically joined upon startup?');
|
|
const i18n_remove = __('Remove');
|
|
const i18n_remove = __('Remove');
|
|
const i18n_name = __('The name for this bookmark:');
|
|
const i18n_name = __('The name for this bookmark:');
|
|
const i18n_nick = __('What should your nickname for this groupchat be?');
|
|
const i18n_nick = __('What should your nickname for this groupchat be?');
|
|
- const i18n_submit = o.bookmark ? __('Update') : __('Save');
|
|
|
|
|
|
+ const i18n_submit = el.bookmark ? __('Update') : __('Save');
|
|
|
|
+
|
|
return html`
|
|
return html`
|
|
- <form class="converse-form chatroom-form" @submit=${o.onSubmit}>
|
|
|
|
|
|
+ <form class="converse-form chatroom-form" @submit=${(ev) => el.onBookmarkFormSubmitted(ev)}>
|
|
<legend>${i18n_heading}</legend>
|
|
<legend>${i18n_heading}</legend>
|
|
<fieldset class="form-group">
|
|
<fieldset class="form-group">
|
|
<label for="converse_muc_bookmark_name">${i18n_name}</label>
|
|
<label for="converse_muc_bookmark_name">${i18n_name}</label>
|
|
@@ -28,7 +30,7 @@ export default (o) => {
|
|
</fieldset>
|
|
</fieldset>
|
|
<fieldset class="form-group">
|
|
<fieldset class="form-group">
|
|
<input class="btn btn-primary" type="submit" value="${i18n_submit}">
|
|
<input class="btn btn-primary" type="submit" value="${i18n_submit}">
|
|
- ${o.bookmark ? html`<input class="btn btn-secondary button-remove" type="button" value="${i18n_remove}" @click=${o.onCancel}>` : '' }
|
|
|
|
|
|
+ ${el.bookmark ? html`<input class="btn btn-secondary button-remove" type="button" value="${i18n_remove}" @click=${(ev) => el.removeBookmark(ev)}>` : '' }
|
|
</fieldset>
|
|
</fieldset>
|
|
</form>
|
|
</form>
|
|
`;
|
|
`;
|