From c53d8d026021f97075fb2f4940ba22793c38fb6e Mon Sep 17 00:00:00 2001 From: davehauenstein Date: Wed, 15 Apr 2009 22:06:42 +0000 Subject: added toolbar; functionality includes refresh button to get back to original page, print article, email a link to the article with a personal note git-svn-id: http://arc90labs-readability.googlecode.com/svn/trunk@31 d4e419ec-0920-11de-bbfd-a7c1bc4c261e --- js/readability.js | 56 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 7 deletions(-) (limited to 'js') diff --git a/js/readability.js b/js/readability.js index 934ffb8..97cd2bb 100755 --- a/js/readability.js +++ b/js/readability.js @@ -1,9 +1,12 @@ -var readabilityVersion = "0.3"; +var readabilityVersion = "0.4"; +var emailSrc = 'http://lab.arc90.com/experiments/readability/email.php'; +var iframeLoads = 0; (function(){ var objOverlay = document.createElement("div"); var objinnerDiv = document.createElement("div"); - + var articleTools = document.createElement("DIV"); + objOverlay.id = "readOverlay"; objinnerDiv.id = "readInner"; @@ -12,7 +15,20 @@ var readabilityVersion = "0.3"; objOverlay.className = readStyle; objinnerDiv.className = readMargin + " " + readSize; + // Set up tools widget + + // NOTE THE IMAGE URL'S HERE !!!!!!!!!!!!!!!!! + // NOTE THE IMAGE URL'S HERE !!!!!!!!!!!!!!!!! + // NOTE THE IMAGE URL'S HERE !!!!!!!!!!!!!!!!! + articleTools.id = "readTools"; + articleTools.innerHTML = "\ + \ + \ + \ + "; + objinnerDiv.appendChild(grabArticle()); // Get the article and place it inside the inner Div + objOverlay.appendChild(articleTools); objOverlay.appendChild(objinnerDiv); // Insert the inner div into the overlay // For totally hosed HTML, add body node that can't be found because of bad HTML or something. @@ -113,25 +129,24 @@ function grabArticle() { topDiv = clean(topDiv, "h2"); topDiv = clean(topDiv, "iframe"); + // Add the footer and contents: articleFooter.id = "readFooter"; articleFooter.innerHTML = "\ \ \ "; - + articleContent.appendChild(topDiv); articleContent.appendChild(articleFooter); - + return articleContent; } // Get the inner text of a node - cross browser compatibly. -function getInnerText(e) -{ +function getInnerText(e) { if (navigator.appName == "Microsoft Internet Explorer") return e.innerText; else @@ -210,3 +225,30 @@ function clean(e, tags, minWords) { return e; } +function emailBox() { + var emailContainer = document.getElementById('email-container'); + if(null != emailContainer) + { + return; + } + + var emailContainer = document.createElement('div'); + emailContainer.setAttribute('id', 'email-container'); + emailContainer.innerHTML = ''; + + document.body.appendChild(emailContainer); +} + +function removeFrame() +{ + ++iframeLoads; + if(iframeLoads >= 6) + { + var emailContainer = document.getElementById('email-container'); + if(null != emailContainer) { + emailContainer.parentNode.removeChild(emailContainer); + } + // reset the count + iframeLoads = 0; + } +} \ No newline at end of file -- cgit v1.2.3