Notion.so Clean Todo Lists - no strikethrough or fading

This script prevents notion from adding a strikethrough and fading checked off items in a todo list.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name Notion.so Clean Todo Lists - no strikethrough or fading
// @description This script prevents notion from adding a strikethrough and fading checked off items in a todo list.
// @namespace Violentmonkey Scripts
// @match https://www.notion.so/*
// @grant none
// @version 1.0.0
// ==/UserScript==
// 

function restyleCheckedTodos(elements){
  elements.forEach((e) => {
    if(e.style.textDecoration == 'line-through' & e.style.opacity == .375){
      e.style.textDecoration = 'none';
      e.style.opacity = 1;
    }
  });
}

let config = {
  attributes: true,
  attributeFilter: ["style"],
  childList: true,
  subtree: true
};

let observer = new MutationObserver((mutationsList, observer) => {
	// Any elements recently added or edited.
	restyleCheckedTodos(mutationsList.map((m) => m.target));
	// Anything that was missed by the above.
    restyleCheckedTodos(document.querySelectorAll("[contenteditable]"));
});

observer.observe(document, config);