<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Brett Terpstraantique page  - Brett Terpstra</title>
	<atom:link href="http://brettterpstra.com/tag/antique/feed/" rel="self" type="application/rss+xml" />
	<link>http://brettterpstra.com</link>
	<description>Elegant solutions to complex problems.</description>
	<lastBuildDate>Tue, 22 May 2012 02:49:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Antique is back, baby</title>
		<link>http://brettterpstra.com/antique-is-back-baby/</link>
		<comments>http://brettterpstra.com/antique-is-back-baby/#comments</comments>
		<pubDate>Sat, 27 Aug 2011 17:56:48 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[antique]]></category>
		<category><![CDATA[reader]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=2569</guid>
		<description><![CDATA[<p>Thanks to a pointer from Jeremy Lu, I’ve got the Antique Safari Reader hack running in Safari 5.1. I can’t begin to tell you how much I’d missed it since updating to Lion. I’ve updated the instructions page to include the Lion location of Reader.html. The file is now located at /System/Library/PrivateFrameworks/Safari.framework/Versions/A/Resources/Reader.html. A quick locate command would have told me&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/antique-is-back-baby/">Antique is back, baby</a></p>]]></description>
			<content:encoded><![CDATA[<p>Thanks to a pointer from Jeremy Lu, I’ve got the Antique Safari Reader hack running in Safari 5.1. I can’t begin to tell you how much I’d missed it since updating to Lion. I’ve updated the <a href="http://brettterpstra.com/howtos/install-a-safari-reader-hack/">instructions page</a> to include the Lion location of Reader.html.</p>

<p>The file is now located at <code>/System/Library/PrivateFrameworks/Safari.framework/Versions/A/Resources/Reader.html</code>. A quick <code>locate</code> command would have told me that, but I didn’t think to look outside of the application bundle for it. Thanks, Jeremy.</p>

<p>Antique is still at version 1.6, but I may do some updating now that it’s back in action. Download below.</p>

<div class="download_desc"><p class="download-icon"><a href="http://brettterpstra.com/downloads/Antique1.6.zip?9d7bd4" title="Download Antique 1.6 for Safari Reader (4836)"><img src="http://cdn2.brettterpstra.com/wp-content/uploads/downloads/thumbnails/2010/11/safariiconantiqued.png?9d7bd4" alt="download image for Antique 1.6 for Safari Reader" width="64" /></a><br /><a href="http://brettterpstra.com/downloads/Antique1.6.zip?9d7bd4" title="Download Antique 1.6 for Safari Reader (4836)" class="download-button">Download</a></p><p class="desc"><a href="http://brettterpstra.com/downloads/Antique1.6.zip?9d7bd4" title="Download Antique 1.6 for Safari Reader (4836)">Antique 1.6 for Safari Reader</a> — Version 1.6 of the Antique hack for Safari 5. Adds pleasant styling to Reader, with many additional features. <a href="http://brettterpstra.com/2010/06/17/antique-1-6-final-release/">More Info</a></p></div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/antique-on-pimpmysafari-com/' rel='bookmark' title='Antique on PimpMySafari.com'>Antique on PimpMySafari.com</a></li>
<li><a href='http://brettterpstra.com/antique-safari-reader-hack-update-with-evernote-goodness/' rel='bookmark' title='Antique Safari Reader hack update with Evernote goodness'>Antique Safari Reader hack update with Evernote goodness</a></li>
<li><a href='http://brettterpstra.com/antique-1-6-final-release/' rel='bookmark' title='Antique 1.6, final release'>Antique 1.6, final release</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/antique-is-back-baby/">Antique is back, baby</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/antique-is-back-baby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Antique on PimpMySafari.com</title>
		<link>http://brettterpstra.com/antique-on-pimpmysafari-com/</link>
		<comments>http://brettterpstra.com/antique-on-pimpmysafari-com/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 04:08:31 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[antique]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=706</guid>
		<description><![CDATA[<p>There was a nice mention of Antique today over at PimpMySafari.com. Thanks, Scott! Despite having sworn off the Reader hacking, I’ve actually been continuing development, making tweaks and expanding functionality. My ultimate goal is still to find a way to override the stylesheet via a global page in an extension, turning it from a hack into something a little more&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/antique-on-pimpmysafari-com/">Antique on PimpMySafari.com</a></p>]]></description>
			<content:encoded><![CDATA[<p>There was a nice mention of <a href="http://brettterpstra.com/2010/06/17/antique-1-6-final-release/">Antique</a> today over <a href="http://www.pimpmysafari.com/extensions/safari-hacks/hacking-safari-reader-for-fun-and-profit">at PimpMySafari.com</a>. Thanks, Scott! Despite having sworn off the Reader hacking, I’ve actually been continuing development, making tweaks and expanding functionality. My ultimate goal is still to find a way to override the stylesheet via a global page in an extension, turning it from a hack into something a little more legitimate. If I can’t pull that off, though, I’ll have to share the current version again as a hack… I think it’s worth it. Take it from me, I’m biased.</p>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/antique-is-back-baby/' rel='bookmark' title='Antique is back, baby'>Antique is back, baby</a></li>
<li><a href='http://brettterpstra.com/antique-1-6-final-release/' rel='bookmark' title='Antique 1.6, final release'>Antique 1.6, final release</a></li>
<li><a href='http://brettterpstra.com/instapaper-beyond-for-safari/' rel='bookmark' title='Instapaper Beyond for Safari'>Instapaper Beyond for Safari</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/antique-on-pimpmysafari-com/">Antique on PimpMySafari.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/antique-on-pimpmysafari-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Antique 1.6, final release</title>
		<link>http://brettterpstra.com/antique-1-6-final-release/</link>
		<comments>http://brettterpstra.com/antique-1-6-final-release/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 15:24:57 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[antique]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[reader]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[safari 5]]></category>
		<category><![CDATA[typography]]></category>
		<category><![CDATA[widont]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=624</guid>
		<description><![CDATA[<p>"Antique" hack for Safari 5's Reader feature. Adds an antiqued theme and several new functions for typography, image handling and send-to applications.</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/antique-1-6-final-release/">Antique 1.6, final release</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://cdn2.brettterpstra.com/wp-content/uploads/2010/06/AntiqueImageLinking.jpg?9d7bd4"><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2010/06/AntiqueImageLinking-150x150.jpg?9d7bd4" alt="" title="AntiqueImageLinking" width="150" height="150" class="alignright size-thumbnail wp-image-628" /></a></p>

<p><strong>For a quick “how-to” on using the Antique (or any) Safari Reader hack, see the <a href="http://brettterpstra.com/howtos/install-a-safari-reader-hack/">related article</a> in the <a href="http://brettterpstra.com/howtos/">HowTo section</a>.</strong></p>

<p>This will be the last release of Antique, I think, barring a few minor fixes (follow <a href="http://twitter.com/ttscoff">@ttscoff</a> for updates on this and other projects). You can download it <a href="http://brettterpstra.com/downloads/Antique1.6.zip?9d7bd4" title="Antique Reader 1.6">here</a>. The code is completely open source, if anyone wants to continue the project feel free (credit would be swell, where it’s due). I’ll be putting my free time into <a href="http://brettterpstra.com/2010/06/09/instapaper-beyond-for-safari/">Instapaper Beyond</a> and other more “legitimate” projects now (although I really would like to do a nice, high-contrast, Helvetica version…). In deference to <a href="http://farukat.es/journal/2010/06/456-stop-hacking-safari-reader">Faruk Ateş</a>, I’d like to clearly state that this <em>is</em> a hack, and you run a risk (albeit very minimal) of breaking your Safari install if you don’t know what you’re doing. I also won’t be posting further simplified instructions for installation, but they’re not hard to find. For advanced users, you simply need to know that you’re replacing <code>Reader.html</code> in <code>Contents/Resources</code>.</p>

<p><a href="http://cdn2.brettterpstra.com/wp-content/uploads/2010/06/AntiqueHeadlineSplit.jpg?9d7bd4"><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2010/06/AntiqueHeadlineSplit-150x150.jpg?9d7bd4" alt="" title="AntiqueHeadlineSplit" width="150" height="150" class="alignright size-thumbnail wp-image-627" /></a></p>

<p>The coolest changes, in my opinion, are an <strong>amped-up Widon’t</strong> for headlines, and <strong>improved image linking</strong>. On the Widon’t end, if a title exceeds the width of the headline area, it’s actually split in the middle to provide more equal-length lines. It’s neat-o. And for the images: I had it only lightboxing images which were too large for the style and which <em>weren’t</em> already linked somewhere else, resulting in the user never knowing what would happen when they clicked an image. Now, if an image is linked to an external site, that link is extracted and placed on a line below the image. If an alt or title attribute are present in the image or the link, they’re preferred over the source attribute for naming the link, which should provide a decent idea of where you’re going, in most cases. Images which are linked, then, are always linked to the Colorbox effect, and will never take you out of the Reader page. Ah, consistency.</p>

<p>Here’s what else is new in this version.</p>

<ul>
<li>I swapped out the scrollbar images, shifted the colors a little, and included them in the HTML file.</li>
<li>Some style changes, including a darker background and slightly heavier gradient</li>
<li>Massively fixed up the <a href="http://brettterpstra.com/2010/06/14/ampersands-javascript/">ampersand code</a>. Also shifted ampersands 1 pixel left for better kerning within non-italicized text.</li>
<li>Improved smashing of empty paragraphs in bad markup to avoid huge spaces between paragraphs.</li>
<li>Fixed a CSS mistake I had introduced which caused the background and drop shadow to be visible before the content slid up from the bottom.</li>
<li>Set up an onscroll check for new elements. Every time the page is scrolled, Antique checks for new elements (i.e. additional pages that were inserted after initial load) and applies the default functions to them.</li>
<li>did I mention 12px Droid Sans Mono for code blocks? 12px seems reasonable, and doesn’t change when zooming/shrinking the rest of the text.</li>
</ul>

<!-- more -->

<p>Are there too many buttons in the HUD for your taste? They’re there as an example, but you can remove them easily by commenting out the “button” lines at the bottom of the Reader.html file. The HUD will adjust size and position automatically based on the number of buttons you have in there, so just remove the ones that aren’t of use to you.</p>

<p>If you’re playing with Reader styles, here’s a tip: you can set up a “sandbox” page to speed up development (at least with css). Once Reader has loaded a page that has elements you want to style, right click and choose “Inspect Element” (obviously, you have to have the developer menu enabled in preferences). Then, right click on the doctype declaration in the element inspector and choose “Copy as HTML.” That will give you the full HTML of the <em>rendered</em> document, which you can save to a new HTML file. Extract the inline stylesheets and link them into external stylesheets, and you can edit in CSSEdit or Firebug. It’s handy, given that, in order to change the live styles, you have to restart Safari every time you edit Reader.html.</p>

<p>I had started working on smart quotes and other javascript-based typography changes, but decided it wasn’t worth the time to try to come up with regular expressions that covered every possible circumstance. If anyone wants to pick up where I left off, I’d love to see what you come up with.</p>

<p><strong>For a quick “how-to” on using the Antique (or any) Safari Reader hack, see the <a href="http://brettterpstra.com/howtos/install-a-safari-reader-hack/">related article</a> in the <a href="http://brettterpstra.com/howtos/">HowTo section</a>.</strong></p>

<div class="download_desc"><p class="download-icon"><a href="http://brettterpstra.com/downloads/Antique1.6.zip?9d7bd4" title="Download Antique 1.6 for Safari Reader (4836)"><img src="http://cdn2.brettterpstra.com/wp-content/uploads/downloads/thumbnails/2010/11/safariiconantiqued.png?9d7bd4" alt="download image for Antique 1.6 for Safari Reader" width="64" /></a><br /><a href="http://brettterpstra.com/downloads/Antique1.6.zip?9d7bd4" title="Download Antique 1.6 for Safari Reader (4836)" class="download-button">Download</a></p><p class="desc"><a href="http://brettterpstra.com/downloads/Antique1.6.zip?9d7bd4" title="Download Antique 1.6 for Safari Reader (4836)">Antique 1.6 for Safari Reader</a> — Version 1.6 of the Antique hack for Safari 5. Adds pleasant styling to Reader, with many additional features. <a href="http://brettterpstra.com/2010/06/17/antique-1-6-final-release/">More Info</a></p></div>

<hr />
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/antique-is-back-baby/' rel='bookmark' title='Antique is back, baby'>Antique is back, baby</a></li>
<li><a href='http://brettterpstra.com/antique-safari-reader-hack-update-with-evernote-goodness/' rel='bookmark' title='Antique Safari Reader hack update with Evernote goodness'>Antique Safari Reader hack update with Evernote goodness</a></li>
<li><a href='http://brettterpstra.com/safari-reader-antique-hack/' rel='bookmark' title='Safari Reader Antique hack'>Safari Reader Antique hack</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/antique-1-6-final-release/">Antique 1.6, final release</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/antique-1-6-final-release/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Ampersands &amp; Javascript</title>
		<link>http://brettterpstra.com/ampersands-javascript/</link>
		<comments>http://brettterpstra.com/ampersands-javascript/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 16:18:31 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[antique]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=613</guid>
		<description><![CDATA[<p>While playing around with Antique1, I decided I really wasn’t in love with the ampersands that were included in any of the fonts I was working with. Normally, I’d just run everything through Typogrify2 and get some handy CSS classes to work with. Working in Safari’s Reader, though, I only had access to Javascript (and jQuery, now). I set out&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/ampersands-javascript/">Ampersands &amp; Javascript</a></p>]]></description>
			<content:encoded><![CDATA[<p><img style=' display:none'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2010/06/ampersandjavascriptheader.jpg?9d7bd4" alt="Ampersands and Javascript" border="0" width="650" height="187" class="headerimg" />While playing around with Antique<sup id="fnref:antique"><a href="#fn:antique" rel="footnote">1</a></sup>, I decided I really wasn’t in love with the ampersands that were included in any of the fonts I was working with. Normally, I’d just run everything through Typogrify<sup id="fnref:typogrify"><a href="#fn:typogrify" rel="footnote">2</a></sup> and get some handy CSS classes to work with. Working in Safari’s Reader, though, I only had access to Javascript (and jQuery, now).</p>

<p><a href="http://cdn2.brettterpstra.com/wp-content/uploads/2010/06/AntiqueAmpersands.jpg?9d7bd4"><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2010/06/AntiqueAmpersands-300x58.jpg?9d7bd4" alt="" title="Antique - Ampersands" width="300" height="58" class="alignright size-medium wp-image-614" /></a>I set out on a search for an easy, all-purpose solution, but nothing worked as well as I wanted it to. So I did a little scavenging and put together a couple of functions that do the job pretty well. They use jQuery, but could just as easily be done with pure Javascript, if you really wanted to.</p>

<p><span id="more-613"></span></p>

<p>Here are the two functions I’m using in the latest (unreleased, at this moment) version of Antique:</p>

<div markdown=0>
<pre><code>
function fixAmpersands() {
    // entity encodes only ampersands that aren&#x27;t already encoded
    $(&quot;h1,h2,h3,p:contains(&#x27;&amp;&#x27;)&quot;, document.body).each(function() {
        if( this.nodeType == 3 ) {
            // regex from Stack Overflow http://bit.ly/aJZVCG
            $(this).html( $(this).html().replace( /&amp;(?![a-zA-Z]{2,6};|#[0-9]{2,4};)/g, &quot;&amp;amp;&quot; ) );
        }
    });
}
function dressUpAmpersands() {
    // adds a span with class &#x27;amp&#x27; to the entity-encoded ampersands
    $(&quot;h1,h2,h3,p:contains(&#x27;&amp;&#x27;)&quot;, document.body).each(function() {
        $(this).html( $(this).html().replace( /&amp;amp;/g, &quot;&lt;span class=&#x27;amp&#x27;&gt;&amp;amp;&lt;/span&gt;&quot; ) );
    });
}
$(document).ready(function() {
    fixAmpersands();
    dressUpAmpersands();
});
</code></pre>
</div>

<p>They seem to work pretty well, so far. I accompany them with some CSS I nicked from <a href="http://simplebits.com/notebook/2008/08/14/ampersands-2/">SimpleBits</a> and <a href="http://patrickhaney.com/thinktank/2008/08/19/automatic-awesompersands">Patrick Haney</a>:</p>

<div markdown=0>
<pre><code>
.page span.amp { 
    font-family: Baskerville, Palatino, Constantia, "Book Antiqua", "URW Palladio L", serif;
    font-style: italic;
}
</code></pre>
</div>

<p>In my situation, it doesn’t really matter if ampersands are captured within code blocks, but just to keep styling consistent, I also force any .amp-wrapped ampersands within pre and code blocks to match the pre/code styling:</p>

<div markdown=0>
<pre><code>
#article .page pre,#article .page code,.page code span.amp, .page pre span.amp {
    font-family: 'Droid Sans Mono', 'Andale Mono', 'Courier New', Courier, monospace !important;
    font-style: normal;
}
</code></pre>
</div>

<p>Of course, this is all really better handled server-side with, say, PHP, but if you’re looking for spicy typography and are limited to client-side solutions, give it a shot! I’m running these right before my rather wicked new version of widon’t which splits long titles into nearly equal-length lines… more on that soon.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:antique">
<p><a href="http://brettterpstra.com/2010/06/13/antique-1-5-for-safari-reader/">http://brettterpstra.com/2010/06/13/antique-1–5-for-safari-reader/</a> <a href="#fnref:antique" rev="footnote">↩</a></p>
</li>

<li id="fn:typogrify">
<p><a href="http://code.google.com/p/typogrify/">http://code.google.com/p/typogrify/</a> <a href="#fnref:typogrify" rev="footnote">↩</a></p>
</li>

</ol>
</div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/word-repetition-checking-with-javascript/' rel='bookmark' title='Word repetition checking with JavaScript'>Word repetition checking with JavaScript</a></li>
<li><a href='http://brettterpstra.com/catching-markdown-mistakes/' rel='bookmark' title='Catching Markdown mistakes'>Catching Markdown mistakes</a></li>
<li><a href='http://brettterpstra.com/antique-1-6-final-release/' rel='bookmark' title='Antique 1.6, final release'>Antique 1.6, final release</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/ampersands-javascript/">Ampersands &amp; Javascript</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/ampersands-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Antique 1.5 for Safari Reader</title>
		<link>http://brettterpstra.com/antique-1-5-for-safari-reader/</link>
		<comments>http://brettterpstra.com/antique-1-5-for-safari-reader/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 21:19:16 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[antique]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[safari 5]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=592</guid>
		<description><![CDATA[<p>There is a new version of Antique available! Check out version 1.6! Version 1.5 1.6 of Antique (originally posted here) is officially available for download. Here’s what’s new! jQuery: added the jQuery library via Google’s Ajax API to make some of the other additions much easier to implement. Colorbox: links to images are automatically opened in a “lightbox” so you&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/antique-1-5-for-safari-reader/">Antique 1.5 for Safari Reader</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>There is a new version of Antique available! <a href="http://brettterpstra.com/2010/06/17/antique-1-6-final-release/">Check out version 1.6</a>!</strong></p>

<p><a href="http://brettterpstra.com/downloads/Antique1.6.zip?9d7bd4" title="Download Antique 1.6">Version <del datetime="2010-06-18T16:36:40+00:00">1.5</del> <ins datetime="2010-06-18T16:36:40+00:00">1.6</ins> of Antique</a> (<a href="http://brettterpstra.com/2010/06/12/safari-reader-antique-hack/">originally posted here</a>) is officially available for download. Here’s what’s new!</p>

<hr style="visibility:hidden;clear:both" />

<ul>
<li><a href="http://cdn2.brettterpstra.com/wp-content/uploads/2010/06/Antique1.5.1screenshot.jpg?9d7bd4"><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2010/06/Antique1.5.1screenshot-150x150.jpg?9d7bd4" alt="" title="Antique1.5.1screenshot" width="150" height="150" class="alignright size-thumbnail wp-image-609" /></a> <strong>jQuery:</strong> added the <a href="http://jquery.com/">jQuery</a> library via Google’s Ajax API to make some of the other additions much easier to implement.</li>
<li><strong>Colorbox:</strong> links to images are automatically opened in a “lightbox” so you don’t have to leave the page. Uses jQuery <a href="http://colorpowered.com/colorbox/">Colorbox</a> and automatically applies the effect to links ending in ‘.jpg’ or ‘.png’.</li>
<li><strong>Widon’t:</strong> headlines and paragraphs have a widon’t function applied to them, preventing “widows” (short words alone on a line). This was mostly annoying me in the top-level headings of the page, but it’s a nice touch throughout. It ignores words longer than 8 characters. They’ll do just fine on their own.</li>
<li><strong>New HUD buttons:</strong> in addition to the Evernote web clipper button in the floating HUD, there are new buttons for <a href="http://www.devon-technologies.com/products/devonthink/devonthink2.html">DEVONthink</a>, <a href="http://delibarapp.com/">Delibar</a> and <a href="http://www.celmaro.com/webbla/">Webbla</a>. These are mostly to show how to pull it off, and are easily edited. See the instructions below to remove buttons from the HUD.</li>
<li><strong>Pass text selections:</strong> unlike using bookmarklets, clicking on a HUD icon makes you lose your text selection. Any service that accepts a selection as a note or description (Evernote, DEVONthink, Webbla, etc.) won’t normally work. By storing the selected text in an HTML5 sessionStorage key every time your mouse enters the HUD, Antique is able to pass what <em>was</em> selected before you clicked the button. <em>Still working on making this function with Evernote.</em></li>
<li><a href="http://cdn2.brettterpstra.com/wp-content/uploads/2010/06/antiqueColorBoxScreenshot.jpg?9d7bd4"><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2010/06/antiqueColorBoxScreenshot-150x150.jpg?9d7bd4" alt="" title="Antique with ColorBox" width="150" height="150" class="alignright size-thumbnail wp-image-595" /></a> <strong>Smarter image resizing:</strong> when you load a page, Antique shrinks the larger images. It’s smarter now, though: wide, centered images are only reduced slightly and left centered, and any floated images that are reduced (and aren’t already linked somewhere) are now linked to the full size version of themselves, which will display in-page using Colorbox. Floated images also have bottom margin and clear:left applied to them to prevent horizontal stacking when images are close to each other in the layout.</li>
<li><strong><em>Minor Update:</em></strong> <em>(version 1.5.1)</em> I just swapped out Crimson Text for OFL Sorts Mill Goudy TT, primarily because I like the quotation marks much better. I also added hanging quotes (image-based) to blockquotes, and improved code blocks and bulleted lists wrapped around images.</li>
</ul>

<h3>Installation</h3>

<p>If you want to try out the style, <a href="http://brettterpstra.com/downloads/Antique1.6.zip?9d7bd4">download it here</a> and open the archive. Inside you’ll find a file called Reader.html. The file you’re going to replace (back it up somewhere safe first) is <code>/Applications/Safari.app/Contents/Resources/Reader.html</code>. If you don’t know how to do this from Terminal, you can just do it in Finder: go to your Applications folder and locate Safari, then right click on it and choose “Show Package Contents.” That will open a new window with the inner workings of Safari inside it. Open the folder called Contents, and then the Resources folder inside of that. Locate the file Reader.html and drag it out to your desktop (that’s your original, keep it safe). Then drag the new Reader.html file you downloaded into the Resources folder. Restart Safari and try it out!</p>

<p>There are lots of minor efficiency and style tweaks, but those are the major changes. If you’re interested in modifying the HUD (removing unnecessary buttons), read on…</p>

<p><span id="more-592"></span></p>

<h3>Removing HUD buttons</h3>

<p>This part is a cinch, even if you don’t know anything about Javscript or HTML. The HUD buttons are in the HTML body section of the Reader.html file, and you can just edit them out in a text editor. If you open the file (Reader.html) in a your editor of choice (as plain text, not rich text), and scroll all the way to the bottom, you’ll see a series of “<code>&lt;button id="hud... &gt;</code>” lines. It will be pretty obvious what each one is for, and you can simply comment out or delete the lines for buttons you don’t need. Antique will automatically resize and reposition the HUD based on the number of buttons in it, so that’s all you have to worry about.</p>

<h3>Adding HUD buttons</h3>

<p>Adding buttons is a different story, depending on what you want the button to do. So far, I’ve mostly been converting existing bookmarklets. You can set the function to call right in the button definition (just copy an existing button and edit it), then add the appropriate function to the script section above. Note that any bookmarklet that uses <code>window.location</code>, <code>location.href</code> or any means of getting the page title attribute are going to break. Reader overrides all of that, but thankfully, it stores the info in an object called ReaderJS. You can access the original page url with <code>ReaderJS.originalURL</code> and the title with <code>ReaderJS.displayTitle</code>. Those two make it pretty easy to cover 90% of bookmarklets you’d want to use.</p>

<p>I’m including most external javascript plugins and libraries directly in the html page. Standard rules don’t apply, this is all being served locally and the fewer files you have to keep track of, the easier it is to distribute. If your needs are different, you can reference external files in the <code>Safari.app/Contents/Resources</code> folder with <code>safari-resource:/filename.ext</code>, where filename.ext is the name of the file.</p>

<p>Antique handles the resizing of the HUD automatically, but if you’re doing it from scratch you’ll need to adjust the width and left-margin of #hud in the css section. The buttons are 48x48px PNG files, with the icon occupying approximately 36x36px of that space. White and transparent pixels only, if you want to fit the aesthetic, and the “inactive” version should be saved at about 70% opacity. I’ve been encoding all of my PNG files in base64 and including them inline in the CSS to make it easier to distribute, but you can reference them as mentioned above.</p>

<p>You also can’t use <code>document.location</code> when Reader.html is loaded, so most bookmarklets need to be modified. You can use <code>window.open</code> and immediately close the new window, like this:</p>

<div markdown=0>
<pre><code>
function sendToWebbla() {
    var wlWindow = window.open(&#x27;webbla:url=&#x27;+encodeURIComponent(ReaderJS.originalURL)+&#x27;&amp;mode=modify&amp;title=&#x27;+encodeURIComponent(ReaderJS.displayTitle))+&#x27;&amp;textSelection=&#x27;+encodeURIComponent(sessionStorage.getItem(&#x27;textSelection&#x27;));
    wlWindow.close();
    self.focus();
}
</code></pre>
</div>

<p>I have the <code>self.focus()</code> in there because I have <a href="http://haoli.dnsalias.com/Saft/index.html">Saft</a> running and restoring focus to the last active tab, which somehow is missing and leaving me on the wrong tab when I execute the above sequence. So this just brings me back to the right tab. When it runs, you can just <em>barely</em> see that it’s even opening a new window/tab. Should be pretty seamless for most folks.</p>

<p>I think that covers the process in a general sense. Each button I’ve added has had its own quirks and issues, so it would take a lot longer to detail every possible problem you’d run in to.</p>

<div class="download_desc"><p class="download-icon"><a href="http://brettterpstra.com/downloads/Antique1.6.zip?9d7bd4" title="Download Antique 1.6 for Safari Reader (4836)"><img src="http://cdn2.brettterpstra.com/wp-content/uploads/downloads/thumbnails/2010/11/safariiconantiqued.png?9d7bd4" alt="download image for Antique 1.6 for Safari Reader" width="64" /></a><br /><a href="http://brettterpstra.com/downloads/Antique1.6.zip?9d7bd4" title="Download Antique 1.6 for Safari Reader (4836)" class="download-button">Download</a></p><p class="desc"><a href="http://brettterpstra.com/downloads/Antique1.6.zip?9d7bd4" title="Download Antique 1.6 for Safari Reader (4836)">Antique 1.6 for Safari Reader</a> — Version 1.6 of the Antique hack for Safari 5. Adds pleasant styling to Reader, with many additional features. <a href="http://brettterpstra.com/2010/06/17/antique-1-6-final-release/">More Info</a></p></div>

<hr style="visibility:hidden;clear:both" />
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/antique-safari-reader-hack-update-with-evernote-goodness/' rel='bookmark' title='Antique Safari Reader hack update with Evernote goodness'>Antique Safari Reader hack update with Evernote goodness</a></li>
<li><a href='http://brettterpstra.com/safari-reader-antique-hack/' rel='bookmark' title='Safari Reader Antique hack'>Safari Reader Antique hack</a></li>
<li><a href='http://brettterpstra.com/antique-1-6-final-release/' rel='bookmark' title='Antique 1.6, final release'>Antique 1.6, final release</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/antique-1-5-for-safari-reader/">Antique 1.5 for Safari Reader</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/antique-1-5-for-safari-reader/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced
Database Caching 14/71 queries in 0.177 seconds using xcache
Object Caching 1789/1849 objects using xcache
Content Delivery Network via cdn2.brettterpstra.com

Served from: brettterpstra.com @ 2012-05-23 02:07:53 -->
