<?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>A Modest Construct &#187; css</title>
	<atom:link href="http://heliologue.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://heliologue.com</link>
	<description></description>
	<lastBuildDate>Fri, 03 Feb 2012 17:18:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using YUI compressor in a web project</title>
		<link>http://heliologue.com/2008/09/22/using-yui-compressor-in-a-web-project/</link>
		<comments>http://heliologue.com/2008/09/22/using-yui-compressor-in-a-web-project/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 23:35:42 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://heliologue.com/?p=2692</guid>
		<description><![CDATA[Last year, I moved our small programming department from using JDeveloper and editing shared files directly on a network drive to using Netbeans 6.x and a proper version control system (Subversion). After the initial learning curve, this has all been going swimmingly. I merged my first development branch into the trunk yesterday, and this branch [...]]]></description>
			<content:encoded><![CDATA[<p>Last year, I moved our small programming department from using JDeveloper and editing shared files directly on a network drive to using Netbeans 6.x and a proper version control system (Subversion).</p>
<p>After the initial learning curve, this has all been going swimmingly.  I merged my first development branch into the trunk yesterday, and this branch just so happens to dovetail nicely into the whole point of this post, which is the <a href="http://developer.yahoo.com/yui/compressor/">YUI compressor</a>, an open-source javascript and CSS minification tool developed by Yahoo&#8217;s <abbr title="Yahoo User Interface">YUI</abbr> team.</p>
<p><span id="more-2692"></span></p>
<h3>The Problem</h3>
<p>To understand quickly why one should minify production client-side code, consider only that with the upward trend of size in javascript libraries (and the necessary files for such libraries), it&#8217;s possibly to be downloading a <em>lot</em> of client-side code in a typical web application, especially as its scope grows.</p>
<p>For a long time, I was using <a href="http://dean.edwards.name/packer/">Dean Edward&#8217;s Packer</a>, as was everyone, because its Base62 encoding produced the very lowest file size.  However, what should have been obvious to everyone is that <code>eval(bunch_of_stuff_goes_here)</code> is making the browser do a lot more work, and this is a problem on dinosaurs like IE6.  </p>
<p>To make matters worse, the nature of such encoding also meant that for servers which tried to compress outgoing content like javascript (either with zlib or gzip), the compression ratio suffered.  Just look at this table that Julien Lecomte posted last August.</p>
<table class="sortable rowstyle-even">
<caption>Javascript compression</caption>
<thead>
<tr>
<th class="sortable-text">File</th>
<th class="sortable-numeric">File size (bytes)</th>
<th class="sortable-numeric">Gzipped file size (bytes)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Original jQuery libraries</td>
<td>62,885</td>
<td>19,758</td>
</tr>
<tr>
<td>jQuery minified with <a href="http://www.crockford.com/javascript/jsmin.html">JSMin</a></td>
<td>36,391</td>
<td>11,541</td>
</tr>
<tr>
<td>jQuery minified with Packer</td>
<td>21,557</td>
<td>11,119</td>
</tr>
<tr>
<td>jQuery minified with the YUI compressor</td>
<td>31,822</td>
<td>10,818</td>
</tr>
</tbody>
</table>
<p>I said to myself, &#8220;Hey, we use a lot of this stuff, and we still support a lot of users with slow computers and slow browsers.&#8221;  So, I moved our project from a Packer-based compression to a YUI-based compression, and turned on server-side GZIP compression for javascript files.  The only problem was that I was storing the javascript files already minified, and simply pasted them into a large a couple of large global <code>.js</code> files.  I had to keep a separate source directory, along with any customizations.</p>
<p>This got to be a pain in the ass, as you might well expect, and so when it occurred to me that I might be able to use the YUI library at build-time in our Netbeans project, I immediately sprung into action.</p>
<p>This was around April, and one night while attending <a href="http://heliologue.com/2008/04/13/anaheim-and-other-larks/">Sungard Summit</a> in Anaheim.  I did the initial work to get our Netbeans project into a state that could use the YUI compressor at build-time, creating separate source file directories and breaking our massive javascript file into modules;  I did the same with our CSS, splitting it up based on what it decorated.</p>
<p>There are a few tutorials about using the YUI library.  <a href="http://blog.gomilko.com/2007/11/29/yui-compression-tool-as-ant-task/">Some of them</a> involve adding the YUI library to Ant&#8217;s classpath (didn&#8217;t want to go down this route); <a href="http://www.henke.ws/machblog/index.cfm?event=showEntry&#038;entryId=8A5CAB53-19B9-BA51-EECADB57919F9714">a lot of them</a> involve invoking the library as an external executable during the build process, which is messy.</p>
<p>The solution I finally settled on was <a href="http://code.google.com/p/javaflight-code/">yui-compressor-ant-task</a>, a small library that allows Ant to use YUI as a build task.  By adding this library and the YUI compressor library to our common libraries folder, and enabling them at build only (and not for deploying in the web archive), it makes using the compressor pretty easy.</p>
<p>Here&#8217;s part of our <code>build.xml</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">   * minify will concatenate all of our non-TinyMCE javascripts and stylesheets</span>
<span style="color: #808080; font-style: italic;">   * then use the YUI compressor library to compress them</span>
<span style="color: #808080; font-style: italic;">   --&gt;</span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;minify&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
       <span style="color: #808080; font-style: italic;">&lt;!--${libs} is path to the downloaded jars --&gt;</span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span></span>
<span style="color: #009900;">           <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;yui-compressor.jar&quot;</span></span>
<span style="color: #009900;">           <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${file.reference.yuicompressor.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span></span>
<span style="color: #009900;">           <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;yui-compressor-ant-task.jar&quot;</span></span>
<span style="color: #009900;">           <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${file.reference.yui-compressor-ant-task.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;task.classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${yui-compressor.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${yui-compressor-ant-task.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
       <span style="color: #808080; font-style: italic;">&lt;!-- yui-compressor task definition --&gt;</span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span></span>
<span style="color: #009900;">           <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;yui-compressor&quot;</span></span>
<span style="color: #009900;">           <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;net.noha.tools.ant.yuicompressor.tasks.YuiCompressorTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath</span> <span style="color: #000066;">refid</span>=<span style="color: #ff0000;">&quot;task.classpath&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/taskdef<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
       <span style="color: #808080; font-style: italic;">&lt;!-- concatenation of javascript --&gt;</span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;Building global javascript&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;concat</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;${build.dir}/web/common/js/global.js&quot;</span> <span style="color: #000066;">force</span>=<span style="color: #ff0000;">&quot;no&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
           <span style="color: #808080; font-style: italic;">&lt;!-- explicitly order js concat because ordering matters here --&gt;</span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/jquery.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/jquery.bgiframe.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/jquery.hoverIntent.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/ui.core.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/ui.autocomplete.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/ui.datepicker.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/ui.tabs.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/tablesort.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/customsort.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/jquery.blockUI.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/jquery.form.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/jquery.ifixpng.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/jquery.superfish.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/jquery.cluetip.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/jquery.scrollTo.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/jquery.jqModal.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/validation.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/js/jquery.timeentry.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/concat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
       <span style="color: #808080; font-style: italic;">&lt;!-- concatenation of cascading stylesheets --&gt;</span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;Building global cascading stylesheets&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;concat</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;${build.dir}/web/common/css/global.css&quot;</span> <span style="color: #000066;">force</span>=<span style="color: #ff0000;">&quot;no&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/css/base.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/css/superfish.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/css/announcements.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/css/myvt.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/css/forms.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/css/cluetip.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>   
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/css/tables.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/css/ui.tabs.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/css/ui.datepicker.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/css/ui.autocomplete.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/css/linkspan.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/css/stepMenu.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/css/print.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;web/common/css/youHaveMessages.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/concat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
       <span style="color: #808080; font-style: italic;">&lt;!-- invoke compressor --&gt;</span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;yui-compressor</span> <span style="color: #000066;">warn</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">charset</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span> <span style="color: #000066;">fromdir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;web/common/js/global.js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;web/common/css/global.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/yui-compressor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
   <span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">   * purge-src takes our compressed files, moves them to the base /common dir</span>
<span style="color: #808080; font-style: italic;">   * and deletes the source js and css dirs from the build dir</span>
<span style="color: #808080; font-style: italic;">   --&gt;</span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;purge-src&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;minify&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;Purging javascript and stylesheet sources&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;move</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${build.dir}/web/common/js/global-min.js&quot;</span> <span style="color: #000066;">tofile</span>=<span style="color: #ff0000;">&quot;${build.dir}/web/common/global.js&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;move</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${build.dir}/web/common/css/global-min.css&quot;</span> <span style="color: #000066;">tofile</span>=<span style="color: #ff0000;">&quot;${build.dir}/web/common/global.css&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}/web/common/js&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}/web/common/css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>What you see there is essentially four steps.</p>
<ol>
<li>Concatenate all the constituent source files into a <code>global.js</code> and a <code>global.css</code></li>
<li>Compress both of these files, which creates <code>global-min.js</code> and <code>global-min.css</code> (default behavior)</li>
<li>Move these files out of the source directories and into the root of the common web directory as <code>global.js</code> and <code>global.css</code></li>
<li>Delete the source directories in our build folder so they don&#8217;t get deployed with the web archive</li>
</ol>
<p>Because certain browsers (IE) break without explicit ordering, we unfortunately can&#8217;t just use &#8220;*.js&#8221; and &#8220;*.css&#8221; in our concatenation step, but having to explicitly list our components in the build file certainly isn&#8217;t the end of the world.  The nice thing is that the Ant task will even print out handy statistics on just how much you&#8217;ve been able to compress the files down.  In our case, we have about 441.8KB of common Javascript and CSS in our source code that, by the time it gets sent to the user, has been minified and/or gzipped to about 89KB.</p>
]]></content:encoded>
			<wfw:commentRss>http://heliologue.com/2008/09/22/using-yui-compressor-in-a-web-project/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Signs that you&#8217;re incorrigibly nerdy</title>
		<link>http://heliologue.com/2008/05/03/signs-that-youre-incorrigibly-nerdy/</link>
		<comments>http://heliologue.com/2008/05/03/signs-that-youre-incorrigibly-nerdy/#comments</comments>
		<pubDate>Sat, 03 May 2008 21:41:10 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[nerd]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://heliologue.com/?p=2032</guid>
		<description><![CDATA[Reading an 8-year thread of responses to a longstanding Gecko bug makes for interesting reading. You can list at least four different ways to create italicized text on a web page, as well as the semantic importance of each You laugh at the joke about the pluperfect subjunctive scrod. You like xkcd; even worse: you [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li>Reading an 8-year thread of responses to a longstanding Gecko bug makes for interesting reading.</li>
<li>You can list at least four different ways to create italicized text on a web page, as well as the semantic importance of each</li>
<li>You laugh at the joke about the <a href="http://www.google.com/search?q=%22pluperfect+subjunctive%22+scrod">pluperfect subjunctive scrod</a>.</li>
<li>You like <a href="http://xkcd.net">xkcd</a>;  even worse:  you understand the humor more than half the time.</li>
<li>Point releases are still very important.</li>
<li>Whenever you see a computer (real life or on television), you try to determine what operating system or browser it&#8217;s running.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://heliologue.com/2008/05/03/signs-that-youre-incorrigibly-nerdy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress Post Classes plugin v0.1</title>
		<link>http://heliologue.com/2008/03/11/wordpress-post-classes-plugin-v01/</link>
		<comments>http://heliologue.com/2008/03/11/wordpress-post-classes-plugin-v01/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 17:11:57 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://heliologue.com/2008/03/11/wordpress-post-classes-plugin-v01/</guid>
		<description><![CDATA[This plugin has been superseded by the much-improved Semantic Classes plugin I&#8217;ve written a small WordPress plugin that provides some new template tags that return a post&#8217;s tags, categories, author, and date; useful for CSS trickery. You can view its page here. This initial release provides the following items: &#60;?php generate_tag_class(); ?&#62; This function returns [...]]]></description>
			<content:encoded><![CDATA[<p class="alert">This plugin has been superseded by the much-improved <a href="http://heliologue.com/projects/semantic-classes-plugin/">Semantic Classes plugin</a></p>
<p>I&#8217;ve written a small WordPress plugin that provides some new template tags that return a post&#8217;s tags, categories, author, and date;  useful for CSS trickery.</p>
<p>You can view its page <a href="http://heliologue.com/projects/wordpress-post-classes-plugin/">here</a>.</p>
<p>This initial release provides the following items:</p>
<dl>
<dt><code>&lt;?php generate_tag_class(); ?&gt;</code></dt>
<dd>This function returns a space-delineated list of the post&#8217;s tags, prefixed with &#8216;tag-&#8217;</dd>
<dd>e.g. tag-politics tag-election-2008</dd>
<dt><code>&lt;?php generate_category_class(); ?&gt;</code></dt>
<dd>This function returns a space-delinated list of the post&#8217;s categories, prefixed with &#8216;category-&#8217;</dd>
<dd>e.g. category-personal category-random-thoughts</dd>
<dt><code>&lt;?php generate_author_class(); ?&gt;</code></dt>
<dd>This function returns the author name of a post, prefixed with &#8216;author-&#8217;</dd>
<dd>e.g. author-Heliologue</dd>
<dt><code>&lt;?php generate_date_class(); ?&gt;</code></dt>
<dd>This function returns a space-delineated list of the post&#8217;s date, prefixed with &#8216;y&#8217; (year), &#8216;m&#8217; (month), and &#8216;d&#8217; (day).</dd>
<dd>e.g. y2008 m03 d11</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://heliologue.com/2008/03/11/wordpress-post-classes-plugin-v01/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Various and sundry technology stuff pertaining to work</title>
		<link>http://heliologue.com/2007/12/08/various-and-sundry-technology-stuff-pertaining-to-work/</link>
		<comments>http://heliologue.com/2007/12/08/various-and-sundry-technology-stuff-pertaining-to-work/#comments</comments>
		<pubDate>Sat, 08 Dec 2007 07:38:25 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://heliologue.com/blog/2007/12/08/various-and-sundry-technology-stuff-pertaining-to-work/</guid>
		<description><![CDATA[I don&#8217;t usually talk about work on this blog, simply because I&#8217;ve read enough horror stories about blogging work matters to know how badly it ends. Granted, if I were to blog about my job, it would mostly consist of technology bits, but it&#8217;s still one of those grey areas I avoid out of propriety. [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t usually talk about work on this blog, simply because I&#8217;ve read enough horror stories about blogging work matters to know how badly it ends.  Granted, if I were to blog about my job, it would mostly consist of technology bits, but it&#8217;s still one of those grey areas I avoid out of propriety.</p>
<p>Yet, I find myself at home, with a <a href="http://en.wikipedia.org/wiki/White_Russian_(cocktail)">White Russian</a> and the urge to opine.</p>
<p><span id="more-1941"></span></p>
<h3>The Background</h3>
<p>In the summer of 2006, my workplace (<a href="http://www.stfrancis.edu">The University of St. Francis</a>, my alma mater) went live with a portal.  For the previous year and half, when I was a student worker, we&#8217;d been working desperately to implement <a href="http://portalcenter.oracle.com/">Oracle Portal</a>.  At a conference that summer, my boss, Tim, heard about <a href="http://uportal.org">uPortal</a>, an open-source J2EE portal.  On the <a href="http://heliologue.com/2006/06/30/the-conference-day-iii/">ride back from Ohio</a>, we more or less decided to try it on a lark.  It&#8217;s basic ease of setup let us switch to uPortal and go live in 6 weeks.  That&#8217;s right, a production-ready portal in 6 weeks.  </p>
<p>Much of the work in that time was tying <a href="http://www.ja-sig.org/products/cas/">CAS</a> into our LDAP implementation (Novell&#8217;s eDirectory), customizing the view (props to Virginia Tech for their excellent <a href="http://my.vt.edu/content/myvt3/myvt/tour-uportal/">Tab-Column customization</a>), and writing some basic portlets to allow quick views into student data:  schedule, personal info, billing, &amp;c.  We&#8217;re a Banner school, so we could basically just reach into our Oracle database and pull the data we needed.</p>
<h3>The Cool Bits</h3>
<p>Since that time, we&#8217;ve poured a tremendous amount of energy into the portal, as it&#8217;s become our go-to spot for finding information and getting things done.  Actually, we&#8217;ve spent very little time on uPortal at all, as it already contains much of the quick-view functionality we want.  Much of what we do is a custom extension to the portal that transparently shares session data via CAS.  </p>
<blockquote title="A brief overview of our functionality, as noted by my boss">
<p>We have completed our portal rollout using uPortal (running on apache/tomcat), and are integrated with Sungard Banner 7.x for much of the information we pull and display, and we are using Novell E-Directory for our directory.</p>
<p>We used uPortal which proved to be a much more promising and easier to use platform than Oracle portal. Within 6 weeks we had our first production portal deployment. Over the last year we have built and put the following into production:</p>
<ul>
<li>Student Schedule and Grades Display (pulled realtime from Banner)</li>
<li>WebCT Integration/SSO</li>
<li>Announcements (Targeted coming by end of summer &#8217;07)</li>
<li>SSO to Novell WebMail, Netstorage, and Banner Self Serve</li>
<li>Bookstore Integration with Barnes and Noble (Shopping cart of books)</li>
<li>Financial Aid Portlet/Accept Loans &#8211; Display and update banner data</li>
<li>Tuition Bill Portlet &#8211; Pulled in realtime from Banner AR</li>
<li>Payment of Tuition Bill/Post Directly to Banner AR</li>
<li>My Profile Portlet (information pulled realtime from Banner)</li>
<li>GPA/Credit Hours Portlet (Pulled realtime from banner)</li>
<li>Banner Security Question/Reset Password Functionality</li>
<li>Expired Password Functionality</li>
<li>Faculty Schedule/Class Rosters/Email Class, Export to Excel</li>
<li>Banner Survey Integration</li>
<li>HR Leave Balances</li>
<li>Budget Reporting/Financial Activity/View Documents, checks cut, etc</li>
<li>Banner Requisition Approval</li>
<li>Web Based University Income/P&#038;L Statement</li>
<li>Banner Finance Journal Voucher Upload</li>
<li>PIDM Usage Utility to help identify and resolve duplicate pidms</li>
<li>EZProxy/Library Databases Integration</li>
<li>Advancement Constituent Profiles</li>
<li>Advancement Fundraising Activity Reports</li>
<li>Advancement Constituent Contacts Data Entry/Reminders</li>
<li>Financial Aid targeted messages</li>
<li>GUAMESG</li>
<li>Residence Life View your Room/Roomates</li>
<li>Bulletin Boards (phpBB)</li>
<li>VT Calendar</li>
<li>Various Web based Reports</li>
<li>E-Directory Integration/Account Creation</li>
<li>Early alert and midterm warning submission, that allows the student, advisor, registrar, athletic coaches, and other support staff know when a student is having academic difficulties.</li>
<li>An online advising center. Advisors can now see all of their advisees, look at who&#8217;s registered, view issues with the students account such as registration or medical holds, etc. The goal is so that advisors can also help the students get their issues resolved.</li>
<li>Our initial stab at targeted announcements is done. We can now target based on the student type, level, or college as currently stored in the Banner ERP, as well as target to only employees or faculty members. The framework is in place to target off of any data element stored in Banner. Now we just need to expand our GUI allowing users to target messages.</li>
<li>Accounts Receivable Reporting Suite &#8211; Our finance office now uses the portal to do various AR reporting tasks, drilling into student details, etc.</li>
<li>Enrollment/Registration Status Reports &#8211; Various members of the university can now easily look at the overall student registration status through the portal.</li>
<li>A faculty attendance tracking module for faculty to electronically submit the attendance of students in their classes at the beginning of term and at the mid-term point. This helps the registrar and financial aid determine who is actually attending, and replaces an old paper based process.</li>
<li>On online Student Check-In procedure. Students can now confirm their class schedules, financial aid, and pay their bill through an easy to use &#8220;wizard&#8221; interface. The system will notify when they need to perform the electronic check in process before the start of the term, and then walks them through the process. This helps to collect payments sooner and determine which students are actually going to show up to class on day 1.</li>
<li>Our portal now has a targeted messaging facility which looks at business rules and notifies the students of issues or action items related to their student records. For example, if a student has holds on their account the system will tell them, show them the hold, tell them what it prevents them from doing, and who to contact to resolve the hold. For students with incomplete medical records they are notified, and shown which parts of their medical records are incomplete (and for our nursing program, which shots, etc they need to have on file to be able to attend clinicals).</li>
<li>A co-curricular transcript which pulls from Banner all the clubs, organizations, and sports a student has been a member of during their time at the university, and shows them in a nicely formatted page that they can print.</li>
<li>A real-time registration status dashboard for administrators, deans, and faculty members. This dashboard now shows the head counts, course registration counts, credit hours, and billing hours generated for registered students, and the number of potential students who are left to register. It breaks the summary counts down in several ways: by college, major, advisor, or level (graduate, undergrad, etc). The users can drill into this report and extract lists of students who still need to get registered, whom to call to see if they need advising help or assistance registering, etc.</li>
</ul>
</blockquote>
<p>As the UI architect for the portal extension, I decided this past summer to standardise on <a href="http://jquery.com">jQuery</a>, and certainly haven&#8217;t regretted it.  The only bad thing about javascript is that it becomes easy to rely on it for things which should really be controlled server-side.  Important validation checks, for instance.   Since our ERP system has certain business logic which it enforces on the database level, we usually do two checks for important data:  one (javascript) for the user&#8217;s sake, and one (servlet) for ours.</p>
<p>It got to the point where we were loading 10 different jQuery javascripts and 2 stylesheets in our header.  Most of the javascripts were either <a href="http://dean.edwards.name/packer/">packed</a> or uncompressed (if packing broke them), and totaled about 200Kb.  Not only was this too much, but the <code>eval()</code> caused a delay for each script.  Recently, after one of our rollouts to production, when I got more leeway to play, I completely upgraded our script layout.  I&#8217;m not going to provide an apples-to-apples comparison table here, since the prior configuration was a hodgepodge, but after <a href="http://developer.yahoo.com/yui/compressor/">minifying</a> and turning on server-side compression for javascripts and stylesheets, I managed to reduce the load from 200Kb in 12 requests to about 50Kb in 5 requests.  According to <a href="http://www.julienlecomte.net/blog/2007/08/13/">Julien Lecomte</a>, running mod_deflate on a minified (but no obfuscated) javascript yields the lowest file size;  regardless of how often that&#8217;s true, I like the idea of avoid latency from the <code>eval()</code>.  A lot of our users are still on IE6, and they take some pretty big performance hits.</p>
<p>Goodness knows there&#8217;s more I could do, but given the nature of our portal (single-image CSS layouts, anyone?), it wouldn&#8217;t be a productive use of our time);  I have enough crap to do with counting pixels.</p>
<h3>jQuery rocks my socks</h3>
<p>I might take a moment here to say just how much I love jQuery.  For those of you who don&#8217;t know, jQuery is a javascript framework which abstracts a lot of functions into a much more easily-written manner.  In the past, I&#8217;ve sort of been a Copy &amp; Paste javascript programmer, since it&#8217;s been easier to use some free script than to write one&#8217;s own code.  jQuery and it&#8217;s vast array (har!) of plugins makes it easy to implement or write new code.  For instance, if we want to implement a support for CSS hover effects in IE, all we do is this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">$<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;input:text,input:password,textarea&quot;</span><span style="color: #00AA00;">&#41;</span>.focus<span style="color: #00AA00;">&#40;</span>function<span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #00AA00;">&#123;</span>
     $<span style="color: #00AA00;">&#40;</span>this<span style="color: #00AA00;">&#41;</span>.addClass<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;focused&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
&nbsp;
$<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;input:text,input:password,textarea&quot;</span><span style="color: #00AA00;">&#41;</span>.blur<span style="color: #00AA00;">&#40;</span>function<span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #00AA00;">&#123;</span>
     $<span style="color: #00AA00;">&#40;</span>this<span style="color: #00AA00;">&#41;</span>.removeClass<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;focused&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>Easy as pie.</p>
<p>Granted, there are a lot of frameworks to choose from.  Originally, there was only <a href="http://">Prototype</a>;  now there&#8217;s also jQuery, <a href="http://dojotoolkit.org/">Dojo</a>, <a href="http://developer.yahoo.com/yui/">YUI</a>, <a href="http://mootools.net/">Mootools</a>, <a href="http://openrico.org/">Rico</a>, and any one of a number of others.  </p>
<p>The one I wanted to talk about in this post in particular is <a href="http://extjs.com/">ExtJS</a>, which was originally an extension of the YUI framework, but which eventually split off into its own project.  It recently went 2.0, and boasts some rather impressive <a href="http://extjs.com/deploy/dev/examples/">demos</a>.  I marvel at the Vista-like UI, which, admittedly, is very slick.</p>
<p>But the more I look at ExtJS, and half-heartedly consider its possible deployment within our portal, the less enthused I become.  ExtJS&#8217;s grid, for instance, doesn&#8217;t even function on existing HTML table markup:  you mass it an array of data as a javascript variable, and it creates markup on the fly&#8230; a <em>lot</em> of markup, in order to create it&#8217;s slick Office 2007 interface.  While this is <em>good</em> insofar as it manages to completely abstract data from presentation, I&#8217;m not sure how much I <em>like</em> the idea, since it <strong>(1)</strong> relegates users to the script default without heavy customization, and <strong>(2)</strong> doesn&#8217;t allow for any kind of fallback mechanism if the javascript should fail or the user has it disabled.  Our table-sorting function, in a case like that, doesn&#8217;t at all prevent the table markup and data itself from being rendered.</p>
<p>Work can be fun sometimes.</p>
]]></content:encoded>
			<wfw:commentRss>http://heliologue.com/2007/12/08/various-and-sundry-technology-stuff-pertaining-to-work/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Using jQuery to extract blockquote metadata</title>
		<link>http://heliologue.com/2007/09/18/using-jquery-to-extract-blockquote-metadata/</link>
		<comments>http://heliologue.com/2007/09/18/using-jquery-to-extract-blockquote-metadata/#comments</comments>
		<pubDate>Tue, 18 Sep 2007 16:58:08 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://heliologue.com/blog/2007/09/18/using-jquery-to-extract-blockquote-metadata/</guid>
		<description><![CDATA[5 Nov. 2007 • I&#8217;ve formatted this code as a plugin, too. Go to the project page. Blockquotes, by definition, can and should in most cases have a title attribute and, if possible, a cite attribute. The former is the actually name of the quote&#8217;s source. The latter is the URI to the quotes location, [...]]]></description>
			<content:encoded><![CDATA[<p class="alert">
<strong>5 Nov. 2007</strong> • I&#8217;ve formatted this code as a plugin, too.  <a href="http://heliologue.com/projects/blockquote-metadata-extractor/">Go to the project page</a>.
</p>
<p>Blockquotes, by definition, can and should in most cases have a <code>title</code> attribute and, if possible, a <code>cite</code> attribute.  The former is the actually name of the quote&#8217;s source.  The latter is the URI to the quotes location, if it was retrieved online.</p>
<p>For instance:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">blockquote</span> <span style="color: #000066;">cite</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://heliologue.com&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;A Modest Construct&quot;</span>&gt;</span>
&nbsp;
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer arcu ligula, tempus vel, dignissim at, molestie ut, leo. Etiam luctus, ipsum sit amet tincidunt malesuada, magna nisi feugiat eros, in tempus libero justo sed dui. Aliquam bibendum pulvinar turpis. Ut iaculis gravida nibh. Quisque elementum ligula vel nibh. Sed leo augue, tempor sed, nonummy in, interdum at, quam. Ut cursus tincidunt felis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Integer pharetra vulputate nunc. Cras nec felis ornare augue tempor fermentum. Nullam rutrum malesuada nunc. Aliquam vel purus. Aliquam faucibus malesuada orci. Nulla sit amet nulla sit amet tortor fermentum euismod.
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">blockquote</span>&gt;</span></pre></div></div>

<p>This is all well and good for search engines, but it doesn&#8217;t do much for human readers (who are arguably more important, though it depends on who you ask).  A human might want to see something like this:</p>
<blockquote>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer arcu ligula, tempus vel, dignissim at, molestie ut, leo. Etiam luctus, ipsum sit amet tincidunt malesuada, magna nisi feugiat eros, in tempus libero justo sed dui. Aliquam bibendum pulvinar turpis. Ut iaculis gravida nibh. Quisque elementum ligula vel nibh. Sed leo augue, tempor sed, nonummy in, interdum at, quam. Ut cursus tincidunt felis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Integer pharetra vulputate nunc. Cras nec felis ornare augue tempor fermentum. Nullam rutrum malesuada nunc. Aliquam vel purus. Aliquam faucibus malesuada orci. Nulla sit amet nulla sit amet tortor fermentum euismod.</p>
<p><cite class="source"><a href="http://heliologue.com" title="A Modest Construct">A Modest Construct</a></cite></p></blockquote>
<p>Which I achieved by appending</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">cite</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;source&quot;</span>&gt;</span>
     <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://heliologue.com&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;A Modest Construct&quot;</span>&gt;</span>A Modest Construct<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">cite</span>&gt;</span></pre></div></div>

<p>to the blockquote.</p>
<p>But nobody wants to hard-code a citation into every blockquote, especially when it&#8217;s technically correct to attach the information to the semantic element in question (the <code>blockquote</code>, for those of you not following along).  So, how to be structurally correct when using blockquotes, while still allowing human readers the benefit of such data?</p>
<p><span id="more-1906"></span></p>
<p>Well, there are a number of methods.   If you&#8217;re using a CMS or any kind of dynamically-generated page, you can use the system itself to parse blockquotes for their attributes and reuse that information.</p>
<h4>The Old Way</h4>
<p>A somewhat simpler and more flexible solution would be Javascript, which isn&#8217;t foolproof, but should be good enough for most people.  Previously, I used <a href="http://demo.1976design.com/blockquotes/">Dunstan&#8217;s Blockquotes</a>, which was an excellent solution for a long time.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> extractBlockquoteInfo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
        quotes <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'blockquote'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> quotes.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
		cite <span style="color: #339933;">=</span> quotes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'cite'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		title <span style="color: #339933;">=</span> quotes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>cite<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>cite <span style="color: #339933;">!=</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span>cite.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'i'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>cite.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ftp://'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'i'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>cite.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'person://'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'i'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
				<span style="color: #009900;">&#123;</span>
				newlink <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				newlink.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #339933;">,</span> cite<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				newlink.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Go to '</span> <span style="color: #339933;">+</span> cite<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				title <span style="color: #339933;">=</span> quotes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>title<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>title <span style="color: #339933;">!=</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
					<span style="color: #009900;">&#123;</span>
					newlink.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">createTextNode</span><span style="color: #009900;">&#40;</span>title<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #000066; font-weight: bold;">else</span>
					<span style="color: #009900;">&#123;</span>
					newlink.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">createTextNode</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Quote source'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				newdiv <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				newdiv.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'source'</span><span style="color: #339933;">;</span>
				newdiv.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">createTextNode</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\u</span>2014 '</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				newdiv.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>newlink<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				quotes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>newdiv<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #000066; font-weight: bold;">else</span>
				<span style="color: #009900;">&#123;</span>
				newdiv <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				newdiv.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'source'</span><span style="color: #339933;">;</span>
				newdiv.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">createTextNode</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\u</span>2014 '</span> <span style="color: #339933;">+</span> cite<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				quotes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>newdiv<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>title<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>title <span style="color: #339933;">!=</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
			newdiv <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			newdiv.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'source'</span><span style="color: #339933;">;</span>
			newdiv.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">createTextNode</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\u</span>2014 '</span> <span style="color: #339933;">+</span> title<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			quotes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>newdiv<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
window.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
extractBlockquoteInfo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>The New Way</h4>
<p>I ran into conflict issues, however.  Also, the script seems overly complicated for what it&#8217;s doing.  I long ago chose my spot in the <a href="http://jquery.com">jQuery</a> camp, and am currently using it on this blog for <a href="http://jquery.com/demo/thickbox/">Thickbox</a> and a few other miscellaneous things.   So I thought:  why not get blockquote data using jQuery?  Here&#8217;s my resulting code (which I&#8217;m sure is flawed and crufty, but I put it together in about five minutes;  suggestions are welcome).</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;blockquote&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
          <span style="color: #003366; font-weight: bold;">var</span> title <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;title&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #003366; font-weight: bold;">var</span> cite <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;cite&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
          <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cite <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> title <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
              $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;cite class='source'&gt;&quot;</span><span style="color: #339933;">+</span>title<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/cite&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
&nbsp;
          <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cite <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> title <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
               $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;cite class='source'&gt;&lt;a href='&quot;</span><span style="color: #339933;">+</span>cite<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;' title='&quot;</span><span style="color: #339933;">+</span>cite<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;'&gt;&quot;</span><span style="color: #339933;">+</span>cite<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/a&gt;&lt;/cite&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
&nbsp;
          <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cite <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> title <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
               $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;cite class='source'&gt;&lt;a href='&quot;</span><span style="color: #339933;">+</span>cite<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;' title='&quot;</span><span style="color: #339933;">+</span>title<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;'&gt;&quot;</span><span style="color: #339933;">+</span>title<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/a&gt;&lt;/cite&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
&nbsp;
          <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #009900;">&#125;</span>
     <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Essentially, I&#8217;m looking for <code>blockquote</code>s that contains at least one of our particular attributes, and then parsing them for <code>title</code> and <code>cite</code> values.    There are four possible outcomes:</p>
<p>1. <strong><code>title</code> but no <code>cite</code>:</strong></p>
<blockquote title="A Modest Construct">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer arcu ligula, tempus vel, dignissim at, molestie ut, leo. Etiam luctus, ipsum sit amet tincidunt malesuada, magna nisi feugiat eros, in tempus libero justo sed dui. Aliquam bibendum pulvinar turpis. Ut iaculis gravida nibh. Quisque elementum ligula vel nibh. Sed leo augue, tempor sed, nonummy in, interdum at, quam. Ut cursus tincidunt felis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Integer pharetra vulputate nunc. Cras nec felis ornare augue tempor fermentum. Nullam rutrum malesuada nunc. Aliquam vel purus. Aliquam faucibus malesuada orci. Nulla sit amet nulla sit amet tortor fermentum euismod.</p>
</blockquote>
<p>2. <strong><code>cite</code> but no <code>title</code>:</strong></p>
<blockquote cite="http://heliologue.com">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer arcu ligula, tempus vel, dignissim at, molestie ut, leo. Etiam luctus, ipsum sit amet tincidunt malesuada, magna nisi feugiat eros, in tempus libero justo sed dui. Aliquam bibendum pulvinar turpis. Ut iaculis gravida nibh. Quisque elementum ligula vel nibh. Sed leo augue, tempor sed, nonummy in, interdum at, quam. Ut cursus tincidunt felis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Integer pharetra vulputate nunc. Cras nec felis ornare augue tempor fermentum. Nullam rutrum malesuada nunc. Aliquam vel purus. Aliquam faucibus malesuada orci. Nulla sit amet nulla sit amet tortor fermentum euismod.</p>
</blockquote>
<p>3. <strong><code>cite</code> and <code>title</code>:</strong></p>
<blockquote cite="http://heliologue.com" title="A Modest Construct">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer arcu ligula, tempus vel, dignissim at, molestie ut, leo. Etiam luctus, ipsum sit amet tincidunt malesuada, magna nisi feugiat eros, in tempus libero justo sed dui. Aliquam bibendum pulvinar turpis. Ut iaculis gravida nibh. Quisque elementum ligula vel nibh. Sed leo augue, tempor sed, nonummy in, interdum at, quam. Ut cursus tincidunt felis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Integer pharetra vulputate nunc. Cras nec felis ornare augue tempor fermentum. Nullam rutrum malesuada nunc. Aliquam vel purus. Aliquam faucibus malesuada orci. Nulla sit amet nulla sit amet tortor fermentum euismod.</p>
</blockquote>
<p>4.  <strong>no <code>cite</code> and no <code>title</code>:</strong></p>
<blockquote>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer arcu ligula, tempus vel, dignissim at, molestie ut, leo. Etiam luctus, ipsum sit amet tincidunt malesuada, magna nisi feugiat eros, in tempus libero justo sed dui. Aliquam bibendum pulvinar turpis. Ut iaculis gravida nibh. Quisque elementum ligula vel nibh. Sed leo augue, tempor sed, nonummy in, interdum at, quam. Ut cursus tincidunt felis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Integer pharetra vulputate nunc. Cras nec felis ornare augue tempor fermentum. Nullam rutrum malesuada nunc. Aliquam vel purus. Aliquam faucibus malesuada orci. Nulla sit amet nulla sit amet tortor fermentum euismod.</p>
</blockquote>
<p>I think that the <code>&lt;cite&gt;</code> element is the most semantically correct, but of course you&#8217;ll have to change that to fit your needs.  I style it like this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">blockquote cite<span style="color: #6666ff;">.source</span> <span style="color: #00AA00;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
     <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">dashed</span> <span style="color: #cc00cc;">#aaa</span><span style="color: #00AA00;">;</span>
     <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0.95em</span><span style="color: #00AA00;">;</span>
     <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
     <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>And there you go.  An excellent Javascript library, a few lines of code (more than necessary even, as I wanted to cover all the possible cases), and you&#8217;ve got a flexible solution to blockquote citations.</p>
]]></content:encoded>
			<wfw:commentRss>http://heliologue.com/2007/09/18/using-jquery-to-extract-blockquote-metadata/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Do they give merit badges for prostituting yourself to a media conglomerate?</title>
		<link>http://heliologue.com/2006/10/23/do-they-give-merit-badges-for-prostituting-yourself-to-a-media-conglomerate/</link>
		<comments>http://heliologue.com/2006/10/23/do-they-give-merit-badges-for-prostituting-yourself-to-a-media-conglomerate/#comments</comments>
		<pubDate>Mon, 23 Oct 2006 17:12:10 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[legal]]></category>
		<category><![CDATA[movies]]></category>
		<category><![CDATA[social]]></category>
		<category><![CDATA[sociology]]></category>

		<guid isPermaLink="false">http://heliologue.com/blog/2006/10/23/1473/</guid>
		<description><![CDATA[Boy Scouts in the Los Angeles area will now be able to earn a merit patch for learning about the evils of downloading pirated movies and music. [...] The movie industry has developed the curriculum. &#8220;Working with the Boy Scouts of Los Angeles, we have a real opportunity to educate a new generation about how [...]]]></description>
			<content:encoded><![CDATA[<blockquote cite="http://sfgate.com/cgi-bin/article.cgi?file=/news/archive/2006/10/20/entertainment/e110452D84.DTL" title="SFGate • L.A. Boy Scots new merit badge: 'Respect Copyrights'">
<p>Boy Scouts in the Los Angeles area will now be able to earn a merit patch for learning about the evils of downloading pirated movies and music. [...]</p>
<p>The movie industry has developed the curriculum.</p>
<p>&#8220;Working with the Boy Scouts of Los Angeles, we have a real opportunity to educate a new generation about how movies are made, why they are valuable, and hopefully change attitudes about intellectual property theft,&#8221; Dan Glickman, chairman of the Motion Picture Association of America, said Friday.</p>
</blockquote>
<p>&#8230;. Does this seem just a bit creepy to anyone else, or am I on my own here?  </p>
<p>A few problems:</p>
<p>Allowing an industry to develop a curriculum is a recipe for disaster (or should I say &#8220;flop&#8221;?).  I would no more allow the MPAA or RIAA to tell me about copyright than I would allow Exxon to tell me about alternative energy or Microsoft to tell me about &#8220;embrace and extend.&#8221;  Remember, the MPAA&#8217;s the same organization that said you aren&#8217;t allowed to make backups of the DVDs you buy—if it gets damaged, you simply have to go out and buy another copy.  Apparently, this sort of stricture is perfectly OK, but it strikes me as odd, given the Boy Scouts&#8217; fear of homosexuals:  apparently, getting fucked in the ass is only all right if it&#8217;s a litigious media conglomerate doing the mounting.</p>
<p>Glickman, ever stubbornly flogging the same dead horse, is right when he concludes that the attitude toward intellectual property theft needs to be changed—yes, by consumers, but just as much by the studios and the soulless abysses which represent them.  I think people <em>know</em> the value of movies, and that is precisely the problem:  certainly, they don&#8217;t seem to be worth buying anymore.  At least, not when they suck, hard, and are available on digital media that was designed to give consumers the shaft.</p>
<p>The article goes on to that say that prospective badge-earners must also choose from a list of activities which include visiting a movie studio &#8220;to see how many people can be harmed by film piracy.&#8221;  I love this, because I&#8217;m quite certain these children will be told that for every movie they download, some humble janitor or assistant to the assistant director will lose their job and return home, Bob Cratchit-like, to tell his starving family that there&#8217;ll be no Christmas presents this year—piracy has ruined the movie industry and it tireless, selfless constituents.  No one will tell the Boy Scouts, of course, that the people who <em>really</em> care about piracy are executives whose salaries won&#8217;t be affected.  <strong>The truth is that this tack by conglomerates to stem piracy with appeals to <i>pathos</i> is little more than people like Dan Glickman holding a pistol to some lowly worker&#8217;s temple and screaming that Dammit, if the piracy doesn&#8217;t stop, then Mr. Cratchit here gets it!</strong></p>
<p>Dan Glickman is an asshole.  And his merit badge isn&#8217;t worthy to wipe my ass with.  <i>Fín</i>.</p>
]]></content:encoded>
			<wfw:commentRss>http://heliologue.com/2006/10/23/do-they-give-merit-badges-for-prostituting-yourself-to-a-media-conglomerate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tubgirl&#8217;d</title>
		<link>http://heliologue.com/2006/10/03/tubgirld/</link>
		<comments>http://heliologue.com/2006/10/03/tubgirld/#comments</comments>
		<pubDate>Wed, 04 Oct 2006 02:55:51 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[miscellany]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://heliologue.com/blog/2006/10/03/tubgirld/</guid>
		<description><![CDATA[MySpace denizens have a long history of stealing pictures from other peoples&#8217; websites. The last time an image of mine was stolen, I was nice about it. Rusty wasn&#8217;t (if you&#8217;re reading this, Rusty, your screenshot is a 404 error). Well, after the last time, I wrote an .htaccess file that stopped all hotlinking of [...]]]></description>
			<content:encoded><![CDATA[<p>MySpace denizens have a <a href="http://heliologue.com/2005/12/20/there-is-mischief-afoot/">long history</a> of stealing pictures from other peoples&#8217; websites.  </p>
<p>The last time an image of mine was stolen, I was nice about it.  Rusty <a href="http://www.ruosteinen.co.uk/kingdom/archives/124">wasn&#8217;t</a> (if you&#8217;re reading this, Rusty, your screenshot is a 404 error).  </p>
<p>Well, after the last time, I wrote an .htaccess file that stopped all hotlinking of images except for sites on this domain, as well as a few select others.  </p>
<p>Here it is, excerpted:</p>
<pre>
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?heliologue.com(/)?.*$     [NC]

[snip]

RewriteRule .*\.(gif|jpg|jpeg|bmp|png)$ - [F,NC]
</pre>
<p>After looking through my logs recently, I found that most referrals from MySpace failed—most were still trying to hotlink <code>HUH.gif</code>.  But there was one MySpace page that showed up under successful referrers.  I visited the page, and sure enough, there was one of my images, unabashedly leeched.</p>
<p>So, Point 1 is:  can anyone tell me why this particular MySpace page was able to leech the image (it was called via CSS, not by an <code>&lt;img&gt;</code> tag)?</p>
<p>Point 2 is:  I was not feeling generous this time around, so I Tubgirled the idiot.  He changed the background pretty quickly, but not before I snagged some screenshots.</p>
<p class="alert">One of the following images (&#8220;After&#8221;) contains a very graphic photograph that is Not Safe For Work, Not Suitable For Children, and as a matter of fact, not suitable for just about anyone.  I&#8217;d advise any of you not already familiar with the internet phenomenon known as &#8220;Tubgirl&#8221; to simply take my word for it and not view the image.  Viewing the image means that you forfeit the right to complain about it.</p>
<p class="center"><a  href="http://heliologue.com/img/albums/Miscellany/pre.png" title="A MySpace page which is stealing one of my images" rel="lightbox[tubgirld]">Before</a> | <a rel="lightbox[tubgirld]" href="http://heliologue.com/img/albums/Miscellany/post.png" title="A MySpace page after I changed the picture it was stealing to Tubgirl">After</a></p>
]]></content:encoded>
			<wfw:commentRss>http://heliologue.com/2006/10/03/tubgirld/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Conference: Day III</title>
		<link>http://heliologue.com/2006/06/30/the-conference-day-iii/</link>
		<comments>http://heliologue.com/2006/06/30/the-conference-day-iii/#comments</comments>
		<pubDate>Sat, 01 Jul 2006 01:47:02 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://heliologue.com/blog/2006/06/30/the-conference-day-iii/</guid>
		<description><![CDATA[A Retrospective on Cleveland qua æsthetic Cleveland is a funny place. Like Wisconsin, it&#8217;s significantly greener than Illinois, and I find myself surprisingly aflush at the sight of all the verdure, but Cleveland is like a rusted, hulking monolith overgrown by jungle. The juxtaposition is frightening: while lost, we drove along so many leafy parkways [...]]]></description>
			<content:encoded><![CDATA[<h4>A Retrospective on Cleveland qua æsthetic</h4>
<p>Cleveland is a funny place.  Like Wisconsin, it&#8217;s significantly <em>greener</em> than Illinois, and I find myself surprisingly aflush at the sight of all the verdure, but Cleveland is like a rusted, hulking monolith overgrown by jungle.  The juxtaposition is frightening:  while lost, we drove along so many leafy parkways lined with large embellished houses, but our destination was inevitably in the sprawl of the city itself, hemmed together with slummy, apartmented streets and the blackened <i>faux</i>-marble of the botanical gardens, the public library, and the enormous Presbyterian church on Euclid Ave.  One building along a main drag called Chester St. appeared to have two dark bronze statues of skeleton warriors, as though someone had stitched together twisted detritus from a plane wreck to make this thanatotic duo, their sharp ribs prominent, their wielded swords even moreso.</p>
<p>It rained all three days we were there, in random spurts of thunderstorms.  Cleveland&#8217;s drainage—at least downtown—isn&#8217;t the best, as even a relatively gentle storm left standing pools of water on the roadsides and muddy ponds in the grassy medians as late as the next morning.  I&#8217;ve already said that Cleveland is organic, but add near-constant construction and rain to the list, and the city itself is a violent storm of confusion, parkways ceding to slums, trees to effaced apartment complexes, prestigious university to vacant, overgrown gas stations.</p>
<p>I realize that I saw but a fraction of the city, but I would expect that the university-dominated section would be a thriving little community of its own.  Perhaps things are different during the school year:  I saw few college students at all;  only middle-aged conference attendees and the occasional gaggle of misguided tourists—why Cleveland?—gaping at the squalor.</p>
<h4>A Retrospective on Ben qua Conference Attendee, as Well as a Discussion of Code</h4>
<p>But enough sentiment.  My own journey to get here, in a plain grey van, speeding down I-480, was just as mixed.  I woke at 7:09 this morning and —my understanding being that only my boss and his boss were going to the presentation at 10:30—went back to bed, to be awoken exactly four hours later at 11:09 by the sound of little kids (?) playing soccer on the athletic field next door.  I was alone—all four of my companions had gone to the presentation, had even called for me through the door of my sleeping area, but to no apparent avail.  The neck-ache I awoke with had nothing on the painful feeling of being such a schlub.</p>
<p>I mentioned last night that the recurring theme of the conference was that Oracle&#8217;s portal is utter shit.  To that end, I find myself excited not by the opportunity to work with <em>it</em>, my loving ministrations being severely limited by its obstinate nature, but the opportunity to work with Tim, our DBA and resident Java guru, on his separate-but-not webpiece that will tie into the portal.  Having seen yesterday&#8217;s presentation on Web 2.0 and AJAX, he and I decided that it would be a good idea to integrate it into his webpiece.  Since the logic that drives the overhead menu requires database calls, we thought that using AJAX to load content into the specified area would reduce overhead and feel more responsive to the user, broken back-button or no.  So, during the afternoon session on Thursday, I found a little AJAX script and made a working prototype with static HTML.  Tim came back from <em>his</em> afternoon session with news of <a href="http://os3grid.sf.net">OS3Grid</a>, a Javascript-based table system that allows for dynamic reordering, editing, and effects that wouldn&#8217;t be possible in IE with pure CSS.  The only problem is that they don&#8217;t want to work together:  the function to render the grid is run on page load, which doesn&#8217;t work if you are loading the grid&#8217;s host page with AJAX.  I hacked up a fix by adding a new line to the AJAX script&#8217;s <code>pageload</code> function that reevaluates OS3Grid&#8217;s table-rendering function, forcing the grid to be rendered when the page was loaded with AJAX. The only problem is that each grid has a specific line that has to include the name of the parent <code>div</code> that hosts the rendered table, and since we&#8217;re guaranteed to have pages with multiple tables, we can&#8217;t simple hard code a standard <code>id</code> into the function and let it go.  I will need to research other methods of forcing the script to run.</p>
<p>These are both neat Javascript tricks, but the real question is how well we can get them to work with the database.  The AJAX function for navigation is entirely client-side:  there&#8217;s not yet AJAX to submit any forms or grab any data from the database—it merely calls a JSP, which in turns talks to the database.  One of the interesting features of OS3Grid, however, is the ability to edit table contents, and I&#8217;d like to make it so that an edited table cell submits—via AJAX, of course—back to the the database the changed contents.  For that, I&#8217;ll need Tim&#8217;s help in using AJAX to talk to Java to talk to the database.  It&#8217;s <em>possible</em>, of course, but my experience with Java is so limited that the slightest problem will sending me running to Google.  Still, I think that this has the potential to be a really great interface, and I really like working with Tim because he&#8217;s truly excited about what he&#8217;s doing, and he asks things of me that push my limits and force me to improve my knowledge set.</p>
]]></content:encoded>
			<wfw:commentRss>http://heliologue.com/2006/06/30/the-conference-day-iii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Conference: Day I, Pt. I</title>
		<link>http://heliologue.com/2006/06/28/the-conference-day-i-pt-i/</link>
		<comments>http://heliologue.com/2006/06/28/the-conference-day-i-pt-i/#comments</comments>
		<pubDate>Wed, 28 Jun 2006 19:15:40 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://heliologue.com/blog/2006/06/28/the-conference-day-i-pt-i/</guid>
		<description><![CDATA[I write today from the Dively Center of Case Western. I woke up at 5:45am this morning to the screech of my alarm clock, which somehow seemed even more grating than usual, having been one of the few amenities supplied by the otherwise—ahem—austere housing department here (for which see my previous post). Last night, after [...]]]></description>
			<content:encoded><![CDATA[<p>I write today from the Dively Center of Case Western.</p>
<p>I woke up at 5:45am this morning to the screech of my alarm clock, which somehow seemed even more grating than usual, having been one of the few amenities supplied by the otherwise—ahem—austere housing department here (for which see my <a href="http://heliologue.com/2006/06/27/making-a-case/">previous post</a>).  Last night, after I&#8217;d finished blogging, I realized with some degree of dread that I&#8217;d forgotten my toothbrush, having brought indeed <em>everything else</em> required for the care of my teeth except the most basic implement.  At midnight in a strange city, I had no recourse but to go to bed feeling somehow fundamentally dirty, and waking up with my teeth feeling mossy.  Today, I am told, we will having a shopping spree at Walgreens or Walmart or whatever store we can find to stock up on the essentials that we weren&#8217;t provided.  Were we in a hotel, there would at least be a vending machine with toothbrushes, but sadly the dorm we are staying at appeared entirely vacant last night except for two malcontents watching the BET Awards in the common room at a volume loud enough to pulverize concrete.</p>
<p>The &#8220;free swag&#8221; situation improved somewhat when we arrived at the Dively Center:  upon registering, one received a blue CampusEAI lanyard upon which was attached a name tag.  Ostensibly, everyone is to wear it around his or her neck during the conference, but afterwards, of course, it can be used for pretty much anything.  More importantly, our &#8220;free gift&#8221; was a <a href="http://catalog.belkin.com/IWCatProductPage.process?Merchant_Id=&#038;Product_Id=137353">Belkin 4-in-1 pen</a>, a heavy metal affair with a bright bluish reading light, a laser pointer, a ballpoint pen, and a PDA stylus in one phallic cylinder.  It requires four tiny batteries (included), but considering the number of times just today that I&#8217;ve accidentally flash the reading light or the laser, I have a sneaking suspicion that it will die within a month and I will have no desire to buy more batteries.</p>
<p>The lobby of the Dively Center was a real sight:  wall-to-wall geeks, some of them long-haired misanthropes that look like they spend most of their time in the dark using <code>vi</code>, some of them crisp-collared management types, always greying just slightly at the temple and generally looking affable, and even some women, which is a rarity at technical conferences.  I seem, as I suspected, to be the youngest person here.  No matter:  the first meeting put me in my element.</p>
<p>From 9am to 11:30am, I and a laptop:human ratio &gt;1 were regaled with advice on how to attack the Oracle portal&#8217;s styling, either using the built-in style generator (which is, if you have a speck of intelligence, obviously crap), adding extra CSS (which we already do), or use a custom renderer.  You see, Oracle&#8217;s portal allows one to customize where the content area goes, which means that I can place the portal contents within a standards-compliant template.  The bad news is that the output created by the built-in code escape <code>#content#</code> is tables nested inside of tables, nested inside of tables.  It&#8217;s enough to make you sick, and the end-user really has no control over what is outputted.  The instructor assured us that later in the afternoon, he would go over customizing the renderer that outputted said tables.</p>
<p>Another attendee, who happened to be from a British university, and thus immeasurably fun to hear speak, complained about Oracle Portal&#8217;s total lack of compatibility with anything resembling a standard.  &#8220;Good,&#8221; I thought. &#8220;Maybe I&#8217;ll get some answers.  And maybe this guy will show up again and I&#8217;ll get to hear his accent more.&#8221;</p>
<p>Lunch was buffet-style, and was actually quite good.  The chef—a trim black man with a rakishly-askew hat—announced the courses and the soups of the day, and I got lasagna and a turkey sandwich and pasta salad and cream of chicken soup and was quite stuffed.  I only had to stop eating once, when trouble back at the university forced me to whip out my laptop and troubleshoot.</p>
<p>The afternoon session was a short one, only lasting until 2pm, and was actually no help at all.  The instructor described editing the various files used for rendering, but it occurred to me <i>in medias res</i> that what I <em>want</em> to change in the portal—that is, changing the tables-in-tables-in-tables structure into a much simpler one based on flexible <code>div</code>s, ideally AJAXified ones—isn&#8217;t really possibly without a <em>lot</em> of work, because Oracle&#8217;s interface for adding portlets to a user&#8217;s page involves essentially a table-splitting mechanism, and I gather from the code that trying to change the way it&#8217;s outputting might break that.  At any rate, it&#8217;s something to look into.</p>
<p>So here I am, drinking tea and eating an apple, typing on my laptop and its persnickity wireless network card.  I relish the thought of getting a toothbrush and possibly beer.  I sort of relish the thought of sitting down and reading Rousseau&#8217;s <cite>The Social Contract</cite>.  I don&#8217;t know how in the world we&#8217;re going to stretch that out for the rest of the day.</p>
]]></content:encoded>
			<wfw:commentRss>http://heliologue.com/2006/06/28/the-conference-day-i-pt-i/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Curly Quotes</title>
		<link>http://heliologue.com/2006/03/03/curly-quotes/</link>
		<comments>http://heliologue.com/2006/03/03/curly-quotes/#comments</comments>
		<pubDate>Fri, 03 Mar 2006 18:35:08 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://heliologue.com/blog/2006/03/03/curly-quotes/</guid>
		<description><![CDATA[I&#8217;ve always been one inclined to heavily stylize my blockquotes. Some people merely indent, some change the color. Me, I apply to blockquotes the same sort of design æsthetic that I would to dropquotes, which is to visually separate and emphasize. So, I have a pleasing bluish-violet background color to it, a distinct &#60;cite&#62;. The [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always been one inclined to heavily stylize my blockquotes.  Some people merely indent, some change the color.  Me, I apply to blockquotes the same sort of design æsthetic that I would to dropquotes, which is to visually separate and emphasize.  So, I have a pleasing bluish-violet background color to it, a distinct <code>&lt;cite&gt;</code>.</p>
<p>The default blockquote style in K2 is a simple indent and a left-positioned PNG openquote.  Not only is the quote graphic kind of ugly (a not-very-stylized grey), but it seems incomplete in that it&#8217;s only an openquote, and doesn&#8217;t include a closequote.  Because it&#8217;s set as a background image, of course, we can&#8217;t have two (one for open, one for closed).</p>
<p>In my old theme, I solved this with a messy hack wherein I searched and replaced all blockquotes with a blockquote and a nested <code>div</code>.  I set the blockquote to have the openquote in the top left and the <code>div</code> to display the closequote in the bottom right.  Semantically bad, but it worked.</p>
<p>For K2, though, I wanted less cruft, but I wanted to accomplish the same basic thing.  Enter CSS and Design Meme&#8217;s <a href="http://www.designmeme.com/articles/csscurlyquotes/">Curly Quotes</a> idea.  It uses <code>:before</code> and <code>:after</code> pseudo-classes to add areas before and after the blockquote.  Then it uses the <code>content</code> attribute to add in <code>open-quote</code> and <code>close-quote</code>.  It&#8217;s an elegant solution, but it has two problems.  One:  it&#8217;s not cross-browser (IE doesn&#8217;t support pseudo-classes).  Two: even among CSS-compliant browsers, the handling of the <code>open-quote</code> and <code>close-quote</code> varies.  Obviously, I want the quotes to appear as &ldquo;&rdquo; and not &quot;&quot;.  However, only Firefox 1.5 did that:  Opera 8.52, Safari 1.3, Firefox =&lt; 1.0.7 and others all displayed &quot;.  <span id="more-1010"></span></p>
<p>So, I changed</p>
<p><code>content: open-quote | close-quote</code></p>
<p>to</p>
<p><code>content: """ | """</code></p>
<p>Still no luck.  Only Firefox 1.5 would display them correctly.  The others just gave me marks that looked more like 11s than stylized quotes.  So, I went back to my old theme, grabbed the quote images, resized them to 50px and adapted the CSS to use images instead of content.  Here&#8217;s the result:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">blockquote <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">60px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">60px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">350px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#c6c9ff</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#f0f0ff</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
blockquote<span style="color: #3333ff;">:before</span><span style="color: #00AA00;">,</span> blockquote<span style="color: #3333ff;">:after </span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#616d9f</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">900%</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>  <span style="color: #ff0000;">'Georgia'</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">'Times New Roman'</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
blockquote<span style="color: #3333ff;">:before </span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>images/quote1.png<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-repeat</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-0.55em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">60px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-50px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
blockquote<span style="color: #3333ff;">:after </span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>images/quote2.png<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-repeat</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-50px</span><span style="color: #00AA00;">;</span>   
<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">360px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
blockquote cite <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">dashed</span> <span style="color: #cc00cc;">#69c</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>The rendering is pretty good—except for IE6, which doesn&#8217;t display the images at all, but degrades pretty gracefully—<del datetime="2006-03-03T20:17:09+00:00">but I can&#8217;t for the life of me figure out why Opera pushes the open-quote so far to the right (see below).  Anyone have any ideas?</del> <ins datetime="2006-03-03T20:17:09+00:00">I was able to fix it.  For some reason, I overlooked the fact that the original curly quotes designer had used <code>em</code> width <em>only</em> for the left margin on the <code>blockquote:before</code> declaration.  When I noticed that Opera seems to handle <code>em</code> a bit differently than its peers, it clicked.</ins></p>
<div class="center">
<img src="http://heliologue.com/img/albums/blockquotes/safari132.png" alt="Blockquotes as rendered by Safari 1.3.2" /><br />
Safari 1.3.2 [OS X 10.3]</div>
<div class="center">
<img src="http://heliologue.com/img/albums/blockquotes/safari203.png" alt="Blockquotes as rendered by Safari 2.0.3" /><br />
Safari 2.0.3 [<a href="http://www.danvine.com/icapture/">iCapture</a>]</div>
<div class="center">
<img src="http://heliologue.com/img/albums/blockquotes/konqueror342.png" alt="Blockquotes as rendered by Konqueror 3.4.2" /><br />
Konqueror 3.4.2 [SuSe 10]</div>
<div class="center">
<img src="http://heliologue.com/img/albums/blockquotes/firefox107.png" alt="Blockquotes as rendered by Firefox 1.0.7" /><br />
Firefox 1.0.7 [SuSe 10]</div>
<div class="center">
<img src="http://heliologue.com/img/albums/blockquotes/firefox1501.png" alt="Blockquotes as rendered by Firefox 1.5.0.1" /><br />
Firefox 1.5.0.1 [Windows XP SP2]</div>
<div class="center">
<img src="http://heliologue.com/img/albums/blockquotes/opera852.png" alt="Blockquotes as rendered by Opera 8.5.2" /><br />
Opera 8.5.2 [Windows XP SP2]</div>
<div class="center">
<img src="http://heliologue.com/img/albums/blockquotes/ie60.png" alt="Blockquotes as rendered by Internet Explorer 6.0" /><br />
Internet Explorer 6.0 [Windows XP SP2]</div>
]]></content:encoded>
			<wfw:commentRss>http://heliologue.com/2006/03/03/curly-quotes/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

