Compare commits
2 Commits
3fb3ef927a
...
017a624c66
Author | SHA1 | Date |
---|---|---|
|
017a624c66 | |
|
0daf5a8e52 |
|
@ -167,7 +167,8 @@
|
||||||
information hidden to make reading
|
information hidden to make reading
|
||||||
messages easier.
|
messages easier.
|
||||||
<ul>
|
<ul>
|
||||||
<li>Tap on the pound sign to see the
|
<li>Tap on the <i class="bi
|
||||||
|
bi-clock"></i> clock to see the
|
||||||
date and time of the message.</li>
|
date and time of the message.</li>
|
||||||
<li>Tap again to hide the popup.</li>
|
<li>Tap again to hide the popup.</li>
|
||||||
<li>Long chat messages are scrollable.
|
<li>Long chat messages are scrollable.
|
||||||
|
|
|
@ -63,7 +63,7 @@ th, td {
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-mobile-date-time {
|
.message-mobile-date-time {
|
||||||
width: 1em;
|
width: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-from-user {
|
.message-from-user {
|
||||||
|
|
|
@ -103,7 +103,8 @@ function processFragment() {
|
||||||
async function saveToDatabase(filename: string, xml: string) {
|
async function saveToDatabase(filename: string, xml: string) {
|
||||||
db.entries
|
db.entries
|
||||||
.put({ filename, backupData: xml })
|
.put({ filename, backupData: xml })
|
||||||
.catch(err => displayFatalError('Saving Failed', err));
|
.then(_ => toggleLoadPrevious(true))
|
||||||
|
.catch(err => console.error('Saving Failed', err));
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayBackup(xsltProcessor: XSLTProcessor, filename: string, xmlText: string): boolean {
|
function displayBackup(xsltProcessor: XSLTProcessor, filename: string, xmlText: string): boolean {
|
||||||
|
@ -136,7 +137,29 @@ function displayBackup(xsltProcessor: XSLTProcessor, filename: string, xmlText:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initEvents() {
|
function toggleLoadPrevious(toggle: boolean) {
|
||||||
|
ui.loadPreviousButtons.forEach(btn => {
|
||||||
|
if (toggle) {
|
||||||
|
btn.classList.remove('disabled');
|
||||||
|
} else {
|
||||||
|
btn.classList.add('disabled');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function initEvents() {
|
||||||
|
db.entries.count()
|
||||||
|
.then(count => {
|
||||||
|
if (count < 1) {
|
||||||
|
toggleLoadPrevious(false);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
//Something wrong with db access, disable buttons anyway.
|
||||||
|
console.error(err);
|
||||||
|
toggleLoadPrevious(false);
|
||||||
|
});
|
||||||
|
|
||||||
ui.loadPreviousButtons.forEach(button => button.addEventListener('click', async () => {
|
ui.loadPreviousButtons.forEach(button => button.addEventListener('click', async () => {
|
||||||
await populateSavedBackups();
|
await populateSavedBackups();
|
||||||
}));
|
}));
|
||||||
|
@ -190,15 +213,7 @@ async function populateSavedBackups() {
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', async () => {
|
window.addEventListener('DOMContentLoaded', async () => {
|
||||||
window.addEventListener('resize', () => {
|
await initEvents();
|
||||||
if (window.innerWidth <= 500) {
|
|
||||||
ui.chatDisplay.querySelector('table')?.classList.add('table-sm');
|
|
||||||
} else {
|
|
||||||
ui.chatDisplay.querySelector('table')?.classList.remove('table-sm');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
initEvents();
|
|
||||||
showLoadingIndicator(false);
|
showLoadingIndicator(false);
|
||||||
showApplication(true);
|
showApplication(true);
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,9 +8,9 @@ export const chatDisplay: HTMLElement = document.getElementById('chat-display')!
|
||||||
export const fileSelector: HTMLInputElement = document.getElementById('backup-file')! as HTMLInputElement;
|
export const fileSelector: HTMLInputElement = document.getElementById('backup-file')! as HTMLInputElement;
|
||||||
export const savedBackups: HTMLSelectElement = document.getElementById('saved-backups')! as HTMLSelectElement;
|
export const savedBackups: HTMLSelectElement = document.getElementById('saved-backups')! as HTMLSelectElement;
|
||||||
export const viewNewButtons =
|
export const viewNewButtons =
|
||||||
document.querySelectorAll('#unloaded-view-new-button, #loaded-view-new-button');
|
<NodeListOf<HTMLElement>>document.querySelectorAll('#unloaded-view-new-button, #loaded-view-new-button');
|
||||||
export const loadPreviousButtons =
|
export const loadPreviousButtons =
|
||||||
document.querySelectorAll('#unloaded-load-previous-button, #loaded-load-previous-button');
|
<NodeListOf<HTMLElement>>document.querySelectorAll('#unloaded-load-previous-button, #loaded-load-previous-button');
|
||||||
export const previousBackupsList: HTMLDivElement = document.getElementById('previous-backups-list')! as HTMLDivElement;
|
export const previousBackupsList: HTMLDivElement = document.getElementById('previous-backups-list')! as HTMLDivElement;
|
||||||
export const noFileLoadedControls: HTMLDivElement = document.getElementById('no-file-loaded-controls')! as HTMLDivElement;
|
export const noFileLoadedControls: HTMLDivElement = document.getElementById('no-file-loaded-controls')! as HTMLDivElement;
|
||||||
export const fileLoadedControls: HTMLDivElement = document.getElementById('file-loaded-controls')! as HTMLDivElement;
|
export const fileLoadedControls: HTMLDivElement = document.getElementById('file-loaded-controls')! as HTMLDivElement;
|
||||||
|
|
|
@ -96,7 +96,7 @@ https://github.com/jerecui/MSNChatHistoryCombiner
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="From/User">
|
<xsl:template match="From/User">
|
||||||
<a class="info-popover" href="#" tabindex="0"
|
<a class="info-popover" href="javascript:void(0);" tabindex="0"
|
||||||
data-bs-trigger="focus"
|
data-bs-trigger="focus"
|
||||||
data-bs-container="body" data-bs-toggle="popover"
|
data-bs-container="body" data-bs-toggle="popover"
|
||||||
data-bs-placement="bottom" data-bs-title="Username">
|
data-bs-placement="bottom" data-bs-title="Username">
|
||||||
|
@ -119,14 +119,14 @@ https://github.com/jerecui/MSNChatHistoryCombiner
|
||||||
|
|
||||||
<!-- mobile shows a popover span for date/time -->
|
<!-- mobile shows a popover span for date/time -->
|
||||||
<td class="d-lg-none message-mobile-date-time">
|
<td class="d-lg-none message-mobile-date-time">
|
||||||
<a class="info-popover" href="#" tabindex="0"
|
<a class="info-popover" href="javascript:void(0);" tabindex="0"
|
||||||
data-bs-trigger="focus"
|
data-bs-trigger="focus"
|
||||||
data-bs-container="body" data-bs-toggle="popover"
|
data-bs-container="body" data-bs-toggle="popover"
|
||||||
data-bs-placement="right" data-bs-title="Date/Time">
|
data-bs-placement="right" data-bs-title="Date/Time">
|
||||||
<xsl:attribute name="data-bs-content">
|
<xsl:attribute name="data-bs-content">
|
||||||
<xsl:value-of select="@Date"/> <xsl:value-of select="@Time"/>
|
<xsl:value-of select="@Date"/> <xsl:value-of select="@Time"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
#
|
<i class="bi bi-clock"></i>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="d-none d-lg-table-cell message-date"> <xsl:value-of select="@Date"/> </td>
|
<td class="d-none d-lg-table-cell message-date"> <xsl:value-of select="@Date"/> </td>
|
||||||
|
|
Loading…
Reference in New Issue