<?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>Brit Gardner ::: Web Developer ::: Dallas, TX &#187; jquery</title>
	<atom:link href="http://britg.com/tags/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://britg.com</link>
	<description>The big yellow one&#039;s the sun.</description>
	<lastBuildDate>Sun, 10 Jan 2010 17:25:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>qTip &#8211; jQuery Tooltip Plugin with Excellent Docs</title>
		<link>http://britg.com/2009/12/06/qtip-jquery-tooltip-plugin-with-excellent-docs/</link>
		<comments>http://britg.com/2009/12/06/qtip-jquery-tooltip-plugin-with-excellent-docs/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 17:22:19 +0000</pubDate>
		<dc:creator>britg</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[javascripts]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[tooltips]]></category>

		<guid isPermaLink="false">http://britg.com/?p=1189</guid>
		<description><![CDATA[The bar has been set on jQuery plugins by this simple yet very robust project: qTip.
What is it?  An easy way to create fancy tooltips that has (optional) customization options for just about anything you want to do.  I had been using a pretty old and bland library before, so I was excited [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_1191" class="wp-caption alignleft" style="width: 102px"><a href="http://craigsworks.com/projects/qtip/"><img src="http://britg.com/blog/wp-content/uploads/2009/12/logo_small.png" alt="qTip - jQuery Tooltips" title="logo_small" width="92" height="99" class="size-full wp-image-1191" /></a><p class="wp-caption-text">qTip - jQuery Tooltips</p></div>The bar has been set on jQuery plugins by this simple yet very robust project: <a href="http://craigsworks.com/projects/qtip/">qTip</a>.</p>
<p>What is it?  An easy way to create fancy tooltips that has (optional) customization options for just about anything you want to do.  I had been using a pretty old and bland library before, so I was excited to stumble on this one.</p>
<p>Example: a tooltip positioned at the bottom left of a selector, with a green color scheme and a little tip pointing to the selector.</p>
<pre class="brush: jscript;">
    $('#myselector').qtip({
        content: 'Eat my tooltip, sucker!',
        position: {
            corner: {
                target: &quot;bottomLeft&quot;,
                tooltip: &quot;topLeft&quot;
            },
            adjust: {
                x: 10,
                y: 10
            }
        },
        style: {
            name: &quot;green&quot;,
            tip: &quot;topLeft&quot;
        }
    });
</pre>
<p>Perhaps the best part of this plugin is the documentation.  Just <a href="http://craigsworks.com/projects/qtip/docs/">check them out</a> and tell me that&#8217;s not the most well-documented library you&#8217;ve ever seen.</p>
]]></content:encoded>
			<wfw:commentRss>http://britg.com/2009/12/06/qtip-jquery-tooltip-plugin-with-excellent-docs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Results are in &#8211; No One Likes Working With Time</title>
		<link>http://britg.com/2009/01/15/results-are-in-no-one-likes-working-with-time/</link>
		<comments>http://britg.com/2009/01/15/results-are-in-no-one-likes-working-with-time/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 13:14:52 +0000</pubDate>
		<dc:creator>britg</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[timeago]]></category>

		<guid isPermaLink="false">http://britg.com/?p=557</guid>
		<description><![CDATA[I recently performed a very Scientific survery asking &#8216;do you like working with time?&#8217;  I don&#8217;t mean &#8216;working with time constraints&#8217;, or &#8216;working with a person whos name is Time but they probably spell it like PThyhm (the P is silent).&#8217;  No, I mean working with time (timestamps, date formating, human-friendly time representation, etc) in [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-560" href="http://britg.com/2009/01/15/results-are-in-no-one-likes-working-with-time/20fswp3/"><img class="alignright size-medium wp-image-560" title="20fswp3" src="http://britg.com/wordpress/wp-content/uploads/2009/01/20fswp3-211x300.jpg" alt="20fswp3" width="211" height="300" /></a>I recently performed a very Scientific survery asking &#8216;do you like working with time?&#8217;  I don&#8217;t mean &#8216;working with time constraints&#8217;, or &#8216;working with a person whos name is Time but they probably spell it like PThyhm (the P is silent).&#8217;  No, I mean working with time (timestamps, date formating, human-friendly time representation, etc) in your code &#8212; do you like it?</p>
<p>The results may or may not surprise you.  With a sample size of 1, most if not all of those surveyed responded that they very strongly dislike working with timestamps!</p>
<p>I strongly agree with the person surveyed, so that&#8217;s why I&#8217;m so elated that I stumbled upon this repo on github the other day &#8212; <a title="jQuery Timeago" href="http://github.com/rmm5t/jquery-timeago/tree/master">jQuery timeago</a>.  Yes!  Finally I can just dump my timestamps straight from the database onto the page, call $.timeago(&#8217;selector&#8217;), and bam &#8212; a perfectly human readable, self updating time representation.</p>
<p>If you&#8217;re one of the many that agree with the extremely scientific survey above, then I highly recommend you give this jQuery plugin a try &#8211; here&#8217;s the plugins <a title="jQuery Timeago" href="http://timeago.yarp.com/">homepage</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://britg.com/2009/01/15/results-are-in-no-one-likes-working-with-time/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Code Drive-By: Edit Anywhere Component for CakePHP</title>
		<link>http://britg.com/2008/08/08/code-drive-by-edit-anywhere-component/</link>
		<comments>http://britg.com/2008/08/08/code-drive-by-edit-anywhere-component/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 14:49:46 +0000</pubDate>
		<dc:creator>britg</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[edit anywhere]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[thickbox]]></category>

		<guid isPermaLink="false">http://britg.com/?p=304</guid>
		<description><![CDATA[I call this a code drive-by because I&#8217;m just going to dump the code without much explanation.  When I have time I&#8217;ll come back and walk through it and turn it into a useful article on the CakePHP bakery.
This component allows you to manage content (primarily text blocks) on a site if you&#8217;re logged in.  [...]]]></description>
			<content:encoded><![CDATA[<p>I call this a code drive-by because I&#8217;m just going to dump the code without much explanation.  When I have time I&#8217;ll come back and walk through it and turn it into a useful article on the <a href="http://bakery.cakephp.org">CakePHP bakery</a>.</p>
<p>This component allows you to manage content (primarily text blocks) on a site if you&#8217;re logged in.  The editor pops up in a <a href="http://jquery.com/demo/thickbox/">thickbox</a>.</p>
<p>Some requirements off the top of my head:</p>
<ul>
<li>CakePHP, duh.</li>
<li>jquery</li>
<li>thickbox</li>
<li>Auth Component</li>
</ul>
<p>Again, sorry for the drive-by but hopefully someone will get use out of this.</p>
<pre lang="php">
<?php

	class ContentComponent extends Object
	{
		var $controller;
		var $Setting;

		function initialize(&#038;$controller)
		{
			$this->controller =&#038; $controller;
			App::import('Model', 'Setting');
			$this->Setting = new Setting();
		}

		function read($field = null) {
			return $this->render($field);
		}

		function render($field = null)
		{
			$content = $this->Setting->findByField($field);

			if(!empty($content)) {
				return $this->output($field, $content['Setting']['value']);
			} else {
				return $this->output($field, '');
			}
		}

		function output($field, $str)
		{
			$output = $str;
			if($this->controller->u['User']['role'] == 'admin') {
				$output .= $this->editButton($field);
			}
			return nl2br($output);
		}

		function editButton($field) {
			return '<a href="/settings/edit/'.$field.'/?r='.$_SERVER['REQUEST_URI'].'" class="thickbox edit-button"><img src="/img/edit.png" width="10" height="10" /></a>';
		}
	}
?>
</pre>
<p>And my Settings Controller looks like:</p>
<pre lang="php">
<?php

	class SettingsController extends AppController
	{
		var $name = 'Settings';

		function edit($field)
		{
			$content = $this->Setting->findByField($field);

			if(!empty($content)) {
				$this->Setting->id = $content['Setting']['id'];
			}

			if(!empty($this->data))
			{
				$content['Setting'] = array(
					'field' => $field,
					'value' => $this->data['Setting']['value'],
				);

				$this->Setting->save($content);
				die($this->redirect($_REQUEST['r']));
			}

			$this->set(compact('field', 'content'));
		}
	}
?>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://britg.com/2008/08/08/code-drive-by-edit-anywhere-component/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
