<?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>DLBATES.COM &#187; Ui</title>
	<atom:link href="http://dlbates.com/Post/tag/ui/feed/" rel="self" type="application/rss+xml" />
	<link>http://dlbates.com</link>
	<description>The life and times of David Bates, Programmer, Graphic Designer, Webmaster, Handyman, Logical Thinker, Husband, Father, and an INTP. Just sit back and take it in one post at a time.</description>
	<lastBuildDate>Sat, 17 Mar 2012 09:07:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Creating a lightbox using JQuery UI Dialog</title>
		<link>http://dlbates.com/Post/creating-a-lightbox-using-jquery-ui-dialog/</link>
		<comments>http://dlbates.com/Post/creating-a-lightbox-using-jquery-ui-dialog/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 02:58:09 +0000</pubDate>
		<dc:creator>David Bates</dc:creator>
				<category><![CDATA[All Post]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Cdn]]></category>
		<category><![CDATA[Combination Of The Two]]></category>
		<category><![CDATA[Content Area]]></category>
		<category><![CDATA[Darkness]]></category>
		<category><![CDATA[Div]]></category>
		<category><![CDATA[Element]]></category>
		<category><![CDATA[Fly]]></category>
		<category><![CDATA[Frustration]]></category>
		<category><![CDATA[Functionality]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Helper Function]]></category>
		<category><![CDATA[Js]]></category>
		<category><![CDATA[Libs]]></category>
		<category><![CDATA[Lightbox]]></category>
		<category><![CDATA[Link Href]]></category>
		<category><![CDATA[Love]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Platforms]]></category>
		<category><![CDATA[Script Type]]></category>
		<category><![CDATA[Showcase]]></category>
		<category><![CDATA[Text Javascript]]></category>
		<category><![CDATA[Thickbox]]></category>
		<category><![CDATA[Ui]]></category>

		<guid isPermaLink="false">http://dlbates.com/?p=1024</guid>
		<description><![CDATA[$(&#8220;&#8221;"#I&#8221;").Love(&#8220;&#8221;"JQuery&#8221;"); I love JQuery and I love JQuery UI even more but what I love most about the combination of the two is that they are cross browser compatible, delivered [...]]]></description>
			<content:encoded><![CDATA[<h2 align="center">$(&#8220;&#8221;"#I&#8221;").Love(&#8220;&#8221;"JQuery&#8221;");</h2>
<p>I love JQuery and I love JQuery UI even more but what I love most about the combination of the two is that they are cross browser compatible, delivered over a CDN network, and open source. This means that I can use anything I build on top of these two very powerful platforms in any website I wish, including the enterprise ones. </p>
<p>I was recently tasked with building a lightbox element that would allow me to showcase Vimeo videos (or any other content) in a cross browser CDN enabled way. At first I scoured the web looking for the best jquery lightbox plugin. I tried fancybox, shadowbox, thickbox, slimbox, facebox, other younameit-box plugins but they all either catered to one type of content, failed in the cross browser arena, or had unknown or grey licensing. </p>
<p>On day two of my growing frustration a friend of mine suggested I look at JQuery UI and specifically the Dialog method. So I did and was instantly hooked, and while it didn&#8217;t provide all of the functionality you need from a lightbox it came pretty darn close. So I began hacking away until I got down to a pretty comprehensive lightbox solution for video and then wrote a little helper function to populate the content area on the fly and set the title. What follows is how to do that: </p>
<h3>Step one: includes</h3>
<p>So first you need to include JQuery and JQuery UI within your page. The easiest way to do this is use Google&#8217;s CDN by placing the following two lines in your head.<br />
<code>&lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">&lt;/script><br />
&lt;script type="text/javascript" src=" https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js">&lt;/script><br />
</code><br />
You will also need to include a JQuery UI theme you can use the starter theme hosted on Google&#8217;s CDN too!<br />
<code><br />
&lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-darkness/jquery-ui.cs"<br />
        type="text/css" rel="Stylesheet" /><br />
</code><br />
Again that needs to be placed in your head. </p>
<h3>Step two: create a div</h3>
<p>We need to create a div that will not only hold our dialog but also most of the embed code for the video&#8217;s we will want to play.<br />
I would suggest adding this code near the footer of the page since it will load an iframe.<br />
<code><br />
&lt;div id="videoPlayerDiv"><br />
    &lt;iframe id="theVideo" src="" width="640" height="360" frameborder="0" webkitallowfullscreen="" allowfullscreen="">&lt;/iframe><br />
&lt;/div><br />
</code></p>
<h3>Step three .dialog()</h3>
<p>Now you need some JQuery magic on page load as well as creating the helper function<br />
<code>&lt;script type="text/jscript"><br />
            $(document).ready(function () {<br />
                $('#videoPlayerDiv').dialog({ autoOpen: false, modal: true, title: "RFMD Video", width: 664, resizable: false });<br />
                $("#videoPlayerDiv").bind("dialogclose", function (event, ui) {<br />
                    $('#theVideo').attr('src', '');<br />
                });</p>
<p>            });<br />
            function SetVideo(source, title) {<br />
                $('#theVideo').attr('src', source);<br />
                $('#videoPlayerDiv').dialog("option", "title", title);<br />
                $('#videoPlayerDiv').dialog('open');<br />
                $('.ui-widget-overlay').click(function () { $('#videoPlayerDiv').dialog('close'); });<br />
            };<br />
    &lt;/script></code><br />
This can go in your header or wherever you might have already put the $(document).ready clause.</p>
<h3>Final step: Call your helper function</h3>
<p>So now all you need to do is call the helper function and pass it the src url for the video and the title<br />
<code><br />
&lt;a href="#" onclick="javascript:SetVideo('http://player.vimeo.com/video/18888136?title=0&amp;byline=0&amp;portrait=0&amp;color=af0522"&amp;autoplay=1', 'Courtesy Vimeo User 1024');return false;">Video&lt;/a><br />
</code><br />
You can prolly tell I use asp.net from the javascript surrounds and return false. If you don&#8217;t use .net you don&#8217;t need this. </p>
<h3>Demo</h3>
<p><a href="http://dlbates.com/jquidialogdemo.html" title="click to open" target="_Blank">Click to open demo</a></p>
<div class="add-comments-link"><center><b><a href="http://dlbates.com/Post/creating-a-lightbox-using-jquery-ui-dialog/#respond" title="Make a Comment">Make a Comment</a></b></center></div>]]></content:encoded>
			<wfw:commentRss>http://dlbates.com/Post/creating-a-lightbox-using-jquery-ui-dialog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Windows Phone 7 Series</title>
		<link>http://dlbates.com/Post/windows-phone-7-series/</link>
		<comments>http://dlbates.com/Post/windows-phone-7-series/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 02:26:09 +0000</pubDate>
		<dc:creator>David Bates</dc:creator>
				<category><![CDATA[Accelerometer]]></category>
		<category><![CDATA[Contender]]></category>
		<category><![CDATA[Device Manufacturers]]></category>
		<category><![CDATA[Free Tools]]></category>
		<category><![CDATA[Gaming Platform]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Gpu]]></category>
		<category><![CDATA[Hardware Buttons]]></category>
		<category><![CDATA[Mobile Os]]></category>
		<category><![CDATA[Mobile Phones]]></category>
		<category><![CDATA[Motorola Q]]></category>
		<category><![CDATA[Multitasking]]></category>
		<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Processors]]></category>
		<category><![CDATA[Short Answer]]></category>
		<category><![CDATA[Shrug]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Ui]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[Xbox 360]]></category>

		<guid isPermaLink="false">http://dlbates.com/?p=520</guid>
		<description><![CDATA[So Windows is making a mobile operating system. Yes is the short answer, and it is brilliant but it seems up until now people never associated windows mobile with Microsoft [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.windowsphone7series.com/"><img src="http://dlbates.com/wp-content/uploads/2010/03/microsoft-windows-phone-7-series.jpg" alt="" title="microsoft-windows-phone-7-series" width="530" height="298" class="alignnone size-full wp-image-522" /></a><br />
So Windows is making a mobile operating system. Yes is the short answer, and it is brilliant but it seems up until now people never associated windows mobile with Microsoft maybe it was due to Microsoft itself never hyping the OS or maybe it&#8217;s the manufacturers fault. Who knows, who cares&#8230; As the local tech person for everyone I know I have had a lot of questions that start something like &#8220;why would Microsoft try to get into the mobile os business now? Is it because both Apple and Google have one? They must be trying to copy them huh?&#8221; I just smile and say well windows has been in mobile phones for a very long time&#8230; remember the Motorola Q? They all shrug and then say &#8220;yeah but it sucked&#8221;&#8230; and I say yes that is why they put so much effort into windows phone 7 series, because they needed to to stay in the game. </p>
<p>So now that I got their attention I delve into why Windows Phone 7 Series is an OS worth having such a long name. I think they got it right. First they are requiring the device manufacturers to have certain features like touchscreen, accelerometer, and three hardware buttons along the bottom. Then they are basing the phone on an already existing platform, Silverlight and XNA both of which are highly used on the xbox 360 Microsoft&#8217;s gaming platform. Finally they are making the tools free. This is a big step for Microsoft and you can still see on the <a href="http://developer.windowsphone.com/">http://developer.windowsphone.com/</a> they still charge $99 per year for developer access to legacy SDK&#8217;s and samples. What freelance developer wants to pay that&#8230; especially when Apple and Google both have free tools (Apple is not completely free as you have to buy an Intel mac) and the phone up till now did not have powerful processors or GPU&#8217;s. Windows Phone 7 Series even goes one step further to make the software on the phone support full multitasking or as some like to call it multi-APPing. Combine that with a slick UI and sound UI standards we have a real contender on our hands. I wish this phone would be released a lot sooner than the Christmas time-frame that they currently predict. </p>
<p>Now I have downloaded the SDK and even followed the keynote given at <a href="http://live.visitmix.com/">http://live.visitmix.com/</a> to make a picture viewing app. It worked great, was easy to follow given I already knew the tools from silverlight development and fast&#8230; on my computer the emulator outperformed any picture app I ever had on my IPhone. I can&#8217;t wait to see what comes of the app store and I hope that MS takes a hint from Apple and Google and decide to make it free to publish apps but charge for advertising and take a cut of sales. If so I&#8217;m in. </p>
<p>Thanks for reading<br />
David Bates</p>
<div class="add-comments-link"><center><b><a href="http://dlbates.com/Post/windows-phone-7-series/#respond" title="Make a Comment">Make a Comment</a></b></center></div>]]></content:encoded>
			<wfw:commentRss>http://dlbates.com/Post/windows-phone-7-series/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

