Skip to content

Commit

Permalink
bug fixes, add pdf export
Browse files Browse the repository at this point in the history
  • Loading branch information
seguinleo committed Oct 12, 2024
1 parent a177939 commit 7ce3801
Show file tree
Hide file tree
Showing 11 changed files with 458 additions and 221 deletions.
2 changes: 1 addition & 1 deletion src/assets/css/style.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/css/style.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 5 additions & 14 deletions src/assets/js/cloud/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const noteActions = () => {
else if (target.classList.contains('pin-note')) pin(noteId);
else if (target.classList.contains('copy-note')) defaultScript.copy(noteContent);
else if (target.classList.contains('delete-note')) deleteNote(noteId);
else if (target.classList.contains('expand-note')) defaultScript.toggleFullscreen(noteId);
else if (target.classList.contains('download-note')) defaultScript.downloadNote(noteId);
else if (target.classList.contains('share-note')) shareNote(noteId, noteLink, noteTitle, noteContent);
});
Expand Down Expand Up @@ -89,7 +88,7 @@ const getNotes = async () => {
const response = await res.json();
const notesJSON = response.notes;

document.querySelector('#last-login').textContent = `Last login: ${response.lastLogin}GMT`;
document.querySelector('#last-login-date').textContent = `${response.lastLogin}GMT`;

if (notesJSON.length === 0) return;

Expand Down Expand Up @@ -210,13 +209,6 @@ const getNotes = async () => {
linkIconElement.setAttribute('role', 'button');
linkIconElement.setAttribute('aria-label', 'Share note');
bottomContentElement.appendChild(linkIconElement);

const expandIconElement = document.createElement('i');
expandIconElement.classList.add('fa-solid', 'fa-expand', 'note-action', 'expand-note');
expandIconElement.tabIndex = 0;
expandIconElement.setAttribute('role', 'button');
expandIconElement.setAttribute('aria-label', 'Fullscreen note');
bottomContentElement.appendChild(expandIconElement);
}

noteElement.appendChild(detailsElement);
Expand Down Expand Up @@ -284,7 +276,7 @@ const getNotes = async () => {
if (!folderDetails) {
const newFolderDetails = document.createElement('details');
newFolderDetails.setAttribute('open', 'open');
newFolderDetails.setAttribute('data-folder', folder);
newFolderDetails.setAttribute('data-folder', encodeURIComponent(folder));
const summary = document.createElement('summary');
summary.textContent = folder;
newFolderDetails.appendChild(summary);
Expand Down Expand Up @@ -334,10 +326,9 @@ const getNotes = async () => {
document.querySelector('#storage-usage').textContent = `${(dataByteSize * 0.001).toFixed(2)} kB / ${maxDataByteSize / 1000000} MB`;
document.querySelectorAll('.note').forEach((e) => {
e.addEventListener('click', (event) => {
if (!event.target.classList.contains('title') &&
!event.target.classList.contains('details') &&
!event.target.classList.contains('fullscreen')
) return;
if (event.target.parentElement.classList.contains('bottom-content') || event.target.classList.contains('bottom-content')) return;
if (event.target.tabIndex > -1) return;
if (document.getSelection().toString()) return;
defaultScript.toggleFullscreen(event.currentTarget.getAttribute('data-note-id'));
});
});
Expand Down
Loading

0 comments on commit 7ce3801

Please sign in to comment.