<?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>Luke's Lot &#187; javascript</title>
	<atom:link href="http://blog.lucanos.com/category/programming/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lucanos.com</link>
	<description>A Collection of Plugins, Scripts, Tips and Tricks. As I learn, I will share, and I hope you will do the same.</description>
	<lastBuildDate>Mon, 14 Apr 2008 06:28:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Email Regular Expression</title>
		<link>http://blog.lucanos.com/2006/06/10/email-regular-expression/</link>
		<comments>http://blog.lucanos.com/2006/06/10/email-regular-expression/#comments</comments>
		<pubDate>Sat, 10 Jun 2006 03:58:42 +0000</pubDate>
		<dc:creator>Lucanos</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://blog.lucanos.com/2006/06/10/email-regular-expression/</guid>
		<description><![CDATA[I found a site which had a very good regular expression to test email addresses, at http://www.codetoad.com/asp_email_reg_exp.asp. However, one slight modification to their original test, which has been annoying me a bit as of late, is the addition of the plus symbol &#8220;+&#8221; as an acceptable character in the middle of the username section. var [...]]]></description>
			<content:encoded><![CDATA[<p>I found a site which had a very good regular expression to test email addresses, at <a href="http://www.codetoad.com/asp_email_reg_exp.asp">http://www.codetoad.com/asp_email_reg_exp.asp</a>.</p>
<p>However, one slight modification to their original test, which has been annoying me a bit as of late, is the addition of the plus symbol &#8220;+&#8221; as an acceptable character in the middle of the username section.</p>
<form><textarea cols="60" rows="3">var reEmail = new RegExp(&#8220;^[A-Z][\w\.\+\-]+[A-Z0-9]@[A-Z0-9][\w\.-]*[A-Z0-9]\.[A-Z][A-Z\.]*[A-Z]$&#8221;,&#8221;gi&#8221;); reEmail.test(&#8220;my.email@my.server.com&#8221;);</textarea></form>
<p>A terrific tool to test Regular Expressions is available at <a href="http://www.cuneytyilmaz.com/prog/jrx/">http://www.cuneytyilmaz.com/prog/jrx/</a>. Well worth a visit.</p>
<p>The reason I have been using the &#8220;+&#8221; symbol and been running into lesser validators, is because GMail allows you to tack on tags behind your username to help you sort and manage your email inbox.</p>
<p>So I can subscribe to a newsletter with the address &#8220;<strong>lucanos+newsletter@gmail.com</strong>&#8221; (as &#8220;lucanos&#8221; is my GMail username) and then setup my GMail inbox rules so those emails are handled in a specific way.</p>
<p>It&#8217;s also a good way to identify sites which are selling your address, or spamming/ all you do, if required to provide an email address, is create one in the format &#8220;<strong>GMailUsername+SiteDomain@gmail.com</strong>&#8220;. Then, if I get spam to that specific email address I know where they got it from, as the culprit&#8217;s name will be included in the destination address.</p>
<p>Pretty tricky, hey?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lucanos.com/2006/06/10/email-regular-expression/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DeviantART &#8211; Full-Viewer</title>
		<link>http://blog.lucanos.com/2006/03/25/deviantart-full-viewer/</link>
		<comments>http://blog.lucanos.com/2006/03/25/deviantart-full-viewer/#comments</comments>
		<pubDate>Sat, 25 Mar 2006 02:00:11 +0000</pubDate>
		<dc:creator>Lucanos</dc:creator>
				<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.lucanos.com/2006/04/05/deviantart-full-viewer/</guid>
		<description><![CDATA[&#8220;If you have 17 inches, why not use all of it?&#8220;™ This GreaseMonkey userscript changes all links inside DeviantART.com and DeviouslyArtistic.com so that they point at the full-resolution image, rather than at the smaller preview page. Very handy when you are looking through alot of deviantions, as it cuts your clicks down by up to [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;<em>If you have 17 inches, why not use all of it?</em>&#8220;™</p>
<p>This GreaseMonkey userscript changes all links inside <a href="http://www.deviantart.com">DeviantART.com</a> and <a href="http://www.deviouslyartistic.com">DeviouslyArtistic.com</a> so that they point at the full-resolution image, rather than at the smaller preview page. Very handy when you are looking through alot of deviantions, as it cuts your clicks down by up to 50%! I created this userscript in August 2005. It was my first userscript, and, as such, started with a very simple, very clunky, very&#8230; inefficient way to perform the required actions. This script has been updated a number of times since then, fixing little glitches here and there.</p>
<p><strong>UPDATE (2006/05/26):</strong></p>
<div style="padding-left: 3em">Apparently, the option to always view images at Full-View is available as a preference for registered users (when logged in). To set this option go to <a title="DeviantART : Settings : Browsing" href="http://my.deviantart.com/settings/#settings-browsing">Settings->Browsing</a> and it&#8217;s there on the top left side &#8220;Open Deviations&#8221; &#8211; set it to &#8220;Zoomed In&#8221;. But, for non-subscribers, this script may still prove handy. But, still, deviantART is a community which is very rewarding to be a member of, so, if you enjoy it, <a title="Join deviantART" href="http://www.deviantart.com/join/">Become A Deviant</a>!</div>
<p style="font-weight: bold">Version History:</p>
<ul>
<li><a title="Version 0.5 - CURRENT" style="font-weight: bold" href="http://greasemonkey.lucanos.com/scripts/deviantartFullViewer/v0_5/deviantartFullViewer.user.js">v0.5</a> &#8211; <em>25 March 2006</em> Resolved a glitch which was preventing the &#8220;Move to Scraps&#8221; button from working. (It only seems to like links with &#8220;*/deviation/*&#8221; in them.)</li>
<li><strike><a title="Version 0.4" href="http://greasemonkey.lucanos.com/scripts/deviantartFullViewer/v0_4/deviantartFullViewer.user.js">v0.4</a></strike> &#8211; <em>22 January 2006</em> Resolved a long-term bug, restoring expected operations to the &#8220;Zoom Out&#8221; button.</li>
<li><strike><a title="Version 0.3.2" href="http://greasemonkey.lucanos.com/scripts/deviantartFullViewer/v0_3_2/deviantartFullViewer.user.js">v0.3.2</a></strike> &#8211; <em>05 November 2005</em> (Failed) Attempt to resolve a long-term bug affecting the operations of the &#8220;Zoom Out&#8221; button.</li>
<li><strike><a href="http://greasemonkey.lucanos.com/scripts/deviantartFullViewer/v0_3_2/deviantartFullViewer.user.js">v0.3.1</a></strike> &#8211; <em>05 November 2005</em> (Failed) Attempt to resolve a long-term bug affecting the operations of the &#8220;Zoom Out&#8221; button.</li>
<li><strike><a title="Version 0.2" href="http://greasemonkey.lucanos.com/scripts/deviantartFullViewer/v0_2/deviantartFullViewer.user.js">v0.2</a></strike> &#8211; <em>05 November 2005</em> Removed a section of the script which changed the link title. (Was part of initial debugging.)</li>
<li><strike><a title="Verion 0.1" href="http://greasemonkey.lucanos.com/scripts/deviantartFullViewer/v0_1/deviantartFullViewer.user.js">v0.1</a></strike> &#8211; <em>05 August 2005</em> Initial release.</li>
</ul>
<p style="font-weight: bold">How It Does What It Does:</p>
<ol>
<li>Create an array of all links on the page, using XPath.</li>
<li>Identify the &#8220;Zoom Out&#8221; button, if present on the page</li>
<li>Evaluate each of the links in turn.</li>
<li>If the following conditions are matched, a replace is done changing &#8220;/deviation/&#8221; to &#8220;/view/&#8221; within the link&#8217;s href attribute.
<ul style="margin-top: 0px; margin-bottom: 0px; padding-bottom: 0px; padding-top: 0px">
<li>If there is no &#8220;Zoom Out&#8221; button OR the current link is not the &#8220;Zoom Out&#8221; button.</li>
<li>If the current link does not end with &#8220;/scrap&#8221;</li>
</ul>
</li>
</ol>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lucanos.com/2006/03/25/deviantart-full-viewer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DeviantART &#8211; Random Love</title>
		<link>http://blog.lucanos.com/2006/01/16/deviantart-random-love/</link>
		<comments>http://blog.lucanos.com/2006/01/16/deviantart-random-love/#comments</comments>
		<pubDate>Mon, 16 Jan 2006 02:00:58 +0000</pubDate>
		<dc:creator>Lucanos</dc:creator>
				<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.lucanos.com/2006/01/16/deviantart-random-love/</guid>
		<description><![CDATA[&#8220;Have you spread some Random Love today?&#8220;™ Share The Love! This script adds buttons directing the user to A Random Deviant and/or a A Random Deviation to the main toolbar at the top of the screen (just beside the Shop button). Version History: v0.1 &#8211; 16 January 2006 Initial release. How It Does What It [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;<em>Have you spread some Random Love today?</em>&#8220;™</p>
<p>Share The Love!<br />
This script adds buttons directing the user to <a href="http://www.deviantart.com/random/deviant">A Random Deviant</a> and/or a <a href="http://www.deviantart.com/random/deviation">A Random Deviation</a> to the main toolbar at the top of the screen (just beside the Shop button).</p>
<p style="font-weight: bold">Version History:</p>
<ul>
<li><a title="Version 0.1 - CURRENT" style="font-weight: bold" href="http://greasemonkey.lucanos.com/scripts/deviantartRandomLove/v0_1/deviantartRandomLove.user.js">v0.1</a> &#8211; <em>16 January 2006</em><br />
Initial release.</li>
</ul>
<p style="font-weight: bold">How It Does What It Does:</p>
<ol>
<li>Finds the Toolbar (using an XPath).</li>
<li>Creates the Random Buttons (including Base64 encoded icons &#8211; they&#8217;re embedded in the script)</li>
<li>Inserts them after the Shop Icon</li>
<li>Changes their titles (A workaround, still figuring the cause there&#8230;)</li>
</ol>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lucanos.com/2006/01/16/deviantart-random-love/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Will-Get Widgets &#8211; Konfabulator (Yahoo! Widgets)</title>
		<link>http://blog.lucanos.com/2005/12/16/will-get-widgets-konfabulator-yahoo-widgets/</link>
		<comments>http://blog.lucanos.com/2005/12/16/will-get-widgets-konfabulator-yahoo-widgets/#comments</comments>
		<pubDate>Fri, 16 Dec 2005 02:00:33 +0000</pubDate>
		<dc:creator>Lucanos</dc:creator>
				<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.lucanos.com/2005/12/16/will-get-widgets-konfabulator-yahoo-widgets/</guid>
		<description><![CDATA[&#8220;Who says you have to go through B to travel from A to C?&#8220;™ After enduring the less-than-perfect interface provided by the Yahoo! Widgets Repository, (which involves a redirecting page to download the widget file, which invariably redirects you to the begining of the collection after each download) for more than I could handle (5 [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;<em>Who says you have to go through <strong>B</strong> to travel from <strong>A</strong> to <strong>C</strong>?</em>&#8220;™</p>
<p>After enduring the less-than-perfect interface provided by the Yahoo! Widgets Repository, (which involves a redirecting page to download the widget file, which invariably redirects you to the begining of the collection after each download) for more than I could handle (5 minutes), I decided that a GreaseMonkey solution was warranted.</p>
<p style="font-weight: bold">Version History:</p>
<ul>
<li><a style="font-weight: bold" title="Version 0.1 - CURRENT" href="http://greasemonkey.lucanos.com/scripts/Will-GetWidget/v0_1/Will-GetWidget.user.js">v0.1</a> &#8211; <em>16 December 2005</em><br />
Initial release.</li>
</ul>
<p style="font-weight: bold">How It Does What It Does:</p>
<p style="padding-left: 35px">This script reads each of the links on any page within the Yahoo! Widgets galleryand, upon finding a link to the despised redirect page, changes it to point to the actual download page which the redirect page fires off.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lucanos.com/2005/12/16/will-get-widgets-konfabulator-yahoo-widgets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DeviantART &#8211; Print Upload v0.1</title>
		<link>http://blog.lucanos.com/2005/11/11/deviantart-print-upload-v01/</link>
		<comments>http://blog.lucanos.com/2005/11/11/deviantart-print-upload-v01/#comments</comments>
		<pubDate>Fri, 11 Nov 2005 02:00:23 +0000</pubDate>
		<dc:creator>Lucanos</dc:creator>
				<category><![CDATA[Print Upload]]></category>
		<category><![CDATA[deviantART]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.lucanos.com/2005/11/11/deviantart-print-upload-v01/</guid>
		<description><![CDATA[&#8220;Which piece of art do you want to commercialise today?&#8220;™ This GreaseMonkey userscript adds a link to your deviations (only visible to you &#8211; the deviation owner) allowing for the quick and easy, well, easier, uploading of deviations into the deviantART Store. Version History: v0.1 &#8211; 11 November 2005 Initial release. How It Does What [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;<em>Which piece of art do you want to commercialise today?</em>&#8220;™</p>
<p>This GreaseMonkey userscript adds a link to your deviations (only visible to you &#8211; the deviation owner) allowing for the quick and easy, well, easier, uploading of deviations into the deviantART Store.</p>
<p style="font-weight: bold">Version History:</p>
<ul>
<li><a title="Version 0.1 - CURRENT" style="font-weight: bold" href="http://greasemonkey.lucanos.com/scripts/deviantartPrintUpload/v0_1/deviantartPrintUpload.user.js">v0.1</a> &#8211; <em>11 November 2005</em><br />
Initial release.</li>
</ul>
<p style="font-weight: bold">How It Does What It Does:</p>
<ol>
<li>Looks for the &#8220;Send To Scraps&#8221; Button (which indicates that the shown Deviation is both yours and not (yet) a Scrap, as such it is eligible to offer via the store.</li>
<li>Checks whether the &#8220;Buy Prints&#8221; button is shown. If not then it can be assumed that you haven&#8217;t yet uploaded prints.</li>
<li>Locates the relevant section of the source code.</li>
<li>Inserts the required code to produce the button and associated &#8220;div&#8221;s.</li>
<li>Profit!</li>
</ol>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lucanos.com/2005/11/11/deviantart-print-upload-v01/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Photobucket &#8211; Customisable Thumbnail Size</title>
		<link>http://blog.lucanos.com/2005/11/08/photobucket-customisable-thumbnail-size/</link>
		<comments>http://blog.lucanos.com/2005/11/08/photobucket-customisable-thumbnail-size/#comments</comments>
		<pubDate>Tue, 08 Nov 2005 02:00:16 +0000</pubDate>
		<dc:creator>Lucanos</dc:creator>
				<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.lucanos.com/2006/04/18/photobucket-customisable-thumbnail-size/</guid>
		<description><![CDATA[This GreaseMonkey userscript allows the user to specify their own thumbnail size for Photobucket.com. NOTE: This script operates by accessing the full-resolutions of the images being processed and then squeezing them into the requested size on screen. As such this script is rather bandwidth-demanding, and is not recommended for people with bandwidth limits/slow connections. Version [...]]]></description>
			<content:encoded><![CDATA[<p>This GreaseMonkey userscript allows the user to specify their own thumbnail size for Photobucket.com.<br />
<strong>NOTE:</strong> This script operates by accessing the full-resolutions of the images being processed and then squeezing them into the requested size on screen. As such this script is rather bandwidth-demanding, and is not recommended for people with bandwidth limits/slow connections.</p>
<p style="font-weight: bold">Version History:</p>
<ul>
<li><a style="font-weight: bold" title="Version 0.1 - CURRENT" href="http://greasemonkey.lucanos.com/scripts/photobucketThumbnailResizer/v0_1/photobucketThumbnailResizer.user.js">v0.1</a> &#8211; <em>08 November 2005</em><br />
Initial release.</li>
</ul>
<p style="font-weight: bold">Configuration:</p>
<ol>
<li>In Firefox go to &#8220;<span style="font-style: italic">Tools</span>&#8220;.</li>
<li>Select &#8220;<span style="font-style: italic">Manage User Scripts</span>&#8220;.</li>
<li>Select &#8220;<span style="font-style: italic">Photobucket.com Thumbnail Resizer</span>&#8220;.</li>
<li>Click the &#8220;<span style="font-style: italic">Edit</span>&#8221; Button.<br />
Your computer will open the Userscript file using your default HTML editor.</li>
<li>In the coding find the line:<br />
&#8220;<span style="font-style: italic">var RequestedLongestEdge = &#8220;<span style="font-weight: bold">320</span>&#8220;;  // in pixels</span>&#8220;</li>
<li>Modify the number in this line (in this case <span style="font-weight: bold">320</span>) to reflect your desired length for the longest edge (this measure is in pixels).</li>
<li>Save the file.</li>
<li>Reload your Photobucket page.</li>
</ol>
<p style="font-weight: bold">How It Does What It Does:</p>
<ol>
<li>Access the Array of Images</li>
<li>Loop through them looking for images with filenames starting &#8220;th_&#8221; (which appears to be what Photobucket does to designate thumbnails</li>
<li>Remove the &#8220;th_&#8221; if present (makes the thumbnail the original file)</li>
<li>Determine the orientation of the image</li>
<li>Make the longest side (width if landscape, height if portrait) the specified length</li>
</ol>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lucanos.com/2005/11/08/photobucket-customisable-thumbnail-size/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
