diff --git a/plugins/Readability/data/Call.js b/plugins/Readability/data/Call.js index 40f7392..1df5406 100644 --- a/plugins/Readability/data/Call.js +++ b/plugins/Readability/data/Call.js @@ -84,7 +84,7 @@ function readablilityBody(article){ function renderPage(article){ var element = document.documentElement; - if(element && !!article){ + if(element && !!article && !!article.content){ element.removeChild(document.body); element.removeChild(document.head); @@ -97,7 +97,4 @@ function renderPage(article){ } } -callReadability(); - - -//todo: nejde renderovani u githubu +callReadability(); \ No newline at end of file diff --git a/plugins/Readability/data/Toolbar.js b/plugins/Readability/data/Toolbar.js index e77e8dd..72c7199 100644 --- a/plugins/Readability/data/Toolbar.js +++ b/plugins/Readability/data/Toolbar.js @@ -1,10 +1,18 @@ %1 function readablilityToolbar(){ - var div = document.createElement('div'); - document.getElementById('container').appendChild(div); - div.innerHTML = ''; + renderToolbar(); + addListeners(); +} + +function renderToolbar(){ + var toolbar = document.createElement('div'); + document.getElementById('container').appendChild(toolbar); + + toolbar.innerHTML = ''; +} +function addListeners(){ document.getElementById('close-button').addEventListener("click", closeReadability); document.getElementById('style-button').addEventListener("click", toolbarService); @@ -101,7 +109,7 @@ function fontSizePlus(){ incrementedSize = parseInt(size) + 1; } else return; container.classList.remove(container.classList[i]); - container.classList.add('font-size'+incrementedSize); + container.classList.add('font-size' + incrementedSize); return; } } @@ -117,7 +125,7 @@ function fontSizeMinus(){ incrementedSize = parseInt(size) - 1; } else return; container.classList.remove(container.classList[i]); - container.classList.add('font-size'+incrementedSize); + container.classList.add('font-size' + incrementedSize); return; } }