Skip to content

Instantly share code, notes, and snippets.

@prateekjadhwani
Last active July 5, 2016 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prateekjadhwani/a9d99bc646861d19b55cc19f10751321 to your computer and use it in GitHub Desktop.
Save prateekjadhwani/a9d99bc646861d19b55cc19f10751321 to your computer and use it in GitHub Desktop.

LMNTL Simplifier

It removes all the distractions from LMNTL website and shows only the main chapter that you are reading.

Installation

####Step 1 Create a new bookmark in your browser with any name and with any url.

####Step 2 Copy the code from lmntl-closured.js file given in this gist

Step 3

Paste it in the url section of the bookmark. You can always right click on the bookmark and edit it, then you can paste the code in URL section.

Step 4

When you are reading a chapter, click on the bookmark that you just created. This will remove everything other than the chapter and next and previous chapter links

javascript:(function(){for(var sentence=document.querySelectorAll(".translated"),title=document.querySelector(".chapter-title"),display=document.createElement("div"),body=document.querySelector("body"),next=document.querySelector(".next").innerHTML,prev=document.querySelector(".previous").innerHTML,i=0;i<sentence.length;i++){var innerSentence=document.createElement("p");innerSentence.innerText=sentence[i].textContent;display.appendChild(innerSentence)}var h4=document.createElement("h4");h4.innerText=title.innerText;var stylesheet=document.createElement("style");stylesheet.innerHTML="body { padding: 20px;}";body.innerHTML="";body.appendChild(stylesheet);body.appendChild(h4);body.appendChild(display);body.innerHTML+=prev;body.innerHTML+=next;})();
function() {
var sentence = document.querySelectorAll('.translated'),
title = document.querySelector('.chapter-title'),
display = document.createElement('div'),
body = document.querySelector('body'),
next = document.querySelector('.next').innerHTML,
prev = document.querySelector('.previous').innerHTML;
// Get and create the chapter text
for(var i=0;i<sentence.length;i++) {
var innerSentence = document.createElement('p');
innerSentence.innerText = sentence[i].textContent;
display.appendChild(innerSentence);
}
// CReate title
var h4 = document.createElement('h4');
h4.innerText = title.innerText;
//create styles
var stylesheet = document.createElement('style');
stylesheet.innerHTML = '' +
'body { ' +
' padding: 20px;' +
'}';
// reset the body
body.innerHTML = "";
// add styles
body.appendChild(stylesheet);
// add title
body.appendChild(h4);
// add chapter
body.appendChild(display);
// add previous and next button
body.innerHTML += prev;
body.innerHTML += next;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment