<?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>Jon Rohan &#187; Share</title>
	<atom:link href="http://www.dinnermint.org/category/share/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dinnermint.org</link>
	<description>I&#039;m a freelance web developer living in San Francisco. This is my portfolio where I share my work, thoughts, and whatever else.</description>
	<lastBuildDate>Sat, 24 Apr 2010 17:01:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<cloud domain='www.dinnermint.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>jQuery Snippet for Opening all External Links in new Windows</title>
		<link>http://www.dinnermint.org/share/jquery-snippet-open-links-in-new-tabs/</link>
		<comments>http://www.dinnermint.org/share/jquery-snippet-open-links-in-new-tabs/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 18:00:09 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[Share]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=1973</guid>
		<description><![CDATA[This is just a quick share, but while developing my site, I realized I don't want visitors to click on a link and be taken away from my site. The proper way to do this is to add the target="_blank" to all your external links like so.]]></description>
			<content:encoded><![CDATA[<p>This is just a quick share, but while developing my site, I realized I don&#8217;t want visitors to click on a link and be taken away from my site. The proper way to do this is to add the target=&#8221;_blank&#8221; to all your external links like so.</p>
<pre><code>&lt;a href=&quot;http://www.deltatangobravo.com&quot; target=&quot;_blank&quot;&gt;design&lt;/a&gt;</code></pre>
<p>But I&#8217;m way too busy to remember to do that for every link I add to my blog. I mean I try to but what happens when I forget. So I wrote a small jQuery snippet to get my back.</p>
<pre><code>$(&quot;a:not([href^=&#039;http://www.dinnermint.org&#039;]):not([href^=&#039;#&#039;]):not([href^=&#039;/&#039;])&quot;).attr(&quot;target&quot;,&quot;_blank&quot;);</code></pre>
<p>It looks for all links on my page that do not begin with my domain www.dinnermint.org and adds the attribute target=&#8221;_blank&#8221;. Laziness FTW!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/share/jquery-snippet-open-links-in-new-tabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Development Bookmarklets</title>
		<link>http://www.dinnermint.org/share/wed-development-bookmarklets/</link>
		<comments>http://www.dinnermint.org/share/wed-development-bookmarklets/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 18:00:15 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[Share]]></category>
		<category><![CDATA[bookmarklets]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=1831</guid>
		<description><![CDATA[During my career, I&#8217;ve run into a few bookmarklets that are useful for web development, and I&#8217;ve created a couple. The Fold Bookmarklet We&#8217;ve all been there, had a product manager obsessed with &#8220;The Fold&#8221; (where the bottom of the browser ends, and you must start scrolling). I had one, and eventually made this bookmarklet [...]]]></description>
			<content:encoded><![CDATA[<p>During my career, I&#8217;ve run into a few bookmarklets that are useful for web development, and I&#8217;ve created a couple.</p>
<h3>The Fold Bookmarklet</h3>
<p>We&#8217;ve all been there, had a product manager obsessed with &#8220;The Fold&#8221; (where the bottom of the browser ends, and you must start scrolling). I had one, and eventually made this bookmarklet to insert a fold line at 768px.</p>
<div style="overflow:hidden;">
<a href="javascript:(function()%7Bdocument.body.innerHTML+=%22%3Cdiv%20style='position:absolute;width:100%25;left:0;top:642px;border-bottom:5px%20solid%20red;color:red;'%3EThe%20Fold%201024x768%3C/div%3E%22;%7D)();" class="bookmarklet">The Fold</a></div>
<h3>Disable Links Bookmarklet</h3>
<p>This bookmark came to life because I kept trying to mock up a page slightly using firebug, and would accidentally click a link then loose all my changes.</p>
<div style="overflow:hidden;">
<a href="javascript:(function()%7Ba=document.getElementsByTagName(%22a%22);for(i=0;i%3Ca.length;i++)%7Ba%5Bi%5D.onclick=function()%7Breturn%20false%7D;%7D%7D)();" class="bookmarklet">Disable Links</a></div>
<h3>Firebug Lite Bookmarklet</h3>
<p>I didn&#8217;t create this one, but it&#8217;s awesome! For people who can&#8217;t use firebug, you can use this bookmarklet and lite version of firebug will be inserted into the page.</p>
<div style="overflow:hidden;">
<a href="javascript:var firebug=document.createElement('script');firebug.setAttribute('src','http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js');document.body.appendChild(firebug);(function(){if(window.firebug.version){firebug.init();}else{setTimeout(arguments.callee);}})();void(firebug);" class="bookmarklet">Firebug Lite</a></div>


<p>Related posts:<ol><li><a href='http://www.dinnermint.org/share/submit-to-digg/' rel='bookmark' title='Permanent Link: Submit to Digg Bookmarklet'>Submit to Digg Bookmarklet</a></li>
<li><a href='http://www.dinnermint.org/tutorial/css-clear-fixes/' rel='bookmark' title='Permanent Link: CSS Clear Fixes'>CSS Clear Fixes</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/share/wed-development-bookmarklets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Ghost Textbox plugin</title>
		<link>http://www.dinnermint.org/share/jquery-ghost-text-plugin/</link>
		<comments>http://www.dinnermint.org/share/jquery-ghost-text-plugin/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 04:55:53 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[invisible text]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=1794</guid>
		<description><![CDATA[I often work on sites now-a-days that call for "ghost text boxes". This is when a text box is already populated with words when the page loads. And then when the textbox is given focus the text goes away.]]></description>
			<content:encoded><![CDATA[<p>I often work on sites that call for &#8220;ghost text boxes&#8221;. This is when a text box is already populated with words when the page loads. And then when the textbox is given focus the text goes away. Like This</p>
<div style="margin:15px 0;">
<input type="text" class="ghost_text" placeholder="This is Ghost Text"/></div>
<p>I&#8217;ve seen a few ways to do this, explicitly writing a function that switches text, but this is too specific. This means that I&#8217;ll need to re-write this for every ghost text box on the site. Some people will add the functions in the onfocus and onblur attributes on the <code>&lt;input&gt;</code> tag. Same deal&#8230;</p>
<p>So I wrote this plugin to make my life simpler. How it works is, anytime you want a textbox to have ghost text you give it a placeholder attribute and put the ghost text inside. like so</p>
<pre><code>&lt;input type=&quot;text&quot; class=&quot;ghost_text&quot; placeholder=&quot;This is Ghost Text&quot;/&gt;</code></pre>
<p>Then I just setup the ghost text globally.</p>
<pre><code>$(&quot;.ghost_text&quot;).ghostText();</code></pre>
<p>And we&#8217;re done! That was easy.</p>
<p>Here&#8217;s the plugin. It&#8217;s may not be perfect, and there are most likely hundreds of these on the net. But here is my implementation.<br />
<pre><code>/* Copyright (c) 2009 Jon Rohan (http://dinnermint.org)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version: 1.0.0
 * Written with jQuery 1.3.2
 */
(function($){$.fn.ghostText = function() {
&nbsp;&nbsp;return this.each(function(){
&nbsp;&nbsp;&nbsp;&nbsp;var text = $(this).attr(&quot;placeholder&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;if(text!=&quot;&quot;&amp;&amp;($(this).val()==&quot;&quot;||$(this).val()==text)) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).addClass(&quot;disabled&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).val(text);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).focus(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).removeClass(&quot;disabled&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if($(this).val()==text) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).val(&quot;&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).blur(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if($(this).val()==&quot;&quot;) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).val(text);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).addClass(&quot;disabled&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;});
};})(jQuery)
</code></pre></p>


<p>Related posts:<ol><li><a href='http://www.dinnermint.org/javascript/jquery-growing-textbox-plugin/' rel='bookmark' title='Permanent Link: jQuery Auto-growing Textarea Plugin'>jQuery Auto-growing Textarea Plugin</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/share/jquery-ghost-text-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Array.prototype.move2Back</title>
		<link>http://www.dinnermint.org/share/array-prototype-move2back/</link>
		<comments>http://www.dinnermint.org/share/array-prototype-move2back/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 07:03:50 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=1715</guid>
		<description><![CDATA[I decided to write a javascript prototype function for the Array class called move2Back. This will move the nth object in the array to the back of the array. For example when I do this. var arr = [1,2,&#34;A&#34;,4,5]; arr.move2Back(2); Then the array becomes: [1,2,4,5,&#34;A&#34;] This is the small javascript function that accomplishes the task. [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to write a javascript prototype function for the Array class called move2Back. This will move the nth object in the array to the back of the array. For example when I do this.<br />
<pre><code>var arr = [1,2,&quot;A&quot;,4,5];
arr.move2Back(2);
</code></pre></p>
<p>Then the array becomes:</p>
<p><code>[1,2,4,5,&quot;A&quot;]</code></p>
<p>This is the small javascript function that accomplishes the task.<br />
<pre><code>/*
 * This function moves the nth member of the array to the end
 */
Array.prototype.move2Back = function(n) {
&nbsp;&nbsp;this.push(this.splice(n,1).pop());
&nbsp;&nbsp;return this;
}
var arr = [&quot;Jani&quot;,&quot;Hege&quot;,&quot;Stale&quot;,&quot;Kai Jim&quot;,&quot;Borge&quot;,&quot;Tove&quot;];
console.log(arr.move2Back(3));
</code></pre></p>


<p>Related posts:<ol><li><a href='http://www.dinnermint.org/share/submit-to-digg/' rel='bookmark' title='Permanent Link: Submit to Digg Bookmarklet'>Submit to Digg Bookmarklet</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/share/array-prototype-move2back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Submit to Digg Bookmarklet</title>
		<link>http://www.dinnermint.org/share/submit-to-digg/</link>
		<comments>http://www.dinnermint.org/share/submit-to-digg/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 16:59:58 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[Share]]></category>
		<category><![CDATA[bookmarklets]]></category>
		<category><![CDATA[digg]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/blog/javascript/submit-to-digg/</guid>
		<description><![CDATA[This is a small bookmarklet I wrote to Submit a story to digg. What&#8217;s different about it is it uses the &#60;title&#62;&#60;/title&#62; of the page as the story title, and any text you selected as the story description. The link will open the submit digg window in a new window or tab. just drag the [...]]]></description>
			<content:encoded><![CDATA[<p>This is a small bookmarklet I wrote to Submit a story to digg. What&#8217;s different about it is it uses the &lt;title&gt;&lt;/title&gt; of the page as the story title, and any text you selected as the story description.</p>
<p>The link will open the submit digg window in a new window or tab. just drag the link below onto your bookmarks toolbar folder.</p>
<p><a style="border: 2px dashed #8f8f8f; display: block; width: 100px; font-size: 9pt; font-weight: bold; text-align: center;" href="javascript:(function(){window.open('http://digg.com/submit?phase=2&#038;url='+%20window.location%20+%20'&#038;title='%20+%20document.title%20+%20'&#038;bodytext='%20+%20((navigator.appName.indexOf('Microsoft')!=%20-1&#038;&#038;parseInt(navigator.appVersion)%3E=4)?document.selection.createRange().text:window.getSelection()));})();">Submit to Digg</a></p>


<p>Related posts:<ol><li><a href='http://www.dinnermint.org/ideas/design-exploration-digg/' rel='bookmark' title='Permanent Link: Design Exploration: Digg'>Design Exploration: Digg</a></li>
<li><a href='http://www.dinnermint.org/share/wed-development-bookmarklets/' rel='bookmark' title='Permanent Link: Web Development Bookmarklets'>Web Development Bookmarklets</a></li>
<li><a href='http://www.dinnermint.org/css/using-css3s-target-pseudo-class-to-make-a-slideshow/' rel='bookmark' title='Permanent Link: Using CSS3&#8242;s :target pseudo-class to Make a Slideshow'>Using CSS3&#8242;s :target pseudo-class to Make a Slideshow</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/share/submit-to-digg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
