Remove compare-view in favor of readable-proxy, and update README to explain that
parent
36213108b6
commit
1fd72d6472
@ -1,18 +0,0 @@
|
||||
|
||||
#inputs {
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
#url {
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
#frames {
|
||||
display: flex;
|
||||
height: 600px;
|
||||
margin: ;
|
||||
}
|
||||
|
||||
.frame {
|
||||
flex: 1;
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
document.getElementById("compare").addEventListener("click", function compare(event) {
|
||||
var original = document.getElementById("original");
|
||||
original.addEventListener("load", function(event) {
|
||||
var contentDoc = original.contentDocument;
|
||||
var docStr = new XMLSerializer().serializeToString(contentDoc);
|
||||
var doc = new DOMParser().parseFromString(docStr, "text/html");
|
||||
|
||||
var location = contentDoc.location;
|
||||
var uri = {
|
||||
spec: location.href,
|
||||
host: location.host,
|
||||
prePath: location.protocol + "//" + location.host, // TODO This is incomplete, needs username/password and port
|
||||
scheme: location.protocol.substr(0, location.protocol.indexOf(":")),
|
||||
pathBase: location.protocol + "//" + location.host + location.pathname.substr(0, location.pathname.lastIndexOf("/") + 1)
|
||||
}
|
||||
var readability = new Readability(uri, doc);
|
||||
var result = readability.parse();
|
||||
|
||||
console.log(result);
|
||||
|
||||
var readerDoc = document.getElementById("readerized").contentWindow.document;
|
||||
readerDoc.getElementById("title").textContent = result.title;
|
||||
readerDoc.getElementById("byline").textContent = result.byline;
|
||||
readerDoc.getElementById("content").innerHTML = result.content;
|
||||
});
|
||||
|
||||
original.src = document.getElementById("url").value;
|
||||
});
|
||||
});
|
@ -1,22 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Readability Compare View</title>
|
||||
<link rel="stylesheet" href="compare.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Readability Compare View</h1>
|
||||
<div id="inputs">
|
||||
<input type="url" placeholder="http://localhost:8080/test-pages/margaret.html" id="url"/>
|
||||
<input type="submit" value="Compare" id="compare"/>
|
||||
</div>
|
||||
<div id="frames">
|
||||
<iframe id="original" class="frame"></iframe>
|
||||
<iframe id="readerized" class="frame" src="reader-view.html"></iframe>
|
||||
</div>
|
||||
|
||||
<script src="../Readability.js"></script>
|
||||
<script src="compare.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,14 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<meta name="viewport" content="width=device-width; user-scalable=0" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1 id="title"></h1>
|
||||
<h2 id="byline"></h2>
|
||||
<div id="content"></div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue