Commit 9392377f authored by JC Brand's avatar JC Brand

chatview: Remove unused template and method

parent 9026062a
...@@ -11,7 +11,6 @@ import log from "@converse/headless/log"; ...@@ -11,7 +11,6 @@ import log from "@converse/headless/log";
import tpl_chatbox from "templates/chatbox.js"; import tpl_chatbox from "templates/chatbox.js";
import tpl_chatbox_head from "templates/chatbox_head.js"; import tpl_chatbox_head from "templates/chatbox_head.js";
import tpl_chatbox_message_form from "templates/chatbox_message_form.js"; import tpl_chatbox_message_form from "templates/chatbox_message_form.js";
import tpl_new_day from "templates/new_day.html";
import tpl_spinner from "templates/spinner.html"; import tpl_spinner from "templates/spinner.html";
import tpl_spoiler_button from "templates/spoiler_button.html"; import tpl_spoiler_button from "templates/spoiler_button.html";
import tpl_toolbar from "templates/toolbar.js"; import tpl_toolbar from "templates/toolbar.js";
...@@ -586,35 +585,6 @@ converse.plugins.add('converse-chatview', { ...@@ -586,35 +585,6 @@ converse.plugins.add('converse-chatview', {
this.content.querySelectorAll('.spinner').forEach(u.removeElement); this.content.querySelectorAll('.spinner').forEach(u.removeElement);
}, },
/**
* Inserts an indicator into the chat area, showing the
* day as given by the passed in date.
* The indicator is only inserted if necessary.
* @private
* @method _converse.ChatBoxView#insertDayIndicator
* @param { HTMLElement } next_msg_el - The message element before
* which the day indicator element must be inserted.
* This element must have a "data-isodate" attribute
* which specifies its creation date.
*/
insertDayIndicator (next_msg_el) {
const prev_msg_el = u.getPreviousElement(next_msg_el, ".message:not(.chat-state-notification)");
const prev_msg_date = (prev_msg_el === null) ? null : prev_msg_el.getAttribute('data-isodate');
const next_msg_date = next_msg_el.getAttribute('data-isodate');
if (prev_msg_date === null && next_msg_date === null) {
return;
}
if ((prev_msg_date === null) || dayjs(next_msg_date).isAfter(prev_msg_date, 'day')) {
const day_date = dayjs(next_msg_date).startOf('day');
next_msg_el.insertAdjacentHTML('beforeBegin',
tpl_new_day({
'isodate': day_date.toISOString(),
'datestring': day_date.format("dddd MMM Do YYYY")
})
);
}
},
setScrollPosition (message_el) { setScrollPosition (message_el) {
/* Given a newly inserted message, determine whether we /* Given a newly inserted message, determine whether we
* should keep the scrollbar in place (so as to not scroll * should keep the scrollbar in place (so as to not scroll
......
<div class="message date-separator" data-isodate="{{{o.isodate}}}">
<hr class="separator"/>
<time class="separator-text" datetime="{{{o.isodate}}}"><span>{{{o.datestring}}}</span></time>
</div>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment