<?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>maSnun&#039;s logs &#187; jQuery</title>
	<atom:link href="http://masnun.com/blog/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://masnun.com/blog</link>
	<description>Personal Blog of maSnun</description>
	<lastBuildDate>Sat, 24 Jul 2010 04:33:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Updated AIR APP</title>
		<link>http://masnun.com/blog/2009/11/30/updated-air-app/</link>
		<comments>http://masnun.com/blog/2009/11/30/updated-air-app/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 15:02:06 +0000</pubDate>
		<dc:creator>masnun</dc:creator>
				<category><![CDATA[Blog Post]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://masnun.com/2009/11/30/updated-air-app/</guid>
		<description><![CDATA[I have updated the AIR app with a better GUI and advanced features. Download App: http://masnun.googlecode.com/files/maSnun-AIR.air Download Source: http://masnun.googlecode.com/files/maSnun_AIR_Source.zip I have added a few more JavaScript files for better interactions]]></description>
			<content:encoded><![CDATA[<p>I have updated the AIR app with a better GUI and advanced features.</p>
<p><b>Download App: </b> <a href="http://masnun.googlecode.com/files/maSnun-AIR.air">http://masnun.googlecode.com/files/maSnun-AIR.air</a><br/><br />
<b>Download Source:</b> <a href="http://masnun.googlecode.com/files/maSnun_AIR_Source.zip">http://masnun.googlecode.com/files/maSnun_AIR_Source.zip</a><br/><br/></p>
<p>I have added a few more JavaScript files for better interactions <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://masnun.com/blog/2009/11/30/updated-air-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My First AIR App</title>
		<link>http://masnun.com/blog/2009/11/30/my-first-air-app/</link>
		<comments>http://masnun.com/blog/2009/11/30/my-first-air-app/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 11:25:53 +0000</pubDate>
		<dc:creator>masnun</dc:creator>
				<category><![CDATA[Blog Post]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://masnun.com/?p=728</guid>
		<description><![CDATA[I have been looking forward to trying the Adobe AIR platform for desktop GUI development for a long time. Recently I started learning more on JavaScript, jQuery and CSS. So I decided to try out the AIR SDK for javascript &#8230; <a href="http://masnun.com/blog/2009/11/30/my-first-air-app/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have been looking forward to trying the Adobe AIR platform for desktop GUI development for a long time. Recently I started learning more on JavaScript, jQuery and CSS. So I decided to try out the AIR SDK for javascript engineers. I must agree that AIR is simply great. The platform is strong and powerful while the development curve is very low <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I read just one article and it helped understand the basics. Later I had some issues regarding the packaging system but managed to hack through <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>First, I downloaded the Adobe AIR runtime and Adobe AIR SDK for Linux since I am on Ubuntu 9.04. I installed the runtime environment for testing the final product. The SDK has built in tools for testing and debugging the apps. I extracted the SDK into my home folder and then added the &#8220;bin&#8221; directory of the SDK to the system path by editing the &#8220;/etc/environment&#8221; file.</p>
<p>I then created a directory for the air application named &#8220;myair&#8221;. Inside that directory, I created an application descriptor named &#8220;myair.xml&#8221;. Here&#8217;s the source code for the file:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;application</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://ns.adobe.com/air/application/1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.example.masnun-air<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filename<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>maSnun-AIR<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filename<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;initialWindow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>index.html<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;visible<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/visible<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;width<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>300<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/width<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;height<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>600<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/height<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/initialWindow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;icon<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;image16x16<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>icons/AIRApp_16.png<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/image16x16<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;image32x32<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>icons/AIRApp_32.png<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/image32x32<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;image48x48<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>icons/AIRApp_48.png<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/image48x48<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;image128x128<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>icons/AIRApp_128.png<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/image128x128<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/icon<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>This descriptor file holds all the basic information regarding the application. I created three more directories under the application directory:</p>
<p>&#8211; icons: for the icons described in the descriptor<br />
&#8211; js: for the javascript files (mainly jQuery)<br />
&#8211; build: for building the final product (packaging)</p>
<p>Then I went on building the initial and only view of the application. It&#8217;s nothing but a very simple html file. Here&#8217;s the source of the &#8220;index.html&#8221; file:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!--
Author: maSnun
URL: http://masnun.com
Email: masnun@gmail.com
--&gt;
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;maSnun's AIR Demo&lt;/title&gt;
        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;
        &lt;script type=&quot;text/JavaScript&quot;
        src=&quot;js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
        &lt;script type=&quot;text/JavaScript&quot;&gt;
            $(document).ready(function() { masnun(); });
&nbsp;
            function masnun() {
&nbsp;
                i = 0;
                $(&quot;p&quot;).prepend(&quot;&amp;#187;&quot;)
                total = $(&quot;p&quot;).length - 1;
                $(&quot;#hide&quot;).click(function (e) {
                    if(i &gt; total) {
                        alert(&quot;No more paragraphs to hide!&quot;);
                        e.preventDefault();
                    } else {
                        e.preventDefault();
                        $(&quot;p:eq(&quot;+i+&quot;)&quot;).hide(&quot;slow&quot;);
                        i = i + 1;
                    }
                });
&nbsp;
&nbsp;
                $(&quot;#show&quot;).click(function (e) {
                    e.preventDefault();
                    $(&quot;p&quot;).show(&quot;slow&quot;);
                    i = 0;
                });
&nbsp;
&nbsp;
                $(&quot;p&quot;).hover(function () {
                    $(this).addClass(&quot;hover&quot;);
                }, function () {
                    $(this).removeClass(&quot;hover&quot;);
                });
&nbsp;
                $(&quot;p&quot;).click(function() {
                    alert(&quot;You clicked a menu item :D&quot;);
                });
&nbsp;
&nbsp;
            }
        &lt;/script&gt;
        &lt;style type=&quot;text/css&quot;&gt;
            body { font-size:18px; background:black; color:white;  border: dashed 3px fuchsia;
            margin:5pt;}
            p { color:red; margin:5px; cursor:pointer; }
            p.hover { background: blue; color: white; }
        &lt;/style&gt;
    &lt;/head&gt;
    &lt;body &gt;
        &lt;div style=&quot;margin: 10pt; color:lime;&quot;&gt;
        &lt;font size=&quot;2&quot;&gt; Welcome to the demo AIR app! Clicking the &quot;Hide&quot; option
        hides the menu items one by one. Clicking the &quot;Reset&quot; option brings
        all the hidden items back. Clicking a menu item shows a dialog box :D&lt;/font&gt;
            &lt;/div&gt;
        &lt;div align=&quot;center&quot;  &gt;
            &lt;a href=&quot;&quot; id=&quot;hide&quot; style=&quot;color:orange;&quot;&gt;Hide&lt;/a&gt; || &lt;a href=&quot;&quot; id=&quot;show&quot; style=&quot;color:orange;&quot;&gt;Reset&lt;/a&gt;  &lt;br/&gt;&lt;br/&gt;
        &lt;/div&gt;
        &lt;div align=&quot;left&quot; style=&quot;color:white;&quot;&gt;
            &lt;p&gt; Menu Item 1&lt;/p&gt;
            &lt;p&gt; Menu Item 2&lt;/p&gt;
            &lt;p&gt; Menu Item 3&lt;/p&gt;
            &lt;p&gt; Menu Item 4&lt;/p&gt;
            &lt;p&gt; Menu Item 5&lt;/p&gt;
            &lt;p&gt; Menu Item 6&lt;/p&gt;
            &lt;p&gt; Menu Item 7&lt;/p&gt;
            &lt;p&gt; Menu Item 8&lt;/p&gt;
            &lt;p&gt; Menu Item 9&lt;/p&gt;
        &lt;/div&gt;
&nbsp;
        &lt;div style=&quot;margin: 10pt; color:yellow;&quot;&gt;
        &lt;font size=&quot;2&quot;&gt; &lt;b&gt;Created by:&lt;/b&gt; maSnun&lt;/font&gt;
            &lt;/div&gt;
&nbsp;
    &lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>If you are familiar with HTML, CSS and jQuery, the code will be self explanatory for you.</p>
<p>Thats completes the development cycle. I tested the application by typing the following commands on my terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> myair
adl myair.xml</pre></div></div>

<p>And it worked! <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Now for packaging, I first created a selfsigned certificate:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adt <span style="color: #660033;">-certificate</span> <span style="color: #660033;">-cn</span> SelfSign <span style="color: #660033;">-ou</span> Dev <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;Example&quot;</span> <span style="color: #660033;">-c</span> US <span style="color: #000000;">2048</span>-RSA cert.px masnun</pre></div></div>

<p>Then packaged the application using the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adt <span style="color: #660033;">-package</span> <span style="color: #660033;">-storetype</span> pkcs12 <span style="color: #660033;">-keystore</span> cert.pfx build<span style="color: #000000; font-weight: bold;">/</span>maSnun-AIR.air myair.xml index.html icons<span style="color: #000000; font-weight: bold;">/*</span>.png js<span style="color: #000000; font-weight: bold;">/*</span>.<span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>It packaged the application and created an air archive for me. I tested it and it installed, worked and uninstalled fine on my machine.</p>
<p><b>Download the App: </b> <a href="http://masnun.googlecode.com/files/maSnun-AIR.air">http://masnun.googlecode.com/files/maSnun-AIR.air</a></p>
<p>Have fun! <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://masnun.com/blog/2009/11/30/my-first-air-app/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery with PHP</title>
		<link>http://masnun.com/blog/2009/11/29/jquery-with-php/</link>
		<comments>http://masnun.com/blog/2009/11/29/jquery-with-php/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 17:34:28 +0000</pubDate>
		<dc:creator>masnun</dc:creator>
				<category><![CDATA[Blog Post]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://masnun.com/?p=724</guid>
		<description><![CDATA[I am learning jQuery these days and here&#8217;s the source code of a php script that uses jQuery on the client side. I have mainly demonstrated jQuery here. PHP has been used to manipulate desired number of paragraphs quickly You &#8230; <a href="http://masnun.com/blog/2009/11/29/jquery-with-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am learning jQuery these days and here&#8217;s the source code of a php script that uses jQuery on the client side.</p>
<p>I have mainly demonstrated jQuery here. PHP has been used to manipulate desired number of paragraphs quickly <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>You get a number of paragraphs. Hovering over them changes their style. Clicking the &#8220;Hide&#8221; link hides the paragraphs one by one. <img src='http://masnun.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
    &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;jQuery with PHP&lt;/title&gt;
        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
        &lt;script type=&quot;text/JavaScript&quot;
        src=&quot;jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
        &lt;script type=&quot;text/JavaScript&quot;&gt;
            $(document).ready(function() { masnun(); });
&nbsp;
            function masnun() {
&nbsp;
                i = 0;
                total = $(&quot;p&quot;).length - 1;
                $(&quot;a&quot;).click(function (e) {
                    if(i &gt; total) {
                        alert(&quot;No more paragraphs to hide!&quot;);
                        e.preventDefault();
                    } else {
                        e.preventDefault();
                        $(&quot;p:eq(&quot;+i+&quot;)&quot;).hide(&quot;slow&quot;);
                        i = i + 1;
                    }
                });
                $(&quot;p&quot;).hover(function () {
                    $(this).addClass(&quot;hover&quot;);
                }, function () {
                    $(this).removeClass(&quot;hover&quot;);
                });
&nbsp;
&nbsp;
            }
        &lt;/script&gt;
        &lt;style&gt;
            p { color:black; margin:5px; cursor:pointer; }
            p.hover { background:black; color: white; }
        &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
&nbsp;
        &lt;a href=&quot;&quot;&gt;Hide&lt;/a&gt; &lt;br/&gt;&lt;br/&gt;
&nbsp;
&nbsp;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span>
        <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">7</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;p&gt; Paragraph number: <span style="color: #006699; font-weight: bold;">{$i}</span> &lt;/p&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
    &lt;/body&gt;
&lt;/html&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://masnun.com/blog/2009/11/29/jquery-with-php/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
