2018-08-16 22:30:59 +00:00
|
|
|
/*
|
2024-01-13 19:35:22 +00:00
|
|
|
* Copyright (c) 2010-2024 Tim Düsterhus.
|
2018-08-16 22:30:59 +00:00
|
|
|
*
|
|
|
|
* Use of this software is governed by the Business Source License
|
|
|
|
* included in the LICENSE file.
|
|
|
|
*
|
2024-01-13 19:35:22 +00:00
|
|
|
* Change Date: 2028-01-13
|
2018-08-16 22:30:59 +00:00
|
|
|
*
|
|
|
|
* On the date above, in accordance with the Business Source
|
|
|
|
* License, use of this software will be governed by version 2
|
|
|
|
* or later of the General Public License.
|
|
|
|
*/
|
|
|
|
|
2024-01-13 19:35:22 +00:00
|
|
|
define(['WoltLabSuite/Core/Language', '../MessageType'], function (
|
|
|
|
Language,
|
|
|
|
MessageType
|
|
|
|
) {
|
2018-08-16 22:30:59 +00:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
class Where extends MessageType {
|
|
|
|
render(message) {
|
|
|
|
const fragment = super.render(message)
|
|
|
|
|
2024-01-13 19:35:22 +00:00
|
|
|
const button = document.createElement('button')
|
|
|
|
button.classList.add('button', 'small', 'jsTooltip', 'hideIcon')
|
|
|
|
button.setAttribute('title', Language.get('wcf.global.button.hide'))
|
|
|
|
|
|
|
|
button.addEventListener('click', () => {
|
|
|
|
button.closest('.chatMessageBoundary').hidden = true
|
|
|
|
})
|
|
|
|
|
|
|
|
const icon = document.createElement('span')
|
|
|
|
icon.classList.add('icon', 'icon16', 'fa-times')
|
|
|
|
|
|
|
|
button.append(icon)
|
2018-08-16 22:30:59 +00:00
|
|
|
|
|
|
|
const elem = fragment.querySelector('.jsRoomInfo > .containerHeadline')
|
2024-01-13 19:35:22 +00:00
|
|
|
elem.insertBefore(button, elem.firstChild)
|
2018-08-16 22:30:59 +00:00
|
|
|
|
|
|
|
return fragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return Where
|
|
|
|
})
|