<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.1.2" -->
<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/"
	>

<channel>
	<title>Web Programming Notes</title>
	<link>http://www.theredplanet.org</link>
	<description>Some information might be useful</description>
	<pubDate>Mon, 22 Dec 2008 12:32:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.2</generator>
	<language>en</language>
			<item>
		<title>TinyMCE Character Limit Example</title>
		<link>http://www.theredplanet.org/javascript/tinymce-character-limit-example</link>
		<comments>http://www.theredplanet.org/javascript/tinymce-character-limit-example#comments</comments>
		<pubDate>Mon, 22 Dec 2008 10:59:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.theredplanet.org/javascript/tinymce-character-limit-example</guid>
		<description><![CDATA[TinyMCE Character Limit Example
Below is some code illustrating how to detect a character count on a TinyMCE wysiwyg control.  Enforcing the character limit can be done in a number of ways, the most basic being an alert.  The regular expression that removes the HTML tags is optional depending on whether they are relevant in the count.
&#60;textarea style=&#8221;width: [...]]]></description>
			<content:encoded><![CDATA[<p><strong>TinyMCE Character Limit Example</strong></p>
<p>Below is some code illustrating how to detect a character count on a TinyMCE wysiwyg control.  Enforcing the character limit can be done in a number of ways, the most basic being an alert.  The regular expression that removes the HTML tags is optional depending on whether they are relevant in the count.</p>
<p>&lt;textarea style=&#8221;width: 600px;height:300px; &#8221;&gt;&lt;/textarea&gt;<br />
&lt;script&gt;<br />
function characterCount() {<br />
    var text = tinyMCE.selectedInstance.getBody().innerHTML.replace(/(&lt;([^&gt;]+)&gt;)/ig,\&#8221;\&#8221;);<br />
     if (text.length &gt; 300)<br />
     {<br />
          alert(&#8221;Character limit of 300 exceeded&#8221;);<br />
     }<br />
}<br />
&#8230;.<br />
tinyMCE.init({<br />
     theme : &#8220;advanced&#8221;,<br />
     handle_event_callback : \&#8221;characterCount\&#8221;<br />
});<br />
&#8230;.<br />
&lt;/script&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theredplanet.org/javascript/tinymce-character-limit-example/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WYMeditor Symbol Selector</title>
		<link>http://www.theredplanet.org/wymeditor/wymeditor-symbol-selector</link>
		<comments>http://www.theredplanet.org/wymeditor/wymeditor-symbol-selector#comments</comments>
		<pubDate>Wed, 23 Jan 2008 04:03:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[WYMeditor]]></category>

		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.theredplanet.org/wymeditor/wymeditor-symbol-selector</guid>
		<description><![CDATA[WYMeditor
In an effort to find a decent  web-based editor that produces valid XHTML, I stumbled across WYMeditor.  From the outset, it seems quite good offering an interface that is not completely awful to look at whilst at the same time preventing the user from messing up the HTML.
Extending WYMeditor
Compared to many web-based editors though, the features offered [...]]]></description>
			<content:encoded><![CDATA[<h2>WYMeditor</h2>
<p>In an effort to find a decent  web-based editor that produces valid XHTML, I stumbled across <a href="http://www.wymeditor.org" title="XHTML Web based Editor">WYMeditor</a>.  From the outset, it seems quite good offering an interface that is not completely awful to look at whilst at the same time preventing the user from messing up the HTML.</p>
<h2>Extending WYMeditor</h2>
<p>Compared to many web-based editors though, the features offered are fairly minimal, which I suppose is in keeping with the project&#8217;s general philosophy.  I decided to see how easy it was to extend.  In this case, I wanted to created a &#8220;symbol selector&#8221; to insert characters like pound and euro.  Not rocket science, but still a useful feature.</p>
<p>Requirements:</p>
<ol>
<li>An additional button that shows the symbol selector</li>
<li>When the user clicks a symbol, the character is inserted into the document and the symbol selector is hidden</li>
<li>Clicking again on the button hides the selector </li>
</ol>
<p>I wanted to use a popup window dialog to match the existing link and image dialogs, however these seem to be hard-coded so I bailed on that idea. Instead I opted for a hidden DIV with each symbol enclosed in a SPAN.  The extensibility offered through plugins seems good, but with only one example, I couldn&#8217;t really tell if what I wanted to do fit the &#8216;plugin&#8217; pattern.  There is an example for creating a button however, so I decided to use that.</p>
<h2>jQuery</h2>
<p>On closer inspection of the example code, I found that WYMeditor heavily relies on a JavaScript library called <a href="http://jquery.com" title="JQuery Javascript Library">JQuery</a>.  Almost like another language to begin with, I eventually found it to be intuitive to use and quite quick to implement.  Essentially it allows you to quickly resolve references to DOM nodes, then apply custom events and manipulate properties in a convienient way.</p>
<h2>The Symbol Selector</h2>
<p>See the <a href="http://www.theredplanet.org/examples/wymeditor/examples/09-symbol-selector.html" title="wymeditor extend demo">Symbol Selector Demo</a></p>
<p>I modified the button example and replaced the &#8216;postInit&#8217; function with the following:</p>
<blockquote><p>postInit: function(wym) {</p>
<p>    //construct the button&#8217;s html<br />
    var html = &#8221;&lt;li class=&#8217;wym_tools_newbutton&#8217;&gt;&#8221;<br />
             + &#8221;&lt;a name=&#8217;NewButton&#8217; href=&#8217;#'&#8221;<br />
             + &#8221; style=&#8217;background-image:&#8221;<br />
             + &#8221; url(../wymeditor/skins/default/icons.png)&#8217;&gt;&#8221;<br />
             + &#8221;Do something&#8221;<br />
             + &#8221;&lt;/a&gt;&lt;/li&gt;<br />
    <br />
    //construct the symbol selector&#8217;s html<br />
    html += &#8221;&lt;div class=&#8217;symbolSelector&#8217; style=&#8217;position: absolute;display: none;width: 100px;background:white;border:1px solid black;&#8217;&gt;&lt;span&gt;£&lt;/span&gt;&lt;span&gt;€&lt;/span&gt;&lt;/div&gt;&#8221;;</p>
<p>    //add the button to the tools box<br />
    jQuery(wym._box).find(wym._options.toolsSelector + wym._options.toolsListSelector).append(html);</p>
<p>    //Make the button show/hide the symbol selector<br />
    jQuery(wym._box).find(&#8217;li.wym_tools_newbutton a&#8217;).click(function() {<br />
        jQuery(wym._box).find(&#8217;div.symbolSelector&#8217;).toggle();<br />
        return(false);<br />
    });</p>
<p>    //Paste symbol into document when symbol clicked, then hide symbol selector<br />
    jQuery(wym._box).find(&#8217;div.symbolSelector span&#8217;).click(function() {<br />
        wym.paste(jQuery(this).text());<br />
        jQuery(wym._box).find(&#8217;div.symbolSelector&#8217;).hide(); <br />
    });<br />
}    </p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.theredplanet.org/wymeditor/wymeditor-symbol-selector/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Target = _blank .. bad etiquette?</title>
		<link>http://www.theredplanet.org/uncategorized/target-_blank-bad-etiquette</link>
		<comments>http://www.theredplanet.org/uncategorized/target-_blank-bad-etiquette#comments</comments>
		<pubDate>Thu, 10 Jan 2008 14:42:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.theredplanet.org/uncategorized/target-_blank-bad-etiquette</guid>
		<description><![CDATA[I had a suggestion from a friend to update my website to include target = _blank for outgoing links.  It kind of makes sense from a marketing point of view since the user is being kept on my site.   Personally, I know how to hold down the &#8217;shift&#8217; key when I click on a link [...]]]></description>
			<content:encoded><![CDATA[<p>I had a suggestion from a friend to update my website to include target = _blank for outgoing links.  It kind of makes sense from a marketing point of view since the user is being kept on my site.   Personally, I know how to hold down the &#8217;shift&#8217; key when I click on a link to force a new window to open, but does the target demographic know that they can do that, probably not?  Anyway, the conclusion I have come to is that to unexpectedly open a new window will possibly annoy some people and disappoint others.  Someone made a very valid point on <a href="http://forums.sixapart.com/lofiversion/index.php/t22553.html" title="Discussion about target = _blank ethics">this forum</a> being that to use target = _blank, you are not giving the user a choice.</p>
<p>I have decided to refrain from using target = _blank for the moment hoping that people at least know how to use the &#8216;back&#8217; button <img src='http://www.theredplanet.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.theredplanet.org/uncategorized/target-_blank-bad-etiquette/feed/</wfw:commentRss>
		</item>
		<item>
		<title>proftd delay problem</title>
		<link>http://www.theredplanet.org/linux/proftd-delay-problem</link>
		<comments>http://www.theredplanet.org/linux/proftd-delay-problem#comments</comments>
		<pubDate>Wed, 14 Nov 2007 11:51:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.theredplanet.org/uncategorized/proftd-delay-problem</guid>
		<description><![CDATA[After months of putting up with an annoying 2 second delay every time I accessed my Linux machine via FTP, I finally looked into the issue and found an incredibly simple solution.
Include the following line in proftpd.conf:
DelayEngine                     off
Apparently it has an inbuilt connection delay by default - for security reasons.  For now I think I [...]]]></description>
			<content:encoded><![CDATA[<p>After months of putting up with an annoying 2 second delay every time I accessed my Linux machine via FTP, I finally looked into the issue and found an incredibly simple solution.</p>
<p>Include the following line in proftpd.conf:</p>
<blockquote><p>DelayEngine                     off</p></blockquote>
<p>Apparently it has an inbuilt connection delay by default - for security reasons.  For now I think I will risk it.  Probably should be using FTP over SSH anyway..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theredplanet.org/linux/proftd-delay-problem/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JavaScript Expanding Clipped Image</title>
		<link>http://www.theredplanet.org/javascript/javascript-expanding-clipped-image</link>
		<comments>http://www.theredplanet.org/javascript/javascript-expanding-clipped-image#comments</comments>
		<pubDate>Wed, 10 Oct 2007 04:06:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.theredplanet.org/javascript/javascript-expanding-clipped-image</guid>
		<description><![CDATA[The JavaScript class ClippedImage.class.js modifies a standard &#60;IMG&#62; tag by clipping it to some specified dimensions and displaying the full image on the mouseover event.
The solution works well for single images and should degrade gracefully in unsupprted browsers. It has been tested in Firefox 2, IE6 and Opera 9.
View this example for for details on [...]]]></description>
			<content:encoded><![CDATA[<p>The JavaScript class <a href="http://www.theredplanet.org/examples/ClippedImage.class.js" title="JavaScript class to expand clipped image">ClippedImage.class.js</a> modifies a standard &lt;IMG&gt; tag by clipping it to some specified dimensions and displaying the full image on the mouseover event.</p>
<p>The solution works well for single images and should degrade gracefully in unsupprted browsers. It has been tested in Firefox 2, IE6 and Opera 9.</p>
<p>View this <a href="http://www.theredplanet.org/examples/javascript_expanding_clipped_image.html" title="Javascript Expanding Clipped Image Example">example</a> for for details on how to implement the expanding clipped image effect. Rollover the image below to see the effect in action:</p>
<script src="http://www.theredplanet.org/examples/ClippedImage.class.js"></script>
<p style="width: 90px; position: relative; height: 60px"><img width="90" src="http://www.theredplanet.org/examples/s1_a.jpg" height="60" id="your_image_id" /></p>
<script>  var yourObjectName = new ClippedImage("your_image_id", 180, 120, 90, 60);</script>
<p>I produced this in an attempt to replicate a flash style animation a client pointed out to me at: <a href="http://www.trafficbroker.co.uk/clients.php" title="Interesting flash animation using image clipping">http://www.trafficbroker.co.uk/clients.php</a></p>
<p>I was able to replicate the general &#8216;feel&#8217; of the flash version, however a <a href="http://www.quirksmode.org/bugreports/archives/2006/01/Explorer_z_index_bug.html" title="Information about the IE CSS z-index bug">css z-index</a> bug in IE thawted my attempts to correctly make a <em>table</em> of clipped images without some images appeared above others. I may at some point attempt to create a table-like layout using CSS and a single relative container which would solve this issue.</p>
<p>This is the <a href="http://www.theredplanet.org/examples/javascript_expanding_clipped_image_table.html" title="Table of exapnding clipped images"><em>table</em> attempt</a> if anyone cares to offer a solution to the IE6 zIndex bug.</p>
<p>UPDATE</p>
<p> - Managed to overcome the IE bug by setting explicitly the z-index of each clipped image&#8217;s parent element.<br />
 - This is a <a target="_blank" href="http://www.theredplanet.org/examples/javascript_expanding_clipped_image_list.html" title="CSS Clipped Expanding Image List Example">List example</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.theredplanet.org/javascript/javascript-expanding-clipped-image/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Connecting to SQL Server using the Zend Framework</title>
		<link>http://www.theredplanet.org/zend-framework/connecting-to-sql-server-using-the-zend-framework</link>
		<comments>http://www.theredplanet.org/zend-framework/connecting-to-sql-server-using-the-zend-framework#comments</comments>
		<pubDate>Tue, 25 Sep 2007 05:40:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.theredplanet.org/uncategorized/connecting-to-sql-server-using-the-zend-framework</guid>
		<description><![CDATA[There seems to be very little in the way of examples that show how to use the Zend framework to connect to a Microsoft SQL Server database, so here is what worked for me:
First up, the Zend Framework Programmer&#8217;s Reference Guide is the place to start, it talks about the Zend_Db_Adapter object that can be used [...]]]></description>
			<content:encoded><![CDATA[<p>There seems to be very little in the way of examples that show how to use the Zend framework to connect to a Microsoft SQL Server database, so here is what worked for me:</p>
<p>First up, the Zend Framework <a href="http://framework.zend.com/manual/en/zend.db.html" title="Zend Framework Programmer's Reference Guide">Programmer&#8217;s Reference Guide</a> is the place to start, it talks about the Zend_Db_Adapter object that can be used to connect to various database types.  Of course the example is for MySQL with little little mention of SQL Server except that &#8216;Pdo_Mssql&#8217; should be specified as the adapter type and that the PHP extensions &#8216;pdo&#8217; and &#8216;pdo_mssql&#8217; are required. </p>
<p><strong>Step 1 : Compiling PHP with PDO/PDO MSSQL support</strong> </p>
<p>You may need to recompile PHP with support for the forementioned extensions and install <a href="http://www.freetds.org">FreeTDS</a> (needed to connect to SQL Server):</p>
<blockquote><p>./configure &#8230; &#8211;with-pdo &#8211;with-pdo-dblib=/usr/local/freetds  &#8211;with-mssql=/usr/local/freetds &#8211;with-zlib &#8230;</p>
<p>note: The location of your FreeTDS installation may differ</p></blockquote>
<p>Once you have successfully compiled PHP (configure, make, make install etc.) then you should be able to use the Zend Framework to connect to SQL Server.</p>
<p><strong>Step 2 : Install the Zend Framework</strong></p>
<p>If you have not already done so, download and install the Zend Framework according to the install.txt file.  Just decompress the archive and ensure the framework &#8216;library&#8217; folder is part of the default PHP include directory, one place to set this is in the php.ini file.  Not sure of where your php.ini file is? Call the PHP phpinfo(); command.</p>
<p><strong>Step 3 : Setup you SQL Server database in FreeTDS</strong></p>
<p>Your FreeTDS configuration file freetds.conf stores the database connections and is usually located at /usr/local/freetds/etc/freetds.conf.  Check the FreeTDS documentation for instructions on how to define your connection.</p>
<p><strong>Step 4 : Using the Zend_Db_Adapter object to connect to SQL Server</strong></p>
<p>Use the following code: </p>
<blockquote><p>require_once &#8216;Zend/Db.php&#8217;; </p>
<p>$params = array(<br />
&#8216;host&#8217;=&gt;&#8217;HOSTNAME&#8217;,<br />
&#8216;username&#8217;=&gt;&#8217;USERNAME&#8217;,<br />
&#8216;password&#8217;=&gt;&#8217;PASSWORD&#8217;,<br />
&#8216;dbname&#8217;=&gt;&#8217;YOUR_FREETDS_DB_NAME&#8217;,<br />
&#8216;pdoType&#8217;=&gt;&#8217;dblib&#8217; //You may want to try &#8216;mssql&#8217; or &#8216;freetds&#8217; here?<br />
);</p>
<p>$db = Zend_Db::factory(&#8217;Pdo_Mssql&#8217;, $params);</p>
<p>$test = $db-&gt;fetchOne(&#8221;SELECT somefield FROM sometable&#8221;);</p>
<p>print $test;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.theredplanet.org/zend-framework/connecting-to-sql-server-using-the-zend-framework/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Javascript Text Effects</title>
		<link>http://www.theredplanet.org/javascript/javascript-text-effects</link>
		<comments>http://www.theredplanet.org/javascript/javascript-text-effects#comments</comments>
		<pubDate>Wed, 22 Aug 2007 08:48:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.theredplanet.org/javascript/javascript-text-effects</guid>
		<description><![CDATA[The JavaScript library TextEffect.class.js can be used to perform various effects on any piece of text within a document.   The 4 effects that have be implemented so far are: disperse, assemble, fade-in and fade-out.  If I can think of more I will add them.
See the example page for a detailed demonstration, or click the test button [...]]]></description>
			<content:encoded><![CDATA[<p>The JavaScript library <a href="http://www.theredplanet.org/examples/TextEffect.class.js" title="Javascript Text Effects Library">TextEffect.class.js</a> can be used to perform various effects on any piece of text within a document.   The 4 effects that have be implemented so far are: disperse, assemble, fade-in and fade-out.  If I can think of more I will add them.</p>
<p>See the <a href="http://www.theredplanet.org/examples/javascript_text_effects.html" title="Javascript Text Effects Example">example page</a> for a detailed demonstration, or click the test button below:</p>
<script src="http://www.theredplanet.org/examples/TextEffect.class.js"></script>
<p><a href="http://www.perthcomputershops.com/" style="font-weight: bold; color: red" id="testElement">Computer stores in Perth Western Australia</a></p>
<script>          var te = new TextEffect("testElement");</script>
<p><a href="javascript:void(0);" onclick="te.disperse( {steps: 10, stepDelay: 20, stepSize: 4} );" style="font-weight: bold; background: white; color: black; text-decoration: none; border: 2px outset; padding: 4px">Test Disperse Method</a> <a href="javascript:void(0);" onclick="te.assemble( );" style="font-weight: bold; background: white; color: black; text-decoration: none; border: 2px outset; padding: 4px">Test Assemble Method</a></p>
<p>Limitations:</p>
<ul>
<li>The tag containing the text cannot contain any markup</li>
<li>Starts to slow down dramatically with a large amount of text</li>
</ul>
<p>Features:</p>
<ul>
<li>Supported (tested) in IE6, Firefox2 and Opera 9</li>
<li>More than one &#8216;TextEffect&#8217; object can exist on a page without interferring with each other.</li>
<li>Code should be non-intrusive and fail gracefully.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.theredplanet.org/javascript/javascript-text-effects/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Simple Javascript Crossfade Slideshow</title>
		<link>http://www.theredplanet.org/javascript/simple-javascript-crossfade-slideshow</link>
		<comments>http://www.theredplanet.org/javascript/simple-javascript-crossfade-slideshow#comments</comments>
		<pubDate>Fri, 27 Jul 2007 14:46:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.theredplanet.org/javascript/simple-javascript-crossfade-slideshow</guid>
		<description><![CDATA[This is another javascript library.  It creates a cross fading slideshow of images from a list of IMG tags and some basic JavaScript.  The code is based on some I found elsewhere some time back.  I will give credit if I can find where!
The script has been tested in Firefox2, IE6 and Opera9.  Have a look [...]]]></description>
			<content:encoded><![CDATA[<p>This is another javascript library.  It creates a cross fading slideshow of images from a list of IMG tags and some basic JavaScript.  The code is based on some I found elsewhere some time back.  I will give credit if I can find where!<br />
The script has been tested in Firefox2, IE6 and Opera9.  Have a look at <a href="http://www.theredplanet.org/examples/javascript_fade_slideshow_example.html" title="JavaScript CrossFade Slideshow example">the example page</a>.</p>
<script src="http://www.theredplanet.org/examples/SlideShow.class.js"></script>
<p id="slideshowcontainer_a"><img src="http://www.theredplanet.org/examples/s1_a.jpg" /><img src="http://www.theredplanet.org/examples/s1_b.jpg" style="display: none" /><img src="http://www.theredplanet.org/examples/s1_c.jpg" style="display: none" /><img src="http://www.theredplanet.org/examples/s1_d.jpg" style="display: none" /></p>
<script>            var s1 = new SlideShow("slideshowcontainer_a",240,180,{});</script>
<p>The script has the following features:</p>
<ul>
<li>Multiple slideshows can co-exist on a single page</li>
<li>The implementation is accessible meaning it will still render the first image if the slideshow fails</li>
<li>The code is contained within a single object definition so it won&#8217;t interfere will any other JavaScript</li>
</ul>
<p>How to implement:</p>
<ol>
<li>Include the <a href="http://www.theredplanet.org/examples/SlideShow.class.js" title="JavaScript CrossFade Slideshow Library">SlideShow.js</a> file in the head of your document.</li>
<li>Create a list of IMG tags (you can put links around them) encased in a DIV tag.  Set the &#8216;display&#8217; style of all but the 1st image to &#8216;none&#8217;.  Give the DIV tag an id attribute. e.g.<br />
&lt;div id=&#8221;slideshowcontainer_a&#8221;&gt;<br />
   &lt;img src=&#8217;s1_a.jpg&#8217;&gt;<br />
   &lt;img src=&#8217;s1_b.jpg&#8217; style=&#8217;display:none;&#8217;&gt;<br />
   &lt;img src=&#8217;s1_c.jpg&#8217; style=&#8217;display:none;&#8217;&gt;<br />
   &lt;img src=&#8217;s1_d.jpg&#8217; style=&#8217;display:none;&#8217;&gt;<br />
  &lt;/div&gt;</li>
<li>After the DIV tag place the JavaScript code that will render the slideshow.<br />
&lt;script&gt;var s1 = new SlideShow(&#8217;slideshowcontainer_a&#8217;,240,180,{});&lt;/script&gt;<br />
The parameters are ID of DIV tag, width and height (pixels) and options.  For details of options see the <a href="http://www.theredplanet.org/examples/javascript_fade_slideshow_example.html" title="Javascript Crossfade Slideshow Example">example page</a> source.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.theredplanet.org/javascript/simple-javascript-crossfade-slideshow/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Javascript ContextMenu Script</title>
		<link>http://www.theredplanet.org/javascript/javascript-contextmenu-script</link>
		<comments>http://www.theredplanet.org/javascript/javascript-contextmenu-script#comments</comments>
		<pubDate>Fri, 27 Jul 2007 05:08:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.theredplanet.org/uncategorized/javascript-contextmenu-script</guid>
		<description><![CDATA[The ContextMenu script allows you to define a contextmenu to show when any html element is &#8216;right-clicked&#8217;.   The standard browser contextmenu is disabled, but only for the elements that trigger a custom ContextMenu.  The menu shown can differ for each element.
Please view the example.  &#8212; or &#8212; Right-click on the element below!

ul.contextMenu{border: 1px solid black;padding: 5px;margin: 0;width: [...]]]></description>
			<content:encoded><![CDATA[<p>The ContextMenu script allows you to define a contextmenu to show when any html element is &#8216;right-clicked&#8217;.   The standard browser contextmenu is disabled, but only for the elements that trigger a custom ContextMenu.  The menu shown can differ for each element.</p>
<p>Please view the <a href="http://www.theredplanet.org/examples/context_menu_example.html" title="Javascript ContextMenu Example">example</a>.  &#8212; or &#8212; Right-click on the element below!</p>
<script src="examples/ContextMenu.class.js"></script>
<style>ul.contextMenu{border: 1px solid black;padding: 5px;margin: 0;width: 200px;position: absolute;background: white;}ul.contextMenu li{list-style: none;margin: 0;padding-right: 3px;}ul.contextMenu li a{font-family: arial, sans-serif;color: black;text-decoration: none;height:100%;width: 100%;display: block;padding: 2px;}ul.contextMenu li a:hover{background: #EEEEEE;}</style>
<p style="background: #ffcc00; width: 200px" id="element1">Test element 1</p>
<ul style="display: none" id="cmenu1" class="contextMenu">
<li><a href="http://www.onthegotours.com">Onthego Tours</a></li>
<li><a href="http://www.holidayonthemenu.com">Cooking Holidays</a></li>
</ul>
<script>        var c = new ContextMenu("element1","cmenu1");</script>
<p>The functionality is:</p>
<ol>
<li>When a designated element is clicked the assigned context menu is displayed</li>
<li>When the document is clicked the context menu disappears, which is the same as the browser&#8217;s implementation.</li>
</ol>
<p>To get it working:</p>
<ol>
<li>Include the <a href="http://www.theredplanet.org/examples/ContextMenu.class.js" title="Class file for JavaScript Context Menu">ContextMenu.class.js</a> file in the HEAD of your document.</li>
<li>Create a trigger element that will fire the context menu: e.g.<br />
&lt;div id=&#8217;trigger&#8217;&gt;Right-Click Here&lt;/div&gt;</li>
<li>Create a menu to show e.g.<br />
&lt;div id=&#8217;contextMenu&#8217; style=&#8217;display: none; position: absolute;&#8217;&gt;&#8230;Menu Goes here&#8230;&lt;/div&gt;</li>
<li>Assign the &#8216;menu&#8217; to the &#8216;trigger&#8217; with a simple Javascript call.<br />
&lt;script&gt;var cm = new ContextMenu(&#8217;trigger&#8217;,'contextMenu&#8217;);&lt;/script&gt;</li>
</ol>
<p>The implementation does not rely on any additional js libraries and should not impact on any existing JavaScript code.  It &#8217;should&#8217; fail gracefully.  You can define as many instances of &#8216;ContextMenus&#8217; as you like on a single page without repeating any unnecessary code.</p>
<p>The script is based on code from various places including:</p>
<p><a href="http://simonwillison.net/2004/May/26/addLoadEvent/">http://simonwillison.net/2004/May/26/addLoadEvent/</a> : I applied a similar technique to the document.onmousedown event so that existing handlers are not overwritten.</p>
<p><a href="http://luke.breuer.com/tutorial/js_contextmenu.htm">http://luke.breuer.com/tutorial/js_contextmenu.htm</a> : The basic ideas were taken from here.</p>
<p>The script has been tested in IE6 and Firefox 2</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theredplanet.org/javascript/javascript-contextmenu-script/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Accessible Javascript News Ticker</title>
		<link>http://www.theredplanet.org/javascript/accessible-javascript-news-ticker</link>
		<comments>http://www.theredplanet.org/javascript/accessible-javascript-news-ticker#comments</comments>
		<pubDate>Thu, 26 Jul 2007 04:10:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.theredplanet.org/uncategorized/accessible-javascript-news-ticker</guid>
		<description><![CDATA[This script is based on one I found at news.bbc.co.uk.  A client pointed it out to me and wanted it on his website. 
Improvements made to original:

Simpler to implement 
Links in the ticker will be found by search engines.
Degrades gracefully
Does not rely on prototype or any other monolithic JS library.
Supports as many tickers on a page as [...]]]></description>
			<content:encoded><![CDATA[<p>This script is based on one I found at <a href="http://news.bbc.co.uk/" title="BCC News">news.bbc.co.uk</a>.  A client pointed it out to me and wanted it on his <a href="http://www.onthegotours.com/" title="Onthego Adventure and Tailormade Tours">website</a>. </p>
<p>Improvements made to original:</p>
<ul>
<li>Simpler to implement </li>
<li>Links in the ticker will be found by search engines.</li>
<li>Degrades gracefully</li>
<li>Does not rely on <a href="http://www.prototypejs.org/" title="Prototype Javascript Framework">prototype</a> or any other monolithic JS library.</li>
<li>Supports as many tickers on a page as you desire</li>
<li>Code is encapsulated into a single class so it wont interfere with any other javascript libraries you may be using.</li>
</ul>
<p>How to use it:</p>
<ol>
<li>Download <a href="http://www.theredplanet.org/examples/AccessibleTicker.class.js" title="Accessible Javascript News Ticker class file">AccessibleTicker.class.js</a></li>
<li>Link to it using standard &lt;script src=&#8221;AccessibleTicker.js&#8221; mce_src=&#8221;AccessibleTicker.js&#8221;&gt;&lt;/script&gt; tag in the head of your html document.</li>
<li>Define an empy placeholder anchor tag where the ticker will be located giving it a unique ID attribute: &lt;a id=&#8221;your_id&#8221;/&gt;</li>
<li>Define an unordered list of links &lt;ul&gt; (see below) giving the ul tag a unique ID attribute.</li>
<li>Initialize the ticker using the &lt;ul&gt; ID and the &lt;a&gt; id from steps 2 and 3.  In the <a href="http://www.theredplanet.org/examples/accessible_news_ticker.html" title="Accessible News Ticker Example">example</a> I have simply placed the initialization code below the elements themselves.  You can run it on the &#8216;onload&#8217; event if desired.</li>
</ol>
<p>Very basic Example code:</p>
<blockquote><p>&lt;a id=&#8217;test1_container&#8217; style=&#8217;display: none;&#8217;&gt;&lt;/a&gt;<br />
&lt;ul id=&#8217;test1_data&#8217;&gt;<br />
&lt;li&gt;&lt;a href=&#8217;http://google.com&#8217;&gt;Google&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8217;http://gmail.com&#8217;&gt;GMail.. web based email&lt;/a&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;script&gt;<br />
var ticker1 = new AccessibleTicker(&#8217;test1_container&#8217;, &#8216;test1_data&#8217;);<br />
&lt;/script&gt;</p></blockquote>
<p>See the <a href="http://www.theredplanet.org/examples/accessible_news_ticker.html" title="Accessible Javascript Ticker Example">example page</a> and view the source for more detail.</p>
<script type="text/javascript" src="http://www.theredplanet.org/examples/AccessibleTicker.class.js" language="JavaScript"></script>
<style>            a.ticker{font-family: verdana, sans-serif;color: #FF9900;}span.tickerHeader	{color: black;font-weight: bold;}span.tickerHeaderCustom{color: red;font-weight: bold;}</style>
<p><a style="display: none" id="test1_container" class="ticker"></a></p>
<ul id="test1_data">
<li><a href="http://www.onthegotours.com/">Onthego Tours - Tours to Egypt, Russia and More</a></li>
<li><a href="http://www.holidayonthemenu.com/">Holiday Onthemenu - Cooking Tours to Exotic Locations</a></li>
</ul>
<script>            var ticker1 = new AccessibleTicker("test1_container", "test1_data", {header: "LINKS: ", headerClass: "tickerHeaderCustom"});</script>
]]></content:encoded>
			<wfw:commentRss>http://www.theredplanet.org/javascript/accessible-javascript-news-ticker/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
