<?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 &#187; Impromptu</title> <atom:link href="http://trentrichardson.com/category/impromptu/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>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>Impromptu 3.2 Gets Quick Update</title><link>http://trentrichardson.com/2011/11/04/impromptu-3-2-gets-quick-update/</link> <comments>http://trentrichardson.com/2011/11/04/impromptu-3-2-gets-quick-update/#comments</comments> <pubDate>Fri, 04 Nov 2011 11:20:29 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Impromptu]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[alert]]></category> <category><![CDATA[confirm]]></category> <category><![CDATA[form]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[lighbox]]></category> <category><![CDATA[modal]]></category> <category><![CDATA[overlay]]></category> <category><![CDATA[prompt]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=994</guid> <description><![CDATA[If you recently downloaded Impromptu 3.2, you may want to grab it again. A small bug was fixed. I didn&#8217;t find it worth while to create a new version, it was a line of code. On top of that the bug was merely a visual detail, and not critical. Long story short the overlay always [...]
Related posts:<ol><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><li><a
href='http://trentrichardson.com/2010/04/01/impromptu-3-1-is-here/' rel='bookmark' title='Impromptu 3.1 is Here'>Impromptu 3.1 is Here</a></li><li><a
href='http://trentrichardson.com/2011/06/20/jquery-impromptu-now-on-github/' rel='bookmark' title='jQuery Impromptu Now on Github'>jQuery Impromptu Now on Github</a></li></ol>]]></description> <content:encoded><![CDATA[<p>If you recently downloaded Impromptu 3.2, you may want to grab it again.  A small bug was fixed.  I didn&#8217;t find it worth while to create a new version, it was a line of code.  On top of that the bug was merely a visual detail, and not critical.  Long story short the overlay always stopped a few pixels short of the bottom of the document.  Thanks to the users for catching this!  Enjoy!</p><p><a
href="http://trentrichardson.com/Impromptu/" title="jQuery Impromptu Download and Documentation">jQuery Impromptu Download and Docuentation</a></p><p>Related posts:<ol><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><li><a
href='http://trentrichardson.com/2010/04/01/impromptu-3-1-is-here/' rel='bookmark' title='Impromptu 3.1 is Here'>Impromptu 3.1 is Here</a></li><li><a
href='http://trentrichardson.com/2011/06/20/jquery-impromptu-now-on-github/' rel='bookmark' title='jQuery Impromptu Now on Github'>jQuery Impromptu Now on Github</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2011/11/04/impromptu-3-2-gets-quick-update/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Impromptu 3.2 &#8211; Mobile jQuery Prompts</title><link>http://trentrichardson.com/2011/10/14/impromptu-3-2-mobile-jquery-prompts/</link> <comments>http://trentrichardson.com/2011/10/14/impromptu-3-2-mobile-jquery-prompts/#comments</comments> <pubDate>Fri, 14 Oct 2011 11:05:25 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[Impromptu]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[alert]]></category> <category><![CDATA[confirm]]></category> <category><![CDATA[dialog]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[modal]]></category> <category><![CDATA[overlay]]></category> <category><![CDATA[prompt]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=979</guid> <description><![CDATA[jQuery Impromptu has seen a little attention lately, mostly dealing with some mobile improvements. While it did work before on most decent devices, iPad and company politely decided not to enable the position:fixed css property. Of course the reasoning behind this is logical. If a large element is &#8220;position: fixed&#8221; on a mobile window, the [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2011/11/04/impromptu-3-2-gets-quick-update/' rel='bookmark' title='Impromptu 3.2 Gets Quick Update'>Impromptu 3.2 Gets Quick Update</a></li><li><a
href='http://trentrichardson.com/2010/04/01/impromptu-3-1-is-here/' rel='bookmark' title='Impromptu 3.1 is Here'>Impromptu 3.1 is Here</a></li><li><a
href='http://trentrichardson.com/2009/03/10/looking-for-impromptu-advice/' rel='bookmark' title='Looking for Impromptu Advice'>Looking for Impromptu Advice</a></li></ol>]]></description> <content:encoded><![CDATA[<p><img
src="http://trentrichardson.com/wp-content/uploads/2010/04/Impromptu-normal-button.jpg" alt="jQuery Impromptu" title="jQuery Impromptu" width="417" height="104" class="alignright size-full wp-image-593" /></p><p><a
href="http://trentrichardson.com/Impromptu/" title="jQuery Impromptu Documentation">jQuery Impromptu</a> has seen a little attention lately, mostly dealing with some mobile improvements.  While it did work before on most decent devices, iPad and company politely decided not to enable the position:fixed css property.  Of course the reasoning behind this is logical.  If a large element is &#8220;position: fixed&#8221; on a mobile window, the page can potentially become inaccessible.  This was a previous issue with Impromptu anyway.</p><p>So the new solution is not to use fixed positioning, but to initialize the prompt at your preferred location in the window&#8217;s current viewing area.  If you scroll the prompt stays put.  If you click on the fade the window scrolls back to the prompt.</p><p>This means a few items were added to the list of changes:</p><ul><li>New default show option: <em>promptDropIn</em> slides the prompt down from the top of the window viewing area</li><li>Prompt is no longer fixed position</li><li>Faded overlay click scrolls the window back to the prompts location</li><li>Fade now blocks the entire page, not just the viewing area</li></ul><p>There are now many plugins doing dialog and lightboxes, but Impromptu still sits atop the mountain of interactive form dialogs.  Check it out, leave some feedback, fork it on <a
href="https://github.com/trentrichardson/jQuery-Impromptu" title="jQuery Impromptu on Github" target="_blank">Github</a>! Enjoy!</p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2011/11/04/impromptu-3-2-gets-quick-update/' rel='bookmark' title='Impromptu 3.2 Gets Quick Update'>Impromptu 3.2 Gets Quick Update</a></li><li><a
href='http://trentrichardson.com/2010/04/01/impromptu-3-1-is-here/' rel='bookmark' title='Impromptu 3.1 is Here'>Impromptu 3.1 is Here</a></li><li><a
href='http://trentrichardson.com/2009/03/10/looking-for-impromptu-advice/' rel='bookmark' title='Looking for Impromptu Advice'>Looking for Impromptu Advice</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2011/10/14/impromptu-3-2-mobile-jquery-prompts/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Filter Select Dropdowns &#8211; Approach 2</title><link>http://trentrichardson.com/2011/06/23/filter-select-dropdowns-approach-2/</link> <comments>http://trentrichardson.com/2011/06/23/filter-select-dropdowns-approach-2/#comments</comments> <pubDate>Thu, 23 Jun 2011 11:31:19 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[Impromptu]]></category> <category><![CDATA[dropdown]]></category> <category><![CDATA[filter]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[options]]></category> <category><![CDATA[search]]></category> <category><![CDATA[select]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=855</guid> <description><![CDATA[In a post just a week or two ago I covered the topic of searching select dropdowns on key events. It seemed to work ok, but could use a bit of polishing. However for the project I was working on I ended up needing something a little more&#8230; &#8220;Obvious&#8221;. So the solution I came up [...]
Related posts:<ol><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><li><a
href='http://trentrichardson.com/2010/04/01/impromptu-3-1-is-here/' rel='bookmark' title='Impromptu 3.1 is Here'>Impromptu 3.1 is Here</a></li><li><a
href='http://trentrichardson.com/2011/05/18/updated-jquery-impromptu-loan-calculator/' rel='bookmark' title='Updated jQuery Impromptu Loan Calculator'>Updated jQuery Impromptu Loan Calculator</a></li></ol>]]></description> <content:encoded><![CDATA[<p>In a post just a week or two ago I covered the topic of <a
href="http://trentrichardson.com/2011/06/10/filter-select-dropdowns-as-you-type/">searching select dropdowns on key events</a>.  It seemed to work ok, but could use a bit of polishing.  However for the project I was working on I ended up needing something a little more&#8230; &#8220;Obvious&#8221;.  So the solution I came up with involved one of my favorite jQuery plugins.. Impromptu, and just some handy jQuery magic.  So what did I come up with?</p><p>Well for obvious reasons the way to interact with a dropdown are relatively limited.  Key events will need to be allowed for native browser functionality.  A click event will need to open the dropdown.  Double click just doesn&#8217;t seem to fire correctly (I guess since the first click opens the dropdown).  And surely not use the focus event to open a search.  Well jQuery comes with one nice little event named &#8220;contextmenu&#8221;.  Essentially its a right click or ctrl click.  And I got to thinking, you know, that would be a perfect place for such.  To me a right click indicates &#8220;I need some extra help on this item&#8221;.  So thats where we are.  We will be opening a slick search prompt on right click.  Lets see it:</p><pre class="js">
function showDropdownSearch(e){
	var $t = $(this),
		$o = $('option:enabled',$t),
		tval = $t.val(),
		html = '&lt;div id="optionsearch"&gt;'+
				'&lt;h3&gt;Search Options&lt;/h3&gt;'+
				'&lt;div class="textinput"&gt;&lt;label for=""&gt;Search &lt;span&gt;type your search term and press Enter&lt;/span&gt;&lt;span id="optionsearchstatus"&gt;Searching, please wait..&lt;/span&gt;&lt;/label&gt;&lt;input type="search" id="searchquery" name="searchquery" value="" placeholder="Search.."&gt;&lt;/div&gt;'+
				'&lt;div id="searchoptionswrapper"&gt;&lt;table id="searchoptions" class="radioTable" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;'+
			'&lt;/div&gt;';

	e.preventDefault();

	var $imp = $.prompt(html, {
			buttons: { Ok:true,Cancel:false },
			submit: function(v,m,f){
				if(v){
					$t.val(f.searchanswer).change();
				}
			}
		});

	var $so = $('#searchoptions', $imp);

	$so.delegate('input', 'click', function(){
		$('tr.checked', $so).removeClass('checked');
		$(this).parent().parent().addClass('checked');
	});

	$('#searchquery', $imp).focus().keydown(function(event){
		var $i = $(this),
			query = $i.val(),
			re = new RegExp(query,"i"),
			html = "",
			counter = 0,
			$sos = $('#optionsearchstatus',$imp);

		if(event.which == 13 || event.keyCode == 13 &#038;&#038; $.trim(query) !== ''){

			$sos.css('display','inline');

			$o.each(function(i,obj){
				var $currt = $(this),
					currval = $currt.attr('value'),
					currtxt = $currt.text(),
					currterm = currval + currtxt;

				if(re.test(currterm) &#038;&#038; currtxt !== '' &#038;&#038; currval !== ''){
					html += '&lt;tr class="row'+ (counter++ % 2) + (currval == tval? ' checked':'')+'"&gt;'+
							'&lt;td class="td-radio"&gt;&lt;input type="radio" name="searchanswer" id="searchanswer_'+ counter +'" value="'+ currval +'"'+ (currval == tval? ' checked':'') +'&gt;&lt;/td&gt;'+
							'&lt;td class="td-label"&gt;&lt;label for="searchanswer_'+ counter +'"&gt;'+ currtxt +'&lt;/label&gt;&lt;/td&gt;'+
						'&lt;/tr&gt;';
				}

			});

			$so.find('tbody').html(html);
			$so.find('tr:eq(0)').addClass('checked').find('input').attr('checked',true);

			$('#searchoptionswrapper',$imp).slideDown('slow', function(){
				$sos.hide();
			});

			event.preventDefault();
			return false;
		}// end if enter key

	});

	return false;
}
</pre><p>Thats the function.  Now here is how you fire the contextmenu event on a select with jQuery:</p><pre class="js">
// by direct event
$('select').bind('contextmenu', showDropdownSearch);

// or by delegation
$('#select_container').delegate('select','contextmenu',showDropdownSearch);
</pre><p>Lets see the <a
href="http://trentrichardson.com/Impromptu/demos/select_filter.php">demo of it in action</a>.</p><p>Now of course there is some extra css to go with it.  I will let you view the source on the demo page and grab it from there.  It just seems like too much bloat for a blog post.  So there you have a nice, hidden, discreet option search for your dropdowns.  This could also be wrapped up nicely in a jquery wrapper to be more jQuery-like, but I&#8217;ll leave that for another post.  Enjoy!</p><p>Related posts:<ol><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><li><a
href='http://trentrichardson.com/2010/04/01/impromptu-3-1-is-here/' rel='bookmark' title='Impromptu 3.1 is Here'>Impromptu 3.1 is Here</a></li><li><a
href='http://trentrichardson.com/2011/05/18/updated-jquery-impromptu-loan-calculator/' rel='bookmark' title='Updated jQuery Impromptu Loan Calculator'>Updated jQuery Impromptu Loan Calculator</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2011/06/23/filter-select-dropdowns-approach-2/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>jQuery Impromptu Now on Github</title><link>http://trentrichardson.com/2011/06/20/jquery-impromptu-now-on-github/</link> <comments>http://trentrichardson.com/2011/06/20/jquery-impromptu-now-on-github/#comments</comments> <pubDate>Mon, 20 Jun 2011 11:58:33 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[Impromptu]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[alert]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[lightbox]]></category> <category><![CDATA[modal]]></category> <category><![CDATA[prompt]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=848</guid> <description><![CDATA[Its been a while in the making, I&#8217;ve finally gotten Impromptu into Github, something I should have done a long time back. I&#8217;m excited to see how it evolves now, as it has been at a very stable 3.1 for a while. Also I created a themes folder with alternate themes (cough cough.. if you [...]
Related posts:<ol><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><li><a
href='http://trentrichardson.com/2011/11/04/impromptu-3-2-gets-quick-update/' rel='bookmark' title='Impromptu 3.2 Gets Quick Update'>Impromptu 3.2 Gets Quick Update</a></li><li><a
href='http://trentrichardson.com/2011/05/20/timepicker-localizations-on-github/' rel='bookmark' title='Timepicker Localizations on Github'>Timepicker Localizations on Github</a></li></ol>]]></description> <content:encoded><![CDATA[<p><a
href="http://trentrichardson.com/wp-content/uploads/2011/06/Impromptu-normal-button.png"><img
src="http://trentrichardson.com/wp-content/uploads/2011/06/Impromptu-normal-button.png" alt="jQuery Impromptu" title="Impromptu-normal-button" width="415" height="90" class="alignright size-full wp-image-851" /></a></p><p>Its been a while in the making, I&#8217;ve finally gotten Impromptu into Github, something I should have done a long time back.  I&#8217;m excited to see how it evolves now, as it has been at a very stable 3.1 for a while.  Also I created a themes folder with alternate themes (cough cough.. if you have some you like to contribute, those go in this folder&#8230;).  Dive in and take a look, fork it, send over some pulls!  The documentation is still at the same place:</p><ul><li><a
href="http://trentrichardson.com/Impromptu/">Impromptu Documentation</a></li><li><a
href="https://github.com/trentrichardson/jQuery-Impromptu">Impromptu on Github</a></li></ul><p>Related posts:<ol><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><li><a
href='http://trentrichardson.com/2011/11/04/impromptu-3-2-gets-quick-update/' rel='bookmark' title='Impromptu 3.2 Gets Quick Update'>Impromptu 3.2 Gets Quick Update</a></li><li><a
href='http://trentrichardson.com/2011/05/20/timepicker-localizations-on-github/' rel='bookmark' title='Timepicker Localizations on Github'>Timepicker Localizations on Github</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2011/06/20/jquery-impromptu-now-on-github/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>A Few New Colors, and Some Moo</title><link>http://trentrichardson.com/2011/06/08/a-few-new-colors-and-some-moo/</link> <comments>http://trentrichardson.com/2011/06/08/a-few-new-colors-and-some-moo/#comments</comments> <pubDate>Wed, 08 Jun 2011 11:41:53 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Design]]></category> <category><![CDATA[Impromptu]]></category> <category><![CDATA[Javascript]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=826</guid> <description><![CDATA[I swapped out a couple dark colors here on the site for something a little lighter. I also made a transition from jQuery to Mootools, which wasn&#8217;t much of a move as syntax highlighting and an Impromptu form were the only things I had going on here. It gave me a good opportunity to have [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2007/11/05/mootools-vs-jquery-speed-smoothness-friendliest/' rel='bookmark' title='Mootools vs. jQuery: Speed, Smoothness, Friendliest'>Mootools vs. jQuery: Speed, Smoothness, Friendliest</a></li><li><a
href='http://trentrichardson.com/2010/10/13/moopromptu-works-with-mootools-1-3/' rel='bookmark' title='Moopromptu works with Mootools 1.3'>Moopromptu works with Mootools 1.3</a></li><li><a
href='http://trentrichardson.com/2008/09/15/jstween-javascript-tweening/' rel='bookmark' title='JSTween: Javascript Tweening'>JSTween: Javascript Tweening</a></li></ol>]]></description> <content:encoded><![CDATA[<p>I swapped out a couple dark colors here on the site for something a little lighter.  I also made a transition from jQuery to Mootools, which wasn&#8217;t much of a move as syntax highlighting and an <a
href="http://trentrichardson.com/Impromptu/">Impromptu</a> form were the only things I had going on here.  It gave me a good opportunity to have a practical use for &#8220;Moopromptu&#8221;.  For the syntax highlighter I decided to go with <a
href="http://pradador.com/code/lighterjs/">Lighter</a>.  Lighter seems to work well, but I had to use the compatibility option with mootools.  In all I think I may have reduced the total file sizes a little, but not enough to make a big difference considering the amount of traffic I receive.</p><p>I guess I should have been a designer?.. I won&#8217;t quit my day job&#8230;</p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2007/11/05/mootools-vs-jquery-speed-smoothness-friendliest/' rel='bookmark' title='Mootools vs. jQuery: Speed, Smoothness, Friendliest'>Mootools vs. jQuery: Speed, Smoothness, Friendliest</a></li><li><a
href='http://trentrichardson.com/2010/10/13/moopromptu-works-with-mootools-1-3/' rel='bookmark' title='Moopromptu works with Mootools 1.3'>Moopromptu works with Mootools 1.3</a></li><li><a
href='http://trentrichardson.com/2008/09/15/jstween-javascript-tweening/' rel='bookmark' title='JSTween: Javascript Tweening'>JSTween: Javascript Tweening</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2011/06/08/a-few-new-colors-and-some-moo/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Updated jQuery Impromptu Loan Calculator</title><link>http://trentrichardson.com/2011/05/18/updated-jquery-impromptu-loan-calculator/</link> <comments>http://trentrichardson.com/2011/05/18/updated-jquery-impromptu-loan-calculator/#comments</comments> <pubDate>Wed, 18 May 2011 11:57:18 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[Impromptu]]></category> <category><![CDATA[calculator]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[loan]]></category> <category><![CDATA[mortgage]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=788</guid> <description><![CDATA[The jQuery Impromptu Loan Calculator has been around for some time now, but it had a couple things missing. First was a Down Payment option. This is pretty easy to figure really in your head before computing the numbers, but its always included in these type calculations. I guess its the more formal approach. Secondly, [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2009/03/04/jquery-loan-calculator-impromptu-style/' rel='bookmark' title='jQuery Loan Calculator &#8211; Impromptu Style'>jQuery Loan Calculator &#8211; Impromptu Style</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><li><a
href='http://trentrichardson.com/2011/06/23/filter-select-dropdowns-approach-2/' rel='bookmark' title='Filter Select Dropdowns &#8211; Approach 2'>Filter Select Dropdowns &#8211; Approach 2</a></li></ol>]]></description> <content:encoded><![CDATA[<p>The <a
href="http://trentrichardson.com/Impromptu/demos/loan_calculator.php">jQuery Impromptu Loan Calculator</a> has been around for some time now, but it had a couple things missing.  First was a Down Payment option.  This is pretty easy to figure really in your head before computing the numbers, but its always included in these type calculations.  I guess its the more formal approach.  Secondly, figuring an interest rate of 0% never worked, and with our stellar interest rates at the moment that is a must!</p><p>Here goes the rebirth of the code:</p><pre><code class="js">
function openLoanCalculatorPrompt(o){
	o = jQuery.extend({},{ amount:100000, down: 1500, years:15, rate:5 },o);

	var formstr = '&lt;p&gt;Calculate monthly payments:&lt;/p&gt;'+
		'&lt;div class="field"&gt;&lt;label for="intamount"&gt;Amount&lt;/label&gt;&lt;input type="text" name="intamount" id="intamount" value="'+ o.amount +'" /&gt;&lt;/div&gt;'+
		'&lt;div class="field"&gt;&lt;label for="intdown"&gt;Down Payment&lt;/label&gt;&lt;input type="text" name="intdown" id="intdown" value="'+ o.down +'" /&gt;&lt;/div&gt;'+
		'&lt;div class="field"&gt;&lt;label for="intyears"&gt;Years&lt;/label&gt;&lt;input type="text" name="intyears" id="intyears" value="'+ o.years +'" /&gt;&lt;/div&gt;'+
		'&lt;div class="field"&gt;&lt;label for="intrate"&gt;Rate&lt;/label&gt;&lt;input type="text" name="intrate" id="intrate" value="'+ o.rate +'" /&gt;&lt;/div&gt;';

	jqistates = {
		state0: {
			html: formstr,
			focus: 1,
			buttons: { Cancel: false, Calculate: true },
			submit: function(v, m, f){
				var e = "";
				m.find('.errorBlock').hide('fast',function(){ jQuery(this).remove(); });

				if (v) {

					if(isNaN(f.intamount))
						e += "Please enter a numeric amount (No commas)&lt;br /&gt;";

					if(isNaN(f.intdown))
						e += "Please enter a numeric down payment (No commas)&lt;br /&gt;";

					if(isNaN(f.intyears))
						e += "Please enter a numeric number of years&lt;br /&gt;";

					if(isNaN(f.intrate))
						e += "Please enter a numeric interest rate&lt;br /&gt;";

					if (e == "") {

						var interest = f.intrate/100;
						var years = f.intyears;
						var amount = f.intamount-f.intdown;
						var n = years * 12;

						if(f.intrate == 0){
							var m = amount / n;
						}
						else{
							var i = interest / 12;
							var i_to_n = Math.pow((i + 1), n);

							var p = amount * ((i * i_to_n) / (i_to_n - 1));
							var m = Math.round(p * 100) / 100;
						}

						jQuery.prompt.getStateContent('state1').find('#intmonthlypayment').text(m);
						jQuery.prompt.goToState('state1');

					}
					else{
						jQuery('&lt;div class="errorBlock" style="display: none;"&gt;'+ e +'&lt;/div&gt;').prependTo(m).show('slow');
					}
					return false;
				}
				else return true;
			}
		},
		state1: {
			html: 'Monthly Payment: $&lt;span id="intmonthlypayment"&gt;&lt;/span&gt;',
			focus: 1,
			buttons: { Back: false, Done: true },
			submit: function(v,m,f){
				if(v)
					return true;

				jQuery.prompt.goToState('state0');
				return false;
			}
		}
	};

	$.prompt(jqistates);
}
</code></pre><p>And to run this beast is pretty easy, even if you&#8217;re not that familiar with javascript, it is a single simple javascript function call:</p><pre><code class="js">
openLoanCalculatorPrompt({amount:150000, down:1000, years:30, rate:5.25});
</code></pre><p>There was previously a video of it in action, which is out of date but it does show how it works:</p><p><object
width="425" height="344"><param
name="movie" value="http://www.youtube.com/v/IeZPsJZw37Y&#038;hl=en&#038;fs=1"></param><param
name="allowFullScreen" value="true"></param><param
name="allowscriptaccess" value="always"></param><embed
src="http://www.youtube.com/v/IeZPsJZw37Y&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p><p>Thats it, hope you enjoy!</p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2009/03/04/jquery-loan-calculator-impromptu-style/' rel='bookmark' title='jQuery Loan Calculator &#8211; Impromptu Style'>jQuery Loan Calculator &#8211; Impromptu Style</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><li><a
href='http://trentrichardson.com/2011/06/23/filter-select-dropdowns-approach-2/' rel='bookmark' title='Filter Select Dropdowns &#8211; Approach 2'>Filter Select Dropdowns &#8211; Approach 2</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2011/05/18/updated-jquery-impromptu-loan-calculator/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Moopromptu works with Mootools 1.3</title><link>http://trentrichardson.com/2010/10/13/moopromptu-works-with-mootools-1-3/</link> <comments>http://trentrichardson.com/2010/10/13/moopromptu-works-with-mootools-1-3/#comments</comments> <pubDate>Wed, 13 Oct 2010 11:47:11 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[Impromptu]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[moopromptu]]></category> <category><![CDATA[mootools]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=676</guid> <description><![CDATA[Good news all the way around with the new Mootools release. First off Mootools is showing off its fast new selector engine Slick. Second, Moopromptu (the mootools version of Impromptu) works with the new release! Recently I also moved Moopromptu over to Forge, so you can check it out there. My thoughts on the new [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2010/05/18/moopromptumootools-version-of-impromptu/' rel='bookmark' title='Moopromptu &#8211; A Mootools Version of Impromptu'>Moopromptu &#8211; A Mootools Version of Impromptu</a></li><li><a
href='http://trentrichardson.com/2007/11/05/mootools-vs-jquery-speed-smoothness-friendliest/' rel='bookmark' title='Mootools vs. jQuery: Speed, Smoothness, Friendliest'>Mootools vs. jQuery: Speed, Smoothness, Friendliest</a></li><li><a
href='http://trentrichardson.com/2011/06/08/a-few-new-colors-and-some-moo/' rel='bookmark' title='A Few New Colors, and Some Moo'>A Few New Colors, and Some Moo</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Good news all the way around with the new Mootools release.  First off Mootools is showing off its fast new selector engine Slick.  Second, Moopromptu (the mootools version of Impromptu) works with the new release!  Recently I also moved Moopromptu over to Forge, so you can check it out there.</p><p>My thoughts on the new release is one of hope.  I hope all the changes have been made as far as depreciating methods from here on.  Its difficult to maintain code with methods becoming obsolete.  That being said I like their decisions to drop the $extend type functions and move to a more object based convention.  Anyway, here are some links:</p><ul><li><a
href="http://mootools.net/forge/p/moopromptu">Moopromptu on Forge</a></li><li><a
href="http://trentrichardson.com/Impromptu/index.php">Moopromptu/Impromptu Documentation</a></li></ul><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2010/05/18/moopromptumootools-version-of-impromptu/' rel='bookmark' title='Moopromptu &#8211; A Mootools Version of Impromptu'>Moopromptu &#8211; A Mootools Version of Impromptu</a></li><li><a
href='http://trentrichardson.com/2007/11/05/mootools-vs-jquery-speed-smoothness-friendliest/' rel='bookmark' title='Mootools vs. jQuery: Speed, Smoothness, Friendliest'>Mootools vs. jQuery: Speed, Smoothness, Friendliest</a></li><li><a
href='http://trentrichardson.com/2011/06/08/a-few-new-colors-and-some-moo/' rel='bookmark' title='A Few New Colors, and Some Moo'>A Few New Colors, and Some Moo</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2010/10/13/moopromptu-works-with-mootools-1-3/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Moopromptu &#8211; A Mootools Version of Impromptu</title><link>http://trentrichardson.com/2010/05/18/moopromptumootools-version-of-impromptu/</link> <comments>http://trentrichardson.com/2010/05/18/moopromptumootools-version-of-impromptu/#comments</comments> <pubDate>Tue, 18 May 2010 11:58:55 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[Impromptu]]></category> <category><![CDATA[alert]]></category> <category><![CDATA[confirm]]></category> <category><![CDATA[dialog]]></category> <category><![CDATA[modal]]></category> <category><![CDATA[mootools]]></category> <category><![CDATA[prompt]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=622</guid> <description><![CDATA[Sometimes my mind wonders and I just want to play with other technologies. This was one of those times. I&#8217;d been wanting to learn a little more about Mootools, especially after reading about their upcoming 1.3 release with a fast, new selector engine. So I figured what better way to learn a new framework than [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2010/10/13/moopromptu-works-with-mootools-1-3/' rel='bookmark' title='Moopromptu works with Mootools 1.3'>Moopromptu works with Mootools 1.3</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><li><a
href='http://trentrichardson.com/2007/08/30/jquery-impromptu-any-final-requests-for-version-1/' rel='bookmark' title='jQuery Impromptu &#8211; Final Call for Version 1.0'>jQuery Impromptu &#8211; Final Call for Version 1.0</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Sometimes my mind wonders and I just want to play with other technologies.  This was one of those times.  I&#8217;d been wanting to learn a little more about <a
href="http://mootools.net/">Mootools</a>, especially after reading about their upcoming <a
href="http://mootools.net/blog/2010/04/27/mootools-1-3-beta-1/">1.3 release</a> with a fast, new selector engine.  So I figured what better way to learn a new framework than to jump in the deep end and convert one of my favorite jQuery plugins, <a
href="http://trentrichardson.com/Impromptu/index.php">Impromptu</a>.</p><p>The journey was very educational.  I found that I like and dislike some things about Mootools, but overall it was an enjoyable experience.  I&#8217;ll write up another post on my likes and dislikes, this post is about the Mootools version of Impromptu.  So yep, there is now a Moopromptu!  I&#8217;ve converted all the methods of the jQuery versions, and to my knowledge the only option which is irrelevant is the &#8220;show&#8221; option, simply because with Core there aren&#8217;t any such functions.  So to call this beast we have $prompt instead of $.prompt, and we must call .show(msg, options) to open the prompt. (because I decided give it as much of the Mootools feel as possible)</p><pre><code class="js">
$prompt.show('hello world!', {
	buttons: { Ok: true, Cancel: false }
});
</code></pre><p>If you need to create a new instance of Impromptu it would look like the following:</p><pre><code class="js">
var myPrompt = new Impromptu();
myPrompt.show('hello world!');
</code></pre><p>And to access all the properties you would call them just like with the jQuery version:</p><pre><code class="js">
$prompt.goToState('myStateName');
$prompt.close();
// etc...
</code></pre><p>Really the only difference is $.prompt converts to $prompt, and to show it you call $prompt.show().  Moopromptu only requires Core, so there are no real requirements.  This is the first version, and my first Mootools plugin, so if any Mootools gurus out there notice I&#8217;ve not done something the Mootools way, let me know, or if you find a bug let me know, or if you just want to let me know how awesome Impromptu is (and I know it is) let me know :)  Enjoy!!</p><p><a
href="http://trentrichardson.com/Impromptu/index.php">Impromptu Downloads and Documentation</a></p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2010/10/13/moopromptu-works-with-mootools-1-3/' rel='bookmark' title='Moopromptu works with Mootools 1.3'>Moopromptu works with Mootools 1.3</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><li><a
href='http://trentrichardson.com/2007/08/30/jquery-impromptu-any-final-requests-for-version-1/' rel='bookmark' title='jQuery Impromptu &#8211; Final Call for Version 1.0'>jQuery Impromptu &#8211; Final Call for Version 1.0</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2010/05/18/moopromptumootools-version-of-impromptu/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Use CSS3 to Spice Up Impromptu Buttons</title><link>http://trentrichardson.com/2010/04/16/use-css3-to-spice-up-impromptu-buttons/</link> <comments>http://trentrichardson.com/2010/04/16/use-css3-to-spice-up-impromptu-buttons/#comments</comments> <pubDate>Fri, 16 Apr 2010 11:42:58 +0000</pubDate> <dc:creator>trent</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Design]]></category> <category><![CDATA[Impromptu]]></category> <category><![CDATA[css 3]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[selectors]]></category><guid
isPermaLink="false">http://trentrichardson.com/?p=592</guid> <description><![CDATA[I thought I would share with you quickly how you can use CSS3 selectors to spice up your Impromptu buttons. Lets say you have a prompt with a Delete button. Delete normally indicates caution/danger/warning which is usually represented by a red color. We can let our CSS do the dirty work and have it find [...]
Related posts:<ol><li><a
href='http://trentrichardson.com/2010/03/22/coloring-columns-rows-tables-css3-rgba/' rel='bookmark' title='Coloring Columns and Rows on Tables with CSS3 and RGBA'>Coloring Columns and Rows on Tables with CSS3 and RGBA</a></li><li><a
href='http://trentrichardson.com/2009/12/01/new-jquery-impromptu-theme-2/' rel='bookmark' title='New jQuery Impromptu Theme'>New jQuery Impromptu Theme</a></li><li><a
href='http://trentrichardson.com/2011/06/20/jquery-impromptu-now-on-github/' rel='bookmark' title='jQuery Impromptu Now on Github'>jQuery Impromptu Now on Github</a></li></ol>]]></description> <content:encoded><![CDATA[<p><img
src="http://trentrichardson.com/wp-content/uploads/2010/04/Impromptu-normal-button.jpg" alt="Normal Prompt" title="Impromptu-normal-button" width="417" height="104" class="alignnone size-full wp-image-593" /></p><p>I thought I would share with you quickly how you can use CSS3 selectors to spice up your Impromptu buttons.  Lets say you have a prompt with a Delete button.  Delete normally indicates caution/danger/warning which is usually represented by a red color.  We can let our CSS do the dirty work and have it find any buttons inside Impromptu which has an id ending with &#8220;Delete&#8221;.  Here is how you would do such:</p><pre><code class="css">
.jqi button[id $='Delete']{ background-color: #aa0000; }
</code></pre><p>And now you have a pretty red button like so:</p><p><img
src="http://trentrichardson.com/wp-content/uploads/2010/04/Impromptu-css3-red-button.jpg" alt="Prompt with red button" title="Impromptu-css3-red-button" width="397" height="95" class="alignnone size-full wp-image-594" /></p><p>Thats all there is to it.  Be sure to check back first of the week for a super post! Enjoy!</p><p>Related posts:<ol><li><a
href='http://trentrichardson.com/2010/03/22/coloring-columns-rows-tables-css3-rgba/' rel='bookmark' title='Coloring Columns and Rows on Tables with CSS3 and RGBA'>Coloring Columns and Rows on Tables with CSS3 and RGBA</a></li><li><a
href='http://trentrichardson.com/2009/12/01/new-jquery-impromptu-theme-2/' rel='bookmark' title='New jQuery Impromptu Theme'>New jQuery Impromptu Theme</a></li><li><a
href='http://trentrichardson.com/2011/06/20/jquery-impromptu-now-on-github/' rel='bookmark' title='jQuery Impromptu Now on Github'>jQuery Impromptu Now on Github</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://trentrichardson.com/2010/04/16/use-css3-to-spice-up-impromptu-buttons/feed/</wfw:commentRss> <slash:comments>2</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 5/106 queries in 0.048 seconds using disk: basic
Object Caching 2817/2924 objects using disk: basic

Served from: trentrichardson.com @ 2012-02-03 22:28:35 -->
