aboutsummaryrefslogtreecommitdiffhomepage
path: root/assets/default
diff options
context:
space:
mode:
Diffstat (limited to 'assets/default')
-rw-r--r--assets/default/js/base.js29
-rw-r--r--assets/default/scss/shaarli.scss16
2 files changed, 37 insertions, 8 deletions
diff --git a/assets/default/js/base.js b/assets/default/js/base.js
index 8bf79d3e..99e03370 100644
--- a/assets/default/js/base.js
+++ b/assets/default/js/base.js
@@ -422,12 +422,12 @@ function init(description) {
422 /** 422 /**
423 * Bulk actions 423 * Bulk actions
424 */ 424 */
425 const linkCheckboxes = document.querySelectorAll('.delete-checkbox'); 425 const linkCheckboxes = document.querySelectorAll('.link-checkbox');
426 const bar = document.getElementById('actions'); 426 const bar = document.getElementById('actions');
427 [...linkCheckboxes].forEach((checkbox) => { 427 [...linkCheckboxes].forEach((checkbox) => {
428 checkbox.style.display = 'inline-block'; 428 checkbox.style.display = 'inline-block';
429 checkbox.addEventListener('click', () => { 429 checkbox.addEventListener('change', () => {
430 const linkCheckedCheckboxes = document.querySelectorAll('.delete-checkbox:checked'); 430 const linkCheckedCheckboxes = document.querySelectorAll('.link-checkbox:checked');
431 const count = [...linkCheckedCheckboxes].length; 431 const count = [...linkCheckedCheckboxes].length;
432 if (count === 0 && bar.classList.contains('open')) { 432 if (count === 0 && bar.classList.contains('open')) {
433 bar.classList.toggle('open'); 433 bar.classList.toggle('open');
@@ -444,7 +444,7 @@ function init(description) {
444 event.preventDefault(); 444 event.preventDefault();
445 445
446 const links = []; 446 const links = [];
447 const linkCheckedCheckboxes = document.querySelectorAll('.delete-checkbox:checked'); 447 const linkCheckedCheckboxes = document.querySelectorAll('.link-checkbox:checked');
448 [...linkCheckedCheckboxes].forEach((checkbox) => { 448 [...linkCheckedCheckboxes].forEach((checkbox) => {
449 links.push({ 449 links.push({
450 id: checkbox.value, 450 id: checkbox.value,
@@ -467,6 +467,25 @@ function init(description) {
467 } 467 }
468 468
469 /** 469 /**
470 * Select all button
471 */
472 const selectAllButtons = document.querySelectorAll('.select-all-button');
473 [...selectAllButtons].forEach((selectAllButton) => {
474 selectAllButton.addEventListener('click', (e) => {
475 e.preventDefault();
476 const checked = selectAllButton.classList.contains('filter-off');
477 [...selectAllButtons].forEach((selectAllButton2) => {
478 selectAllButton2.classList.toggle('filter-off');
479 selectAllButton2.classList.toggle('filter-on');
480 });
481 [...linkCheckboxes].forEach((linkCheckbox) => {
482 linkCheckbox.checked = checked;
483 linkCheckbox.dispatchEvent(new Event('change'));
484 });
485 });
486 });
487
488 /**
470 * Tag list operations 489 * Tag list operations
471 * 490 *
472 * TODO: support error code in the backend for AJAX requests 491 * TODO: support error code in the backend for AJAX requests
@@ -548,7 +567,7 @@ function init(description) {
548 event.preventDefault(); 567 event.preventDefault();
549 const block = findParent(event.target, 'div', { class: 'tag-list-item' }); 568 const block = findParent(event.target, 'div', { class: 'tag-list-item' });
550 const tag = block.getAttribute('data-tag'); 569 const tag = block.getAttribute('data-tag');
551 const refreshedToken = document.getElementById('token'); 570 const refreshedToken = document.getElementById('token').value;
552 571
553 if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) { 572 if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) {
554 const xhr = new XMLHttpRequest(); 573 const xhr = new XMLHttpRequest();
diff --git a/assets/default/scss/shaarli.scss b/assets/default/scss/shaarli.scss
index 6b286f1e..760d8d6a 100644
--- a/assets/default/scss/shaarli.scss
+++ b/assets/default/scss/shaarli.scss
@@ -381,8 +381,6 @@ body,
381 box-shadow: 0 1px 0 $light-shadow, 0 1px 4px $dark-shadow inset; 381 box-shadow: 0 1px 0 $light-shadow, 0 1px 4px $dark-shadow inset;
382 background: $almost-white; 382 background: $almost-white;
383 padding: 5px 5px 3px 15px; 383 padding: 5px 5px 3px 15px;
384 width: 20%;
385 height: 20px;
386 color: $dark-grey; 384 color: $dark-grey;
387} 385}
388 386
@@ -742,7 +740,7 @@ body,
742 font-size: 1em; 740 font-size: 1em;
743 } 741 }
744 742
745 .delete-checkbox { 743 .link-checkbox {
746 display: none; 744 display: none;
747 } 745 }
748} 746}
@@ -757,6 +755,14 @@ body,
757 font-size: 1.3em; 755 font-size: 1.3em;
758} 756}
759 757
758.pin-link {
759 font-size: 1.3em;
760}
761
762.pinned-link {
763 color: $blue !important;
764}
765
760.linklist-item-description { 766.linklist-item-description {
761 position: relative; 767 position: relative;
762 padding: 0 10px; 768 padding: 0 10px;
@@ -850,6 +856,10 @@ body,
850 margin: 0 7px; 856 margin: 0 7px;
851} 857}
852 858
859.ctrl-delete {
860 margin: 0 7px 0 0;
861}
862
853// 64em -> lg 863// 64em -> lg
854@media screen and (max-width: 64em) { 864@media screen and (max-width: 64em) {
855 .linklist-item-infos-url { 865 .linklist-item-infos-url {