MyShaarli/plugins/readitlater/readitlater.default.js
ArthurHoaro bf8bec322b New Core Plugin: ReadItLater
Create a new core plugin allowing to mark bookmarks to read them later.
When enabled:

  * checkbox is displayed in editlink view for new bookmarks
  * a plugin setting is available to check it or not it by default
  * in bookmark list:
    * new global filter to display only bookmark flagged as read it
      later
    * for each bookmarks, new action icon to toggle read it later status
    * for each « readitlater » bookmark, red label « To Read » added,
      and red line on the right of the bookmark added (default template)

Fixes #143

Signed-off-by: ArthurHoaro <arthur@hoa.ro>
2022-08-12 19:58:07 +02:00

14 lines
517 B
JavaScript

(() => {
document.addEventListener('DOMContentLoaded', () => {
const unreadLinks = document.querySelectorAll('.readitlater-unread');
if (unreadLinks) {
const unreadLabel = document.createElement('span');
unreadLabel.className = 'label label-unread';
unreadLabel.innerHTML = ' To Read';
[...unreadLinks].forEach((element) => {
const button = unreadLabel.cloneNode(true);
element.querySelector('.linklist-item-editbuttons').prepend(button);
});
}
});
})();