<?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>Plan Zero Blog &#187; Code</title>
	<atom:link href="http://blog.planzero.org/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.planzero.org</link>
	<description>Mind dump</description>
	<lastBuildDate>Sat, 05 Sep 2009 17:29:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JavaScript Luhn modulus implementation</title>
		<link>http://blog.planzero.org/2009/08/javascript-luhn-modulus-implementation/</link>
		<comments>http://blog.planzero.org/2009/08/javascript-luhn-modulus-implementation/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 21:43:01 +0000</pubDate>
		<dc:creator>Plan Zero</dc:creator>
				<category><![CDATA[Code Snippets]]></category>

		<guid isPermaLink="false">http://blog.planzero.org/?p=267</guid>
		<description><![CDATA[<p>The following luhn_check() function is a small JavaScript function which checks whether a number is a valid based on the Luhn algoritm. One common example of use is with credit and debit card numbers. This function may be used to check for valid credit card numbers, however additional checks may be desired, such as card prefix and length checks.</p>
<p>There&#8217;s a&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>The following luhn_check() function is a small JavaScript function which checks whether a number is a valid based on the Luhn algoritm. One common example of use is with credit and debit card numbers. This function may be used to check for valid credit card numbers, however additional checks may be desired, such as card prefix and length checks.</p>
<p>There&#8217;s a <a href="http://planzero.org/bits/example_luhn_check">working example</a> of this function to give you more of an idea of how it works!
<pre></pre>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/* Luhn algorithm number checker - (c) 2005-2009 - planzero.org            *
 * This code has been released into the public domain, however please      *
 * give credit to the original author where possible.                      */</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> luhn_check<span style="color: #009900;">&#40;</span>number<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">//&lt;![CDATA[</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">// Strip any non-digits (useful for credit card numbers with spaces and hyphens)</span>
  <span style="color: #003366; font-weight: bold;">var</span> number<span style="color: #339933;">=</span>number.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\D/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">// Set the string length and parity</span>
  <span style="color: #003366; font-weight: bold;">var</span> number_length<span style="color: #339933;">=</span>number.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> parity<span style="color: #339933;">=</span>number_length <span style="color: #339933;">%</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">// Loop through each digit and do the maths</span>
  <span style="color: #003366; font-weight: bold;">var</span> total<span style="color: #339933;">=</span><span style="color: #CC0000;">0</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> number_length<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> digit<span style="color: #339933;">=</span>number.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">// Multiply alternate digits by two</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">%</span> <span style="color: #CC0000;">2</span> <span style="color: #339933;">==</span> parity<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      digit<span style="color: #339933;">=</span>digit <span style="color: #339933;">*</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
      <span style="color: #006600; font-style: italic;">// If the sum is two digits, add them together (in effect)</span>
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>digit <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">9</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        digit<span style="color: #339933;">=</span>digit <span style="color: #339933;">-</span> <span style="color: #CC0000;">9</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #006600; font-style: italic;">// Total up the digits</span>
    total <span style="color: #339933;">=</span> total <span style="color: #339933;">+</span> parseInt<span style="color: #009900;">&#40;</span>digit<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">// If the total mod 10 equals 0, the number is valid</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>total <span style="color: #339933;">%</span> <span style="color: #CC0000;">10</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</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>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//]]&gt;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.planzero.org/2009/08/javascript-luhn-modulus-implementation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PHP Luhn modulus implementation</title>
		<link>http://blog.planzero.org/2009/08/luhn-modulus-implementation-php/</link>
		<comments>http://blog.planzero.org/2009/08/luhn-modulus-implementation-php/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 21:28:51 +0000</pubDate>
		<dc:creator>Plan Zero</dc:creator>
				<category><![CDATA[Code Snippets]]></category>

		<guid isPermaLink="false">http://blog.planzero.org/?p=250</guid>
		<description><![CDATA[<p>The following <code>luhn_check()</code> function is a small PHP function which checks whether a number is a valid based on the <a href="http://en.wikipedia.org/wiki/Luhn_algorithm">Luhn algorithm</a>. One common example of use is with credit and debit card numbers. This function may be used to check for valid credit card numbers, however additional checks may be desired, such as card prefix and length checks.
<pre></pre>

<pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&#60;?php</span>
<span style="color: #666666; font-style: italic;">/* Luhn&#8230;</span></pre></p>]]></description>
			<content:encoded><![CDATA[<p>The following <code>luhn_check()</code> function is a small PHP function which checks whether a number is a valid based on the <a href="http://en.wikipedia.org/wiki/Luhn_algorithm">Luhn algorithm</a>. One common example of use is with credit and debit card numbers. This function may be used to check for valid credit card numbers, however additional checks may be desired, such as card prefix and length checks.
<pre></pre>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/* Luhn algorithm number checker - (c) 2005-2008 - planzero.org            *
 * This code has been released into the public domain, however please      *
 * give credit to the original author where possible.                      */</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> luhn_check<span style="color: #009900;">&#40;</span><span style="color: #000088;">$number</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Strip any non-digits (useful for credit card numbers with spaces and hyphens)</span>
  <span style="color: #000088;">$number</span><span style="color: #339933;">=</span><span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\D/'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$number</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Set the string length and parity</span>
  <span style="color: #000088;">$number_length</span><span style="color: #339933;">=</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$number</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$parity</span><span style="color: #339933;">=</span><span style="color: #000088;">$number_length</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Loop through each digit and do the maths</span>
  <span style="color: #000088;">$total</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$number_length</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$digit</span><span style="color: #339933;">=</span><span style="color: #000088;">$number</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Multiply alternate digits by two</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$parity</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$digit</span><span style="color: #339933;">*=</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
      <span style="color: #666666; font-style: italic;">// If the sum is two digits, add them together (in effect)</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$digit</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">9</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$digit</span><span style="color: #339933;">-=</span><span style="color: #cc66cc;">9</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #666666; font-style: italic;">// Total up the digits</span>
    <span style="color: #000088;">$total</span><span style="color: #339933;">+=</span><span style="color: #000088;">$digit</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// If the total mod 10 equals 0, the number is valid</span>
  <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$total</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">10</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900; font-weight: bold;">TRUE</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.planzero.org/2009/08/luhn-modulus-implementation-php/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>BBEditor, the free BBCode editor</title>
		<link>http://blog.planzero.org/2008/12/bbeditor-the-free-bbcode-editor/</link>
		<comments>http://blog.planzero.org/2008/12/bbeditor-the-free-bbcode-editor/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 13:23:41 +0000</pubDate>
		<dc:creator>Plan Zero</dc:creator>
				<category><![CDATA[Code Projects]]></category>

		<guid isPermaLink="false">http://blog.planzero.org/?p=45</guid>
		<description><![CDATA[<p>Well, I said that I&#8217;d be using this blog to publish code, so here&#8217;s my latest little project.</p>
<p>BBEditor is a <a href="http://en.wikipedia.org/wiki/MIT_License">free</a> BBCode editor written in JavaScript for HTML/PHP. It&#8217;s standards compliant, and really is rather sexy.</p>
<h3>

<dl id="attachment_89" class="wp-caption alignnone" style="width: 310px;">
<dt class="wp-caption-dt"><img class="size-full wp-image-89" title="BBEditor edit bar" src="http://blog.planzero.org/wp-content/uploads/2008/12/bbeditor_bbebar_300x30.png" alt="BBEditor edit bar" width="300" height="30" /></dt>
</dl>

</h3>
<h3>Features:</h3>
<ul>
<li>Easy to integrate</li>
<li>Cross-browser compliant</li>
<li>Degrades wonderfully in old or non-compliant browsers</li>
<li>Sleek code &#8211; fast loading, no bulk, no mess</li>
<li>Easy to style to your needs</li>
<li>Adding additional buttons and&#8230;</li></ul>]]></description>
			<content:encoded><![CDATA[<p>Well, I said that I&#8217;d be using this blog to publish code, so here&#8217;s my latest little project.</p>
<p>BBEditor is a <a href="http://en.wikipedia.org/wiki/MIT_License">free</a> BBCode editor written in JavaScript for HTML/PHP. It&#8217;s standards compliant, and really is rather sexy.</p>
<h3>
<div class="mceTemp">
<dl id="attachment_89" class="wp-caption alignnone" style="width: 310px;">
<dt class="wp-caption-dt"><img class="size-full wp-image-89" title="BBEditor edit bar" src="http://blog.planzero.org/wp-content/uploads/2008/12/bbeditor_bbebar_300x30.png" alt="BBEditor edit bar" width="300" height="30" /></dt>
</dl>
</div>
</h3>
<h3>Features:</h3>
<ul>
<li>Easy to integrate</li>
<li>Cross-browser compliant</li>
<li>Degrades wonderfully in old or non-compliant browsers</li>
<li>Sleek code &#8211; fast loading, no bulk, no mess</li>
<li>Easy to style to your needs</li>
<li>Adding additional buttons and functionality is a sinch!</li>
</ul>
<p>Got you curious? Try the <a href="http://planzero.org/bits/bbeditor_demo/">basic demonstration</a> that comes with BBEditor!</p>
<h3>Download</h3>
<p>Current version: <a title="Download BBEditor" href="http://planzero.org/bits/bbeditor_20081218.tar.bz2">BBEditor v0.1</a></p>
<h3>Integration</h3>
<p>You&#8217;ll like this.</p>
<ol>
<li>Download and extract BBEditor</li>
<li> Add the following two lines to the &lt;head&gt; section of your page:
<pre lang="html" id="line1">&lt;<span class="start-tag">link</span><span class="attribute-name"> href</span>=<span class="attribute-value">"bbeditor.css" </span><span class="attribute-name">rel</span>=<span class="attribute-value">"stylesheet" </span><span class="attribute-name">type</span>=<span class="attribute-value">"text/css" </span><span class="error"><span class="attribute-name">/</span></span>&gt;
&lt;<span class="start-tag">script</span><span class="attribute-name"> src</span>=<span class="attribute-value">"bbeditor.js" </span><span class="attribute-name">type</span>=<span class="attribute-value">"text/javascript"</span>&gt;&lt;/<span class="end-tag">script</span>&gt;</pre>
</li>
<li>Add <em>class=&#8221;bbeditor&#8221;</em> to any &lt;textarea&gt; that uses BBCode</li>
</ol>
<p>Yup, that&#8217;s all there is to it. Simple.</p>
<h3>Customisation</h3>
<p>Customising BBEditor is fairly easy. To <strong>edit the styles</strong> associated with the BBEditor bar, you can edit <em>bbeditor.css</em>. The main bar uses a class named <em>bbebar</em>. To keep things simple, you may want to add the contents of <em>bbeditor.css</em> to your main style sheet. This will also cut down on browser traffic.</p>
<p>To <strong>add your own buttons and functionality</strong> to BBEditor, you&#8217;ll have to have a little JavaScript knowhow. You&#8217;ll find that <em>bbeditor.js</em> has a compressed chunk of code at the top; skip this and go to the bottom of the file. This is where the fun stuff is.</p>
<p>The buttons are defined in a <em>Hash</em>, so to make changes locate and alter the following code (this should be fairly self explanatory, so I won&#8217;t go into detail):</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Buttons definitions!</span>
bbeButtons<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> Hash<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  bold<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Hash<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    title<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Embolden Text'</span><span style="color: #339933;">,</span>
    icon<span style="color: #339933;">:</span> bbeSettings.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'imageBase'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'text_bold.png'</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
  italic<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Hash<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    title<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Italicise Text'</span><span style="color: #339933;">,</span>
    icon<span style="color: #339933;">:</span> bbeSettings.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'imageBase'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'text_italic.png'</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>The function to be performed is defined by the target link associated with each button.  This is defined in the <em>bbeButtons</em> hash, so in the above code, <em>italic</em> and <em>bold</em> are the link targets. To add new functionality, add the relevant link target to the <em>switch() </em>statement in the <em>bbeAction()</em> function:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Perform an action, determined by the href of the followed link</span>
<span style="color: #003366; font-weight: bold;">function</span> bbeAction<span style="color: #009900;">&#40;</span>el<span style="color: #339933;">,</span> et<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
...
  <span style="color: #000066; font-weight: bold;">switch</span><span style="color: #009900;">&#40;</span>action<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'#bold'</span><span style="color: #339933;">:</span>
      et.<span style="color: #660066;">insertAroundCursor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'before'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'[b]'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'after'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'[/b]'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'#italic'</span><span style="color: #339933;">:</span>
      et.<span style="color: #660066;">insertAroundCursor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'before'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'[i]'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'after'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'[/i]'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
...
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h3>FAQ</h3>
<p><span style="color: #ff6600;"><strong>Why did you write BBEditor when there are other similar tools?</strong></span></p>
<p>When I was looking for a simple BBCode editor, I found so much messy code that I got fed up and decided to take the time to write my own. Many of the existing editors wouldn&#8217;t create a text input box at all if JavaScript was disabled, or were slow and clunky to use. BBEditor is light, and degrades well. If a user doesn&#8217;t have JavaScript, the input box is still usable without the editing bar.</p>
<p><span style="color: #ff6600;"><strong>My images aren&#8217;t loading! Help!</strong></span></p>
<p>If you have moved the location of the script or the images, the images may not load. Don&#8217;t panic! You can set the base location for the images in <em>bbeditor.js</em>. Just update the <em>imageBase</em> setting in the following block of code:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// General settings</span>
bbeSettings<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> Hash<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  position<span style="color: #339933;">:</span> <span style="color: #3366CC;">'before'</span><span style="color: #339933;">,</span>
  imageBase<span style="color: #339933;">:</span> <span style="color: #3366CC;">'icons/'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span style="color: #ff6600;"><strong>Where did you get those great icons, anyway?</strong></span></p>
<p>I have used the fantastic free <a href="http://www.famfamfam.com/lab/icons/silk/" target="_blank">Silk icon set</a>. If you want to add some buttons, I couldn&#8217;t recommend this set of icons enough.</p>
<p><strong><span style="color: #ff6600;">What technology does BBEditor use?</span></strong></p>
<p>BBEditor uses DOM-compliant JavaScript. For compatibility and efficiency reasons I have used code from the <a href="http://mootools.net/" target="_blank">mootools</a> library complimented by the <a href="http://www.clientcide.com/wiki/cnet-libraries/" target="_blank">Clientcide</a> extension for accessing forms. This is all included in <em>bbeditor.js</em>.</p>
<p><span style="color: #ff6600;"><strong>How much does this all cost?</strong></span></p>
<p>Nothing! This is free, open source software, released under the <a href="http://en.wikipedia.org/wiki/MIT_License" target="_blank">MIT License</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.planzero.org/2008/12/bbeditor-the-free-bbcode-editor/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>
