diff options
author | umbrae <umbrae@d4e419ec-0920-11de-bbfd-a7c1bc4c261e> | 2009-03-11 15:58:53 +0000 |
---|---|---|
committer | umbrae <umbrae@d4e419ec-0920-11de-bbfd-a7c1bc4c261e> | 2009-03-11 15:58:53 +0000 |
commit | 9980a2d430b66db1069d10622520b4806313ceda (patch) | |
tree | dec5d724518cfb7017b5c12bb1cf68ae20f82340 | |
parent | 3fc0722518f69935a67e49e8fc423317f0308e01 (diff) | |
download | readability-simple-9980a2d430b66db1069d10622520b4806313ceda.tar.bz2 readability-simple-9980a2d430b66db1069d10622520b4806313ceda.zip |
Tweak to the regular expression to determine special classnames/id's
git-svn-id: http://arc90labs-readability.googlecode.com/svn/trunk@28 d4e419ec-0920-11de-bbfd-a7c1bc4c261e
-rwxr-xr-x | css/readability-home.css | 34 | ||||
-rwxr-xr-x | css/readability.css | 39 | ||||
-rwxr-xr-x | index.htm | 1 | ||||
-rwxr-xr-x | js/readability.js | 4 |
4 files changed, 67 insertions, 11 deletions
diff --git a/css/readability-home.css b/css/readability-home.css index ac6fe5c..c16b329 100755 --- a/css/readability-home.css +++ b/css/readability-home.css @@ -156,18 +156,44 @@ div#margin { color: #C6FFC6;
}
+.style-slate {
+ font-family: "Gill Sans", Calibri, Trebuchet, sans-serif;
+ background: #262626;
+ color: #6A6969;
+ font-weight: lighter;
+ letter-spacing: .1em;
+}
+
+.style-slate #articleContent {
+ text-align: left;
+}
+
+.style-slate hr {
+ background-color: #666;
+ color: #666;
+ height: 1px;
+ border-width: 0;
+}
+
+.style-slate h1 {
+ font-variant: small-caps;
+ font-weight: lighter;
+ letter-spacing: .15em;
+ text-align: left;
+}
+
/* Margin Options */
.margin-x-wide {
- width: 35%;
+ width: 385px;
}
.margin-wide {
- width: 55%;
+ width: 435px;
}
.margin-medium {
- width: 75%;
+ width: 580px;
}
.margin-narrow {
- width: 95%;
+ width: 760px;
}
/* ---------------- USER-CONFIGURABLE STYLING --------------------- */
/* ---------------- USER-CONFIGURABLE STYLING --------------------- */
diff --git a/css/readability.css b/css/readability.css index 15292d0..889f1e1 100755 --- a/css/readability.css +++ b/css/readability.css @@ -25,7 +25,6 @@ text-align: left;
line-height: 1.4em;
margin: 1em auto;
- max-width: 800px;
}
#readInner a {
@@ -119,18 +118,48 @@ span.version { color: #C6FFC6;
}
+.style-slate {
+ font-family: "Gill Sans", Calibri, Trebuchet, sans-serif;
+ background: #262626;
+ color: #6A6969;
+ font-weight: lighter;
+ letter-spacing: .1em;
+}
+
+.style-slate hr {
+ background-color: #666;
+ color: #666;
+ height: 1px;
+ border-width: 0;
+}
+
+.style-slate h1 {
+ font-variant: small-caps;
+ font-weight: lighter;
+ letter-spacing: .15em;
+}
+
+.style-slate #readInner a {
+ color: #36C;
+ text-decoration: none;
+}
+
+.style-slate #readInner a:hover {
+ text-decoration: underline;
+}
+
/* Margin Options */
.margin-x-wide {
- width: 35%;
+ width: 385px;
}
.margin-wide {
- width: 55%;
+ width: 435px;
}
.margin-medium {
- width: 75%;
+ width: 580px;
}
.margin-narrow {
- width: 95%;
+ width: 760px;
}
/* ---------------- USER-CONFIGURABLE STYLING --------------------- */
@@ -23,6 +23,7 @@ <p><input type="radio" name="style" value="style-novel" id="novel"/><label for="novel">Novel</label></p>
<p><input type="radio" name="style" value="style-ebook" id="ebook" /><label for="ebook">eBook</label></p>
<p><input type="radio" name="style" value="style-terminal" id="terminal" /><label for="terminal">Terminal</label></p>
+ <p><input type="radio" name="style" value="style-slate" id="slate" /><label for="slate">Slate</label></p>
</div>
<div class="settings-box" id="size">
<p><input type="radio" name="size" value="size-small" id="small" /><label for="small">Small</label></p>
diff --git a/js/readability.js b/js/readability.js index 8719d21..ef8b0e4 100755 --- a/js/readability.js +++ b/js/readability.js @@ -59,13 +59,13 @@ function grabArticle() { // Look for a special classname
if(parentNode.className.match(/(comment|meta|footer|footnote)/))
parentNode.readability.contentScore -= 50;
- else if(parentNode.className.match(/(hentry|entry[-]?(content|text|body)|article[-]?(content|text|body))/))
+ else if(parentNode.className.match(/((^|\\s)(post|hentry|entry[-]?(content|text|body)|article[-]?(content|text|body))(\\s|$))/))
parentNode.readability.contentScore += 25;
// Look for a special ID
if(parentNode.id.match(/(comment|meta|footer|footnote)/))
parentNode.readability.contentScore -= 50;
- else if(parentNode.id.match(/(hentry|entry[-]?(content|text)|article[-]?(text|content))/))
+ else if(parentNode.id.match(/((^|\\s)(post|hentry|entry[-]?(content|text|body)|article[-]?(content|text|body))(\\s|$))/))
parentNode.readability.contentScore += 25;
}
|