<?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>The JavaScript Blog &#187; Extensions</title>
	<atom:link href="http://thejavascriptblog.com/category/extensions/feed/" rel="self" type="application/rss+xml" />
	<link>http://thejavascriptblog.com</link>
	<description>Everything JavaScript</description>
	<lastBuildDate>Sat, 09 Jul 2011 19:16:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>When Percents Just Don&#8217;t Cut It</title>
		<link>http://thejavascriptblog.com/when-percents-just-dont-cut-it/</link>
		<comments>http://thejavascriptblog.com/when-percents-just-dont-cut-it/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 16:46:57 +0000</pubDate>
		<dc:creator>Merrick Christensen</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://thejavascriptblog.com/?p=105</guid>
		<description><![CDATA[The Code $.fn.fill = function(options){ var settings, container, el, calculateHeight, calculateWidth; settings = { fill: window, margins: { x: 0, y: 0 } }; if(options){ $.extend(settings, options); } container = $(settings.fill); el = $(this); calculateWidth = function(){ return (container.width() - settings.margins.x); }; calculateHeight = function(){ return (container.height() - settings.margins.y); } el.css({ width: calculateWidth(), height: calculateHeight() [...]]]></description>
			<content:encoded><![CDATA[<h2>The Code</h2>
<pre>
$.fn.fill = function(options){
	var settings, container, el, calculateHeight, calculateWidth;

	settings = {
		fill: window,
		margins: {
			x: 0,
			y: 0
		}
	};

	if(options){
		$.extend(settings, options);
	}

	container = $(settings.fill);
	el = $(this);

	calculateWidth = function(){
		return (container.width() - settings.margins.x);
	};

	calculateHeight = function(){
		return (container.height() - settings.margins.y);
	}

	el.css({
		width: calculateWidth(),
		height: calculateHeight()
	});

	container.resize(function(){
	       el.css({
	       width: calculateWidth(),
	       height: calculateHeight()
		});

	});
};
</pre>
<h2>Usage</h2>
<pre>
$('#dashboard').fill({
	margins : {
		x: (80 + $('#sidebar').width()),
		y: 100
	}
});
</pre>
<p>This snippet fills the entire window with the dashboard minus the sidebar and 100 pixel padding on the y axis.</p>
]]></content:encoded>
			<wfw:commentRss>http://thejavascriptblog.com/when-percents-just-dont-cut-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grid Bookmarklets</title>
		<link>http://thejavascriptblog.com/grid-bookmarklets/</link>
		<comments>http://thejavascriptblog.com/grid-bookmarklets/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 22:29:55 +0000</pubDate>
		<dc:creator>Merrick Christensen</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://thejavascriptblog.com/?p=90</guid>
		<description><![CDATA[This morning I was seeking after a sweet bookmarklet to overlay a grid to the current website. Andy Budd had a pretty cool one but there was no way to turn it off, also the image was a little busy. So with the help of Jacob O&#8217;Neal for the images I created a modified version [...]]]></description>
			<content:encoded><![CDATA[<p>This morning I was seeking after a sweet bookmarklet to overlay a grid to the current website. Andy Budd had a pretty cool <a href="http://www.andybudd.com/archives/2006/07/layout_grid_bookmarklet/">one</a> but there was no way to turn it off, also the image was a little busy.</p>
<p>So with the help of <a href="http://jacoboneal.com/">Jacob O&#8217;Neal</a> for the images I created a modified version of Andy Budd&#8217;s bookmarklet. You can now turn off the grid by pressing &#8220;G&#8221;. There is also a white and black version available.</p>
<p>The solid lines represent every 100 pixels. The dotted lines represent every 10 pixels.</p>
<p>To install just drag the below links into your bookmarks bar.</p>
<p><a href="javascript:void(myDiv=document.createElement('div'));void(myBody=document.getElementsByTagName('body'));void(myDiv.style.background='url(http://www.thejavascriptblog.com/public/grid-overlay-white.png)');void(myDiv.style.position='fixed');void(myDiv.style.width='100%');void(myDiv.style.height='100%');void(myDiv.style.top='0');void(myDiv.style.left='0');void(myDiv.style.display='block');void(document.body.appendChild(myDiv));window.addEventListener('keypress',%20function(e){if(e.keyCode%20==%20103){if(myDiv.style.display%20==%20'block'){myDiv.style.display='none';}else{myDiv.style.display='block';}}},%20false);">White Grid</a> <a href="javascript:void(myDiv=document.createElement('div'));void(myBody=document.getElementsByTagName('body'));void(myDiv.style.background='url(http://www.thejavascriptblog.com/public/grid-overlay-black.png)');void(myDiv.style.position='fixed');void(myDiv.style.width='100%');void(myDiv.style.height='100%');void(myDiv.style.top='0');void(myDiv.style.left='0');void(myDiv.style.display='block');void(document.body.appendChild(myDiv));window.addEventListener('keypress',%20function(e){if(e.keyCode%20==%20103){if(myDiv.style.display%20==%20'block'){myDiv.style.display='none';}else{myDiv.style.display='block';}}},%20false);">Black Grid</a></p>
<p>Note: Due to an immense amount of laziness the toggling is only supported in Webkit.</p>
]]></content:encoded>
			<wfw:commentRss>http://thejavascriptblog.com/grid-bookmarklets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Confirmootion &#8211; MooTools Class For HTML5 &#8211; Rails 3 Inspired Confirmations</title>
		<link>http://thejavascriptblog.com/confirmootion-mootools-class-for-html5-rails-3-inspired-confirmations/</link>
		<comments>http://thejavascriptblog.com/confirmootion-mootools-class-for-html5-rails-3-inspired-confirmations/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 22:56:42 +0000</pubDate>
		<dc:creator>Merrick Christensen</dc:creator>
				<category><![CDATA[Classes]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://thejavascriptblog.com/?p=79</guid>
		<description><![CDATA[With Rails 3 Comes The End Of Obtrusive JavaScript (please!) Ruby on Rails 3 makes huge use of custom attributes using the data-* from the HTML 5 spec. This is a miniature class that will grab all anchor tags with &#8220;data-confirm&#8221;, pull that attributes value and stop the default event from firing till after they [...]]]></description>
			<content:encoded><![CDATA[<h2>With Rails 3 Comes The End Of Obtrusive JavaScript (please!)</h2>
<p><a href="http://rubyonrails.org">Ruby on Rails 3</a> makes huge use of custom attributes using the data-* from the HTML 5 spec. This is a miniature class that will grab all anchor tags with &#8220;data-confirm&#8221;, pull that attributes value and stop the default event from firing till after they click &#8220;Ok&#8221;. If they click &#8220;Cancel&#8221; nothing happens.</p>
<p>John Resig has great post on these custom attributes. You can find it on his blog <a href="http://ejohn.org/blog/html-5-data-attributes/">here</a>.</p>
<h2>Usage</h2>
<h3>JavaScript</h3>
<pre>
var confirmations = new Confirmootion({
     attribute: 'data-confirm'
});
</pre>
<h3>HTML</h3>
<pre>
<a href="http://google.com" data-confirm="You sure you want to hit up Google?">Google</a>
</pre>
<h2>Demo and Download</h2>
<p><a href="http://thejavascriptblog.com/demos/confirmootion/">View Online Here</a><br />
<a href="http://thejavascriptblog.com/demos/confirmootion/downloads/Confirmootion.zip">Download Here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://thejavascriptblog.com/confirmootion-mootools-class-for-html5-rails-3-inspired-confirmations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MooTools Grapher Class</title>
		<link>http://thejavascriptblog.com/mootools-grapher-class/</link>
		<comments>http://thejavascriptblog.com/mootools-grapher-class/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 20:50:42 +0000</pubDate>
		<dc:creator>Merrick Christensen</dc:creator>
				<category><![CDATA[Classes]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[graph]]></category>

		<guid isPermaLink="false">http://thejavascriptblog.com/?p=58</guid>
		<description><![CDATA[Let it be known. This class doesn&#8217;t have a lot of options but it is fairly dynamic. If people actually use this class I will make it more customizable to the options and not just the class itself. While this is nothing special and there are plenty of great MooTools graphing systems out there I [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Let it be known. This class doesn&#8217;t have a lot of options but it is fairly dynamic. If people actually use this class I will make it more customizable to the options and not just the class itself.</p></blockquote>
<p>While this is nothing special and there are plenty of great MooTools graphing systems out there I wanted to build one that animated up and down as well as side to side. I&#8217;m sure there are others that do this but I was curious to learn how and dove in. Any advice, tips, improvements, or feedback is greatly appreciated.</p>
<h2>Usage</h2>
<h3>JavaScript</h3>
<pre>
var myGraph = new Grapher('element_id',{
	json : 'json.php',
	total : '100'
});
</pre>
<h3>JSON</h3>
<p>The JSON productivity number in this case is based on 100 but this class will support any value. When you initiate your graph you set the total option to calculate the percentage. If you are just comparing to other employees you would take the top sells man and calculate the percentage on a bell curve. </p>
<pre>
{"graph": [ { "name" : "insert name", "key" : "1", "productivity" : "92" } ] }
</pre>
<h3>CSS</h3>
<p>The element container that you pass into the initiating function of this graph will be the total set width for the bars at 100%. Make sure you keep that in mind.</p>
<pre>
.graph{
	/* This contains everything in a particular object. The name, and the bar.*/
}

.graph_bar{
	/* This is the actual bar the width changes based on the JSON calculated percentage. You need a background image or color to show the bar as well as a height. */
}

.label{
        /* This is just the place the name is inserted. */
}
</pre>
<h2>Demo and Download</h2>
<blockquote><p>Please wait at least 5 seconds to see the graph refresh and animate. These numbers are being dynamically created via PHP into a JSON file.</p></blockquote>
<p>You can see it in action <a href="http://thejavascriptblog.com/demos/grapher/" target="_blank">here</a>.<br />
Download a zip <a href="http://thejavascriptblog.com/demos/grapher/downloads/grapher.zip" target="_blank">here</a>.</p>
<h2>Credits</h2>
<p>Big thanks to these guys:</p>
<ul>
<li><a href="http://gabebarrientos.com">Gabe Barrientos</a> &#8211; Original Idea</li>
<li><a href="http://davidwalsh.name">David Walsh</a> &#8211; Converting percentage to pixels. </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://thejavascriptblog.com/mootools-grapher-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MooTools Multiple Links Class</title>
		<link>http://thejavascriptblog.com/mootools-multiple-links-class/</link>
		<comments>http://thejavascriptblog.com/mootools-multiple-links-class/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 22:39:48 +0000</pubDate>
		<dc:creator>Merrick Christensen</dc:creator>
				<category><![CDATA[Classes]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://thejavascriptblog.com/?p=51</guid>
		<description><![CDATA[This is a concept based on the idea that maybe you want a link to go to more then one place. Multiple links if you will. For Example: A company has a page full of images of employees that work for them with links to their Facebook accounts or personal websites. What if I&#8217;m not [...]]]></description>
			<content:encoded><![CDATA[<p>This is a concept based on the idea that maybe you want a link to go to more then one place. Multiple links if you will. </p>
<p>For Example: A company has a page full of images of employees that work for them with links to their Facebook accounts or personal websites. What if I&#8217;m not a member of Facebook? What if I prefer following them on Twitter? Or maybe I want all of those options. Well this is where my idea came into play. It works like a right-click menu (sort of). When you click the image a styled menu appears with all of the links available. If you leave the menu fades out and lets you continue browsing as normal. This is completely customizable and style able so please feel free to make it blend with your site. </p>
<h2>Usage</h2>
<h3>JavaScript</h3>
<pre>
var myMultipleLink = new MultipleLinks('element_id',{
	'links' : [
			['url','target','title'],
			['url','target','title'],
			['url','target','title']
	]
});
</pre>
<h3>CSS</h3>
<pre>
.multiple_link{
	/* This is the ul */
}

.multiple_link_item{
	/* This is the actual  li item */
}
</pre>
<p>Obviously those are injected with the actual anchor tags and those can be selected using standard selectors.</p>
<h2>Demo and Download</h2>
<p>You can see it in action <a href="http://thejavascriptblog.com/demos/multiple_links/" target="_blank">here</a>.<br />
Download a zip <a href="http://thejavascriptblog.com/demos/multiple_links/downloads/MultipleLinks.zip" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thejavascriptblog.com/mootools-multiple-links-class/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>MooTools Fader Class</title>
		<link>http://thejavascriptblog.com/mootools-fader-class/</link>
		<comments>http://thejavascriptblog.com/mootools-fader-class/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 17:21:11 +0000</pubDate>
		<dc:creator>Merrick Christensen</dc:creator>
				<category><![CDATA[Classes]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://thejavascriptblog.com/?p=31</guid>
		<description><![CDATA[While this is a very basic piece of code it adds a very nice effect to any item you choose. The MooTools Fader Class will fade any item to a specified opacity and fade it back to a specified opacity.]]></description>
			<content:encoded><![CDATA[<p>While this is a very basic piece of code it adds a very nice effect to any item you choose. The MooTools Fader Class will fade any item to a specified opacity and fade it back to a specified opacity.</p>
<h2>Usage</h2>
<pre>
new Fader(elements);
</pre>
<h2>Parameters and Options</h2>
<p><strong>elements:</strong> Parameter. This is a CSS selector that will be used to select your items.<br />
<strong>fadeTo:</strong> Option. This is the decimal value that your item will be faded to. E.G. 0.3<br />
<strong>fadeFrom:</strong> Option. This is the decimal value that your item will be faded back to.  E.G. 1<br />
<strong>duration:</strong> Option. The speed of the animation in milliseconds. E.G. 250<br />
<strong>transition:</strong> Option. The transition of the animation. E.G. Fx.Transitions.Sine.easeOut </p>
<h2>Demo and Download</h2>
<p>You can see it in action <a href="http://thejavascriptblog.com/demos/fader/" target="_blank">here</a>.<br />
Download a zip <a href="http://thejavascriptblog.com/demos/fader/downloads/Fader.zip" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thejavascriptblog.com/mootools-fader-class/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MooTools Content Slider Class</title>
		<link>http://thejavascriptblog.com/mootools-content-slider-class/</link>
		<comments>http://thejavascriptblog.com/mootools-content-slider-class/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 03:32:30 +0000</pubDate>
		<dc:creator>Merrick Christensen</dc:creator>
				<category><![CDATA[Classes]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://thejavascriptblog.com/?p=18</guid>
		<description><![CDATA[So I&#8217;ve been wanting to write a class like this for a while now and I finally got around to it. It creates a content slider. That being said a content slider could be a number of things these days but, this particular one creates a slider that manipulates the position of the content in [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve been wanting to write a class like this for a while now and I finally got around to it. It creates a content slider. That being said a content slider could be a number of things these days but, this particular one creates a slider that manipulates the position of the content in a div element. The class constructor takes three arguments and can be called using:</p>
<h2>Usage</h2>
<pre>

new ContentSlider(element, sliderTrack, sliderKnob, options);
</pre>
<h2>Parameters</h2>
<p>The element parameter needs to be an element that is wrapped within a viewport div. The viewport div&#8217;s width will be what is seen. While the element div&#8217;s width will be set using Javascript. In order for this to happen your item_list li element needs to have a set width. While the getSize() method of MooTools works dynamically in Firefox it only counts set properties in Safari and Internet Explorer. Dear MooTools Team, if it is possible please fix this.</p>
<p>The sliderTrack parameter is the background of the slider. The track if you will. It will wrap around the sliderKnob.</p>
<p>The sliderKnob parameter is the actual knob of the slider. The knob or controller needs to have a set width or else it won&#8217;t work in Safari or IE.</p>
<p>The option for itemList is very important as well. It takes an ID of an element and is absolutely necessary. By default it looks for a ul tag with and id of &#8216;item_list&#8217;. </p>
<p>Important thing about this class is it absolutely requires that your HTML markup is properly set up. While something with this many variants is difficult to write a blueprint for, I tried anyway. Reason for this is I have seen this done a lot, mostly in jQuery. I wanted to show that the same effect could be done in a reusable manner with minimal code. I hope someone out there is able to use this.</p>
<h2>jQuery Users</h2>
<p>For those of you who are looking to accomplish this effect in jQuery <a href="http://net.tutsplus.com/tutorials/javascript-ajax/making-a-content-slider-with-jquery-ui/">check this out</a>.</p>
<h2>Demo and Download</h2>
<p>You can see it in action <a href="http://thejavascriptblog.com/demos/content_slider/">here</a>.<br />
Download a zip <a href="http://thejavascriptblog.com/demos/content_slider/downloads/content_slider.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thejavascriptblog.com/mootools-content-slider-class/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Quotator &#8211; The JSON Driven HTML Rotator</title>
		<link>http://thejavascriptblog.com/the-quotator-the-json-driven-html-rotator/</link>
		<comments>http://thejavascriptblog.com/the-quotator-the-json-driven-html-rotator/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 21:17:14 +0000</pubDate>
		<dc:creator>Merrick Christensen</dc:creator>
				<category><![CDATA[Classes]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Plugins]]></category>

		<guid isPermaLink="false">http://thejavascriptblog.com/?p=12</guid>
		<description><![CDATA[Hopefully the plug-ins and classes I write are simple enough to figure out and manipulate. Its an extremely simple and customizable little testimonial rotator that also supports HTML. So yes your quotes can have links, logos or even avatars. It will support as many quotes or testimonials you may need. The options that can be [...]]]></description>
			<content:encoded><![CDATA[<p>Hopefully the plug-ins and classes I write are simple enough to figure out and manipulate. Its an extremely simple and customizable little testimonial rotator that also supports HTML. So yes your quotes can have links, logos or even avatars. It will support as many quotes or testimonials you may need. The options that can be set are speed (number), json (JSON file URL), and what quote you want to start from (number).</p>
<p>If you have any feature requests, questions, or issues please drop me a comment and I would love to help you out. Here are the details and usage for each of the particular frameworks.</p>
<h2>jQuery</h2>
<pre>
$('#container').quotator();
</pre>
<h2>MooTools</h2>
<pre>
var myQuotes = new Quotator('container');
</pre>
<h2>The JSON</h2>
<p>By default it looks for a file called quotes.js which is a simple JSON file that looks something like this:</p>
<pre>
{"quotes":
[{
"quote" : "Quote 1",
"author" : "Author 1"
},{
"quote" : "Quote 2",
"author" : "Author 2"
}]}
</pre>
<h2>Demo and Download</h2>
<p>You can see it in action <a href="http://www.thejavascriptblog.com/demos/quotator/" title="Quotator Demonstration">here.</a><br />
Download a zip for jQuery <a href="http://thejavascriptblog.com/demos/quotator/downloads/jquery.zip">here.</a><br />
Download a zip for MooTools <a href="http://thejavascriptblog.com/demos/quotator/downloads/mootools.zip">here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://thejavascriptblog.com/the-quotator-the-json-driven-html-rotator/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
	</channel>
</rss>

