From 288e955ea963eab42f7ddc5694fc012cd49b9004 Mon Sep 17 00:00:00 2001 From: Nick White Date: Sun, 11 Dec 2011 11:52:43 +0000 Subject: Simplify css, add ability to disable css & link hiding (not in gecko or chromium guis yet) --- simplyread.js | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/simplyread.js b/simplyread.js index 60a96c2..1f5ba17 100755 --- a/simplyread.js +++ b/simplyread.js @@ -2,7 +2,7 @@ if(window.content && window.content.document.simplyread_original === undefined) window.content.document.simplyread_original = false; -function simplyread() +function simplyread(nostyle, nolinks) { /* count the number of

tags that are direct children of parenttag */ function count_p(parenttag) @@ -53,25 +53,28 @@ function simplyread() fresh.innerHTML = biggest_tag.innerHTML; fresh.innerHTML = fresh.innerHTML.replace(/<\/?font[^>]*>/g, ""); fresh.innerHTML = fresh.innerHTML.replace(/style="[^"]*"/g, ""); - fresh.innerHTML = fresh.innerHTML.replace(/<\/?a[^>]*>/g, ""); + if(nolinks) + fresh.innerHTML = fresh.innerHTML.replace(/<\/?a[^>]*>/g, ""); fresh.innerHTML = fresh.innerHTML.replace(/<\/?span[^>]*>/g, ""); - fresh.innerHTML = fresh.innerHTML.replace(/]*>/g, "" + - "

" + - "

"+doc.title+"

" + - "
" + - fresh.innerHTML + "
"; - + "" + + "
" + "

"+doc.title+"

" + fresh.innerHTML + "
"; + return 0; } -- cgit v1.2.3