diff --git a/src/headless/utils/form.js b/src/headless/utils/form.js index 2533a54d9..7c597af9f 100644 --- a/src/headless/utils/form.js +++ b/src/headless/utils/form.js @@ -5,9 +5,9 @@ */ import u from "./core"; -const tpl_xform_field = (name, value) => `${ value }`; +const tplXformField = (name, value) => `${ value }`; -const tpl_xform_value = (value) => `${value}`; +const tplXformValue = (value) => `${value}`; /** * Takes an HTML DOM and turns it into an XForm field. @@ -30,9 +30,9 @@ export function webForm2xForm (field) { } else { value = field.value; } - return u.toStanza(tpl_xform_field( + return u.toStanza(tplXformField( name, - Array.isArray(value) ? value.map(tpl_xform_value) : tpl_xform_value(value), + Array.isArray(value) ? value.map(tplXformValue) : tplXformValue(value), )); } diff --git a/src/plugins/adhoc-views/adhoc-commands.js b/src/plugins/adhoc-views/adhoc-commands.js index 5b0cf7094..72b52e957 100644 --- a/src/plugins/adhoc-views/adhoc-commands.js +++ b/src/plugins/adhoc-views/adhoc-commands.js @@ -1,6 +1,6 @@ import 'shared/autocomplete/index.js'; import log from '@converse/headless/log'; -import tpl_adhoc from './templates/ad-hoc.js'; +import tplAdhoc from './templates/ad-hoc.js'; import { CustomElement } from 'shared/components/element.js'; import { __ } from 'i18n'; import { api, converse } from '@converse/headless/core.js'; @@ -30,7 +30,7 @@ export default class AdHocCommands extends CustomElement { } render () { - return tpl_adhoc(this) + return tplAdhoc(this) } async fetchCommands (ev) { diff --git a/src/plugins/adhoc-views/templates/ad-hoc-command.js b/src/plugins/adhoc-views/templates/ad-hoc-command.js index a44e604a8..78f0b2ba5 100644 --- a/src/plugins/adhoc-views/templates/ad-hoc-command.js +++ b/src/plugins/adhoc-views/templates/ad-hoc-command.js @@ -1,5 +1,5 @@ import { html } from "lit"; -import tpl_command_form from './ad-hoc-command-form.js'; +import tplCommandForm from './ad-hoc-command-form.js'; export default (el, command) => html`
  • @@ -12,6 +12,6 @@ export default (el, command) => html` title="${command.name}" href="#">${command.name || command.jid} - ${ command.node === el.showform ? tpl_command_form(el, command) : '' } + ${ command.node === el.showform ? tplCommandForm(el, command) : '' }
  • `; diff --git a/src/plugins/adhoc-views/templates/ad-hoc.js b/src/plugins/adhoc-views/templates/ad-hoc.js index ee9ebfb52..b85d21466 100644 --- a/src/plugins/adhoc-views/templates/ad-hoc.js +++ b/src/plugins/adhoc-views/templates/ad-hoc.js @@ -1,5 +1,5 @@ -import tpl_command from './ad-hoc-command.js'; -import tpl_spinner from 'templates/spinner.js'; +import tplCommand from './ad-hoc-command.js'; +import tplSpinner from 'templates/spinner.js'; import { __ } from 'i18n'; import { getAutoCompleteList } from 'plugins/muc-views/utils.js'; import { html } from "lit"; @@ -31,13 +31,13 @@ export default (el) => {
    - ${ el.fetching ? tpl_spinner() : html`` } + ${ el.fetching ? tplSpinner() : html`` }
    ${ el.view === 'list-commands' ? html`
    ` : '' } diff --git a/src/plugins/bookmark-views/components/bookmark-form.js b/src/plugins/bookmark-views/components/bookmark-form.js index affba9bd0..858ccb9be 100644 --- a/src/plugins/bookmark-views/components/bookmark-form.js +++ b/src/plugins/bookmark-views/components/bookmark-form.js @@ -1,4 +1,4 @@ -import tpl_muc_bookmark_form from './templates/form.js'; +import tplMUCBookmarkForm from './templates/form.js'; import { CustomElement } from 'shared/components/element'; import { _converse, api } from "@converse/headless/core"; @@ -19,7 +19,7 @@ class MUCBookmarkForm extends CustomElement { } render () { - return tpl_muc_bookmark_form(this) + return tplMUCBookmarkForm(this) } onBookmarkFormSubmitted (ev) { diff --git a/src/plugins/bookmark-views/components/bookmarks-list.js b/src/plugins/bookmark-views/components/bookmarks-list.js index 9abc5b626..8c981d9a0 100644 --- a/src/plugins/bookmark-views/components/bookmarks-list.js +++ b/src/plugins/bookmark-views/components/bookmarks-list.js @@ -1,6 +1,6 @@ import debounce from "lodash-es/debounce"; -import tpl_bookmarks_list from './templates/list.js'; -import tpl_spinner from "templates/spinner.js"; +import tplBookmarksList from './templates/list.js'; +import tplSpinner from "templates/spinner.js"; import { CustomElement } from 'shared/components/element.js'; import { Model } from '@converse/skeletor/src/model.js'; import { _converse, api } from '@converse/headless/core.js'; @@ -36,7 +36,7 @@ export default class BookmarksView extends CustomElement { } render () { - return _converse.bookmarks && this.model ? tpl_bookmarks_list(this) : tpl_spinner(); + return _converse.bookmarks && this.model ? tplBookmarksList(this) : tplSpinner(); } clearFilter (ev) { diff --git a/src/plugins/chatboxviews/view.js b/src/plugins/chatboxviews/view.js index 758cc8528..3965fdcfa 100644 --- a/src/plugins/chatboxviews/view.js +++ b/src/plugins/chatboxviews/view.js @@ -1,5 +1,5 @@ -import tpl_background_logo from '../../templates/background_logo.js'; -import tpl_chats from './templates/chats.js'; +import tplBackgroundLogo from '../../templates/background_logo.js'; +import tplChats from './templates/chats.js'; import { CustomElement } from 'shared/components/element.js'; import { api, _converse } from '@converse/headless/core'; import { getAppSettings } from '@converse/headless/shared/settings/utils.js'; @@ -29,7 +29,7 @@ class ConverseChats extends CustomElement { const bg = document.getElementById('conversejs-bg'); if (bg && !bg.innerHTML.trim()) { - render(tpl_background_logo(), bg); + render(tplBackgroundLogo(), bg); } const body = document.querySelector('body'); body.classList.add(`converse-${api.settings.get('view_mode')}`); @@ -43,7 +43,7 @@ class ConverseChats extends CustomElement { } render () { // eslint-disable-line class-methods-use-this - return tpl_chats(); + return tplChats(); } } diff --git a/src/plugins/chatview/bottom-panel.js b/src/plugins/chatview/bottom-panel.js index 3bd2cf9d0..114cb69bd 100644 --- a/src/plugins/chatview/bottom-panel.js +++ b/src/plugins/chatview/bottom-panel.js @@ -1,6 +1,6 @@ import './message-form.js'; import debounce from 'lodash-es/debounce'; -import tpl_bottom_panel from './templates/bottom-panel.js'; +import tplBottomPanel from './templates/bottom-panel.js'; import { ElementView } from '@converse/skeletor/src/element.js'; import { _converse, api } from '@converse/headless/core'; import { clearMessages } from './utils.js'; @@ -38,7 +38,7 @@ export default class ChatBottomPanel extends ElementView { } render () { - render(tpl_bottom_panel({ + render(tplBottomPanel({ 'model': this.model, 'viewUnreadMessages': ev => this.viewUnreadMessages(ev) }), this); diff --git a/src/plugins/chatview/chat.js b/src/plugins/chatview/chat.js index faee2173d..916f15c26 100644 --- a/src/plugins/chatview/chat.js +++ b/src/plugins/chatview/chat.js @@ -1,7 +1,7 @@ import 'plugins/chatview/heading.js'; import 'plugins/chatview/bottom-panel.js'; import BaseChatView from 'shared/chat/baseview.js'; -import tpl_chat from './templates/chat.js'; +import tplChat from './templates/chat.js'; import { __ } from 'i18n'; import { _converse, api } from '@converse/headless/core'; @@ -33,7 +33,7 @@ export default class ChatView extends BaseChatView { } render () { - return tpl_chat(Object.assign({ + return tplChat(Object.assign({ 'model': this.model, 'help_messages': this.getHelpMessages(), 'show_help_messages': this.model.get('show_help_messages'), diff --git a/src/plugins/chatview/heading.js b/src/plugins/chatview/heading.js index e503eae25..4fad77caf 100644 --- a/src/plugins/chatview/heading.js +++ b/src/plugins/chatview/heading.js @@ -1,5 +1,5 @@ import 'shared/modals/user-details.js'; -import tpl_chatbox_head from './templates/chat-head.js'; +import tplChatboxHead from './templates/chat-head.js'; import { CustomElement } from 'shared/components/element.js'; import { __ } from 'i18n'; import { _converse, api } from "@converse/headless/core"; @@ -30,7 +30,7 @@ export default class ChatHeading extends CustomElement { } render () { - return tpl_chatbox_head(Object.assign(this.model.toJSON(), { + return tplChatboxHead(Object.assign(this.model.toJSON(), { 'heading_buttons_promise': this.getHeadingButtons(), 'model': this.model, 'showUserDetailsModal': ev => this.showUserDetailsModal(ev), diff --git a/src/plugins/chatview/message-form.js b/src/plugins/chatview/message-form.js index 2fa9692ae..2af5ddd78 100644 --- a/src/plugins/chatview/message-form.js +++ b/src/plugins/chatview/message-form.js @@ -1,4 +1,4 @@ -import tpl_message_form from './templates/message-form.js'; +import tplMessageForm from './templates/message-form.js'; import { ElementView } from '@converse/skeletor/src/element.js'; import { __ } from 'i18n'; import { _converse, api, converse } from "@converse/headless/core.js"; @@ -32,7 +32,7 @@ export default class MessageForm extends ElementView { } toHTML () { - return tpl_message_form( + return tplMessageForm( Object.assign(this.model.toJSON(), { 'onDrop': ev => this.onDrop(ev), 'hint_value': this.querySelector('.spoiler-hint')?.value, diff --git a/src/plugins/controlbox/controlbox.js b/src/plugins/controlbox/controlbox.js index 257d072f8..684fd6bed 100644 --- a/src/plugins/controlbox/controlbox.js +++ b/src/plugins/controlbox/controlbox.js @@ -1,4 +1,4 @@ -import tpl_controlbox from './templates/controlbox.js'; +import tplControlbox from './templates/controlbox.js'; import { CustomElement } from 'shared/components/element.js'; import { _converse, api, converse } from '@converse/headless/core.js'; @@ -42,7 +42,7 @@ class ControlBox extends CustomElement { } render () { - return this.model ? tpl_controlbox(this) : ''; + return this.model ? tplControlbox(this) : ''; } close (ev) { diff --git a/src/plugins/controlbox/loginform.js b/src/plugins/controlbox/loginform.js index 0084c53b9..a350920f4 100644 --- a/src/plugins/controlbox/loginform.js +++ b/src/plugins/controlbox/loginform.js @@ -1,5 +1,5 @@ import bootstrap from 'bootstrap.native'; -import tpl_login_panel from './templates/loginform.js'; +import tplLoginPanel from './templates/loginform.js'; import { CustomElement } from 'shared/components/element.js'; import { _converse, api, converse } from '@converse/headless/core.js'; import { initConnection } from '@converse/headless/utils/init.js'; @@ -26,7 +26,7 @@ class LoginForm extends CustomElement { } render () { - return tpl_login_panel(this); + return tplLoginPanel(this); } firstUpdated () { diff --git a/src/plugins/controlbox/navback.js b/src/plugins/controlbox/navback.js index 5541d1968..efa2eb1b7 100644 --- a/src/plugins/controlbox/navback.js +++ b/src/plugins/controlbox/navback.js @@ -1,4 +1,4 @@ -import tpl_controlbox_navback from "./templates/navback.js"; +import tplControlboxNavback from "./templates/navback.js"; import { CustomElement } from 'shared/components/element.js'; import { api } from "@converse/headless/core"; @@ -12,7 +12,7 @@ class ControlBoxNavback extends CustomElement { } render () { - return tpl_controlbox_navback(this.jid); + return tplControlboxNavback(this.jid); } } diff --git a/src/plugins/controlbox/templates/controlbox.js b/src/plugins/controlbox/templates/controlbox.js index 7ecfcc66c..437acc454 100644 --- a/src/plugins/controlbox/templates/controlbox.js +++ b/src/plugins/controlbox/templates/controlbox.js @@ -1,4 +1,4 @@ -import tpl_spinner from "templates/spinner.js"; +import tplSpinner from "templates/spinner.js"; import { _converse, api, converse } from "@converse/headless/core.js"; import { html } from 'lit'; @@ -8,7 +8,7 @@ const { Strophe } = converse.env; function whenNotConnected (o) { const connection_status = _converse.connfeedback.get('connection_status'); if ([Strophe.Status.RECONNECTING, Strophe.Status.CONNECTING].includes(connection_status)) { - return tpl_spinner(); + return tplSpinner(); } if (o['active-form'] === 'register') { return html``; diff --git a/src/plugins/controlbox/templates/loginform.js b/src/plugins/controlbox/templates/loginform.js index 354d04b6b..a6794ed75 100644 --- a/src/plugins/controlbox/templates/loginform.js +++ b/src/plugins/controlbox/templates/loginform.js @@ -1,5 +1,5 @@ import 'shared/components/brand-heading.js'; -import tpl_spinner from 'templates/spinner.js'; +import tplSpinner from 'templates/spinner.js'; import { REPORTABLE_STATUSES, PRETTY_CONNECTION_STATUS, CONNECTION_STATUS_CSS_CLASS } from '../constants.js'; import { __ } from 'i18n'; import { _converse, api } from "@converse/headless/core"; @@ -139,6 +139,6 @@ export default (el) => {

    ${ pretty_status }

    ${conn_feedback_message}

    - ${ (_converse.CONNECTION_STATUS[connection_status] === 'CONNECTING') ? tpl_spinner({'classes': 'hor_centered'}) : form_fields(el) } + ${ (_converse.CONNECTION_STATUS[connection_status] === 'CONNECTING') ? tplSpinner({'classes': 'hor_centered'}) : form_fields(el) } `; } diff --git a/src/plugins/controlbox/toggle.js b/src/plugins/controlbox/toggle.js index b0432554f..e2293f6d9 100644 --- a/src/plugins/controlbox/toggle.js +++ b/src/plugins/controlbox/toggle.js @@ -1,4 +1,4 @@ -import tpl_controlbox_toggle from "./templates/toggle.js"; +import tplControlboxToggle from "./templates/toggle.js"; import { CustomElement } from 'shared/components/element.js'; import { _converse, api } from "@converse/headless/core"; import { showControlBox } from './utils.js'; @@ -15,7 +15,7 @@ class ControlBoxToggle extends CustomElement { } render () { - return tpl_controlbox_toggle({ + return tplControlboxToggle({ 'onClick': showControlBox, 'hide': !this.model?.get('closed') }); diff --git a/src/plugins/dragresize/components/dragresize.js b/src/plugins/dragresize/components/dragresize.js index c8bf71429..0742fbd95 100644 --- a/src/plugins/dragresize/components/dragresize.js +++ b/src/plugins/dragresize/components/dragresize.js @@ -1,4 +1,4 @@ -import tpl_dragresize from "../templates/dragresize.js"; +import tplDragresize from "../templates/dragresize.js"; import { CustomElement } from 'shared/components/element.js'; import { api } from '@converse/headless/core.js'; @@ -6,7 +6,7 @@ import { api } from '@converse/headless/core.js'; class ConverseDragResize extends CustomElement { render () { // eslint-disable-line class-methods-use-this - return tpl_dragresize(); + return tplDragresize(); } } diff --git a/src/plugins/headlines-view/feed-list.js b/src/plugins/headlines-view/feed-list.js index 04f2e3ad3..bd60f0508 100644 --- a/src/plugins/headlines-view/feed-list.js +++ b/src/plugins/headlines-view/feed-list.js @@ -1,4 +1,4 @@ -import tpl_feeds_list from './templates/feeds-list.js'; +import tplFeedsList from './templates/feeds-list.js'; import { CustomElement } from 'shared/components/element.js'; import { _converse, api } from '@converse/headless/core'; @@ -19,7 +19,7 @@ export class HeadlinesFeedsList extends CustomElement { } render () { - return tpl_feeds_list(this); + return tplFeedsList(this); } renderIfHeadline (model) { diff --git a/src/plugins/headlines-view/heading.js b/src/plugins/headlines-view/heading.js index 227cfa56a..6df533579 100644 --- a/src/plugins/headlines-view/heading.js +++ b/src/plugins/headlines-view/heading.js @@ -1,4 +1,4 @@ -import tpl_chat_head from './templates/chat-head.js'; +import tplChatHead from './templates/chat-head.js'; import { CustomElement } from 'shared/components/element.js'; import { __ } from 'i18n'; import { _converse, api } from "@converse/headless/core.js"; @@ -19,7 +19,7 @@ export default class HeadlinesHeading extends CustomElement { } render () { - return tpl_chat_head({ + return tplChatHead({ ...this.model.toJSON(), ...{ 'display_name': this.model.getDisplayName(), diff --git a/src/plugins/headlines-view/templates/feeds-list.js b/src/plugins/headlines-view/templates/feeds-list.js index b4c79b397..9656e20f6 100644 --- a/src/plugins/headlines-view/templates/feeds-list.js +++ b/src/plugins/headlines-view/templates/feeds-list.js @@ -2,7 +2,7 @@ import { __ } from 'i18n'; import { _converse } from '@converse/headless/core'; import { html } from "lit"; -const tpls_headlines_feeds_list_item = (el, feed) => { +function tplHeadlinesFeedsListItem (el, feed) { const open_title = __('Click to open this server message'); return html`
    {
    - ${ feeds.map(feed => tpls_headlines_feeds_list_item(el, feed)) } + ${ feeds.map(feed => tplHeadlinesFeedsListItem(el, feed)) }
    ` } diff --git a/src/plugins/headlines-view/view.js b/src/plugins/headlines-view/view.js index 129872171..a0c6d439a 100644 --- a/src/plugins/headlines-view/view.js +++ b/src/plugins/headlines-view/view.js @@ -1,5 +1,5 @@ import BaseChatView from 'shared/chat/baseview.js'; -import tpl_headlines from './templates/headlines.js'; +import tplHeadlines from './templates/headlines.js'; import { _converse, api } from '@converse/headless/core'; @@ -29,7 +29,7 @@ class HeadlinesFeedView extends BaseChatView { } render () { - return tpl_headlines(this.model); + return tplHeadlines(this.model); } async close (ev) { diff --git a/src/plugins/mam-views/placeholder.js b/src/plugins/mam-views/placeholder.js index f94da2171..bf2a0e817 100644 --- a/src/plugins/mam-views/placeholder.js +++ b/src/plugins/mam-views/placeholder.js @@ -1,5 +1,5 @@ import { CustomElement } from 'shared/components/element.js'; -import tpl_placeholder from './templates/placeholder.js'; +import tplPlaceholder from './templates/placeholder.js'; import { api } from "@converse/headless/core"; import { fetchArchivedMessages } from '@converse/headless/plugins/mam/utils.js'; @@ -15,7 +15,7 @@ class Placeholder extends CustomElement { } render () { - return tpl_placeholder(this); + return tplPlaceholder(this); } async fetchMissingMessages (ev) { diff --git a/src/plugins/mam-views/templates/placeholder.js b/src/plugins/mam-views/templates/placeholder.js index f7cae58ca..87ca27dce 100644 --- a/src/plugins/mam-views/templates/placeholder.js +++ b/src/plugins/mam-views/templates/placeholder.js @@ -1,9 +1,9 @@ -import tpl_spinner from 'templates/spinner.js'; +import tplSpinner from 'templates/spinner.js'; import { __ } from 'i18n'; import { html } from 'lit/html.js'; export default (el) => { - return el.model.get('fetching') ? tpl_spinner({'classes': 'hor_centered'}) : + return el.model.get('fetching') ? tplSpinner({'classes': 'hor_centered'}) : html`
    `; diff --git a/src/plugins/minimize/components/minimized-chat.js b/src/plugins/minimize/components/minimized-chat.js index e315a34bc..972eb11a4 100644 --- a/src/plugins/minimize/components/minimized-chat.js +++ b/src/plugins/minimize/components/minimized-chat.js @@ -1,4 +1,4 @@ -import tpl_trimmed_chat from "../templates/trimmed_chat.js"; +import tplTrimmedChat from "../templates/trimmed_chat.js"; import { CustomElement } from 'shared/components/element.js'; import { api } from "@converse/headless/core"; import { maximize } from '../utils.js'; @@ -23,7 +23,7 @@ export default class MinimizedChat extends CustomElement { 'title': this.title, 'type': this.type }; - return tpl_trimmed_chat(data); + return tplTrimmedChat(data); } close (ev) { diff --git a/src/plugins/minimize/view.js b/src/plugins/minimize/view.js index 831ca7847..a8e690aab 100644 --- a/src/plugins/minimize/view.js +++ b/src/plugins/minimize/view.js @@ -1,5 +1,5 @@ import MinimizedChatsToggle from './toggle.js'; -import tpl_chats_panel from './templates/chats-panel.js'; +import tplChatsPanel from './templates/chats-panel.js'; import { CustomElement } from 'shared/components/element'; import { _converse, api } from '@converse/headless/core'; import { initStorage } from '@converse/headless/utils/storage.js'; @@ -31,7 +31,7 @@ export default class MinimizedChats extends CustomElement { const collapsed = this.minchats.get('collapsed'); const data = { chats, num_unread, num_minimized, collapsed }; data.toggle = ev => this.toggle(ev); - return tpl_chats_panel(data); + return tplChatsPanel(data); } async initToggle () { diff --git a/src/plugins/modal/alert.js b/src/plugins/modal/alert.js index b35761c84..b112b6054 100644 --- a/src/plugins/modal/alert.js +++ b/src/plugins/modal/alert.js @@ -1,5 +1,5 @@ import BaseModal from "plugins/modal/modal.js"; -import tpl_alert_modal from "./templates/alert.js"; +import tplAlertModal from "./templates/alert.js"; import { api } from "@converse/headless/core"; @@ -12,7 +12,7 @@ export default class Alert extends BaseModal { } renderModal () { - return tpl_alert_modal(this.model.toJSON()); + return tplAlertModal(this.model.toJSON()); } getModalTitle () { diff --git a/src/plugins/modal/base.js b/src/plugins/modal/base.js index 2345d5291..2741e7ae0 100644 --- a/src/plugins/modal/base.js +++ b/src/plugins/modal/base.js @@ -1,6 +1,6 @@ import bootstrap from "bootstrap.native"; import log from "@converse/headless/log"; -import tpl_alert_component from "./templates/modal-alert.js"; +import tplAlertComponent from "./templates/modal-alert.js"; import { View } from '@converse/skeletor/src/view.js'; import { api, converse } from "@converse/headless/core"; import { render } from 'lit'; @@ -71,7 +71,7 @@ const BaseModal = View.extend({ } // FIXME: Instead of adding the alert imperatively, we should // find a way to let the modal rerender with an alert message - render(tpl_alert_component({'type': `alert-${type}`, 'message': message}), body); + render(tplAlertComponent({'type': `alert-${type}`, 'message': message}), body); const el = body.firstElementChild; setTimeout(() => { u.addClass('fade-out', el); diff --git a/src/plugins/modal/confirm.js b/src/plugins/modal/confirm.js index cc7c2ba77..8f775f0b6 100644 --- a/src/plugins/modal/confirm.js +++ b/src/plugins/modal/confirm.js @@ -1,5 +1,5 @@ import BaseModal from "plugins/modal/modal.js"; -import tpl_prompt from "./templates/prompt.js"; +import tplPrompt from "./templates/prompt.js"; import { getOpenPromise } from '@converse/openpromise'; import { api } from "@converse/headless/core"; @@ -21,7 +21,7 @@ export default class Confirm extends BaseModal { } renderModal () { - return tpl_prompt(this); + return tplPrompt(this); } getModalTitle () { diff --git a/src/plugins/modal/modal.js b/src/plugins/modal/modal.js index 11578c0fe..6c9456220 100644 --- a/src/plugins/modal/modal.js +++ b/src/plugins/modal/modal.js @@ -1,5 +1,5 @@ import bootstrap from "bootstrap.native"; -import tpl_modal from './templates/modal.js'; +import tplModal from './templates/modal.js'; import { ElementView } from '@converse/skeletor/src/element.js'; import { getOpenPromise } from '@converse/openpromise'; @@ -29,7 +29,7 @@ class BaseModal extends ElementView { } toHTML () { - return tpl_modal(this); + return tplModal(this); } getModalTitle () { // eslint-disable-line class-methods-use-this diff --git a/src/plugins/modal/templates/modal.js b/src/plugins/modal/templates/modal.js index ddddc63a8..daa2c2981 100644 --- a/src/plugins/modal/templates/modal.js +++ b/src/plugins/modal/templates/modal.js @@ -1,4 +1,4 @@ -import tpl_alert_component from "./modal-alert.js"; +import tplAlertComponent from "./modal-alert.js"; import { html } from "lit"; import { modal_close_button, modal_header_close_button } from "plugins/modal/templates/buttons.js"; @@ -15,7 +15,7 @@ export default (el) => { diff --git a/src/plugins/modal/templates/prompt.js b/src/plugins/modal/templates/prompt.js index 1402a278e..2c0ad211f 100644 --- a/src/plugins/modal/templates/prompt.js +++ b/src/plugins/modal/templates/prompt.js @@ -2,7 +2,7 @@ import { html } from "lit"; import { __ } from 'i18n'; -const tpl_field = (f) => html` +const tplField = (f) => html`
    - + `; } diff --git a/src/plugins/muc-views/utils.js b/src/plugins/muc-views/utils.js index 0b982648e..745c5063c 100644 --- a/src/plugins/muc-views/utils.js +++ b/src/plugins/muc-views/utils.js @@ -1,7 +1,7 @@ import './modals/occupant.js'; import './modals/moderator-tools.js'; import log from "@converse/headless/log"; -import tpl_spinner from 'templates/spinner.js'; +import tplSpinner from 'templates/spinner.js'; import { __ } from 'i18n'; import { _converse, api, converse } from "@converse/headless/core"; import { html } from "lit"; @@ -82,7 +82,7 @@ export function getChatRoomBodyTemplate (o) { return html` ${ conn_status == RS.PASSWORD_REQUIRED ? html`` : '' } ${ conn_status == RS.ENTERED ? html`` : '' } - ${ conn_status == RS.CONNECTING ? tpl_spinner() : '' } + ${ conn_status == RS.CONNECTING ? tplSpinner() : '' } ${ conn_status == RS.NICKNAME_REQUIRED ? getNicknameRequiredTemplate(o.model) : '' } ${ conn_status == RS.DISCONNECTED ? html`` : '' } ${ conn_status == RS.BANNED ? html`` : '' } diff --git a/src/plugins/omemo/fingerprints.js b/src/plugins/omemo/fingerprints.js index 848c0fa2b..00b9f86d8 100644 --- a/src/plugins/omemo/fingerprints.js +++ b/src/plugins/omemo/fingerprints.js @@ -1,4 +1,4 @@ -import tpl_fingerprints from './templates/fingerprints.js'; +import tplFingerprints from './templates/fingerprints.js'; import { CustomElement } from 'shared/components/element.js'; import { api } from "@converse/headless/core"; @@ -21,7 +21,7 @@ export class Fingerprints extends CustomElement { } render () { - return this.devicelist ? tpl_fingerprints(this) : ''; + return this.devicelist ? tplFingerprints(this) : ''; } toggleDeviceTrust (ev) { diff --git a/src/plugins/omemo/profile.js b/src/plugins/omemo/profile.js index d91d954bf..fb5a1356c 100644 --- a/src/plugins/omemo/profile.js +++ b/src/plugins/omemo/profile.js @@ -1,6 +1,6 @@ import log from '@converse/headless/log'; -import tpl_profile from './templates/profile.js'; -import tpl_spinner from "templates/spinner.js"; +import tplProfile from './templates/profile.js'; +import tplSpinner from "templates/spinner.js"; import { CustomElement } from 'shared/components/element.js'; import { __ } from 'i18n'; import { _converse, api, converse } from "@converse/headless/core"; @@ -28,7 +28,7 @@ export class Profile extends CustomElement { } render () { - return this.devicelist ? tpl_profile(this) : tpl_spinner(); + return this.devicelist ? tplProfile(this) : tplSpinner(); } selectAll (ev) { // eslint-disable-line class-methods-use-this diff --git a/src/plugins/omemo/utils.js b/src/plugins/omemo/utils.js index 8a462310b..ab786b204 100644 --- a/src/plugins/omemo/utils.js +++ b/src/plugins/omemo/utils.js @@ -2,10 +2,10 @@ import concat from 'lodash-es/concat'; import difference from 'lodash-es/difference'; import log from '@converse/headless/log'; -import tpl_audio from 'templates/audio.js'; -import tpl_file from 'templates/file.js'; -import tpl_image from 'templates/image.js'; -import tpl_video from 'templates/video.js'; +import tplAudio from 'templates/audio.js'; +import tplFile from 'templates/file.js'; +import tplImage from 'templates/image.js'; +import tplVideo from 'templates/video.js'; import { KEY_ALGO, UNTRUSTED, TAG_LENGTH } from './consts.js'; import { MIMETYPES_MAP } from 'utils/file.js'; import { __ } from 'i18n'; @@ -204,17 +204,17 @@ function getTemplateForObjectURL (uri, obj_url, richtext) { const file_url = uri.toString(); if (isImageURL(file_url)) { - return tpl_image({ + return tplImage({ 'src': obj_url, 'onClick': richtext.onImgClick, 'onLoad': richtext.onImgLoad }); } else if (isAudioURL(file_url)) { - return tpl_audio(obj_url); + return tplAudio(obj_url); } else if (isVideoURL(file_url)) { - return tpl_video(obj_url); + return tplVideo(obj_url); } else { - return tpl_file(obj_url, uri.filename()); + return tplFile(obj_url, uri.filename()); } } diff --git a/src/plugins/profile/modals/chat-status.js b/src/plugins/profile/modals/chat-status.js index 673a4306b..16cf74c49 100644 --- a/src/plugins/profile/modals/chat-status.js +++ b/src/plugins/profile/modals/chat-status.js @@ -1,5 +1,5 @@ import BaseModal from "plugins/modal/modal.js"; -import tpl_chat_status_modal from "../templates/chat-status-modal.js"; +import tplChatStatusModal from "../templates/chat-status-modal.js"; import { __ } from 'i18n'; import { _converse, api, converse } from "@converse/headless/core"; @@ -17,7 +17,7 @@ export default class ChatStatusModal extends BaseModal { } renderModal () { - return tpl_chat_status_modal(this); + return tplChatStatusModal(this); } getModalTitle () { // eslint-disable-line class-methods-use-this diff --git a/src/plugins/profile/modals/profile.js b/src/plugins/profile/modals/profile.js index b4aa89be6..51da14b4b 100644 --- a/src/plugins/profile/modals/profile.js +++ b/src/plugins/profile/modals/profile.js @@ -1,6 +1,6 @@ import BaseModal from "plugins/modal/modal.js"; import log from "@converse/headless/log"; -import tpl_profile_modal from "../templates/profile_modal.js"; +import tplProfileModal from "../templates/profile_modal.js"; import Compress from 'client-compress'; import { __ } from 'i18n'; import { _converse, api } from "@converse/headless/core"; @@ -33,7 +33,7 @@ export default class ProfileModal extends BaseModal { } renderModal () { - return tpl_profile_modal(this); + return tplProfileModal(this); } getModalTitle () { // eslint-disable-line class-methods-use-this diff --git a/src/plugins/profile/modals/templates/user-settings.js b/src/plugins/profile/modals/templates/user-settings.js index 73a8d2817..8dd696278 100644 --- a/src/plugins/profile/modals/templates/user-settings.js +++ b/src/plugins/profile/modals/templates/user-settings.js @@ -5,7 +5,7 @@ import { html } from "lit"; import { unsafeHTML } from 'lit/directives/unsafe-html.js'; -const tpl_navigation = (el) => { +const tplNavigation = (el) => { const i18n_about = __('About'); const i18n_commands = __('Commands'); return html` @@ -53,7 +53,7 @@ export default (el) => { const show_both_tabs = show_client_info && allow_adhoc_commands; return html` - ${ show_both_tabs ? tpl_navigation(el) : '' } + ${ show_both_tabs ? tplNavigation(el) : '' }
    ${ show_client_info ? html` diff --git a/src/plugins/profile/modals/user-settings.js b/src/plugins/profile/modals/user-settings.js index 567ef45c1..1e4df1328 100644 --- a/src/plugins/profile/modals/user-settings.js +++ b/src/plugins/profile/modals/user-settings.js @@ -1,5 +1,5 @@ import BaseModal from "plugins/modal/modal.js"; -import tpl_user_settings_modal from "./templates/user-settings.js"; +import tplUserSettingsModal from "./templates/user-settings.js"; import { __ } from 'i18n'; import { api } from "@converse/headless/core"; @@ -20,7 +20,7 @@ export default class UserSettingsModal extends BaseModal { } renderModal () { - return tpl_user_settings_modal(this); + return tplUserSettingsModal(this); } getModalTitle () { // eslint-disable-line class-methods-use-this diff --git a/src/plugins/profile/password-reset.js b/src/plugins/profile/password-reset.js index 3592271a1..58c9ffa23 100644 --- a/src/plugins/profile/password-reset.js +++ b/src/plugins/profile/password-reset.js @@ -1,5 +1,5 @@ import log from '@converse/headless/log'; -import tpl_password_reset from './templates/password-reset.js'; +import tplPasswordReset from './templates/password-reset.js'; import { CustomElement } from 'shared/components/element.js'; import { __ } from 'i18n'; import { _converse, api, converse } from '@converse/headless/core'; @@ -22,7 +22,7 @@ class PasswordReset extends CustomElement { } render () { - return tpl_password_reset(this); + return tplPasswordReset(this); } checkPasswordsMatch (ev) { diff --git a/src/plugins/profile/statusview.js b/src/plugins/profile/statusview.js index df39e5fea..ab3c3b381 100644 --- a/src/plugins/profile/statusview.js +++ b/src/plugins/profile/statusview.js @@ -1,4 +1,4 @@ -import tpl_profile from './templates/profile.js'; +import tplProfile from './templates/profile.js'; import { CustomElement } from 'shared/components/element.js'; import { _converse, api } from '@converse/headless/core'; @@ -11,7 +11,7 @@ class Profile extends CustomElement { } render () { - return tpl_profile(this); + return tplProfile(this); } showProfileModal (ev) { diff --git a/src/plugins/profile/templates/profile.js b/src/plugins/profile/templates/profile.js index 4fa6e25fc..18a5e2d4b 100644 --- a/src/plugins/profile/templates/profile.js +++ b/src/plugins/profile/templates/profile.js @@ -5,14 +5,14 @@ import { getPrettyStatus, logOut } from '../utils.js'; import { html } from "lit"; -function tpl_signout () { +function tplSignout () { const i18n_logout = __('Log out'); return html` ` } -function tpl_user_settings_button (o) { +function tplUserSettingsButton (o) { const i18n_details = __('Show details about this chat client'); return html` @@ -45,8 +45,8 @@ export default (el) => { height="40" width="40"> ${fullname} - ${show_settings_button ? tpl_user_settings_button(el) : ''} - ${api.settings.get('allow_logout') ? tpl_signout() : ''} + ${show_settings_button ? tplUserSettingsButton(el) : ''} + ${api.settings.get('allow_logout') ? tplSignout() : ''}
    diff --git a/src/plugins/profile/templates/profile_modal.js b/src/plugins/profile/templates/profile_modal.js index da9f2a823..e67eb01f3 100644 --- a/src/plugins/profile/templates/profile_modal.js +++ b/src/plugins/profile/templates/profile_modal.js @@ -4,7 +4,7 @@ import { _converse } from "@converse/headless/core"; import { html } from "lit"; -const tpl_omemo_page = (el) => html` +const tplOmemoPage = (el) => html`
    ${ el.tab === 'omemo' ? html`` : '' }
    `; @@ -114,7 +114,7 @@ export default (el) => { ${ el.tab === 'passwordreset' ? html`` : '' }
    - ${ _converse.pluggable.plugins['converse-omemo']?.enabled(_converse) ? tpl_omemo_page(el) : '' } + ${ _converse.pluggable.plugins['converse-omemo']?.enabled(_converse) ? tplOmemoPage(el) : '' } `; } diff --git a/src/plugins/register/panel.js b/src/plugins/register/panel.js index 289bbf3a7..b61efde61 100644 --- a/src/plugins/register/panel.js +++ b/src/plugins/register/panel.js @@ -1,10 +1,10 @@ import log from "@converse/headless/log"; import pick from "lodash-es/pick"; -import tpl_form_input from "templates/form_input.js"; -import tpl_form_url from "templates/form_url.js"; -import tpl_form_username from "templates/form_username.js"; -import tpl_register_panel from "./templates/register_panel.js"; -import tpl_spinner from "templates/spinner.js"; +import tplFormInput from "templates/form_input.js"; +import tplFormUrl from "templates/form_url.js"; +import tplFormUsername from "templates/form_username.js"; +import tplRegisterPanel from "./templates/register_panel.js"; +import tplSpinner from "templates/spinner.js"; import { webForm2xForm } from "@converse/headless/utils/form"; import { ElementView } from "@converse/skeletor/src/element"; import { __ } from 'i18n'; @@ -51,7 +51,7 @@ class RegisterPanel extends ElementView { } render () { - render(tpl_register_panel({ + render(tplRegisterPanel({ 'domain': this.domain, 'fields': this.fields, 'form_fields': this.form_fields, @@ -241,7 +241,7 @@ class RegisterPanel extends ElementView { showSpinner () { const form = this.querySelector('form'); - render(tpl_spinner(), form); + render(tplSpinner(), form); return this; } @@ -292,7 +292,7 @@ class RegisterPanel extends ElementView { getLegacyFormFields () { const input_fields = Object.keys(this.fields).map(key => { if (key === "username") { - return tpl_form_username({ + return tplFormUsername({ 'domain': ` @${this.domain}`, 'name': key, 'type': "text", @@ -301,7 +301,7 @@ class RegisterPanel extends ElementView { 'required': true }); } else { - return tpl_form_input({ + return tplFormInput({ 'label': key, 'name': key, 'placeholder': key, @@ -311,7 +311,7 @@ class RegisterPanel extends ElementView { }) } }); - const urls = this.urls.map(u => tpl_form_url({'label': '', 'value': u})); + const urls = this.urls.map(u => tplFormUrl({'label': '', 'value': u})); return [...input_fields, ...urls]; } diff --git a/src/plugins/register/templates/register_panel.js b/src/plugins/register/templates/register_panel.js index 44398be7c..deef665eb 100644 --- a/src/plugins/register/templates/register_panel.js +++ b/src/plugins/register/templates/register_panel.js @@ -1,16 +1,16 @@ -import tpl_registration_form from './registration_form.js'; -import tpl_spinner from 'templates/spinner.js'; +import tplRegistrationForm from './registration_form.js'; +import tplSpinner from 'templates/spinner.js'; import { __ } from 'i18n'; import { api } from '@converse/headless/core'; import { html } from 'lit'; -const tpl_form_request = () => { +const tplFormRequest = () => { const default_domain = api.settings.get('registration_domain'); const i18n_fetch_form = __("Hold tight, we're fetching the registration form…"); const i18n_cancel = __('Cancel'); return html`
    - ${tpl_spinner({ 'classes': 'hor_centered' })} + ${tplSpinner({ 'classes': 'hor_centered' })}

    ${i18n_fetch_form}

    ${default_domain ? '' @@ -21,7 +21,7 @@ const tpl_form_request = () => { `; }; -const tpl_domain_input = () => { +const tplDomainInput = () => { const domain_placeholder = api.settings.get('domain_placeholder'); const i18n_providers = __('Tip: A list of public XMPP providers is available'); const i18n_providers_link = __('here'); @@ -35,7 +35,7 @@ const tpl_domain_input = () => { `; }; -const tpl_fetch_form_buttons = () => { +const tplFetchFormButtons = () => { const i18n_register = __('Fetch registration form'); const i18n_existing_account = __('Already have a chat account?'); const i18n_login = __('Log in here'); @@ -50,7 +50,7 @@ const tpl_fetch_form_buttons = () => { `; }; -const tpl_choose_provider = () => { +const tplChooseProvider = () => { const default_domain = api.settings.get('registration_domain'); const i18n_create_account = __('Create your account'); const i18n_choose_provider = __('Please enter the XMPP provider to register with:'); @@ -60,9 +60,9 @@ const tpl_choose_provider = () => {
    - ${default_domain ? default_domain : tpl_domain_input()} + ${default_domain ? default_domain : tplDomainInput()}
    - ${default_domain ? '' : tpl_fetch_form_buttons()} + ${default_domain ? '' : tplFetchFormButtons()}
    `; }; @@ -74,8 +74,8 @@ const REGISTRATION_FORM = 2; export default o => { return html` - ${o.model.get('registration_status') === CHOOSE_PROVIDER ? tpl_choose_provider() : ''} - ${o.model.get('registration_status') === FETCHING_FORM ? tpl_form_request() : ''} - ${o.model.get('registration_status') === REGISTRATION_FORM ? tpl_registration_form(o) : ''} + ${o.model.get('registration_status') === CHOOSE_PROVIDER ? tplChooseProvider() : ''} + ${o.model.get('registration_status') === FETCHING_FORM ? tplFormRequest() : ''} + ${o.model.get('registration_status') === REGISTRATION_FORM ? tplRegistrationForm(o) : ''} `; }; diff --git a/src/plugins/roomslist/view.js b/src/plugins/roomslist/view.js index 8cf775599..dea738b6a 100644 --- a/src/plugins/roomslist/view.js +++ b/src/plugins/roomslist/view.js @@ -1,6 +1,6 @@ import 'plugins/muc-views/modals/muc-details.js'; import RoomsListModel from './model.js'; -import tpl_roomslist from "./templates/roomslist.js"; +import tplRoomslist from "./templates/roomslist.js"; import { CustomElement } from 'shared/components/element.js'; import { __ } from 'i18n'; import { _converse, api, converse } from "@converse/headless/core"; @@ -26,7 +26,7 @@ export class RoomsList extends CustomElement { } render () { - return tpl_roomslist(this); + return tplRoomslist(this); } renderIfChatRoom (model) { diff --git a/src/plugins/rootview/root.js b/src/plugins/rootview/root.js index 69fcfd6ca..4c8092f1c 100644 --- a/src/plugins/rootview/root.js +++ b/src/plugins/rootview/root.js @@ -1,4 +1,4 @@ -import tpl_root from "./templates/root.js"; +import tplRoot from "./templates/root.js"; import { api } from '@converse/headless/core'; import { CustomElement } from 'shared/components/element.js'; import { getAppSettings } from '@converse/headless/shared/settings/utils.js'; @@ -17,7 +17,7 @@ import './styles/root.scss'; export default class ConverseRoot extends CustomElement { render () { // eslint-disable-line class-methods-use-this - return tpl_root(); + return tplRoot(); } initialize () { diff --git a/src/plugins/rosterview/contactview.js b/src/plugins/rosterview/contactview.js index cc043caa1..c44619308 100644 --- a/src/plugins/rosterview/contactview.js +++ b/src/plugins/rosterview/contactview.js @@ -1,6 +1,6 @@ import log from "@converse/headless/log.js"; -import tpl_requesting_contact from "./templates/requesting_contact.js"; -import tpl_roster_item from "./templates/roster_item.js"; +import tplRequestingContact from "./templates/requesting_contact.js"; +import tplRosterItem from "./templates/roster_item.js"; import { CustomElement } from 'shared/components/element.js'; import { __ } from 'i18n'; import { _converse, api } from "@converse/headless/core"; @@ -24,7 +24,7 @@ export default class RosterContact extends CustomElement { render () { if (this.model.get('requesting') === true) { const display_name = this.model.getDisplayName(); - return tpl_requesting_contact( + return tplRequestingContact( Object.assign(this.model.toJSON(), { display_name, 'openChat': ev => this.openChat(ev), @@ -35,7 +35,7 @@ export default class RosterContact extends CustomElement { }) ); } else { - return tpl_roster_item(this, this.model); + return tplRosterItem(this, this.model); } } diff --git a/src/plugins/rosterview/filterview.js b/src/plugins/rosterview/filterview.js index 75bdda995..55f5208c7 100644 --- a/src/plugins/rosterview/filterview.js +++ b/src/plugins/rosterview/filterview.js @@ -1,5 +1,5 @@ import debounce from "lodash-es/debounce"; -import tpl_roster_filter from "./templates/roster_filter.js"; +import tplRosterFilter from "./templates/roster_filter.js"; import { CustomElement } from 'shared/components/element.js'; import { _converse, api } from "@converse/headless/core"; import { ancestor } from 'utils/html.js'; @@ -28,7 +28,7 @@ export class RosterFilterView extends CustomElement { render () { return this.model ? - tpl_roster_filter( + tplRosterFilter( Object.assign(this.model.toJSON(), { visible: this.shouldBeVisible(), changeChatStateFilter: ev => this.changeChatStateFilter(ev), diff --git a/src/plugins/rosterview/modals/add-contact.js b/src/plugins/rosterview/modals/add-contact.js index 8f9cb31dd..268f6902c 100644 --- a/src/plugins/rosterview/modals/add-contact.js +++ b/src/plugins/rosterview/modals/add-contact.js @@ -2,7 +2,7 @@ import 'shared/autocomplete/index.js'; import BaseModal from "plugins/modal/modal.js"; import compact from 'lodash-es/compact'; import debounce from 'lodash-es/debounce'; -import tpl_add_contact_modal from "./templates/add-contact.js"; +import tplAddContactModal from "./templates/add-contact.js"; import { __ } from 'i18n'; import { _converse, api, converse } from "@converse/headless/core"; @@ -19,7 +19,7 @@ export default class AddContactModal extends BaseModal { } renderModal () { - return tpl_add_contact_modal(this); + return tplAddContactModal(this); } getModalTitle () { // eslint-disable-line class-methods-use-this diff --git a/src/plugins/rosterview/rosterview.js b/src/plugins/rosterview/rosterview.js index 2676b1465..f79da2b1a 100644 --- a/src/plugins/rosterview/rosterview.js +++ b/src/plugins/rosterview/rosterview.js @@ -1,4 +1,4 @@ -import tpl_roster from "./templates/roster.js"; +import tplRoster from "./templates/roster.js"; import { CustomElement } from 'shared/components/element.js'; import { Model } from '@converse/skeletor/src/model.js'; import { _converse, api } from "@converse/headless/core"; @@ -40,7 +40,7 @@ export default class RosterView extends CustomElement { } render () { - return tpl_roster(this); + return tplRoster(this); } showAddContactModal (ev) { // eslint-disable-line class-methods-use-this diff --git a/src/plugins/rosterview/templates/roster.js b/src/plugins/rosterview/templates/roster.js index 17773461a..d347f2a43 100644 --- a/src/plugins/rosterview/templates/roster.js +++ b/src/plugins/rosterview/templates/roster.js @@ -1,4 +1,4 @@ -import tpl_group from "./group.js"; +import tplGroup from "./group.js"; import { __ } from 'i18n'; import { _converse, api } from "@converse/headless/core"; import { contactsComparator, groupsComparator } from '@converse/headless/plugins/roster/utils.js'; @@ -50,7 +50,7 @@ export default (el) => { ${ repeat(groupnames, (n) => n, (name) => { const contacts = contacts_map[name].filter(c => shouldShowContact(c, name)); contacts.sort(contactsComparator); - return contacts.length ? tpl_group({ contacts, name }) : ''; + return contacts.length ? tplGroup({ contacts, name }) : ''; }) } `; diff --git a/src/plugins/rosterview/templates/roster_item.js b/src/plugins/rosterview/templates/roster_item.js index 6115f6a47..86b6b9494 100644 --- a/src/plugins/rosterview/templates/roster_item.js +++ b/src/plugins/rosterview/templates/roster_item.js @@ -3,7 +3,7 @@ import { api } from "@converse/headless/core.js"; import { html } from "lit"; import { STATUSES } from '../constants.js'; -const tpl_remove_link = (el, item) => { +const tplRemoveLink = (el, item) => { const display_name = item.getDisplayName(); const i18n_remove = __('Click to remove %1$s as a contact', display_name); return html` @@ -46,5 +46,5 @@ export default (el, item) => { ${ num_unread ? html`${ num_unread }` : '' } ${display_name}
    - ${ api.settings.get('allow_contact_removal') ? tpl_remove_link(el, item) : '' }`; + ${ api.settings.get('allow_contact_removal') ? tplRemoveLink(el, item) : '' }`; } diff --git a/src/shared/avatar/avatar.js b/src/shared/avatar/avatar.js index ee276a3ec..64caa0a06 100644 --- a/src/shared/avatar/avatar.js +++ b/src/shared/avatar/avatar.js @@ -1,5 +1,5 @@ import { CustomElement } from 'shared/components/element.js'; -import tpl_avatar from './templates/avatar.js'; +import tplAvatar from './templates/avatar.js'; import { _converse, api } from '@converse/headless/core'; import './avatar.scss'; @@ -31,7 +31,7 @@ export default class Avatar extends CustomElement { const image_data = this.data?.image || _converse.DEFAULT_IMAGE; image = "data:" + image_type + ";base64," + image_data; } - return tpl_avatar({ + return tplAvatar({ 'classes': this.getAttribute('class'), 'height': this.height, 'width': this.width, diff --git a/src/shared/chat/chat-content.js b/src/shared/chat/chat-content.js index 29618793c..2b782e87e 100644 --- a/src/shared/chat/chat-content.js +++ b/src/shared/chat/chat-content.js @@ -1,5 +1,5 @@ import './message-history'; -import tpl_spinner from "templates/spinner.js"; +import tplSpinner from "templates/spinner.js"; import { CustomElement } from 'shared/components/element.js'; import { api } from '@converse/headless/core'; import { html } from 'lit'; @@ -57,7 +57,7 @@ export default class ChatContent extends CustomElement { .model=${this.model} .messages=${[...this.model.messages.models]}> - ${ this.model.ui?.get('chat-content-spinner-top') ? tpl_spinner() : '' } + ${ this.model.ui?.get('chat-content-spinner-top') ? tplSpinner() : '' } `; } diff --git a/src/shared/chat/emoji-picker-content.js b/src/shared/chat/emoji-picker-content.js index b025c2328..9ab570092 100644 --- a/src/shared/chat/emoji-picker-content.js +++ b/src/shared/chat/emoji-picker-content.js @@ -1,7 +1,7 @@ import { CustomElement } from 'shared/components/element.js'; import { _converse, converse, api } from "@converse/headless/core"; import { html } from "lit"; -import { tpl_all_emojis, tpl_search_results } from "./templates/emoji-picker.js"; +import { tplAllEmojis, tplSearchResults } from "./templates/emoji-picker.js"; import { getTonedEmojis } from './utils.js'; const { sizzle } = converse.env; @@ -28,8 +28,8 @@ export default class EmojiPickerContent extends CustomElement { } return html`
    - ${tpl_search_results(props)} - ${tpl_all_emojis(props)} + ${tplSearchResults(props)} + ${tplAllEmojis(props)}
    `; } diff --git a/src/shared/chat/emoji-picker.js b/src/shared/chat/emoji-picker.js index 69d0b4e88..2116e35c7 100644 --- a/src/shared/chat/emoji-picker.js +++ b/src/shared/chat/emoji-picker.js @@ -6,7 +6,7 @@ import { CustomElement } from 'shared/components/element.js'; import { KEYCODES } from '@converse/headless/shared/constants.js'; import { _converse, api, converse } from "@converse/headless/core"; import { getTonedEmojis } from './utils.js'; -import { tpl_emoji_picker } from "./templates/emoji-picker.js"; +import { tplEmojiPicker } from "./templates/emoji-picker.js"; import './styles/emoji.scss'; @@ -50,7 +50,7 @@ export default class EmojiPicker extends CustomElement { } render () { - return tpl_emoji_picker({ + return tplEmojiPicker({ 'chatview': this.chatview, 'current_category': this.current_category, 'current_skintone': this.current_skintone, diff --git a/src/shared/chat/message-limit.js b/src/shared/chat/message-limit.js index 23fa98681..e27189ac2 100644 --- a/src/shared/chat/message-limit.js +++ b/src/shared/chat/message-limit.js @@ -1,4 +1,4 @@ -import tpl_message_limit from './templates/message-limit.js'; +import tplMessageLimit from './templates/message-limit.js'; import { CustomElement } from 'shared/components/element.js'; import { api } from '@converse/headless/core'; @@ -19,7 +19,7 @@ export default class MessageLimitIndicator extends CustomElement { const limit = api.settings.get('message_limit'); if (!limit) return ''; const chars = this.model.get('draft') || ''; - return tpl_message_limit(limit - chars.length); + return tplMessageLimit(limit - chars.length); } } diff --git a/src/shared/chat/message.js b/src/shared/chat/message.js index c685422ff..9f72fab7a 100644 --- a/src/shared/chat/message.js +++ b/src/shared/chat/message.js @@ -5,14 +5,14 @@ import 'shared/modals/message-versions.js'; import 'shared/modals/user-details.js'; import 'shared/registry'; import 'plugins/muc-views/modals/occupant.js'; -import tpl_file_progress from './templates/file-progress.js'; +import tplFileProgress from './templates/file-progress.js'; import log from '@converse/headless/log'; -import tpl_info_message from './templates/info-message.js'; -import tpl_mep_message from 'plugins/muc-views/templates/mep-message.js'; -import tpl_message from './templates/message.js'; -import tpl_message_text from './templates/message-text.js'; -import tpl_retraction from './templates/retraction.js'; -import tpl_spinner from 'templates/spinner.js'; +import tplInfoMessage from './templates/info-message.js'; +import tplMepMessage from 'plugins/muc-views/templates/mep-message.js'; +import tplMessage from './templates/message.js'; +import tplMessageText from './templates/message-text.js'; +import tplRetraction from './templates/retraction.js'; +import tplSpinner from 'templates/spinner.js'; import { CustomElement } from 'shared/components/element.js'; import { __ } from 'i18n'; import { _converse, api, converse } from '@converse/headless/core'; @@ -74,7 +74,7 @@ export default class Message extends CustomElement { if (!this.model) { return ''; } else if (this.show_spinner) { - return tpl_spinner(); + return tplSpinner(); } else if (this.model.get('file') && this.model.get('upload') !== _converse.SUCCESS) { return this.renderFileProgress(); } else if (['mep'].includes(this.model.get('type'))) { @@ -94,19 +94,19 @@ export default class Message extends CustomElement { } renderRetraction () { - return tpl_retraction(this); + return tplRetraction(this); } renderMessageText () { - return tpl_message_text(this); + return tplMessageText(this); } renderMEPMessage () { - return tpl_mep_message(this); + return tplMepMessage(this); } renderInfoMessage () { - return tpl_info_message(this); + return tplInfoMessage(this); } renderFileProgress () { @@ -114,11 +114,11 @@ export default class Message extends CustomElement { // Can happen when file upload failed and page was reloaded return ''; } - return tpl_file_progress(this); + return tplFileProgress(this); } renderChatMessage () { - return tpl_message(this, this.getProps()); + return tplMessage(this, this.getProps()); } shouldShowAvatar () { diff --git a/src/shared/chat/templates/emoji-picker.js b/src/shared/chat/templates/emoji-picker.js index 62eb45442..bf4ac68fb 100644 --- a/src/shared/chat/templates/emoji-picker.js +++ b/src/shared/chat/templates/emoji-picker.js @@ -33,7 +33,7 @@ const emoji_item = (o) => { `; } -export const tpl_search_results = (o) => { +export const tplSearchResults = (o) => { const i18n_search_results = __('Search results'); return html` @@ -53,7 +53,7 @@ const emojis_for_category = (o) => { `; } -export const tpl_all_emojis = (o) => { +export const tplAllEmojis = (o) => { const cats = api.settings.get('emoji_categories'); return html` @@ -70,7 +70,7 @@ const skintone_emoji = (o) => { } -export const tpl_emoji_picker = (o) => { +export const tplEmojiPicker = (o) => { const i18n_search = __('Search'); const skintones = ['tone1', 'tone2', 'tone3', 'tone4', 'tone5']; return html` diff --git a/src/shared/chat/templates/message-text.js b/src/shared/chat/templates/message-text.js index 17d701417..acc59a5c6 100644 --- a/src/shared/chat/templates/message-text.js +++ b/src/shared/chat/templates/message-text.js @@ -2,12 +2,12 @@ import { __ } from 'i18n/index.js'; import { getOOBURLMarkup } from 'utils/html.js'; import { html } from 'lit'; -const tpl_edited_icon = (el) => { +const tplEditedIcon = (el) => { const i18n_edited = __('This message has been edited'); return html``; } -const tpl_checkmark = () => { +const tplCheckmark = () => { return html`` } @@ -17,7 +17,7 @@ export default (el) => { const is_groupchat_message = (el.model.get('type') === 'groupchat'); const i18n_show_less = __('Show less'); - const tpl_spoiler_hint = html` + const tplSpoilerHint = html`
    ${el.model.get('spoiler_hint')} @@ -32,7 +32,7 @@ export default (el) => { const show_oob = el.model.get('oob_url') && text !== el.model.get('oob_url'); return html` - ${ el.model.get('is_spoiler') ? tpl_spoiler_hint : '' } + ${ el.model.get('is_spoiler') ? tplSpoilerHint : '' } ${ el.model.get('subject') ? html`
    ${el.model.get('subject')}
    ` : '' } { hide_url_previews=${el.model.get('hide_url_previews')} ?is_me_message=${el.model.isMeCommand()} text="${text}"> - ${ (el.model.get('received') && !el.model.isMeCommand() && !is_groupchat_message) ? tpl_checkmark() : '' } - ${ (el.model.get('edited')) ? tpl_edited_icon(el) : '' } + ${ (el.model.get('received') && !el.model.isMeCommand() && !is_groupchat_message) ? tplCheckmark() : '' } + ${ (el.model.get('edited')) ? tplEditedIcon(el) : '' } ${ show_oob ? html`
    ${getOOBURLMarkup(el.model.get('oob_url'))}
    ` : '' }
    ${ el.model.get('error_text') || el.model.get('error') }
    diff --git a/src/shared/chat/templates/toolbar.js b/src/shared/chat/templates/toolbar.js index 5a0121a27..72ac50730 100644 --- a/src/shared/chat/templates/toolbar.js +++ b/src/shared/chat/templates/toolbar.js @@ -2,7 +2,7 @@ import { __ } from 'i18n'; import { html } from 'lit'; import { until } from 'lit/directives/until.js'; -function tpl_send_button () { +function tplSendButton () { const i18n_send_message = __('Send the message'); return html`