<?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>Ben Kahn &#187; html</title>
	<atom:link href="http://xkahn.zoned.net/blog/category/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://xkahn.zoned.net/blog</link>
	<description>Thoughts</description>
	<lastBuildDate>Wed, 31 Mar 2010 19:03:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Mediawiki Acronyms</title>
		<link>http://xkahn.zoned.net/blog/2010/03/31/mediawiki-acronyms/</link>
		<comments>http://xkahn.zoned.net/blog/2010/03/31/mediawiki-acronyms/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 19:03:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://xkahn.zoned.net/blog/?p=64</guid>
		<description><![CDATA[I was working on a project that used a lot acronyms and terminology that I didn&#8217;t know yet. It was making me crazy, so eventually I created a Terminology extension for media wiki. You can see a demo of it on CyanogenMod&#8217;s Wiki. And see the Terminology source page. (and contribute to it!) Anyway, hope [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on a project that used a lot acronyms and terminology that I didn&#8217;t know yet.  It was making me crazy, so eventually I created a <a href="http://www.mediawiki.org/wiki/Extension:Terminology">Terminology extension for media wiki</a>.</p>
<p>You can see a demo of it on <a href="http://wiki.cyanogenmod.com/index.php/Main_Page">CyanogenMod&#8217;s Wiki</a>. And see the <a href="http://wiki.cyanogenmod.com/index.php/Terminology">Terminology source page</a>. (and contribute to it!)</p>
<p>Anyway, hope it helps someone else.</p>
]]></content:encoded>
			<wfw:commentRss>http://xkahn.zoned.net/blog/2010/03/31/mediawiki-acronyms/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Twisty 3: Simple and lightweight Disclosure Triangles for the web</title>
		<link>http://xkahn.zoned.net/blog/2010/03/31/twisty-3-simple-and-lightweight-disclosure-triangles-for-the-web/</link>
		<comments>http://xkahn.zoned.net/blog/2010/03/31/twisty-3-simple-and-lightweight-disclosure-triangles-for-the-web/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 18:15:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://xkahn.zoned.net/blog/?p=49</guid>
		<description><![CDATA[Twisties, otherwise known as “Disclosure Triangles” are little triangles (►) that twist (▼) when clicked to hide or show content on the page. I’m working on a web page that has a lot of content, but didn’t want it all displayed all the time. I searched around for a little while trying to find a [...]]]></description>
			<content:encoded><![CDATA[<link rel="stylesheet" href="/software/twisty3/twisty.css" type="text/css" media="screen"></link>
<link rel="stylesheet" href="/software/twisty3/twisty-print.css" type="text/css" media="print"></link><script src="/software/twisty3/twisty.js" type="text/javascript"></script><script src="/software/twisty3/prototype.js" type="text/javascript"></script><script src="/software/twisty3/scriptaculous.js?load=effects" type="text/javascript"></script> Twisties, otherwise known as “Disclosure Triangles” are little triangles (►) that twist (▼) when clicked to hide or show content on the page. I’m working on a web page that has a lot of content, but didn’t want it all displayed all the time.  I searched around for a little while trying to find a nice example written by someone else, but came up empty. Probably other people thought this was too simple, or my searching skills failed me. Either way, I ended up writing this myself.  These were my requirements:</p>
<ul>
<li><strong>Cross-platform</strong>:  It should work on my cell phone, on IE6, and real web browsers</li>
<li><strong>Robust</strong>: If things go wrong, it shouldn’t break. If the user doesn’t have JavaScript enabled, it should work. No CSS? It should still work. A user script which hides or shows nodes out from under us? It should still work</li>
<li><strong>Understandable</strong>: It should be easy for web developers to understand and add to their existing pages</li>
<li><strong>Small</strong>: If this adds lots of code to a web site, it won&#8217;t be used and will slow downloads down</li>
<li><strong>Attractive</strong>: It should “feel” nice. Lots of feedback to the user, and maybe some animation if appropriate. It shouldn’t seem different from twisties the user has seen before</li>
<li><strong>Accessible</strong>: Should work with the keyboard and with the mouse; printed pages should do the right thing
</ul>
<p>First, a demo:</p>
<div style="background-color: #f0f0f0; border: 1px solid #707070; padding-left: 1em; margin: 3px;" class="collapsible"><a href="javascript:toggleTwisty('test1');">Click this title to hide and show a portion of the page <img class="twisty" src="/software/twisty3/twisty-down.gif" alt="" /></a></p>
<div id="test1">
<div>
<div class="collapsible"><a href="javascript:toggleTwisty('test2')">Don&#8217;t open me! <img class="twisty" src="/software/twisty3/twisty-down.gif" alt="" /></a></p>
<div id="test2">
<div><span style="color: red;">Hey!  I told you not to open this section!</span></div>
</p></div>
</p></div>
<p>        <img src="http://xkahn.zoned.net/media/ben-icon-128x128.png"></p>
<table border="1">
<tr>
<th>Name</th>
<th>My numbers</th>
<th>My letters</th>
</tr>
<tr>
<td>Beth</td>
<td>65, 5, 1, 6</td>
<td>y</td>
</tr>
<tr>
<td>Andy</td>
<td>21, 12</td>
<td>k,f,s</td>
</tr>
<tr>
<td>Fred</td>
<td>9</td>
<td>k</td>
</tr>
<tr>
<td>Mary</td>
<td>100,000</td>
<td>r, w, e</td>
</tr>
</table></div>
</p></div>
</div>
<p><script type="text/javascript">// <![CDATA[
    hideTwisty('test2');
// ]]&gt;</script></p>
<p>To get started, you can simply download the code:</p>
<ul>
<li>UNIX/Linux: <a href="http://xkahn.zoned.net/software/twisty3/twisty3.tar.gz">twisty3.tar.gz</a> &#8211; 30K</li>
<li>Windows: <a href="http://xkahn.zoned.net/software/twisty3/twisty3.zip">twisty3.zip</a> &#8211; 36K</li>
<li>CVS/SVN: <span style="color: grey;">Not yet available</span></li>
</ul>
<h2>Set Up</h2>
<p>If you want the <a href="http://xkahn.zoned.net/software/twisty3/twisty.html">smooth animation</a>, seen above, put the following into your <code>&lt;head&gt;</code>:</p>
<pre><code class="html">&lt;script type="text/javascript" src="twisty3/twisty.js"&gt;&lt;/script&gt;
&lt;script src="prototype.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="scriptaculous.js?load=effects" type="text/javascript"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="twisty.css" type="text/css" media="screen"&gt;&lt;/link&gt;
&lt;link rel="stylesheet" href="twisty-print.css" type="text/css" media="print"&gt;&lt;/link&gt;
</code></pre>
<p>If you want a <a href="http://xkahn.zoned.net/software/twisty3/twisty-noslide.html">smaller footprint, or don&#8217;t like the exposure animation</a>, put the following into your <code>&lt;head&gt;</code> tag instead:</p>
<pre><code class="html">&lt;script type="text/javascript" src="twisty3/twisty.js"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="twisty.css" type="text/css" media="screen"&gt;&lt;/link&gt;
&lt;link rel="stylesheet" href="twisty-print.css" type="text/css" media="print"&gt;&lt;/link&gt;
</code></pre>
<h2>Defining a section to be hidden</h2>
<p>Each section needs a unique id, a title, and the content of the section to be hidden.  Then, format that section like this:</p>
<pre><code class="html">&lt;div class="collapsible"&gt;
  &lt;a href="javascript:toggleTwisty('uniqueid');"&gt;
    The Section Title
    &lt;img class="twisty" src="twisty-down.gif"&gt;
  &lt;/a&gt;
  &lt;div id="uniqueid"&gt;
    &lt;div&gt;
      Section Content
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>
<h2>Hiding sections by default</h2>
<p>If you want a section to be hidden by default, add after the section&#8217;s &lt;div&gt;:</p>
<pre><code class="html">&lt;script type="text/javascript"&gt;
  hideTwisty('uniqueid');
&lt;script&gt;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://xkahn.zoned.net/blog/2010/03/31/twisty-3-simple-and-lightweight-disclosure-triangles-for-the-web/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HOWTO: Creating An Automated Staging Server using CVS</title>
		<link>http://xkahn.zoned.net/blog/2007/03/22/howto-creating-an-automated-staging-server-using-cvs/</link>
		<comments>http://xkahn.zoned.net/blog/2007/03/22/howto-creating-an-automated-staging-server-using-cvs/#comments</comments>
		<pubDate>Thu, 22 Mar 2007 17:33:47 +0000</pubDate>
		<dc:creator>xkahn</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://xkahn.zoned.net/blog/2007/03/22/howto-creating-an-automated-staging-server-using-cvs/</guid>
		<description><![CDATA[It&#8217;s easy to create an automated staging server for content that doesn&#8217;t need to be compiled (like most web content.) The trick is that CVS has a very flexible logging system. All you need to do is have your CVS server send an email on each check in and have the staging server take that [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s easy to create an automated staging server for content that doesn&#8217;t need to be compiled (like most web content.)  The trick is that CVS has a very flexible logging system.  All you need to do is have your CVS server send an email on each check in and have the staging server take that email and check out the files that changed.</p>
<p><a href="http://xkahn.zoned.net/blog/wp-content/uploads/2007/03/cvs-stage.png" title="CVS Automated Staging Process"></a></p>
<p style="text-align: center"><a href="http://xkahn.zoned.net/blog/wp-content/uploads/2007/03/cvs-stage.png" title="CVS Automated Staging Process"><img src="http://xkahn.zoned.net/blog/wp-content/uploads/2007/03/cvs-stage.png" title="CVS Automated Staging Process" alt="CVS Automated Staging Process" border="0" /></a></p>
<p><span id="more-14"></span>The Bonsai project helpfully <a href="http://lxr.mozilla.org/mozilla/source/webtools/bonsai/dolog.pl?raw=1" title="dolog.pl">wrote a nice perl script</a> which emails check in information in a machine readable format.  To use it:</p>
<ol>
<li> Check out the CVSROOT module on your CVS server</li>
<li>Copy the perl script into that directory</li>
<li>Add the line: <code>ALL      $CVSROOT/CVSROOT/dolog.pl -r /cvs cvs-watch@stage1.example.com</code> to <code>CVSROOT/loginfo</code>
<ol>
<li>where <code>/cvs</code> is whatever your cvs path is and <code>stage1.example.com</code> is your staging server</li>
</ol>
</li>
<li>Add the <code>dolog.pl</code> script, and check in the file and the change to <code>loginfo</code>.</li>
</ol>
<p>It&#8217;s simple to make the staging server respond to these emails.</p>
<ol>
<li>Edit your <code>/etc/aliases</code> file and add:  <code>cvs-watch:      "|cvs-robot"</code></li>
<li>Check out your CVS module in the appropriate place</li>
<li>Create <code>/etc/smrsh/cvs-robot</code></li>
</ol>
<p>So what goes in the cvs-robot script?</p>
<pre>#!/bin/shexport CVSROOT=':pserver:anonymous@cvs.example.com:/cvs'cd /var

touch /tmp/checkin-errors.log

grep 'www' | grep '. HEAD .' | cut -d" " -f3- | xargs -r cvs update -P -d &amp;&gt; /tmp/checkin-errors.log</pre>
<p>This file is only an example.  You&#8217;ll obviously have a different CVSROOT, and you&#8217;ll likely have checked out into a different place than /var.  Your module might not be &#8216;www&#8217; and your branch might not be HEAD.  Edit as appropriate.</p>
<p><strong>Bugs</strong></p>
<p>So what doesn&#8217;t work?  Well, if you add a new directory, this script fails.  I&#8217;m not sure why.  You&#8217;ll need to log onto stage1 and do an update manually to get new directories.  Luckily, adding a directory is usually rare.</p>
<p>The update is checked out using the root account.  I&#8217;m not sure what the security concerns are about doing that, and it&#8217;s possible you may have permissions issues.  You can create a simple wrapper script  that calls the real update command:</p>
<pre>#!/bin/shsudo -u apache /etc/smrsh/cvs-robot-real</pre>
]]></content:encoded>
			<wfw:commentRss>http://xkahn.zoned.net/blog/2007/03/22/howto-creating-an-automated-staging-server-using-cvs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Even more twisty HTML</title>
		<link>http://xkahn.zoned.net/blog/2007/02/28/even-more-twisty-html/</link>
		<comments>http://xkahn.zoned.net/blog/2007/02/28/even-more-twisty-html/#comments</comments>
		<pubDate>Wed, 28 Feb 2007 17:17:21 +0000</pubDate>
		<dc:creator>xkahn</dc:creator>
				<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://xkahn.zoned.net/blog/2007/02/28/even-more-twisty-html/</guid>
		<description><![CDATA[Whew! Yesterday I received a number of comments and complaints about my small twisty (disclosure triangle) library. To review: It didn&#8217;t work in Internet Explorer. (Not too surprising since I don&#8217;t have access to a Windows machine for testing.) It was a little ugly. (Okay, no one said that, but I think it was implied.) [...]]]></description>
			<content:encoded><![CDATA[<p>Whew!  Yesterday I received a number of comments and complaints about my small twisty (disclosure triangle) library.  To review:</p>
<ul>
<li>It didn&#8217;t work in Internet Explorer.  <em>(Not too surprising since I don&#8217;t have access to a Windows machine for testing.)</em></li>
<li>It was a little ugly.  <em>(Okay, no one said that, but I think it was implied.)</em></li>
<li> The hidden sections would display for a moment before being hidden.</li>
<li>It wasn&#8217;t keyboard accessible.</li>
<li>I had a typo in the script.</li>
<li>The hiding animation wasn&#8217;t the same speed as the twisty animation.</li>
</ul>
<p>So I&#8217;ve tried again with some good ideas from the <a href="http://swat.silverorange.com/demo/index.php?demo=Disclosure">SWAT tooklit</a>.  You can try the <a href="http://script.aculo.us/">script.aculo.us</a> <a href="http://xkahn.zoned.net/software/twisty2/twisty.html">animated version</a> or the <a href="http://xkahn.zoned.net/software/twisty2/twisty-noslide.html">plain non-animated version</a>.  You can also simply <a href="http://xkahn.zoned.net/software/twisty2/twisty2.tar.gz">download the whole thing as a tar file</a> to play with.</p>
<p>To use this on your own, you need to include the twisty.js file in your code:</p>
<p><code>&lt;script type="text/javascript" src="twisty.js"&gt;&lt;/script&gt;</code></p>
<p>You should also include the two external style sheets:</p>
<p><code>&lt;link rel="stylesheet" href="twisty.css" type="text/css" media="screen"&gt;&lt;/link&gt;<br />
&lt;link rel="stylesheet" href="twisty-print.css" type="text/css" media="print"&gt;&lt;/link&gt;</code></p>
<p>You no longer need any changes to your &lt;body&gt; tag.</p>
<p>To define a twisty, use this template:</p>
<p><code>&lt;div class="collapsible"&gt;&lt;a href="javascript:toggleTwisty('uniqueid');"&gt;The Section Title&lt;img class="twisty" src="twisty-down.gif"&gt;&lt;/a&gt;<br />
&lt;div id="uniqueid"&gt;<br />
&lt;div&gt;<br />
Section Content<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;</code></p>
<p>If you want the section to default to hidden, simpy add this code to the end of the above code snippet. (after the last &lt;/div&gt;)</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
hideTwisty('uniqueid');<br />
&lt;/script&gt;</code></p>
<p>Hopefully, this version works better.</p>
]]></content:encoded>
			<wfw:commentRss>http://xkahn.zoned.net/blog/2007/02/28/even-more-twisty-html/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Twisty HTML</title>
		<link>http://xkahn.zoned.net/blog/2007/02/27/twisty-html/</link>
		<comments>http://xkahn.zoned.net/blog/2007/02/27/twisty-html/#comments</comments>
		<pubDate>Tue, 27 Feb 2007 22:09:53 +0000</pubDate>
		<dc:creator>xkahn</dc:creator>
				<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://xkahn.zoned.net/blog/2007/02/27/twisty-html/</guid>
		<description><![CDATA[Edit: I&#8217;ve created an updated version of this library and described it at Even More Twisty HTML. I don&#8217;t recommend using the version described below because of the issues people have reported. Twisties, otherwise known as &#8220;Disclosure Triangles&#8221; are little triangles (►) that twist (▼) when clicked to hide or show content on the page. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Edit: </strong>I&#8217;ve created an updated version of this library and described it at <a href="http://xkahn.zoned.net/blog/2007/02/28/even-more-twisty-html/">Even More Twisty HTML</a>. I don&#8217;t recommend using the version described below because of the issues people have reported.</p>
<p>Twisties, otherwise known as &#8220;Disclosure Triangles&#8221; are little triangles (►) that twist (▼) when clicked to hide or show content on the page.  I&#8217;m working on a web page that has a lot of content, but didn&#8217;t want it all displayed all the time.</p>
<p>I searched around for a little while trying to find a nice example written by someone else, but came up empty.  Probably other people thought this was too simple, or my searching skills failed me.  Either way, I ended up writing this myself.</p>
<p>So first I came up with some requirements for myself:</p>
<ul>
<li>It needed to be robust.  If things go wrong, it shouldn&#8217;t break.  If the user doesn&#8217;t have JavaScript enabled, it should work.  No CSS?  It should still work.  A user script which hides or shows nodes out from under us?  It should still work.</li>
<li>It should be small, and run quickly.</li>
<li>It should be easy for web developers to understand.</li>
<li>It should &#8220;feel&#8221; nice.  Lots of feedback to the user, and maybe some animation if appropriate.  It shouldn&#8217;t seem different from twisties the user has seen before.</li>
<li>It should be extensible so others can do things with it I hadn&#8217;t imagined.</li>
</ul>
<p>I have two results.  One uses <a href="http://script.aculo.us/downloads">script.aculo.us</a> to show <a href="http://xkahn.zoned.net/software/twisty/twisty.html">smooth animations</a>, and the <a href="http://xkahn.zoned.net/software/twisty/twisty-noslide.html">other doesn&#8217;t</a>.  In both cases, the underlying code is the same.  My twisty library checks to see if script.aculo.us is available.  If it is, you&#8217;ll see animations.  If it isn&#8217;t, you won&#8217;t.</p>
<p>So how do you use it?</p>
<p>First, you need to download <a href="http://http://xkahn.zoned.net/software/twisty/twisty.js">twisty.js</a> and the four twisty images: <a href="http://http://xkahn.zoned.net/software/twisty/twisty-hidden.gif">hidden</a>, <a href="http://xkahn.zoned.net/software/twisty/twisty-down.gif">down</a>, the <a href="http://xkahn.zoned.net/software/twisty/twisty-do-hidden.gif">hidden animation</a>, and  the <a href="http://xkahn.zoned.net/software/twisty/twisty-do-down.gif">down animation</a>.  Save them into the same directory as your web page.</p>
<p>Next, in your page header, include the following to load the javascript:</p>
<p><code>&lt;script type="text/javascript" src="twisty.js"&gt;&lt;/script&gt;</code></p>
<p>If you want animations, you need to download and include the script.aculo.us scripts too.</p>
<p>In your stylsheet, you should include:<br />
<code><br />
.twisty:hover {<br />
background-color: #f0f0f0;<br />
border: 1px solid #e0e0e0;<br />
margin-left: -1px;<br />
}<br />
.twisty {<br />
cursor: hand;<br />
cursor: pointer;<br />
}<br />
</code></p>
<p>To make sure you get a nice mouse cursor over a twisty, and also the image highlights nicely when you hover over it.</p>
<p>Next, you need to initialize the twisties in your &lt;body&gt; tag.  This is only needed if you want to support users not using Javascript and want to have blocks that are hidden by default.</p>
<p><code>&lt;body onload="initTwisty();"&gt;<br />
</code></p>
<p>To create a twisty, you need to put the whole thing inside a &lt;div&gt;, Add a label, the image with a class of twisty, reference the correct twisty image (either twisty-down.gif or twisty-hidden.gif), and an onclick handler referencing a unique id.  Then put a &lt;div&gt; with a class of collapsible and the id you chose before in the onclick handler.  Inside that put another div.  (This last div is needed by script.aculo.us for some reason.)</p>
<p><code>&lt;div&gt;Some Label &lt;img class="twisty" src="twisty-down.gif" onclick="toggleTwisty('childid'); return false;"&gt;<br />
&lt;div class="collapsible" id="childid"&gt;<br />
&lt;div&gt;Some content&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;</code></p>
<p>Let me know if you can think of anything to improve this widget, or it&#8217;s description.</p>
]]></content:encoded>
			<wfw:commentRss>http://xkahn.zoned.net/blog/2007/02/27/twisty-html/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
