Fix call history
This commit is contained in:
parent
b83cef625a
commit
9e5d93bad2
@ -6,18 +6,12 @@ export class CallHistory {
|
||||
private callerIds: { [number: string]: TapiContact } = {}
|
||||
|
||||
private updateCallHistoryEntry (call: HTMLElement, callerId: TapiContact) {
|
||||
var span = call.querySelector('span')
|
||||
this.showTimeManager(call, span.nextSibling.textContent.trim(), callerId)
|
||||
var span = call.querySelector(':scope > span')
|
||||
this.showTimeManager(call, call.querySelector('.date').textContent, callerId)
|
||||
|
||||
if (callerId && callerId.tD_NAME !== '') {
|
||||
var text = span.textContent
|
||||
span.textContent = callerId.tD_NAME
|
||||
var br = document.createElement('br')
|
||||
var span2 = document.createElement('span')
|
||||
span2.style.fontSize = 'small'
|
||||
span2.textContent = text
|
||||
span.parentNode.insertBefore(br, span.nextSibling)
|
||||
span.parentNode.insertBefore(span2, span.nextSibling)
|
||||
span.textContent = callerId.tD_NAME + ' ' + callerId.tD_NUMBER
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +22,6 @@ export class CallHistory {
|
||||
date = dateParts.groups.date
|
||||
duration = dateParts.groups.duration
|
||||
}
|
||||
|
||||
var parsedDate = chrono.de.parseDate(date)
|
||||
if (!parsedDate) {
|
||||
parsedDate = chrono.parseDate(date)
|
||||
@ -50,7 +43,7 @@ export class CallHistory {
|
||||
|
||||
var length = (parsedDuration.getHours() * 60 + parsedDuration.getMinutes()).toString()
|
||||
|
||||
var toolbar = call.querySelector('.wcToolbarTiles')
|
||||
var toolbar = call.querySelector('call-history-options')
|
||||
var href = 'domizil://PM/Zeitbuchung?'
|
||||
if (callerId && callerId.tD_ID) {
|
||||
href += 'KontaktId=' + callerId.tD_ID + '&'
|
||||
@ -62,7 +55,7 @@ export class CallHistory {
|
||||
a.onclick = () => {
|
||||
window.open(href)
|
||||
}
|
||||
a.innerHTML = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 559.98 559.98" width="20" height="20">' +
|
||||
a.innerHTML = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 559.98 559.98">' +
|
||||
'<g>' +
|
||||
' <g>' +
|
||||
' <path d="M279.99,0C125.601,0,0,125.601,0,279.99c0,154.39,125.601,279.99,279.99,279.99c154.39,0,279.99-125.601,279.99-279.99' +
|
||||
@ -74,11 +67,14 @@ export class CallHistory {
|
||||
' </g>' +
|
||||
'</g>' +
|
||||
'</svg>'
|
||||
|
||||
a.classList.add('btn');
|
||||
a.classList.add('btn-plain');
|
||||
toolbar.insertBefore(a, toolbar.firstChild)
|
||||
}
|
||||
|
||||
public async showCallHistory (element: HTMLElement) {
|
||||
var span = element.querySelector('span')
|
||||
var span = element.querySelector(':scope > span')
|
||||
var number = extractNumber(span.textContent)
|
||||
if (!number) {
|
||||
this.updateCallHistoryEntry(element, undefined)
|
||||
|
Loading…
x
Reference in New Issue
Block a user