jack-chapman / redacted

πŸ‘€ quick and easy custom censorship ✍️

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ‘€ Redacted

Quick and easy custom* censorship

* custom config coming soon.

Fair warning: This is hardly tested at all. Use at your own risk.

πŸ”§ Installation

Download the minified version of redacted here

Alternatively, you could clone this repo and run npm install, then npm build to make your own copy.

✍️ How to use Redacted

First, drop the minified version of Redacted right at the bottom of the <body> in your HTML file:

<body>
  ...
  <script src="redacted.min.js" type="text/javascript"></script>
</body>

Then, make an instance of Redacted and pass in a selector string for the elements you want to censor.

Redacted uses document.querySelectorAll under the hood, so anything you can select with that, Redacted will be able to find.

Once that's done, call the censor method on your Redacted instance.

Here's an example:

<body>
  <p>
    This sentence has a word that is <span class="censor-me">censored</span>
  <p>
  ...
  <script src="redacted.min.js" type="text/javascript"></script>
  <script>
    new Redacted('.censor-me').censor();
  </script>
</body>

❌ What you can't censor

You can basically just censor text, so don't bother trying to censor images or something because you'll just be disappointed...

About

πŸ‘€ quick and easy custom censorship ✍️

License:MIT License


Languages

Language:HTML 81.7%Language:JavaScript 18.3%