<?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>Radu Poenaru &#187; My work</title>
	<atom:link href="http://www.radupoenaru.com/category/my-work/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.radupoenaru.com</link>
	<description>Team leader and Software engineer</description>
	<lastBuildDate>Mon, 01 Aug 2011 20:47:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Improving Coding4Fun&#8217;s AboutPrompt</title>
		<link>http://www.radupoenaru.com/improving-coding4fun-aboutprompt/</link>
		<comments>http://www.radupoenaru.com/improving-coding4fun-aboutprompt/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 19:01:15 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[My work]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Master Thesis]]></category>
		<category><![CDATA[WP7]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/?p=1678</guid>
		<description><![CDATA[While creating the Windows Phone7 version of my Master Thesis project, I needed to show some custom dialogs. Because  I wanted a clean, nice look which would be also familiar, I choose the layout of the Windows MessageBox.<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/improving-coding4fun-aboutprompt/">Improving Coding4Fun&rsquo;s AboutPrompt</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fimproving-coding4fun-aboutprompt%2F' data-shr_title='Improving+Coding4Fun%26rsquo%3Bs+AboutPrompt'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fimproving-coding4fun-aboutprompt%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fimproving-coding4fun-aboutprompt%2F' data-shr_title='Improving+Coding4Fun%26rsquo%3Bs+AboutPrompt'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fimproving-coding4fun-aboutprompt%2F' data-shr_title='Improving+Coding4Fun%26rsquo%3Bs+AboutPrompt'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://www.radupoenaru.com/wp-content/uploads/2011/02/AboutPrompt.png"><img align="left" alt="AboutPrompt" border="0" height="88" longdesc="How to add a nice Warning to your Windows Phone 7 application" src="http://www.radupoenaru.com/wp-content/uploads/2011/02/AboutPrompt_thumb.png" style="background-image: none; border: 0px none; margin: 10px; padding-left: 0px; padding-right: 0px; display: inline; float: left; padding-top: 0px;" title="AboutPrompt" width="89" /></a>While creating the Windows Phone7 version of my Master Thesis project, I needed to show some custom dialogs. Since <a href="http://coding4fun.codeplex.com/">Coding4Fun </a>has some very nice dialogs, I explored the way that they might be customized to fit my needs. I needed a quick solution to a pressing problem.</p>
<p>I got in touch with this controls through WinPhoneGeek&rsquo;s article <a href="http://www.windowsphonegeek.com/articles/Coding4Fun-Toolkit-for-WP7-Overview-and-Getting-Started" target="_blank">Coding4Fun Toolkit for WP7 Overview and Getting Started</a>, where he presented from the eagle&rsquo;s eye the controls in the package. I was interested more in AboutPrompt control, but unfortunately he didn&rsquo;t had it presented in the detail.<span id="more-1678"></span></p>
<p>After opening the assembly and navigate to the class, you can see this:</p>
<p><a href="http://www.radupoenaru.com/wp-content/uploads/2011/02/image.png"><img alt="AboutPrompt Class " border="0" height="293" longdesc="The class of AboutPrompt object from Coding4Fun controls for Windows Phone 7" src="http://www.radupoenaru.com/wp-content/uploads/2011/02/image_thumb.png" style="background-image: none; border-width: 0px; margin: 10px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px;" title="AboutPrompt class" width="364" /></a></p>
<p>What is the most interesting is that we can have access to the (String)Title, (Object)Body and&nbsp; (Object)Footer properties. This opens a lot of possibilities, since what I wanted was to create a custom body in which to show an Error, Warning or Notification.</p>
<p>So let&rsquo;s dig into some code!</p>
<p>First, create a new Windows Phone 7 application in Visual Studio 2010 (if you are tired and just want to read this article, please do so &ndash; the full code is attached at the end of the article). You can create any flavor of WP7 application, as my code will be as unobtrusive as possible.</p>
<p><a href="http://www.radupoenaru.com/wp-content/uploads/2011/02/image3.png"><img align="left" alt="Add a button to your MainPage.xaml in new Windows Phone 7 application" border="0" height="240" longdesc="Add a button to your MainPage.xaml in new Windows Phone 7 application" src="http://www.radupoenaru.com/wp-content/uploads/2011/02/image3_thumb.png" style="background-image: none; border-width: 0px; margin: 10px; padding-left: 0px; padding-right: 0px; display: inline; float: left; padding-top: 0px;" title="Add a button to your MainPage.xaml in new Windows Phone 7 application" width="142" /></a>Then, download and add references to the Coding4Fun assemblies. You can read how to do this in the WinPhoneGeek&rsquo;s article. Next add a button on the MainPage.xaml (or any desired xaml page) and then hook it to the code.</p>
<p>Next, in the button click we need to create the message view, hook its Completed action and show it. The Completed event is very important &ndash; will give you the possibility of interacting with the user, recover from the error by restarting the erroneous action or just navigate through your app to a e-mail submission form, allowing user to describe the issue encountered while using your app &ndash; very important, while you want your WP7 application to get only high reviews and this can be accomplished only keeping the users happy.</p>
<p>Since the customization is quite simple, I took the pattern of the desktop messages, displaying only the essential:</p>
<ul>
<li>Title of the notification,</li>
<li>a icon describing the gravity of the notification,</li>
<li>a succinct description of the notification</li>
<li>more detailed description</li>
</ul>
<p>&nbsp;</p>
<p>The code to do this is the following (double click to select all code):</p>
<pre class="brush :csharp" style="width: 90%;">private void button1_Click ( object sender, RoutedEventArgs e ) {
    ModalNotification( &quot;My Fancy Error&quot;, &quot;Error while coding&quot;, &quot;Silence! I will debug you!&quot;, Notification.Warning );
}

private void button1_Click ( object sender, RoutedEventArgs e ) {    ModalNotification( &quot;My Fancy Error&quot;, &quot;Error while coding&quot;, &quot;Silence! I will debug you!&quot;, Notification.Warning );}public void ModalNotification ( string title, string semiTitle, String message, Notification notification ) {
    var about = new AboutPrompt( );
    about.Completed += new System.EventHandler&gt;( about_Completed );
    about.Title = title;
    var panel = new WrapPanel {
        HorizontalAlignment = HorizontalAlignment.Stretch,
        VerticalAlignment = VerticalAlignment.Stretch
    };

    Uri myUri = notification == Notification.Error ?
        new Uri( &quot;images/error.png&quot;, UriKind.RelativeOrAbsolute )
        : new Uri( &quot;images/warn.png&quot;, UriKind.RelativeOrAbsolute );
    ImageSource imgSource = new BitmapImage( myUri );
    var imgVisual = new Image { Source = imgSource, Height = 64, Width = 64 };

    var tbSemiTitle = new TextBlock {
        Text = semiTitle,
        Margin = new Thickness { Top = 8, Left = 18 },
        FontSize = 30
    };

    var tbMessage = new TextBlock {
        HorizontalAlignment = HorizontalAlignment.Stretch,
        VerticalAlignment = VerticalAlignment.Stretch,
        TextWrapping = TextWrapping.Wrap,
        Margin = new Thickness { Top = 20 },
        Text = message
    };

    panel.Children.Add( imgVisual );
    panel.Children.Add( tbSemiTitle );
    panel.Children.Add( tbMessage );
    about.Body = panel;

    about.Show( );
}

void about_Completed ( object sender, PopUpEventArgs e ) {
    // Implement here the logic to handle the return from Modal AboutPrompt
    throw new System.NotImplementedException( );
}

public enum Notification {
    Warning,
    Error
} ;</pre>
<p><a href="http://www.radupoenaru.com/wp-content/uploads/2011/02/image1.png"><img align="left" alt="My fancy error shown on Windows Phone 7 " border="0" height="240" longdesc="My fancy error shown on Windows Phone 7 " src="http://www.radupoenaru.com/wp-content/uploads/2011/02/image_thumb1.png" style="background-image: none; border-width: 0px; margin: 10px; padding-left: 0px; padding-right: 0px; display: inline; float: left; padding-top: 0px;" title="image" width="131" /></a>Now let&rsquo;s see what code does: First, it instantiates a new instance of AboutPrompt and hooks its Completed event to a proper handler. Here you can write your logic to handle the user confirmation.</p>
<p>Because&nbsp; I wanted a clean, nice look which would be also familiar, I choose the layout of the Windows MessageBox. As for the main title it was pretty easy, since I had access to the about.Title string property. But with the rest it got a little complicated, since about.Body doesn&rsquo;t specify which kind of control desires. By looking into the sources of the project, I noticed that it needs a Container &ndash; so I provided a Wrap Panel, in which I added a Image and two TextBlocks. The visual can be seen in the left:</p>
<p>The code can be freely downloaded from <a href="http://www.radupoenaru.com/wp-content/uploads/2011/02/windowsphoneapplication1.zip">here</a>.</p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/improving-coding4fun-aboutprompt/">Improving Coding4Fun&rsquo;s AboutPrompt</a></p>
<div class="shr-publisher-1678"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/improving-coding4fun-aboutprompt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding new Social icons to the Mystique theme</title>
		<link>http://www.radupoenaru.com/adding-new-social-icons-to-mystique-theme/</link>
		<comments>http://www.radupoenaru.com/adding-new-social-icons-to-mystique-theme/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 17:21:55 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/?p=1661</guid>
		<description><![CDATA[I use my blog to record and share my knowledge, but also to present to possible employers my skills. I use it like a marketing tool for my persona. For this, I need to make available not only the RSS and twitter account, but also resume profiles like Xing, LinkedIn and Facebook. <p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/adding-new-social-icons-to-mystique-theme/">Adding new Social icons to the Mystique theme</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fadding-new-social-icons-to-mystique-theme%2F' data-shr_title='Adding+new+Social+icons+to+the+Mystique+theme'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fadding-new-social-icons-to-mystique-theme%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fadding-new-social-icons-to-mystique-theme%2F' data-shr_title='Adding+new+Social+icons+to+the+Mystique+theme'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fadding-new-social-icons-to-mystique-theme%2F' data-shr_title='Adding+new+Social+icons+to+the+Mystique+theme'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://www.radupoenaru.com/wp-content/uploads/2010/05/wordpress.png" rel="lightbox[1225]" title="WordPress, my favourite blogging system."><img align="left" alt="Adding child themes to WordPress, my favourite blogging system." border="0" height="150" src="http://www.radupoenaru.com/wp-content/uploads/2010/05/wordpress_thumb.png" style="border-width: 0px; margin: 10px; display: inline;" title="Adding child themes to WordPress, my favourite blogging system." width="150" /></a>I use my blog to record and share my knowledge, but also to present to possible employers my skills. I use it like a marketing tool for my persona. For this, I need to make available not only the <a href="http://www.radupoenaru.com/feed/">RSS</a> and <a href="http://twitter.com/radu_poenaru">Twitter</a> account, but also resume profiles like <a href="https://www.xing.com/profile/Radu_Poenaru">Xing</a>, <a href="http://www.linkedin.com/in/radupoe">LinkedIn</a> and <a href="http://www.facebook.com/radu.poenaru">Facebook</a>.</p>
<p>Since I am using <a href="http://www.radupoenaru.com/tag/wordpress/">WordPress </a>and I know a little bit of <a href="http://www.radupoenaru.com/tag/php/">PHP</a> and MySQL I wanted to customize my current theme.But some time ago I&rsquo;ve read that they <a href="http://codex.wordpress.org/Child_Themes" target="_blank">don&rsquo;t encourage</a> you to customize directly the chosen theme, but instead create your own child theme, with the desired customizations. This way, when the theme will be updated, you won&rsquo;t loose neither time nor brains trying to redo all the modifications.</p>
<p><span id="more-1661"></span></p>
<p>Creating a child theme, directly from the developers of WordPress</p>
<blockquote style="width: 90%;">
<p>Making a child theme is very simple. Create a directory, put a properly formatted <i>style.css</i> file in it, and you have a child theme! With a little understanding of HTML and <a href="http://codex.wordpress.org/CSS">CSS</a>, you can make that <i>very basic child theme</i> modify the styling and layout of a parent theme to any extent without editing the files of the parent theme itself. That way, when the parent theme is updated, your modifications are preserved.</p>
</blockquote>
<p>For some time ago, I started using child themes. At first, it seemed a useless time investment, but since then the theme was updated 3 or 4 times, so imagine each time creating a list of modifications to the original, implement them again and again in the new version!</p>
<p>Let&rsquo;s see some code!</p>
<p>The modification that I will present now is how to add new icons for job websites, up on the bar. The steps are:</p>
<p>1. Using your preffered image editing tool (I preffer using <a href="http://www.getpaint.net/">Paint .Net</a>, very smart and effective PNG producer) I modified the <strong>nav-icons.png </strong>file :</p>
<p>From :<img alt="The initial set of Social icons" border="0" height="64" src="http://www.radupoenaru.com/wp-content/uploads/2011/01/nav-icons_old.png" style="background-image: none; border-width: 0px; margin: 10px 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px;" title="Initial Social icons" width="128" /> To: <img alt="The final set of Social icons" border="0" height="64" src="http://www.radupoenaru.com/wp-content/uploads/2011/01/nav-icons.png" style="background-image: none; border-width: 0px; margin: 10px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px;" title="New set of Social icons" width="320" /></p>
<p>The extra icons are taken from a royality free icon pack. They are 64 by 64 pixels. You can modify their sizes, but you&rsquo;ll also have to update the javascript code that moves the images up and down.</p>
<p>Note: To make your life easier and keep the modifications to a minimum, keep the Twitter icon first and the RSS last, otherwise you&rsquo;ll have to override the entire $nav_extra underneath.</p>
<p>2.&nbsp; Add the icons in your child theme, by concatenating the script that shows new buttons with the one which is already present, containing the Twitter and RSS. If you want to change the order of the icons, you can change the lines order. If you want to make the RSS icon first, instead of adding strings to $nav_extra, you&rsquo;ll have to recreate also the RSS and Twitter strings and insert them in the string variable. Don&rsquo;t forget to add the action to WordPress queue, such that your function to be called:</p>
<pre class="brush: php" style="width: 90%;">function mystique_navbuttons_pics($nav_extra)
{
  $nav_extra .= &#39;&lt;a href=&quot;http://www.facebook.com/radu.poenaru&quot; class=&quot;nav-extra facebook&quot; target=&quot;_blank&quot; title=&quot;Contact me on Facebook!&quot;&gt;&lt;span&gt;Contact me on Facebook!&lt;/span&gt;&lt;/a&gt;&#39;;
  $nav_extra .= &#39;&lt;a href=&quot;http://www.linkedin.com/in/radupoe&quot; class=&quot;nav-extra linkedin&quot; target=&quot;_blank&quot; title=&quot;Contact me on LinkedIn!&quot;&gt;&lt;span&gt;Contact me on LinkedIn!&lt;/span&gt;&lt;/a&gt;&#39;;
  $nav_extra .= &#39;&lt;a href=&quot;https://www.xing.com/profile/Radu_Poenaru&quot; class=&quot;nav-extra xing&quot; target=&quot;_blank&quot; title=&quot;Contact me on Xing!&quot;&gt;&lt;span&gt;Contact me on LinkedIn!&lt;/span&gt;&lt;/a&gt;&#39;;

  $nav_extra = str_replace(&quot;title&quot;, &quot;target=&#39;_blank&#39; title&quot;, $nav_extra) ;

  return $nav_extra;
}
add_action(&#39;mystique_navigation_extra&#39;, mystique_navbuttons_pics&#39;);</pre>
<p>3. Add the CSS required by the icons. This requires each icon to know where to start cutting from main PNG file its own appearance. We will create and inject the CSS in the corresponding file.</p>
<pre class="brush: php" style="width: 90%;">function mystique_navbuttons_css(){
 $i = THEME_URL.&#39;/images&#39;; ?&gt;
/* Extra navigation icons */
#header a.xing{background: url(&lt;?php echo $i; ?&gt;/nav-icons.png) no-repeat scroll -192px top transparent}
#header a.linkedin{background: url(&lt;?php echo $i; ?&gt;/nav-icons.png) no-repeat scroll -64px top transparent}
#header a.facebook{background: url(&lt;?php echo $i; ?&gt;/nav-icons.png) no-repeat scroll -128px top transparent}

&lt;?php
}
add_action(&#39;mystique_css&#39;,&#39;mystique_navbuttons_css&#39;);</pre>
<p>That&rsquo;s all guys, now you have a child theme wit your customizations and never afraid that you&rsquo;ll have to spend time again when the theme will be updated!</p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/adding-new-social-icons-to-mystique-theme/">Adding new Social icons to the Mystique theme</a></p>
<div class="shr-publisher-1661"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/adding-new-social-icons-to-mystique-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7 easy steps to use Webmatrix and WordPress local development</title>
		<link>http://www.radupoenaru.com/7-easy-steps-to-use-webmatrix-and-wordpress-local-development/</link>
		<comments>http://www.radupoenaru.com/7-easy-steps-to-use-webmatrix-and-wordpress-local-development/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 09:14:00 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Webmatrix]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/?p=1656</guid>
		<description><![CDATA[Almost all good developers that I know have some kind of repository of their code. Mine is my blog, this blog. Stay with me and you’ll find out how to easily be able to create your local version of Wordpress, customize and test your plugins.<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/7-easy-steps-to-use-webmatrix-and-wordpress-local-development/">7 easy steps to use Webmatrix and WordPress local development</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2F7-easy-steps-to-use-webmatrix-and-wordpress-local-development%2F' data-shr_title='7+easy+steps+to+use+Webmatrix+and+Wordpress+local+development'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2F7-easy-steps-to-use-webmatrix-and-wordpress-local-development%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2F7-easy-steps-to-use-webmatrix-and-wordpress-local-development%2F' data-shr_title='7+easy+steps+to+use+Webmatrix+and+Wordpress+local+development'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2F7-easy-steps-to-use-webmatrix-and-wordpress-local-development%2F' data-shr_title='7+easy+steps+to+use+Webmatrix+and+Wordpress+local+development'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://www.radupoenaru.com/wp-content/uploads/2011/01/webmatrix.png"><img align="left" alt="Use Webmatrix to setup your local WordPress development environment." border="0" height="77" src="http://www.radupoenaru.com/wp-content/uploads/2011/01/webmatrix_thumb.png" style="background-image: none; border-width: 0px; margin: 10px; padding-left: 0px; padding-right: 0px; display: inline; float: left; padding-top: 0px;" title="Webmatrix" width="74" /></a>Almost all good developers that I know have some kind of repository of their code. Mine is my blog, this blog. Stay with me and you&rsquo;ll find out how to easily be able to create your local version of WordPress, customize and test your plugins.</p>
<p>For&acute;this you&rsquo;ll need to follow the next steps:</p>
<ol>
<li>Go to Webmatrix official website and download the Web Platform Installer which will install for you not only Webmatrix itself, but also a lot of useful tools like an integrated webserver, Internet Information Services Express, PHP interpretor and its connectors just to name a few. But you can also use it to add new features like ASP .Net MVC3!<span id="more-1656"></span></li>
<li>Because now the install of MySQL server is not any more supported, you&rsquo;ll have to install it by yourself &ndash; go to their <a href="http://dev.mysql.com/downloads/mysql/5.1.html" target="_blank">official website</a> and download it from there. Choose the MSI Installer essentials and the process will be very easy. I prefer to install it as a service and then, from Control Panel &ndash;&gt; Services, to set it to start manually. This way won&rsquo;t eat resources when it is not needed.</li>
<li>Next, we&rsquo;ll download a MySQL GUI called <a href="http://www.heidisql.com/" target="_blank">HeidiSQL</a> &ndash; free and smart product. One might say that command line is enough, but I would rather concentrate on development instead of memorizing all those commands.</li>
<li>Create an empty database and a user. I personally like to set the database name, user and its password to the ones that I use on my production WordPress website. This way, I only have to modify only the DBHost in the WordPress&rsquo; configuration file.</li>
<li>Create a production database backup using your prefered tool &ndash; I use for quite a while the <a href="http://wordpress.org/extend/plugins/wp-db-backup/" target="_blank">WP-DB-Backup</a> plugin for WordPress to generate my scheduled backups. Import&nbsp; the content of the backup (using HeidiSQL is very easy &ndash; just point it to a zip, gzip archive or a sql file).</li>
<li>Now that we setup our database, let&rsquo;s go to the code &ndash; download locally the sources of your website using FTP or other tools that your hosting provides, open Webmatrix and create a new website using local files. This way you will setup your development workspace wherever you like &ndash; I prefer to use D: drive. Otherwise, you&rsquo;ll be prompted to use your MyDocuments folder which will not be available any more in case of windows clean reinstall &ndash; the entire c: drive will be wiped-out.</li>
<li>Make the proper changes to the wp-config file (if you followed my advice you&rsquo;ll just have to replace in DBHost your production server with localhost). Hit Run (the small green arrow from the Webmatrix top ribbon) and you&rsquo;re good to go!</li>
</ol>
<p>If by any change you get a blank window in your prefered browser stating that &ldquo;</p>
<h3>Error establishing a database connection</h3>
<p>&rdquo; or something like this, go and check that in your hosts file (found in c:\Windows\System32\drivers\etc\) you have uncommented the line with localhost:</p>
<p>&nbsp;</p>
<p># For example: <br />
	# <br />
	#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 102.54.94.97&nbsp;&nbsp;&nbsp;&nbsp; rhino.acme.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # source server <br />
	#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 38.25.63.10&nbsp;&nbsp;&nbsp;&nbsp; x.acme.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # x client host</p>
<p># localhost name resolution is handled within DNS itself. <br />
	&nbsp;&nbsp;&nbsp; 127.0.0.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost <br />
	#&nbsp;&nbsp;&nbsp; ::1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost</p>
<p>Happy coding!</p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/7-easy-steps-to-use-webmatrix-and-wordpress-local-development/">7 easy steps to use Webmatrix and WordPress local development</a></p>
<div class="shr-publisher-1656"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/7-easy-steps-to-use-webmatrix-and-wordpress-local-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add Syntax Highlight to WordPress</title>
		<link>http://www.radupoenaru.com/how-to-add-syntax-highlight-to-wordpress/</link>
		<comments>http://www.radupoenaru.com/how-to-add-syntax-highlight-to-wordpress/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 10:32:39 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Syntax Highlight]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/?p=1403</guid>
		<description><![CDATA[How to add SyntaxHilight in a child theme for the Wordpress blog. THis way you'll be able to update your theme without losing the additional scripts that customise it. Or move to another theme while keeping your favorite scripts attached to it.<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/how-to-add-syntax-highlight-to-wordpress/">How to add Syntax Highlight to WordPress</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhow-to-add-syntax-highlight-to-wordpress%2F' data-shr_title='How+to+add+Syntax+Highlight+to+Wordpress'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhow-to-add-syntax-highlight-to-wordpress%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhow-to-add-syntax-highlight-to-wordpress%2F' data-shr_title='How+to+add+Syntax+Highlight+to+Wordpress'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhow-to-add-syntax-highlight-to-wordpress%2F' data-shr_title='How+to+add+Syntax+Highlight+to+Wordpress'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a title="WordPress, my favourite blogging system." href="http://www.radupoenaru.com/wp-content/uploads/2010/05/wordpress.png" rel="lightbox[1225]"><img style="border-right-width: 0px; margin: 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Adding child themes to WordPress, my favourite blogging system." border="0" alt="Adding child themes to WordPress, my favourite blogging system." align="left" src="http://www.radupoenaru.com/wp-content/uploads/2010/05/wordpress_thumb.png" width="150" height="150" /></a>I wrote quite a while ago about <a href="http://www.radupoenaru.com/implement-syntax-highlighting/" target="_blank">How to implement Syntax Highlight</a> in your WordPress blog. It used an forward, yet permanent approach: modify you’re theme’s <a href="http://www.radupoenaru.com/how-to-add-a-nice-jquery-slider/" target="_blank">header.php</a>. But is it enough?</p>
<p>Lately, I wanted to update my blog’s theme to the newest version. But hey! I had a lot of modifications such the one above that kept me from doing a smooth update: <a href="http://www.radupoenaru.com/bnr-exchange-rate/" target="_blank">BNR Slider,</a> custom images for RSS and Twitter, hints, Syntax Highlight and so on.</p>
<p>The newest solution that I come up with is using a child theme, feature provided by WordPress engine. Basically, you have a theme applied to you blog that you like. Instead of modifying it, you create a new folder in theme’s directory with a special name who’ll be applied OVER your base theme, customizing only the aspects you need. Assuming that your theme’s name is <strong>MyFavoriteTheme</strong>, you’ll have to create the child theme as <strong>MyFavoriteTheme-child</strong>. </p>
<p>In order to use your new theme, you’ll have to create in the<strong> MyFavoriteTheme-child</strong> folder two files:</p>
<ol>
<li>styles.css – required – who’ll mark your folder as a child theme </li>
<li>functions.php – optional – for our example is required, as we’ll write code inside of it </li>
</ol>
<p> <span id="more-1403"></span>
<p>First, you Really need to setup the styles. The content is simple and explained in <a href="http://codex.wordpress.org/Child_Themes" target="_blank">this straight-forward article</a>.</p>
<p>The most interesting part is the functions.php, where we’ll define code to add our Syntax Highlight classes. You’ll have to put all needed JavaScript files in the /scripts folder, in the root of the WordPress install, and the css files respectively in /styles folder. This is just for easy of migration from one theme to the other, if you get bored or want to change your current one.</p>
<p>Then, in the aforementioned functions.php from your <strong>MyFavoriteTheme-child</strong> folder you have to insert the following text:</p>
<pre class="brush: php">&lt;?php
$path_to_scripts = &quot;/scripts/&quot;;
$path_to_styles = &quot;/styles/&quot;;

function register_syntaxhighlight() {
  wp_enqueue_script('shcore',  $path_to_scripts.'shcore.js');

  wp_enqueue_script('shbrushcsharp', $path_to_scripts.'shBrushCSharp.js');
  wp_enqueue_script('shbrushcpp', $path_to_scripts.'shBrushCpp.js');
  wp_enqueue_script('shbrushcss', $path_to_scripts.'shBrushCss.js');
  wp_enqueue_script('shbrushobjc', $path_to_scripts.'shBrushObjC.js');
  wp_enqueue_script('shbrushjscript', $path_to_scripts.'shBrushJScript.js');
  wp_enqueue_script('shbrushphp', $path_to_scripts.'shBrushPhp.js');
  wp_enqueue_script('shbrushplain', $path_to_scripts.'shBrushPlain.js');
  wp_enqueue_script('shbrushruby', $path_to_scripts.'shBrushRuby.js');
  wp_enqueue_script('shbrushsql', $path_to_scripts.'shBrushSql.js');
  wp_enqueue_script('shbrushxml', $path_to_scripts.'shBrushXml.js');
  wp_enqueue_script('shbrushas3', $path_to_scripts.'shBrushAs3.js');
  wp_enqueue_script('shbrushjava', $path_to_scripts.'shBrushJava.js');
  wp_enqueue_script('shbrushSql', $path_to_scripts.'shBrushSql.js');

  wp_enqueue_script('shstarter', $path_to_scripts.'shstarter.js', array('shcore'));

  wp_enqueue_style('shcore',  $path_to_styles.'shcore.css');
  wp_enqueue_style('shThemeDefault', $path_to_styles.'shThemeDefault.css');
}

add_action('init', 'register_syntaxhighlight');

?&gt;</pre>
<p>The code explanation:</p>
<ol>
<li>First we set some global vars, to know where the directories are; </li>
<li>Then we create a new function in which we add one by one the scripts required for the site – you can add the ones that you use and when you’ll post some content that requires a new brush, the shCore will kindly alert you that one of the brushes is missing, specify also the name of it. This way you’ll load only the ones used and no more, keeping the webpage size low and quality high. </li>
<li>wp_enqueue_script assures that the script will be loaded once. So if it is already loaded by any other plugin or theme, you will not have it downloaded twice; </li>
<li>finally, we add an WordPress action, binding to the init hook and add there our code. </li>
</ol>
<p>After uploading your code to your WordPress install (be careful to names &#8211; Linux is case sensitive), you’ll have to select as theme the child theme, so your modification will be applied. Until you’ll select the child theme, you will not see any changes!</p>
<p>That’s it, folks! </p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/how-to-add-syntax-highlight-to-wordpress/">How to add Syntax Highlight to WordPress</a></p>
<div class="shr-publisher-1403"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/how-to-add-syntax-highlight-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Add Silverlight to WordPress</title>
		<link>http://www.radupoenaru.com/add-silverlight-to-wordpress-2/</link>
		<comments>http://www.radupoenaru.com/add-silverlight-to-wordpress-2/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 17:45:04 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/?p=1354</guid>
		<description><![CDATA[Few easy steps to add your Silverlight application to your favorite blogging system (mine is Wordpress).<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/add-silverlight-to-wordpress-2/">Add Silverlight to WordPress</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fadd-silverlight-to-wordpress-2%2F' data-shr_title='Add+Silverlight+to+Wordpress'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fadd-silverlight-to-wordpress-2%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fadd-silverlight-to-wordpress-2%2F' data-shr_title='Add+Silverlight+to+Wordpress'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fadd-silverlight-to-wordpress-2%2F' data-shr_title='Add+Silverlight+to+Wordpress'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a class="cboxElement" title="silverlight" href="http://www.radupoenaru.com/wp-content/uploads/2010/06/silverlight1.png" rel="lightbox[1338]"><img style="border-right-width: 0px; margin: 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Few easy steps to add your Silverlight application to your favorite blogging system (mine is WordPress)." border="0" alt="Few easy steps to add your Silverlight application to your favorite blogging system (mine is WordPress)." align="left" src="http://www.radupoenaru.com/wp-content/uploads/2010/06/silverlight_thumb1.png" width="91" height="89" /></a>
<p>As I presented earlier, you can easily create a <a href="http://www.radupoenaru.com/silverlight-videoplayer-for-railscasts/">Silverlight video player</a> and you can see it working <a href="http://www.radupoenaru.com/railscasts-silverlight-video-player/">pretty nice</a>. Not to mention that it can play&#160; a lot of formats and it is only 344 kb in size!&#160; Now let’s see how this is possible and how can one do it on his website.</p>
<p>From the start, <a href="http://www.radupoenaru.com/tag/silverlight-4/">Silverlight</a> was meant to be as easiest as possible to develop and deploy. Also, the cross browser (running on all major browsers) and cross platform (running on Linux, <a href="http://www.radupoenaru.com/tag/objective-c">Mac OSX</a> and Windows) was a requirement. But more than this, not to depend on the server side on .Net framework was also important. So you can deploy and run (only for running you’ll need the Silverlight Runtime installed) your app no matter the OS (Operating System).</p>
<p>This is why we discuss today on adding Silverlight to WordPress and not on How to deploy Silverlight on Linux. From the server’s OS point of view, Silverlight is just another file so you don’t need any plugin nor installs on the server side. It is on the client side where it is downloaded, setup with parameters and processed and here you need to install the Silverlight runtime – a mere of 4 Mb. If you’ve developed prior Adobe Flash application, you’ll feel very natural on the process. So let’s begin our ride to add your Silverlight application to WordPress.</p>
<h4>Step 1.</h4>
<p>Develop your Silverlight application. You should have a .xap file built in order to go further. </p>
</p>
<p> <span id="more-1354"></span><br />
<h4>Step 2.</h4>
<p>Upload to your WordPress blog your Silverlight application to a folder of your desire and then the Silverlight.js file that you find in your Visual Studio solution, in the web application project (I prefer to the root’s scripts folder). If you don’t find it, you can take it from <a href="http://www.radupoenaru.com/scripts/silverlight.js">here</a>, but beware that this might be outdated. Afterwards, create a new file, called silverlight_app.js ( I prefer lowercasing all my server side files so I won’t have problems with case-sensitive OS like Linux). In that file, paste the following script (the default way to handle Silverlight errors) and then upload it also:</p>
<pre class="brush: js">
function onSilverlightError(sender, args) {
    var appSource = &quot;&quot;;
    if (sender != null &amp;&amp; sender != 0) {
        appSource = sender.getHost().Source;
    }

    var errorType = args.ErrorType;
    var iErrorCode = args.ErrorCode;

    if (errorType == &quot;ImageError&quot; || errorType == &quot;MediaError&quot;) {
        return;
    }

    var errMsg = &quot;Unhandled Error in Silverlight Application &quot; +  appSource + &quot;\n&quot; ;

    errMsg += &quot;Code: &quot;+ iErrorCode + &quot;    \n&quot;;
    errMsg += &quot;Category: &quot; + errorType + &quot;       \n&quot;;
    errMsg += &quot;Message: &quot; + args.ErrorMessage + &quot;     \n&quot;;

    if (errorType == &quot;ParserError&quot;) {
        errMsg += &quot;File: &quot; + args.xamlFile + &quot;     \n&quot;;
        errMsg += &quot;Line: &quot; + args.lineNumber + &quot;     \n&quot;;
        errMsg += &quot;Position: &quot; + args.charPosition + &quot;     \n&quot;;
    }
    else if (errorType == &quot;RuntimeError&quot;) {
        if (args.lineNumber != 0) {
            errMsg += &quot;Line: &quot; + args.lineNumber + &quot;     \n&quot;;
            errMsg += &quot;Position: &quot; +  args.charPosition + &quot;     \n&quot;;
        }
        errMsg += &quot;MethodName: &quot; + args.methodName + &quot;     \n&quot;;
    }

    throw new Error(errMsg);
}</pre>
<p>Add references to both files in your WordPress theme&#8217;s header file, inside the &lt;head&gt;&lt;/head&gt; tag (you can edit the header.php).Note that even if the theme’s folder way deep from the root, the actual page processing is done in the root, where core web files are located. This is why we have added scripts with this path:</p>
<pre class="brush: html">&lt;script src=&quot;scripts/silverlight.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;scripts/silverlight_app.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</pre>
<h4>Step 3. </h4>
<p>Create a new article in which you put the Silverlight object. Note that some blog editors (like Windows LiveWriter doesn’t like to have inside the article &lt; or &gt; so you’ll have to replace them with their HTML equivalents &amp;lt; and &amp;gt;). Also replace the PathTo with your actual path&#160; where you uploaded your Silverlight application ( can be a relative path or full http path – as long as you point to the application’s directory) and YourSilverlightApplicationName.xap with the actual name of your application :</p>
<pre class="brush: html">&lt;form id=&quot;form1&quot; style=&quot;height:100%&quot;&gt;
&lt;div id=&quot;silverlightControlHost&quot; style=&quot;width:400px; height:300px&quot; &gt;
    &lt;object data=&quot;data:application/x-silverlight-2,&quot; type=&quot;application/x-silverlight-2&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;
	  &lt;param name=&quot;source&quot; value=&quot;PathTo/YourSilverlightApplicationName.xap&quot;/&gt;
	  &lt;param name=&quot;onError&quot; value=&quot;onSilverlightError&quot; /&gt;
	  &lt;param name=&quot;background&quot; value=&quot;white&quot; /&gt;
	  &lt;param name=&quot;minRuntimeVersion&quot; value=&quot;4.0.50401.0&quot; /&gt;
	  &lt;param name=&quot;autoUpgrade&quot; value=&quot;true&quot; /&gt;
	  &lt;a href=&quot;http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=4.0.50401.0&quot; style=&quot;text-decoration:none&quot;&gt;
			  &lt;img src=&quot;http://go.microsoft.com/fwlink/?LinkId=161376&quot; alt=&quot;Get Microsoft Silverlight&quot; style=&quot;border-style:none&quot;/&gt;
	  &lt;/a&gt;
    &lt;/object&gt;&lt;iframe id=&quot;_sl_historyFrame&quot; style=&quot;visibility:hidden;height:0px;width:0px;border:0px&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;/form&gt;</pre>
<h4>Step 4. </h4>
<p>Post the article and your hard worked Silverlight application!</p>
<p>That’s all! </p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/add-silverlight-to-wordpress-2/">Add Silverlight to WordPress</a></p>
<div class="shr-publisher-1354"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/add-silverlight-to-wordpress-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Silverlight VideoPlayer for RailsCasts</title>
		<link>http://www.radupoenaru.com/silverlight-videoplayer-for-railscasts/</link>
		<comments>http://www.radupoenaru.com/silverlight-videoplayer-for-railscasts/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 14:28:00 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/?p=1338</guid>
		<description><![CDATA[This is my second shot, this time in Silverlight 4, to develop a video player for RailsCasts. I learned a great bunch of stuff and used IValueConverter, RSS parsing with LINQtoXML, XAML, deep template customisation, dispatching.<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/silverlight-videoplayer-for-railscasts/">Silverlight VideoPlayer for RailsCasts</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fsilverlight-videoplayer-for-railscasts%2F' data-shr_title='Silverlight+VideoPlayer+for+RailsCasts'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fsilverlight-videoplayer-for-railscasts%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fsilverlight-videoplayer-for-railscasts%2F' data-shr_title='Silverlight+VideoPlayer+for+RailsCasts'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fsilverlight-videoplayer-for-railscasts%2F' data-shr_title='Silverlight+VideoPlayer+for+RailsCasts'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://www.radupoenaru.com/wp-content/uploads/2010/06/silverlight1.png"><img style="border-right-width: 0px; margin: 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="silverlight" border="0" alt="silverlight" align="left" src="http://www.radupoenaru.com/wp-content/uploads/2010/06/silverlight_thumb1.png" width="91" height="89" /></a>
<p>I am and will be a Microsoft Developer. While working for convenience with other tools, I love strong type languages. I don’t want to ship products because I saved once and hit “s” one more time, so my product will be shipped with that small, human and yet unpardonable error in code. </p>
<p>How many times did you loose your time and effort with PHP in order to find a small mistake like this?</p>
<p>In my pursue on Microsoft tools path I started enjoying the Silverlight technology. Who might not know, Silverlight is a competitor to Flash. By now, on its 4th version, is way above Adobe Flash in almost all areas (I actually worked with Flex and Flash recently, so I really know what I’m talking about):</p>
<ul>
<li>Easy to develop : the C# language is a world class, easy to write in, with good compiler, a lot of resources and a VERY good IDE (try to write code and animations in same time in that Flash IDE and you’ll see what I mean) </li>
<li>Supports Full HD (there are examples on the net with 2 or 3 full HD movies playing), while Flash just tries to get HD with lots of CPU used. </li>
<li>The model of development is the same for in Browser and Out of Browser – you don’t need to change the tool from Flash to Flex in order to have same product for Desktop and Web. </li>
</ul>
<p> <span id="more-1338"></span>
<p>So I want to really learn, but what example shall I have? My <a href="http://www.radupoenaru.com/unibonn/">second job</a> as student is to work in Uni-Bonn, developing a <a href="http://www.radupoenaru.com/tag/ruby-on-rails/">Ruby on Rails</a> solution for them. While this is also an interpreted language, the RubyMine IDE makes it possible not to miss a variable or a mistyped string. It doesn’t provide types, but still, it’s a step forward. To improve my Rails skills I use a lot the website of a professional Ruby developer, <a href="http://railscasts.com/">Ryan Bates</a>. He has a lot of RailsCasts and he adds one each week. But unfortunately, being an Apple user, the movie is encoded as .mov file. I discovered that on the second link, with smaller font, provides also an .m4p link.</p>
<p>So I&#160; started developing a web Silverlight player for its movies. Yeah, I know, the web is full of them, but I wanted to lean this technology and also improve my access to Rails Casts.</p>
<p>I begun with a simple Silverlight project, adding a MediaElement on the canvas and set its Source property to a movie. It immediately started playing – was a nice experience by now. But you need controls for moving along the movie timeline, a list from which to choose your desired movie.</p>
<p>Thus, I started creating two User controls – one for MediaElement controls, and other for retrieving the guy’s rss feed, parse it and display it nicely. While the controls were quite fast to develop, the list took more time. Also because I wanted to learn a little bit of Expression Blend. So I used the Shawn Wildermuth’s <a href="http://wildermuth.com/dls/Dirty_Little_Secrets_Episode_2">Dirty Little Secret #2</a> and learn deep custom templating for a Listbox.</p>
<p>Putting all together was a breeze, the most time used was for testing the final product.</p>
<p>You can go directly to the Silverlight player and <a href="http://www.radupoenaru.com/railscasts-silverlight-video-player/">see the result</a>.</p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/silverlight-videoplayer-for-railscasts/">Silverlight VideoPlayer for RailsCasts</a></p>
<div class="shr-publisher-1338"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/silverlight-videoplayer-for-railscasts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Railscasts Silverlight video player</title>
		<link>http://www.radupoenaru.com/railscasts-silverlight-video-player/</link>
		<comments>http://www.radupoenaru.com/railscasts-silverlight-video-player/#comments</comments>
		<pubDate>Mon, 31 May 2010 10:46:36 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/?p=1328</guid>
		<description><![CDATA[Silverlight 4 player for RailsCasts. Created by Radu Poenaru using Silverlight 4, XAML, skining a ListBox completely,  deep control templates, IValueConverters, LinqToXml RSS feed parsing.<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/railscasts-silverlight-video-player/">Railscasts Silverlight video player</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Frailscasts-silverlight-video-player%2F' data-shr_title='Railscasts+Silverlight+video+player'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Frailscasts-silverlight-video-player%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Frailscasts-silverlight-video-player%2F' data-shr_title='Railscasts+Silverlight+video+player'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Frailscasts-silverlight-video-player%2F' data-shr_title='Railscasts+Silverlight+video+player'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://www.radupoenaru.com/wp-content/uploads/2009/06/microsoft-silverlight.jpg"><img style="border-right-width: 0px; margin: 10px 20px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="microsoft_silverlight" border="0" alt="microsoft_silverlight" align="left" src="http://www.radupoenaru.com/wp-content/uploads/2009/06/microsoft-silverlight-thumb.jpg" width="134" height="150" /></a>
<p>This is my second shot to create a better player for Railcasts. As you can see, it goes better and better. Who knows what might be next?</p>
<div>If you want to know more about the process through&#160; which this player was designed you can read also:</div>
<ul>
<li><a href="http://www.radupoenaru.com/silverlight-videoplayer-for-railscasts/">How and why I choose the Silverlight platform</a> </li>
<li><a href="http://www.radupoenaru.com/add-silverlight-to-wordpress-2/">How to integrate your Silverlight content with your WordPress blog</a> (and presumable all blog systems who allow you to add JavaScript) </li>
</ul>
<form style="height: 100%" id="form1" runat="server">
<div style="width: 400px; height: 300px" id="silverlightControlHost"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"><param name="source" value="http://www.radupoenaru.com/ClientBin/RailsPlayer.xap" /><param name="onError" value="onSilverlightError" /><param name="background" value="white" /><param name="enableHtmlAccess" value="true"/><param name="minRuntimeVersion" value="4.0.50401.0" /><param name="autoUpgrade" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=4.0.50401.0" style="text-decoration:none">  			  <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none" /> 		  </a> 	    </object><iframe style="border-right-width: 0px; width: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px; visibility: hidden; border-left-width: 0px" id="_sl_historyFrame"></iframe></div>
</p></form>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/railscasts-silverlight-video-player/">Railscasts Silverlight video player</a></p>
<div class="shr-publisher-1328"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/railscasts-silverlight-video-player/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create a simple HTML .MOV player</title>
		<link>http://www.radupoenaru.com/create-a-simple-html-mov-player/</link>
		<comments>http://www.radupoenaru.com/create-a-simple-html-mov-player/#comments</comments>
		<pubDate>Wed, 26 May 2010 13:05:25 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/?p=1304</guid>
		<description><![CDATA[As a Ruby developer, I work quite a lot with their “special” plugins called gems. The nice fact about the gems is that they bring lots of functionality. By example, there’s a gem for paginating a collection who takes just few parameters and not only that finds out how many objects the collection has, but&#8230;<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/create-a-simple-html-mov-player/">Create a simple HTML .MOV player</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fcreate-a-simple-html-mov-player%2F' data-shr_title='Create+a+simple+HTML+.MOV+player'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fcreate-a-simple-html-mov-player%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fcreate-a-simple-html-mov-player%2F' data-shr_title='Create+a+simple+HTML+.MOV+player'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fcreate-a-simple-html-mov-player%2F' data-shr_title='Create+a+simple+HTML+.MOV+player'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img style="border-right-width: 0px; margin: 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="This is how I added ui-icon to JQuery tabs" border="0" alt="This is how I added ui-icon to JQuery tabs" align="left" src="http://www.radupoenaru.com/wp-content/uploads/2010/05/jqueryui1.png" width="73" height="73" />
<p>As a <a href="http://www.radupoenaru.com/unibonn/" target="_blank">Ruby developer</a>, I work quite a lot with their “special” plugins called gems. The nice fact about the gems is that they bring lots of functionality. By example, there’s a gem for paginating a collection who takes just few parameters and not only that finds out how many objects the collection has, but also how to split them, generating the corresponding links and serving to the original container (that used to show the entire collection) only the collection part that is representative in the context of current page and items per page.</p>
<p>Before someone new to a specific gem starts thinking to implement it, usually searches on the net for examples. The most important gems are described and exemplified in <a href="http://railscasts.com" target="_blank">Railscasts.com</a>. The content is excelent, the quality is good, sound is nice but the format chosen for movies is Apple’s .MOV proprietary format. There are few plugins to install for playing the files with MediaPlayer, but frankly I wanted a quicker solution than go on some obscure websites and getting from there a creepy .exe installer.</p>
<p>So I’ve created a simple .mov player that will replace the <strong>33 MB </strong>of useless QuickTime Player (if you’re a Mac user, you have already this installed so you’ll not need my hack).</p>
<p><a href="http://www.radupoenaru.com/online-mov-player/">Go directly to the player &gt;</a></p>
<p>So let’s see some code!</p>
<p>First, I decided to use the Object method in order to play mov files. Apple provides a .cab file, who is able to play this files in browser. More documentation on its parameters you can find in their <a href="http://support.apple.com/kb/TA26486?viewlocale=en_US" target="_blank">Embedding</a> tutorial.</p>
<p>Don’t forget to add a link to JQuery library!</p>
<pre class="brush: html">&lt;script type=&quot;text/javascript&quot; src=&quot;http://code.jquery.com/jquery-1.4.2.min.js&quot;&gt;&lt;/script&gt;</pre>
<p>The html code is shown below and it is pretty straight forward:</p>
<pre class="brush: html">&lt;body&gt;
&lt;div class=&quot;media&quot;&gt;
  &lt;div class=&quot;navigationTabs&quot;&gt;
      &lt;input type=&quot;text&quot; id=&quot;txtURL&quot; style=&quot;width:75%&quot;/&gt;
      &lt;input type=&quot;button&quot; id=&quot;btnPlayMov&quot; value=&quot;Play&quot;/&gt;
      &lt;input type=&quot;button&quot; id=&quot;btnClearMov&quot; value=&quot;Clear&quot;/&gt;
      &lt;/div&gt;
      &lt;div id=&quot;divPlayer&quot;&gt;

http://media.railscasts.com/videos/188_declarative_authorization.mov

  &lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;</pre>
<p>The JavaScript is a little bit trickier as it involves JQuery.&#160; For a newbie, it is pretty hard to debug, but after a while you’ll just feel it:</p>
<pre class="brush: js">$(function() {
  // bind an onClick event for this second Flash container
  $(&quot;#btnPlayMov&quot;).click(function() {
    var _height = &quot;306px&quot;;
    var _width = &quot;400px&quot;;
    var _movie =  $('#txtURL').val();

    var _html = '<object width="' + _width +
          '" height="' + _height +
          '" classid = "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" >';
    _html += '<param name="src" value="' + _movie + ' ">';
    _html += '<param name="scale" value="tofit">';
    _html += '<embed width="' + _width + '" height="' + _height + '" src="' + _movie + '" scale="tofit" pluginspage="http://www.apple.com/quicktime/download/"></embed>';
    _html += '</object>';

    $(&quot;#divPlayer&quot;).html(_html);
  });

  $(&quot;#btnClearMov&quot;).click(function() {
    $(&quot;#divPlayer&quot;).html(&quot;http://media.railscasts.com/videos/188_declarative_authorization.mov&quot;);
  })
})</pre>
<p>Not to mention that it works in all major browsers (IE 8, FireFox 3.6 and Chrome) !</p>
<p><a href="http://www.radupoenaru.com/online-mov-player/">Go directly to the player &gt;</a></p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/create-a-simple-html-mov-player/">Create a simple HTML .MOV player</a></p>
<div class="shr-publisher-1304"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/create-a-simple-html-mov-player/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://media.railscasts.com/videos/188_declarative_authorization.mov" length="38117771" type="video/quicktime" />
		</item>
		<item>
		<title>Online Mov Player</title>
		<link>http://www.radupoenaru.com/online-mov-player/</link>
		<comments>http://www.radupoenaru.com/online-mov-player/#comments</comments>
		<pubDate>Wed, 26 May 2010 12:15:34 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[My work]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Uni-Bonn]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/?p=1307</guid>
		<description><![CDATA[Online player for .mov files created by me to be able to view online the content of Railcasts.<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/online-mov-player/">Online Mov Player</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fonline-mov-player%2F' data-shr_title='Online+Mov+Player'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fonline-mov-player%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fonline-mov-player%2F' data-shr_title='Online+Mov+Player'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fonline-mov-player%2F' data-shr_title='Online+Mov+Player'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><span id="more-1307"></span>
<div class="media">
<div class="navigationTabs">Paste here a movie from <a title="http://railscasts.com/" href="http://railscasts.com/">http://railscasts.com/</a><br />
<input style="width: 65%" id="txtURL" />  </div>
<div><label for="txtW">Width in px:</label><br />
<input id="txtW" value="650px" /><br/><label for="txtH">Height in px:</label><br />
<input id="txtH" value="500px" />
<input id="btnPlayMov" type="button" value="Play"/>
<input id="btnClearMov" type="button" value="Clear" /></div>
<hr />
<div id="divPlayer" style="height:500px;width:650px;text-align:center;">http://media.railscasts.com/videos/188_declarative_authorization.mov </div>
</p></div>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/online-mov-player/">Online Mov Player</a></p>
<div class="shr-publisher-1307"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/online-mov-player/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://media.railscasts.com/videos/188_declarative_authorization.mov" length="38117771" type="video/quicktime" />
		</item>
		<item>
		<title>How to add ui-icons to JQuery tabs</title>
		<link>http://www.radupoenaru.com/how-to-add-ui-icons-to-jquery-tabs/</link>
		<comments>http://www.radupoenaru.com/how-to-add-ui-icons-to-jquery-tabs/#comments</comments>
		<pubDate>Tue, 25 May 2010 12:07:49 +0000</pubDate>
		<dc:creator>Radu Poenaru</dc:creator>
				<category><![CDATA[My work]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[User experience]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.radupoenaru.com/?p=1272</guid>
		<description><![CDATA[While working in Uni Bonn, I wanted to add ui-icon to JQuery tabs. This is how I did it: I've added .ui-tabs .ui-tabs-nav li a img into the css style and class="ui-state-error" to the container, thus all users will focus on the important tab. But you can read about the the entire process on my blog.<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/how-to-add-ui-icons-to-jquery-tabs/">How to add ui-icons to JQuery tabs</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhow-to-add-ui-icons-to-jquery-tabs%2F' data-shr_title='How+to+add+ui-icons+to+JQuery+tabs'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhow-to-add-ui-icons-to-jquery-tabs%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhow-to-add-ui-icons-to-jquery-tabs%2F' data-shr_title='How+to+add+ui-icons+to+JQuery+tabs'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Fwww.radupoenaru.com%2Fhow-to-add-ui-icons-to-jquery-tabs%2F' data-shr_title='How+to+add+ui-icons+to+JQuery+tabs'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>&#160;<img style="border-right-width: 0px; margin: 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="This is how I added ui-icon to JQuery tabs" border="0" alt="This is how I added ui-icon to JQuery tabs" align="left" src="http://www.radupoenaru.com/wp-content/uploads/2010/05/jqueryui1.png" width="73" height="73" />
</p>
<p>While <a href="http://www.radupoenaru.com/unibonn/" target="_blank">working in UniBonn</a>, I have a lot of contact with <a href="http://www.radupoenaru.com/ruby-on-rails-agile-development/" target="_blank">Ruby on Rails</a> and <a href="http://www.radupoenaru.com/how-to-add-a-nice-jquery-slider/" target="_blank">JQuery</a>; I actually started loving its interactivity and stability. But lately I encountered a small situation with the <a href="http://jqueryui.com/demos/tabs/" target="_blank">tabs</a> object that they offer.</p>
<p>This is their default view, with Redmond theme applied. Nice and clean, you might say. But what’s missing? These tabs don’t support images. So you’ll not be able to show an image to specify, let’s say, that this tab has some updated information or a warning that something important is inside that tab.</p>
<p><a href="http://www.radupoenaru.com/wp-content/uploads/2010/05/JQuerytabs.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="JQuery tabs -the default view with Redmond theme" border="0" alt="JQuery tabs -the default view with Redmond theme" src="http://www.radupoenaru.com/wp-content/uploads/2010/05/JQuerytabs_thumb.png" width="523" height="164" /></a></p>
<p>I wanted to have some kind of control on specifying how the tab should look when I wanted my users to understand that something important is inside and requires their immediate attention.</p>
<p>As I searched through the website,<em>&#160;</em>I found the mentions of how to change the tab looks into an “error” style, so that it will attract attention no matter how tired the users are. In the <a href="http://jqueryui.com/docs/Theming/API" target="_blank">Theming area</a> of JQuery UI website, I found the help for Layout Helpers. Basically, you can specify additional classes who can override the theming of an element. Under <a href="http://www.radupoenaru.com/how-to-add-ui-icons-to-jquery-tabs/" target="_blank">Interaction cues</a>, you’ll find all you need to set your elements style to highlighting, error, disable etc.</p>
<p> <span id="more-1272"></span>
</p>
<blockquote style="width: 100%"><h5>Interaction Cues</h5>
<ul>
<li><strong>.ui-state-highlight:</strong> Class to be applied to highlighted or selected elements. Applies &quot;highlight&quot; container styles to an element and its child text, links, and icons. </li>
<li><strong>.ui-state-error:</strong> Class to be applied to error messaging container elements. Applies &quot;error&quot; container styles to an element and its child text, links, and icons. </li>
<li><strong>.ui-state-error-text:</strong> An additional class that applies just the error text color without background. Can be used on form labels for instance. Also applies error icon color to child icons. </li>
<li><strong>.ui-state-disabled:</strong> Applies a dimmed opacity to disabled UI elements. Meant to be added in addition to an already-styled element. </li>
<li><strong>.ui-priority-primary:</strong> Class to be applied to a priority-1 button in situations where button hierarchy is needed. Applies bold text. </li>
<li><strong>.ui-priority-secondary:</strong> Class to be applied to a priority-2 button in situations where button hierarchy is needed. Applies normal weight text and slight transparency to element. </li>
</ul>
</blockquote>
<p>And as an addition, some styles can trigger the change of icons, for example <strong>ui-state-error shows red icons</strong> instead of the default blue ones. The next step is to modify the style of the div that requires attention:</p>
<pre class="brush: xml">  &lt;li &lt;%= 'class=&quot;ui-state-error&quot;' unless user_alert %&gt; &gt;
    &lt;a href=&quot;#tabs-6&quot;&gt;
      &lt;%= '&lt;img class=&quot;ui-icon ui-icon-alert&quot;/&gt;' unless user_alert %&gt; User activity
    &lt;/a&gt;
  &lt;/li&gt;</pre>
<p>So here I was blocked. The alert image should have been shown in the left of the text, aligned with it, but because of the tab style, it didn’t do that properly.</p>
<p>One last modification to the JQuery UI did the magic:</p>
<pre class="brush:css; highlight: 3">.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
.ui-tabs .ui-tabs-nav li a img { float: left; margin-right: 5px}
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }</pre>
<p>The added line, the one with .ui-tabs .ui-tabs-nav li a img enabled my image to stay nice in her position, so the divs looks now: </p>
</p>
</p>
<p><a href="http://www.radupoenaru.com/wp-content/uploads/2010/05/JQueryUItabwithimage1.png"><img style="border-right-width: 0px; margin: 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="JQueryUI tab with ui-icons on tabs and  ui-state-error style" border="0" alt="JQueryUI tab with ui-icons on tabs and  ui-state-error style" src="http://www.radupoenaru.com/wp-content/uploads/2010/05/JQueryUItabwithimage_thumb1.png" width="359" height="79" /></a></p>
<p>That’s all, folks! Enjoy!</p>
<p>Post from: <a href="http://www.radupoenaru.com">Radu Poenaru's Weblog</a><br/><br/><a href="http://www.radupoenaru.com/how-to-add-ui-icons-to-jquery-tabs/">How to add ui-icons to JQuery tabs</a></p>
<div class="shr-publisher-1272"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.radupoenaru.com/how-to-add-ui-icons-to-jquery-tabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->

