<?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>Trent Richardson</title> <atom:link href="http://trentrichardson.com/feed/" rel="self" type="application/rss+xml" /><link>http://trentrichardson.com</link> <description>practical web design &#38; development</description> <lastBuildDate>Wed, 25 Jan 2012 11:43:16 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Using Impress.js for a Car Bounce Video</title><link>http://trentrichardson.com/2012/01/25/using-impress-js-for-a-car-bounce-video/</link> <comments>http://trentrichardson.com/2012/01/25/using-impress-js-for-a-car-bounce-video/#comments</comments> <pubDate>Wed, 25 Jan 2012 11:43:16 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[car bounce]]></category> <category><![CDATA[html]]></category> <category><![CDATA[presentation]]></category> <category><![CDATA[transformations]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=1088</guid> <description><![CDATA[I was pretty amazed when I first saw Impress.js. It&#8217;s ability to take a very simple html page and use transformations to create a presentation phenomenal. This plays right in to the hands of developers who want to create something snazzy, but do not have the video experience to do so. It is also probably [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2011/11/22/car-bounce-keep-up-with-your-cars-value/' rel='bookmark' title='Car Bounce &#8211; Keep Up with Your Car&#8217;s Value'>Car Bounce &#8211; Keep Up with Your Car&#8217;s Value</a></li></ol>]]></description> <content:encoded><![CDATA[<p>I was pretty amazed when I first saw <a
href="http://bartaz.github.com/impress.js/#/bored" title="Impress.js" target="_blank">Impress.js</a>.  It&#8217;s ability to take a very simple html page and use transformations to create a presentation phenomenal.  This plays right in to the hands of developers who want to create something snazzy, but do not have the video experience to do so.  It is also probably worth noting that it has likely been done before, but this is the first I&#8217;ve seen (I didn&#8217;t do much research on it, I was happy with what I saw).</p><p>Its process is simple, line up multiple container elements inside a container with id=&#8221;impress&#8221;, and supply those elements with a variety of data coordinates and scaling attributes, resulting in something like:</p><pre><code class="html">
&lt;div id="block1" class="step" data-x="1000" data-y="1500" data-rotate="90" data-scale="2"&gt;
    &lt;p>This is a test&lt;/p&gt;
&lt;/div&gt;
</code></pre><p>Impress will take the coordinates and scale and place them on your canvas.  You can also apply 3D effects too using the z for the 3rd dimension and rotate on the x and y axis:</p><pre><code class="html">
&lt;div class="block2" data-x="1500" data-y="2000" data-z="-100" data-rotate-x="-40" data-rotate-y="10" data-scale="2"&gt;
    &lt;p>This is a test&lt;/p&gt;
&lt;/div&gt;
</code></pre><p>Thats all, just line up these different containers in order and Impress does the rest.  Style them up a little and you have a snazzy presentation!  I will leave you with simple demo I came up with for CarBounce.com</p><p><iframe
width="480" height="360" src="http://www.youtube.com/embed/Fr5JreMYmlo?rel=0" frameborder="0" allowfullscreen></iframe></p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2011/11/22/car-bounce-keep-up-with-your-cars-value/' rel='bookmark' title='Car Bounce &#8211; Keep Up with Your Car&#8217;s Value'>Car Bounce &#8211; Keep Up with Your Car&#8217;s Value</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2012/01/25/using-impress-js-for-a-car-bounce-video/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Make jQueryUI and Timepicker More Beautiful</title><link>http://trentrichardson.com/2012/01/23/make-jqueryui-and-timepicker-more-beautiful/</link> <comments>http://trentrichardson.com/2012/01/23/make-jqueryui-and-timepicker-more-beautiful/#comments</comments> <pubDate>Mon, 23 Jan 2012 11:24:28 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[Timepicker]]></category> <category><![CDATA[custom]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[jqueryui]]></category> <category><![CDATA[themes]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=1071</guid> <description><![CDATA[After some time the standard jQueryUI themes can get stale, boring, monotonous, and you need a fresh look. I&#8217;ve rounded up a couple very customized, non-&#8221;run of the mill&#8221; themes you should take a look at. Absolution (Github) is a very clean theme with support for Uniform and Wijmo. Uniform, as its name indicates, styles [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2008/04/15/new-impromput-theme/' rel='bookmark' title='New Impromptu Theme!'>New Impromptu Theme!</a></li><li><a
href='http://trentrichardson.com/2010/11/15/timepicker-0-8-bug-fix-galore/' rel='bookmark' title='Timepicker 0.8, Bug Fix Galore'>Timepicker 0.8, Bug Fix Galore</a></li><li><a
href='http://trentrichardson.com/2010/12/28/jquery-timepicker-addon-0-9-2-available/' rel='bookmark' title='jQuery Timepicker Addon 0.9.2 Available'>jQuery Timepicker Addon 0.9.2 Available</a></li></ol>]]></description> <content:encoded><![CDATA[<p><a
href="http://trentrichardson.com/wp-content/uploads/2012/01/absolution-timepicker.png"><img
src="http://trentrichardson.com/wp-content/uploads/2012/01/absolution-timepicker.png" alt="" title="absolution-timepicker" width="205" height="334" class="alignright size-full wp-image-1072" /></a></p><p>After some time the standard jQueryUI themes can get stale, boring, monotonous, and you need a fresh look.  I&#8217;ve rounded up a couple very customized, non-&#8221;run of the mill&#8221; themes you should take a look at.</p><p><a
href="http://www.michaelvanderheeren.be/archives/382" title="Absolution jQueryUI Theme" target="_blank">Absolution</a> (<a
href="https://github.com/michaelvanderheeren/Absolution" title="Absolution on Github" target="_blank">Github</a>) is a very clean theme with support for <a
href="http://uniformjs.com/" title="Uniform JS" target="_blank">Uniform</a> and <a
href="http://wijmo.com/" title="Wijmo UI Widgets" target="_blank">Wijmo</a>.  Uniform, as its name indicates, styles form elements to have a uniform look, across all browsers.  Drastically, improving the consistency of appearance.  Wijmo is a snazzy widget collection providing both an &#8220;Open&#8221; (open source) and &#8220;Complete&#8221; (commercial) set of widgets.  The developer has a few example widgets on their site showing off the look on all widgets. Another bonus is that development is handled with LESS, making it super easy to tweak.  I will definitely keep this close by for future development!</p><p><a
href="http://trentrichardson.com/wp-content/uploads/2012/01/Aristo-Timepicker.jpg"><img
src="http://trentrichardson.com/wp-content/uploads/2012/01/Aristo-Timepicker.jpg" alt="" title="Aristo-Timepicker" width="206" height="296" class="alignleft size-full wp-image-1073" /></a></p><p>A second theme worth a look is <a
href="http://taitems.tumblr.com/post/482577430/introducing-aristo-a-jquery-ui-theme" title="Aristo jQueryUI Theme" target="_blank">Aristo</a> (<a
href="https://github.com/taitems/Aristo-jQuery-UI-Theme" title="Aristo on Github" target="_blank">Github</a>), a port of Cappuccino.  It has a bit more of an OSX look, but still a very clean, beautiful theme.  An example of all widgets are included on the developer&#8217;s site.</p><p>Just looking over the Absolution I am impressed with how LESS makes this look so more portable and themable than if only the CSS were provided.  I definitely need to get up to speed on using LESS and the compiler.  Better keep an eye out for integration on an upcoming project ;)</p><p>Both of these themes appear to work very well with Timepicker as well as the SliderAccess plugin, and are a nice compliment to most any jQueryUI based project!  I&#8217;m still on the hunt for more quality custom jQueryUI themes for projects, so if you know of any please post them!</p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2008/04/15/new-impromput-theme/' rel='bookmark' title='New Impromptu Theme!'>New Impromptu Theme!</a></li><li><a
href='http://trentrichardson.com/2010/11/15/timepicker-0-8-bug-fix-galore/' rel='bookmark' title='Timepicker 0.8, Bug Fix Galore'>Timepicker 0.8, Bug Fix Galore</a></li><li><a
href='http://trentrichardson.com/2010/12/28/jquery-timepicker-addon-0-9-2-available/' rel='bookmark' title='jQuery Timepicker Addon 0.9.2 Available'>jQuery Timepicker Addon 0.9.2 Available</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2012/01/23/make-jqueryui-and-timepicker-more-beautiful/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Return Multiple Result Sets with PHP and PostgreSQL Functions</title><link>http://trentrichardson.com/2012/01/04/return-multiple-result-sets-with-php-and-postgresql-functions/</link> <comments>http://trentrichardson.com/2012/01/04/return-multiple-result-sets-with-php-and-postgresql-functions/#comments</comments> <pubDate>Wed, 04 Jan 2012 11:45:24 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[Database]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Windows]]></category> <category><![CDATA[cursor]]></category> <category><![CDATA[functions]]></category> <category><![CDATA[postgresql]]></category> <category><![CDATA[procedures]]></category> <category><![CDATA[results]]></category> <category><![CDATA[return]]></category> <category><![CDATA[stored]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=1061</guid> <description><![CDATA[A while back I discussed how to use the new sqlsrv extension for php to retrieve multiple result sets at a time from stored proceedures. This was indeed helpful when you need to retrieve related data and avoid multiple calls to stored proceedures. The down side is this was using a rather expensive (but good) [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2011/08/10/making-sense-of-stored-procedures-with-php-pdo-and-sqlsrv/' rel='bookmark' title='Making Sense of Stored Procedures with PHP, PDO, and Sqlsrv'>Making Sense of Stored Procedures with PHP, PDO, and Sqlsrv</a></li><li><a
href='http://trentrichardson.com/2010/12/01/thought-is-else-return-really-necessary/' rel='bookmark' title='Thought: Is else return really necessary?'>Thought: Is else return really necessary?</a></li><li><a
href='http://trentrichardson.com/2010/01/31/cakephp-postgresql-and-regex/' rel='bookmark' title='CakePHP, PostgreSQL, and Regex'>CakePHP, PostgreSQL, and Regex</a></li></ol>]]></description> <content:encoded><![CDATA[<p>A while back I discussed how to use the new sqlsrv extension for php to <a
href="http://trentrichardson.com/2011/08/10/making-sense-of-stored-procedures-with-php-pdo-and-sqlsrv/" title="SQL Server Stored Proceedures with PHP, PDO, and SQLSrv">retrieve multiple result sets at a time from stored proceedures</a>.  This was indeed helpful when you need to retrieve related data and avoid multiple calls to stored proceedures.  The down side is this was using a rather expensive (but good) database engine.  Also, <a
href="http://www.microsoft.com/download/en/details.aspx?id=28160" title="SQLSrv PHP extension for linux" target="_blank">until recently</a>, there was absolutely no support for the sqlsrv php extension on unix based servers.  How can the open source world tap into such functionality?</p><p>PostgreSQL has the ability to return multiple cursors to result sets.  Using this we can achieve the same effect with php with a little magic.  Lets take a look at a simple function which returns three queries by way of refcursor type.  Also not that I said &#8220;function&#8221;, not &#8220;procedure&#8221;, but never fear, 6 of one, half dozen of the other as far as this topic goes:</p><pre><code class="sql">
CREATE OR REPLACE FUNCTION test_get_users(userID integer) RETURNS SETOF refcursor AS $$

	DECLARE
		ref1 refcursor;
		ref2 refcursor;
		ref3 refcursor;
	BEGIN

	OPEN ref1 FOR
		SELECT id, name, email FROM users;
	RETURN NEXT ref1;

	OPEN ref2 FOR
		SELECT id FROM users WHERE is_active=1;
	RETURN next ref2;

	OPEN ref3 FOR
		SELECT * FROM users WHERE id = userID;
	RETURN next ref3;

	RETURN;

END;
$$ LANGUAGE plpgsql;
</code></pre><p><span
id="more-1061"></span></p><p><a
href="http://trentrichardson.com/wp-content/uploads/2012/01/pg_test_get_users.jpg"><img
src="http://trentrichardson.com/wp-content/uploads/2012/01/pg_test_get_users.jpg" alt="" title="pg_test_get_users" width="200" height="111" class="alignright size-full wp-image-1065" /></a></p><p>So that is pretty simple, we run 3 select queries, and return the refcursor for those.  Now the tricky part will be how to read each of these queries on the php end.  The values returned from calling this function will resemble the image presented here.  These merely represent references to the cursors to each query run, so we will have to use some pg magic to pull those result sets in.  It boils down to we need to make one call to the function, then a separate call per result set to bring in those results (note the query has run at this point, its basically reading in the data, which should be quick).  Lets look at the SQL which would achieve this:<pre><code class="sql">
BEGIN;
SELECT test_get_users(2);
FETCH ALL IN "&lt;unnamed portal 1&gt;";
FETCH ALL IN "&lt;unnamed portal 2&gt;";
FETCH ALL IN "&lt;unnamed portal 3&gt;";
END;
</code></pre><p>Now it should make a little more sense what has to happen.  We call a fetch for each result set to return. So now we just need to process this with PHP:</p><pre><code class="php">
$conn = new PDO("pgsql:host=localhost;port=5432;dbname=testing", "username", "password");

$userID = 2;

// begin transaction, this is all one process
$conn-&gt;beginTransaction();

	// call the function
	$stmt = $conn-&gt;prepare("select test_get_users(:userID)");
	$stmt-&gt;bindParam('userID', $userID, PDO::PARAM_INT);
	$stmt-&gt;execute();
	$cursors = $stmt-&gt;fetchAll();
	$stmt-&gt;closeCursor();

	// get each result set
	$results = array();
	foreach($cursors as $k=&gt;$v){
		$stmt = $conn-&gt;query('FETCH ALL IN "'. $v[0] .'";');
		$results[$k] = $stmt-&gt;fetchAll();
		$stmt-&gt;closeCursor();
	}
$conn-&gt;commit();
unset($stmt);

echo '&lt;pre&gt;';
print_r($results);echo "\n"; // all record sets
echo '&lt;/pre&gt;';
</code></pre><p>Now first off, we call the select test_get_users(), which returns a list of refcursor names.  So with this we know how many queries were returned.  Just loop through this list and fetch each result set.  It is essentially the same process used from the Sql Server example, except the nextRowset() is not yet implemented for the pdo pgsql extension, so we just manually call the fetch.  No Biggie. You would then receive something similar to the following:</p><pre><code>
Array
(
	[0] =&gt; Array
		(
			[0] =&gt; Array
				(
					[id] =&gt; 2
					[0] =&gt; 2
					[name] =&gt; John Doe
					[1] =&gt; John Doe
					[email] =&gt; test2@test.com
					[2] =&gt; test2@test.com
				)

			[1] =&gt; Array
				(
					[id] =&gt; 3
					[0] =&gt; 3
					[name] =&gt; Jane Doe
					[1] =&gt; Jane Doe
					[email] =&gt; test3@test.com
					[2] =&gt; test3@test.com
				)

			......

		)

	[1] =&gt; Array
		(
			[0] =&gt; Array
				(
					[id] =&gt; 3
					[0] =&gt; 3
				)

			[1] =&gt; Array
				(
					[id] =&gt; 1
					[0] =&gt; 1
				)

		)

	[2] =&gt; Array
		(
			[0] =&gt; Array
				(
					[id] =&gt; 2
					[0] =&gt; 2
					[name] =&gt; John Doe
					[1] =&gt; John Doe
					[email] =&gt; test2@test.com
					[2] =&gt; test2@test.com
					[password] =&gt; zxcvxcvczxcv
					[3] =&gt; zxcvxcvczxcv
					[is_active] =&gt; 0
					[4] =&gt; 0
				)

		)

)
</code></pre><p>If you&#8217;re still feeling frisky at this point, there are all sorts of ways to &#8220;fetch&#8221; the result sets, just take a look at the <a
href="http://www.postgresql.org/docs/9.1/static/plpgsql-cursors.html" title="Postgresql Cursor Docs" target="_blank">docs on cursors</a>.  The more I use PostgreSQL the more I am becoming a fan.  It&#8217;s power and features go far beyond my skill set, but it feels good always knowing you have the best tool at hand for whatever task you have ahead of you.  As always feel free to chime in and leave any knowledge you may have, especially on Postgres!</p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2011/08/10/making-sense-of-stored-procedures-with-php-pdo-and-sqlsrv/' rel='bookmark' title='Making Sense of Stored Procedures with PHP, PDO, and Sqlsrv'>Making Sense of Stored Procedures with PHP, PDO, and Sqlsrv</a></li><li><a
href='http://trentrichardson.com/2010/12/01/thought-is-else-return-really-necessary/' rel='bookmark' title='Thought: Is else return really necessary?'>Thought: Is else return really necessary?</a></li><li><a
href='http://trentrichardson.com/2010/01/31/cakephp-postgresql-and-regex/' rel='bookmark' title='CakePHP, PostgreSQL, and Regex'>CakePHP, PostgreSQL, and Regex</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2012/01/04/return-multiple-result-sets-with-php-and-postgresql-functions/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>UberUploadCropper V2 &#8211; Upload, Crop, No Flash</title><link>http://trentrichardson.com/2011/12/20/uberuploadcropper-v2-upload-crop-no-flash/</link> <comments>http://trentrichardson.com/2011/12/20/uberuploadcropper-v2-upload-crop-no-flash/#comments</comments> <pubDate>Tue, 20 Dec 2011 11:51:19 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[Design]]></category> <category><![CDATA[Impromptu]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[crop]]></category> <category><![CDATA[jcrop]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[resize]]></category> <category><![CDATA[upload]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=1056</guid> <description><![CDATA[Finally, UberUploadCropper gets a much needed update. First off, flash is gone. Now you can upload and crop with just javascript and your serverside language of choice. What is UberUploadCropper? It is a jQuery plugin which pulls together jCrop, Impromptu, and FileUploader plugins into one uniform unit to upload and crop images. The latest version [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2010/04/12/uberuploadcropper-0-2-with-example/' rel='bookmark' title='UberUploadCropper 0.2 With Example'>UberUploadCropper 0.2 With Example</a></li><li><a
href='http://trentrichardson.com/2008/05/21/javascript-finding-the-focused-element/' rel='bookmark' title='Javascript: Finding the Focused Element'>Javascript: Finding the Focused Element</a></li><li><a
href='http://trentrichardson.com/2011/10/14/impromptu-3-2-mobile-jquery-prompts/' rel='bookmark' title='Impromptu 3.2 &#8211; Mobile jQuery Prompts'>Impromptu 3.2 &#8211; Mobile jQuery Prompts</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Finally, UberUploadCropper gets a much needed update.  First off, flash is gone.  Now you can upload and crop with just javascript and your serverside language of choice.  What is UberUploadCropper?  It is a jQuery plugin which pulls together jCrop, Impromptu, and FileUploader plugins into one uniform unit to upload and crop images.</p><p><a
href="http://trentrichardson.com/wp-content/uploads/2011/12/uberuploadcropper-v2.png"><img
src="http://trentrichardson.com/wp-content/uploads/2011/12/uberuploadcropper-v2.png" alt="" title="UberUploadCropper V2" width="509" height="98" class="size-full wp-image-1057" /></a></p><p>The latest version can be found with all it&#8217;s glory on Github, along with 2 examples. The examples provide a very basic, upload and crop routine.  The second, a much more advanced example, demonstrates how to handle large images efficiently.  Both examples should be fairly easy to merge into your own projects.  Here is a video of <a
href="http://trentrichardson.com/2009/10/25/uberuploadcropper-jquery-upload-and-crop-plugin/" title="UberUploadCropper V1" target="_blank">version 1 of UberUploadCropper</a> in action.  I will provide a newer video shortly:</p><p><iframe
width="420" height="315" src="http://www.youtube.com/embed/1ofL8K74imc?rel=0" frameborder="0" allowfullscreen></iframe></p><p>This plugin uses these three fantastic plugins:</p><ul><li><a
href="http://trentrichardson.com/Impromptu/" title="jQuery Impromptu" target="_blank">jQuery Impromptu</a> for modal windows.</li><li><a
href="https://github.com/tapmodo/Jcrop" title="Jcrop" target="_blank">Jcrop</a> to crop the images.</li><li><a
href="http://github.com/valums/file-uploader" title="FileUploader" target="_blank">FileUploader</a> to upload the images.</li></ul><p>The plugins mostly differ in using ajax upload instead of Uploadify.  So all options which use to target Uploadify have been removed and replaced with the corresponding FileUploader options.  The examples are commented and should be pretty clear cut.  Enjoy!</p><p><a
href="https://github.com/trentrichardson/UberUploadCropper" title="UberUploadCropper on Github" target="_blank">UberUploadCropper on Github</a></p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2010/04/12/uberuploadcropper-0-2-with-example/' rel='bookmark' title='UberUploadCropper 0.2 With Example'>UberUploadCropper 0.2 With Example</a></li><li><a
href='http://trentrichardson.com/2008/05/21/javascript-finding-the-focused-element/' rel='bookmark' title='Javascript: Finding the Focused Element'>Javascript: Finding the Focused Element</a></li><li><a
href='http://trentrichardson.com/2011/10/14/impromptu-3-2-mobile-jquery-prompts/' rel='bookmark' title='Impromptu 3.2 &#8211; Mobile jQuery Prompts'>Impromptu 3.2 &#8211; Mobile jQuery Prompts</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2011/12/20/uberuploadcropper-v2-upload-crop-no-flash/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Clientside Plugin Available for Gedit 3</title><link>http://trentrichardson.com/2011/12/15/clientside-plugin-available-for-gedit-3/</link> <comments>http://trentrichardson.com/2011/12/15/clientside-plugin-available-for-gedit-3/#comments</comments> <pubDate>Thu, 15 Dec 2011 11:34:57 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[clientside]]></category> <category><![CDATA[format]]></category> <category><![CDATA[gedit]]></category> <category><![CDATA[lint]]></category> <category><![CDATA[minify]]></category> <category><![CDATA[plugin]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=1053</guid> <description><![CDATA[The Gedit Clientside plugin is now available for Gedit 3. All the features remained the same, just some minor tweaks throughout. You can still find both Gedit versions of the plugin on Github: Clientside Plugin for Gedit 3+ Clientside Plugin for Gedit 2 I moved the old Gedit 2 version to a separate branch on [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2011/03/02/gedit-clientside-plugin-gets-batch-minify-option/' rel='bookmark' title='Gedit Clientside Plugin gets Batch Minify Option'>Gedit Clientside Plugin gets Batch Minify Option</a></li><li><a
href='http://trentrichardson.com/2010/11/30/gedit-clientside-plugin/' rel='bookmark' title='Gedit Clientside Plugin'>Gedit Clientside Plugin</a></li><li><a
href='http://trentrichardson.com/2011/09/23/updated-lint-for-clientside/' rel='bookmark' title='Updated Lint for Clientside'>Updated Lint for Clientside</a></li></ol>]]></description> <content:encoded><![CDATA[<p>The Gedit Clientside plugin is now available for Gedit 3.  All the features remained the same, just some minor tweaks throughout.  You can still find both Gedit versions of the plugin on Github:</p><ul><li><a
href="https://github.com/trentrichardson/Gedit-Clientside-Plugin" title="Clientside Plugin for Gedit 3+" target="_blank">Clientside Plugin for Gedit 3+</a></li><li><a
href="https://github.com/trentrichardson/Gedit-Clientside-Plugin/tree/Gedit2" title="Clientside Plugin for Gedit 2" target="_blank">Clientside Plugin for Gedit 2</a></li></ul><p>I moved the old Gedit 2 version to a separate branch on Github, so both versions of the project are still available.</p><p>If you&#8217;re unfamiliar with the Clientside plugin you just found a real gem.  The plugin bundles together functionality to minify, format, batch minify, and run a lint service on both Javascript and CSS.  Hope you enjoy!</p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2011/03/02/gedit-clientside-plugin-gets-batch-minify-option/' rel='bookmark' title='Gedit Clientside Plugin gets Batch Minify Option'>Gedit Clientside Plugin gets Batch Minify Option</a></li><li><a
href='http://trentrichardson.com/2010/11/30/gedit-clientside-plugin/' rel='bookmark' title='Gedit Clientside Plugin'>Gedit Clientside Plugin</a></li><li><a
href='http://trentrichardson.com/2011/09/23/updated-lint-for-clientside/' rel='bookmark' title='Updated Lint for Clientside'>Updated Lint for Clientside</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2011/12/15/clientside-plugin-available-for-gedit-3/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>jQuery Timepicker Addon 0.9.8 Available</title><link>http://trentrichardson.com/2011/12/07/jquery-timepicker-addon-0-9-8-available/</link> <comments>http://trentrichardson.com/2011/12/07/jquery-timepicker-addon-0-9-8-available/#comments</comments> <pubDate>Wed, 07 Dec 2011 11:18:24 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[Timepicker]]></category> <category><![CDATA[date]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[localizations]]></category> <category><![CDATA[mobile]]></category> <category><![CDATA[picker]]></category> <category><![CDATA[time]]></category> <category><![CDATA[touch]]></category> <category><![CDATA[translations]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=1049</guid> <description><![CDATA[A new jQueryUI Timepicker Addon is now available. With this release comes many additions, including support for touch/mobile devices through integration with the sliderAccess plugin. Here is an overview list of the updates: Fix Daylight Savings bug. Fix and Add several localizations/translations. Fixed getter/setter bug. Fixed timepicker update issue with undefined &#8220;inst&#8221;. Updated CSS and [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2011/10/04/jquery-timepicker-addon-0-9-7-now-available/' rel='bookmark' title='jQuery Timepicker Addon 0.9.7 Now Available'>jQuery Timepicker Addon 0.9.7 Now Available</a></li><li><a
href='http://trentrichardson.com/2011/12/05/add-ui-slider-accessibility-to-timepicker/' rel='bookmark' title='Add UI-Slider Accessibility to Timepicker'>Add UI-Slider Accessibility to Timepicker</a></li><li><a
href='http://trentrichardson.com/2010/04/19/timepicker-addon-for-jquery-ui-datepicker/' rel='bookmark' title='Timepicker Addon for jQuery UI Datepicker'>Timepicker Addon for jQuery UI Datepicker</a></li></ol>]]></description> <content:encoded><![CDATA[<p>A new <a
href="http://trentrichardson.com/examples/timepicker/" title="jQuery Timepicker Addon">jQueryUI Timepicker Addon</a> is now available.  With this release comes many additions, including support for touch/mobile devices through <a
href="http://trentrichardson.com/2011/12/05/add-ui-slider-accessibility-to-timepicker/" title="Timepicker Addon integration with sliderAccess for Touch and Mobile Devices">integration with the sliderAccess plugin</a>.  Here is an overview list of the updates:</p><ul><li>Fix Daylight Savings bug.</li><li>Fix and Add several localizations/translations.</li><li>Fixed getter/setter bug.</li><li>Fixed timepicker update issue with undefined &#8220;inst&#8221;.</li><li>Updated CSS and generated markup.</li><li>Added integration with sliderAccess for touch devices.</li></ul><p>As always feel free to check out <a
href="https://github.com/trentrichardson/jQuery-Timepicker-Addon" title="Timepicker on Github" target="_blank">timepicker on Github</a>.  If you&#8217;re upgrading be sure to grab the new CSS, as the markup generated has been changed.  Hope you enjoy!</p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2011/10/04/jquery-timepicker-addon-0-9-7-now-available/' rel='bookmark' title='jQuery Timepicker Addon 0.9.7 Now Available'>jQuery Timepicker Addon 0.9.7 Now Available</a></li><li><a
href='http://trentrichardson.com/2011/12/05/add-ui-slider-accessibility-to-timepicker/' rel='bookmark' title='Add UI-Slider Accessibility to Timepicker'>Add UI-Slider Accessibility to Timepicker</a></li><li><a
href='http://trentrichardson.com/2010/04/19/timepicker-addon-for-jquery-ui-datepicker/' rel='bookmark' title='Timepicker Addon for jQuery UI Datepicker'>Timepicker Addon for jQuery UI Datepicker</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2011/12/07/jquery-timepicker-addon-0-9-8-available/feed/</wfw:commentRss> <slash:comments>36</slash:comments> </item> <item><title>Add UI-Slider Accessibility to Timepicker</title><link>http://trentrichardson.com/2011/12/05/add-ui-slider-accessibility-to-timepicker/</link> <comments>http://trentrichardson.com/2011/12/05/add-ui-slider-accessibility-to-timepicker/#comments</comments> <pubDate>Mon, 05 Dec 2011 11:18:10 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[Javascript]]></category> <category><![CDATA[Timepicker]]></category> <category><![CDATA[accessibility]]></category> <category><![CDATA[datetimepicker]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[slider]]></category> <category><![CDATA[touch]]></category> <category><![CDATA[ui]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=1035</guid> <description><![CDATA[You knew it was coming! An example of integrating my jQuery UI Slider Touch Accessibility addon to the jQuery Timepicker Addon. Before getting started I must note that this currently will only work with the latest Timepicker (version 0.9.8+). I had to clean up the markup generated in timepicker to make this easier, as well [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2011/12/07/jquery-timepicker-addon-0-9-8-available/' rel='bookmark' title='jQuery Timepicker Addon 0.9.8 Available'>jQuery Timepicker Addon 0.9.8 Available</a></li><li><a
href='http://trentrichardson.com/2010/04/19/timepicker-addon-for-jquery-ui-datepicker/' rel='bookmark' title='Timepicker Addon for jQuery UI Datepicker'>Timepicker Addon for jQuery UI Datepicker</a></li><li><a
href='http://trentrichardson.com/2011/08/31/adding-tooltip-to-timepicker-sliders/' rel='bookmark' title='Adding Tooltip to Timepicker Sliders'>Adding Tooltip to Timepicker Sliders</a></li></ol>]]></description> <content:encoded><![CDATA[<p><a
href="http://trentrichardson.com/wp-content/uploads/2011/12/timepicker-accessibility.png"><img
src="http://trentrichardson.com/wp-content/uploads/2011/12/timepicker-accessibility.png" alt="" title="Timepicker with Slider Accessibility" width="200" height="285" class="alignright size-full wp-image-1036" /></a></p><p>You knew it was coming! An example of integrating my <a
href="http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/" title="jQueryUI Slider Touch Accessibility Plugin">jQuery UI Slider Touch Accessibility addon</a> to the jQuery Timepicker Addon.  Before getting started I must note that this currently will only work with the <a
href="http://trentrichardson.com/examples/timepicker/" title="Get the latest Timepicker Addon" target="_blank">latest Timepicker (version 0.9.8+)</a>.  I had to clean up the markup generated in timepicker to make this easier, as well as other adjustments (Thanks to Dana over on the sliderAccess post).</p><p>First, start off with a normal timepicker.  This means include all the scripts and initiate (jquery, ui, timepicker, and sliderAccess plugin):</p><p>The HTML:</p><pre><code class="html">
&lt;div id="datepicker"&gt;&lt;/div&gt;
</code></pre><p>The JS:</p><pre><code class="js">
$('#datepicker').datetimepicker({});
</code></pre><p>Ok, with the newest timepicker addon there are two new options, addSliderAccess (true/false), and sliderAccessArgs (object of sliderAccess options).  Now we can attach our accessibility addon for touch devices:</p><pre><code class="js">
$('#datepicker').datetimepicker({
	addSliderAccess: true,
	sliderAccessArgs: { touchonly: false }
})
</code></pre><p>These two new options are solely for sliderAccess, and will attach it to any visible slider.  I passed in the touchonly option just so its immediately visible to you that it is installed.  In production you may want to either set to true or omit passing this option.  Then it will only be visible when a touch device is present.</p><p>Wow! Thats it!  Check with the <a
href="http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/" title="jQuery UI Slider Touch Accessibility Addon">Slider Accessibility docs</a> for more options.  I have also added this example to the <a
href="http://trentrichardson.com/examples/timepicker/" title="Timepicker Documentation" target="_blank">timepicker documentation</a>. Enjoy!</p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2011/12/07/jquery-timepicker-addon-0-9-8-available/' rel='bookmark' title='jQuery Timepicker Addon 0.9.8 Available'>jQuery Timepicker Addon 0.9.8 Available</a></li><li><a
href='http://trentrichardson.com/2010/04/19/timepicker-addon-for-jquery-ui-datepicker/' rel='bookmark' title='Timepicker Addon for jQuery UI Datepicker'>Timepicker Addon for jQuery UI Datepicker</a></li><li><a
href='http://trentrichardson.com/2011/08/31/adding-tooltip-to-timepicker-sliders/' rel='bookmark' title='Adding Tooltip to Timepicker Sliders'>Adding Tooltip to Timepicker Sliders</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2011/12/05/add-ui-slider-accessibility-to-timepicker/feed/</wfw:commentRss> <slash:comments>17</slash:comments> </item> <item><title>Discussion &#8211; How Asynchronous Should We Get</title><link>http://trentrichardson.com/2011/12/02/discussion-how-asynchronous-should-we-get/</link> <comments>http://trentrichardson.com/2011/12/02/discussion-how-asynchronous-should-we-get/#comments</comments> <pubDate>Fri, 02 Dec 2011 11:06:51 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[Javascript]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[ajax]]></category> <category><![CDATA[async]]></category> <category><![CDATA[asyncronous]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=1027</guid> <description><![CDATA[I recently read an article about turning the &#8220;asynchronous-ness&#8221; up a notch. His reasoning was very good, response times keep users on the site longer. Lets go in to more detail. Ajax requests allow users to stay on the same page, while the site contacts the server in the background. This may be to post [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2011/06/30/clientside-discussion/' rel='bookmark' title='Clientside Discussion'>Clientside Discussion</a></li><li><a
href='http://trentrichardson.com/2011/06/10/filter-select-dropdowns-as-you-type/' rel='bookmark' title='Filter Select Dropdowns as You Type'>Filter Select Dropdowns as You Type</a></li></ol>]]></description> <content:encoded><![CDATA[<p>I recently <a
href="http://alexmaccaw.co.uk/posts/async_ui" target="_blank">read an article</a> about turning the &#8220;asynchronous-ness&#8221; up a notch.  His reasoning was very good, response times keep users on the site longer.  Lets go in to more detail.</p><p>Ajax requests allow users to stay on the same page, while the site contacts the server in the background.  This may be to post some information, or retrieve information, and the polite thing to do these days is to indicate to the user &#8220;Yes, we&#8217;re processing your request, please wait..&#8221;.  But the claim here is there is no need to keep the user waiting.  It&#8217;s pointless and they may as well have done a complete page reload.</p><p>Since we can use asynchronous requests the user can continue what they were doing, while the page request runs in the background.  This makes the response &#8220;feel&#8221; faster to the user, even though it may not technically be.  Now the problem comes in when the user navigates the browser away from the page before an ajax request has completed, causing data incomplete data, or loss of data.  Where is the line drawn where it is &#8220;safe&#8221; to use this method.  To keep all data integrity I would have to say never.</p><p>However, I&#8217;m not going to say &#8220;never&#8221;.  Fact I believe with a little though we can avoid this almost always.  He notes that Google Mail nicely displays a message which is visible, but not in the way of the user moving on to their next task.  And although its ugly we could easily add onbeforeunload listeners to warn the user about navigating away from the page, then remove the listener when the request successfully completes.</p><p>So my thoughts are, why not?</p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2011/06/30/clientside-discussion/' rel='bookmark' title='Clientside Discussion'>Clientside Discussion</a></li><li><a
href='http://trentrichardson.com/2011/06/10/filter-select-dropdowns-as-you-type/' rel='bookmark' title='Filter Select Dropdowns as You Type'>Filter Select Dropdowns as You Type</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2011/12/02/discussion-how-asynchronous-should-we-get/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Car Bounce &#8211; Keep Up with Your Car&#8217;s Value</title><link>http://trentrichardson.com/2011/11/22/car-bounce-keep-up-with-your-cars-value/</link> <comments>http://trentrichardson.com/2011/11/22/car-bounce-keep-up-with-your-cars-value/#comments</comments> <pubDate>Tue, 22 Nov 2011 11:12:22 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[Design]]></category> <category><![CDATA[General]]></category> <category><![CDATA[bounce]]></category> <category><![CDATA[car]]></category> <category><![CDATA[finance]]></category> <category><![CDATA[payoff]]></category> <category><![CDATA[trade]]></category> <category><![CDATA[truck]]></category> <category><![CDATA[value]]></category> <category><![CDATA[vehicle]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=1013</guid> <description><![CDATA[I would like to take a moment to introduce my newest creation, CarBounce.com. Car Bounce is a simple website, which aims to help keep you informed of your position financially with your vehicles. Far too often people go months, even years, without checking on their financial position with their vehicle. Car Bounce brings an end [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2012/01/25/using-impress-js-for-a-car-bounce-video/' rel='bookmark' title='Using Impress.js for a Car Bounce Video'>Using Impress.js for a Car Bounce Video</a></li></ol>]]></description> <content:encoded><![CDATA[<p><a
href="http://trentrichardson.com/wp-content/uploads/2011/11/logo.png"><img
src="http://trentrichardson.com/wp-content/uploads/2011/11/logo.png" alt="" title="logo" width="200" height="95" class="alignright size-full wp-image-1015" /></a></p><p>I would like to take a moment to introduce my newest creation, <a
href="http://carbounce.com" title="Car Bounce - Keep up with your vehicle's value" target="_blank">CarBounce.com</a>.  Car Bounce is a simple website, which aims to help keep you informed of your position financially with your vehicles.  Far too often people go months, even years, without checking on their financial position with their vehicle.  Car Bounce brings an end to that!  How does it work?</p><p><a
href="http://trentrichardson.com/wp-content/uploads/2011/11/tour-tools.png"><img
src="http://trentrichardson.com/wp-content/uploads/2011/11/tour-tools.png" alt="" title="tour-tools" width="360" height="241" class="alignleft size-full wp-image-1016" /></a></p><p>Car Bounce provides a free breakdown of your vehicle with month by month estimates of it&#8217;s value, how far ahead/behind you are, and how much it would cost to purchase again at any point in time.  On top of that it also provides interactive graphs and tools to help you visualize and decide when may be the best time to trade, pay off, or even hang on to your car.</p><p>But Wait, There&#8217;s More!  In addition to the month by month breakdown and tools, you can also receive a summary email each month, export PDF&#8217;s, and Spreadsheets of the breakdown of each vehicle, bringing CarBounce right to your phone or desktop.</p><p>You no longer have any reason to forget about the value and financial position of you and your vehicles! <a
href="http://carbounce.com" title="Car Bounce - Get Started" target="_blank">Sign Up for free!</a></p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2012/01/25/using-impress-js-for-a-car-bounce-video/' rel='bookmark' title='Using Impress.js for a Car Bounce Video'>Using Impress.js for a Car Bounce Video</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2011/11/22/car-bounce-keep-up-with-your-cars-value/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>jQuery UI Sliders and Touch Accessibility</title><link>http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/</link> <comments>http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/#comments</comments> <pubDate>Fri, 11 Nov 2011 11:32:40 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[Javascript]]></category> <category><![CDATA[button]]></category> <category><![CDATA[event]]></category> <category><![CDATA[ipad]]></category> <category><![CDATA[iphone]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[mobile]]></category> <category><![CDATA[slider]]></category> <category><![CDATA[touch]]></category> <category><![CDATA[ui]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=997</guid> <description><![CDATA[jQuery UI is now a main stream user interface toolkit. It works most everywhere, but touch devices currently struggle with some of it&#8217;s widgets, including the Slider. The problem is touch and drag events can get mixed up between the web page and the browser. In other words when does a swipe indicate to scroll [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2011/12/05/add-ui-slider-accessibility-to-timepicker/' rel='bookmark' title='Add UI-Slider Accessibility to Timepicker'>Add UI-Slider Accessibility to Timepicker</a></li><li><a
href='http://trentrichardson.com/2011/08/31/adding-tooltip-to-timepicker-sliders/' rel='bookmark' title='Adding Tooltip to Timepicker Sliders'>Adding Tooltip to Timepicker Sliders</a></li><li><a
href='http://trentrichardson.com/2011/12/07/jquery-timepicker-addon-0-9-8-available/' rel='bookmark' title='jQuery Timepicker Addon 0.9.8 Available'>jQuery Timepicker Addon 0.9.8 Available</a></li></ol>]]></description> <content:encoded><![CDATA[<p>jQuery UI is now a main stream user interface toolkit.  It works most everywhere, but touch devices currently struggle with some of it&#8217;s widgets, including the Slider.  The problem is touch and drag events can get mixed up between the web page and the browser.  In other words when does a swipe indicate to scroll the page or slider adjustment.  Currently after a couple searches there are a couple attempts to fix this without much effort beyond including a javascript file:</p><ul><li><a
href="http://furf.com/exp/touch-punch/" title="Touch Punch" target="_blank">Touch Punch</a></li><li><a
href="http://code.google.com/p/jquery-ui-for-ipad-and-iphone/" title="jQuery.UI.iPad plugin" target="_blank">jQuery.UI.iPad plugin</a></li></ul><p>Essentially these two plugins listen for touch events and pass the event on to jQuery UI so they can be processed.  But still these can be cumbersome in my findings.  So I&#8217;ve come up with a quick solution.</p></p><p>When we use a slider, and touch events are available we know it is a touch device, so we can insert a couple jQuery UI buttons to increment and decrement the sliders.</p><p><a
href="http://trentrichardson.com/wp-content/uploads/2011/11/jquery-ui-slider-access.png"><img
src="http://trentrichardson.com/wp-content/uploads/2011/11/jquery-ui-slider-access.png" alt="Add Accessibility to jQuery UI Slider for Touch Devices" title="jquery-ui-slider-access" width="330" height="48" class="size-full wp-image-998" /></a></p><p>Adding this ability can be as simple as one more method chained after your slider:</p><pre><code class="js">
$('#slider').slider().sliderAccess();
</code></pre><p>On top of that if you want it to always show, even when it&#8217;s not a touch enabled device, you can specify that as well:</p><pre><code class="js">
$('#slider').slider().sliderAccess({ touchonly : false });
</code></pre><p>Ok, so you this is easy enough to use, lets see the goods:</p><pre><code class="js">
/*
 * jQuery UI Slider Access
 * By: Trent Richardson [http://trentrichardson.com]
 * Version 0.2
 * Last Modified: 12/12/2011
 *
 * Copyright 2011 Trent Richardson
 * Dual licensed under the MIT and GPL licenses.
 * http://trentrichardson.com/Impromptu/GPL-LICENSE.txt
 * http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
 *
 */
 (function ($) {

 	$.fn.extend({
 		sliderAccess: function (options) {
 			options = options || {};
 			options.touchonly = options.touchonly !== undefined ? options.touchonly : true; // by default only show it if touch device

 			if (options.touchonly === true &#038;&#038; !("ontouchend" in document))
 				return $(this);

 			return $(this).each(function (i, obj) {
 				var $t = $(this),
 				    o = $.extend({}, {
		 				    	where: 'after',
		 				    	step: $t.slider('option', 'step'),
		 				    	upIcon: 'ui-icon-plus',
		 				    	downIcon: 'ui-icon-minus',
		 				    	text: false,
		 				    	upText: '+',
		 				    	downText: '-',
		 				    	buttonset: true,
		 				    	buttonsetTag: 'span',
		 				    	speed: 150
	 				    }, options),
 				    $buttons = $('&lt;' + o.buttonsetTag + ' class="ui-slider-access"&gt;' +
 				    	'&lt;button data-icon="' + o.downIcon + '" data-step="-' + o.step + '"&gt;' + o.downText + '&lt;/button&gt;' +
 				    	'&lt;button data-icon="' + o.upIcon + '" data-step="' + o.step + '"&gt;' + o.upText + '&lt;/button&gt;' +
 				    	'&lt;/' + o.buttonsetTag + '&gt;');

 				$buttons.children('button').each(function (j, jobj) {
 					var $jt = $(this),
 						timeout = null,
 						increment = function($jt, $t, e) {
						 		var step = $jt.data('step'),
									curr = $t.slider('value'),
									newval = curr += step * 1,
									minval = $t.slider('option', 'min'),
									maxval = $t.slider('option', 'max');
								e.preventDefault();
								if (newval &lt; minval || newval &gt; maxval)
									return;
								$t.slider('value', newval);
								$t.slider("option", "slide").call($t, null, { value: newval });
						 	};

 					$jt.button({
 						text: o.text,
 						icons: { primary: $jt.data('icon') }
 					})
 					.bind('touchstart mousedown', function (e) {
 						increment($jt, $t, e);
 						timeout = setInterval(function () {
 							increment($jt, $t, e);
 						}, o.speed);
 					});

 					$(document).bind('touchend mouseup', function () {
	 						clearInterval(timeout);
	 						return false;
	 					});

 				});

 				// before or after
 				$t[o.where]($buttons);

 				if (o.buttonset) {
 					$buttons.removeClass('ui-corner-right').removeClass('ui-corner-left').buttonset();
 					$buttons.eq(0).addClass('ui-corner-left');
 					$buttons.eq(1).addClass('ui-corner-right');
 				}

 				// adjust the width so we don't break the original layout
 				var bOuterWidth = $buttons.css({
 					marginLeft: (o.where == 'after' ? 10 : 0),
 					marginRight: (o.where == 'before' ? 10 : 0)
 				}).outerWidth(true) + 5;
 				var tOuterWidth = $t.outerWidth(true);
 				$t.css('display', 'inline-block').width(tOuterWidth - bOuterWidth);
 			});
 		}
 	});

 })(jQuery);
</code></pre><p>A quick look at the source and you will notice I also threw in a few options to make things more versital.  The options are:</p><ul><li><strong>touchonly</strong> &#8211; true/false &#8211; Show this control Only for touch devices.</li><li><strong>where</strong> &#8211; before/after &#8211; Show this control before or after the slider.</li><li><strong>step</strong> &#8211; [0-9]+ &#8211; How much each button press increments.  Defaults to slider step.</li><li><strong>upIcon</strong> &#8211; one of ui icon names &#8211; defaults to &#8220;ui-icon-plus&#8221;.</li><li><strong>downIcon</strong> &#8211; one of ui icon names &#8211; defaults to &#8220;ui-icon-minus&#8221;.</li><li><strong>text</strong> &#8211; true/false &#8211; Show text in buttons?</li><li><strong>upText</strong> &#8211; string &#8211; Text of up button, default is &#8220;+&#8221;.</li><li><strong>downText</strong> &#8211; string &#8211; Text of down button, default is &#8220;-&#8221;.</li><li><strong>buttonset</strong> &#8211; true &#8211; Wrap the button in a button set?</li><li><strong>buttonsetTag</strong> &#8211; tagName &#8211; element type to wrap the buttons with, default is &#8220;span&#8221;.</li><li><strong>speed</strong> &#8211; [0-9]+ &#8211; Interval speed on touch-hold or click-hold to increment, default is 150</li></ul><p>It should also be noted that for this plugin to work you will need to include the button widget in your jQueryUI build.  From there we handle the rest.  When a button is clicked the change event will be fired through the slider, however the slide event will not.  This plugin makes no attempt to stop the click event on the buttons, so if you need to catch these events since there is not slide event you may do it the natural way.</p><p>One final note for this plugin.  It is small, I will likely not be making many updates to it.  If you need to tweak something feel free, and if you like post your changes here.  I may integrate it if I see the need.  The downfall and updside is as time passes jQueryUI will likely improve their support, so this plugin will become irrelevant.  Enjoy!</p><p><strong>Last updated: 2011-12-12</strong></p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2011/12/05/add-ui-slider-accessibility-to-timepicker/' rel='bookmark' title='Add UI-Slider Accessibility to Timepicker'>Add UI-Slider Accessibility to Timepicker</a></li><li><a
href='http://trentrichardson.com/2011/08/31/adding-tooltip-to-timepicker-sliders/' rel='bookmark' title='Adding Tooltip to Timepicker Sliders'>Adding Tooltip to Timepicker Sliders</a></li><li><a
href='http://trentrichardson.com/2011/12/07/jquery-timepicker-addon-0-9-8-available/' rel='bookmark' title='jQuery Timepicker Addon 0.9.8 Available'>jQuery Timepicker Addon 0.9.8 Available</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching using disk: basic
Object Caching 2737/2911 objects using disk: basic

Served from: trentrichardson.com @ 2012-02-03 21:01:56 -->
