<?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>Flying memes &#187; Sencha</title>
	<atom:link href="http://sandropaganotti.com/tag/sencha/feed/" rel="self" type="application/rss+xml" />
	<link>http://sandropaganotti.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 08 Jan 2012 16:00:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WiPad 0.3, aka: how to handle permalinks</title>
		<link>http://sandropaganotti.com/2010/10/16/wipad-0-3-aka-how-to-handle-permalinks/</link>
		<comments>http://sandropaganotti.com/2010/10/16/wipad-0-3-aka-how-to-handle-permalinks/#comments</comments>
		<pubDate>Sat, 16 Oct 2010 15:45:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Annunci]]></category>
		<category><![CDATA[permalink]]></category>
		<category><![CDATA[Sencha]]></category>
		<category><![CDATA[wipad]]></category>

		<guid isPermaLink="false">http://sandropaganotti.com/?p=447</guid>
		<description><![CDATA[I&#8217;ve just committed the 0.3 version of WiPad, this new release introduce a new mechanism which helps handle permalinks. Having to deal with a single-file Sencha-based application made me pretty hard to figure out how to re-introduce permalink and give the opportunity to reach a single post using its url. The strategy I adopted was [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just committed the 0.3 version of <a title="WiPad" href="http://wordpress.org/plugins/wipad" target="_blank">WiPad</a>, this new release introduce a new mechanism which helps handle permalinks. Having to deal with a single-file Sencha-based application made me pretty hard to figure out how to re-introduce permalink and give the opportunity to reach a single post using its url.</p>
<p><span id="more-447"></span><br />
The strategy I adopted was to use the &#8216;window.location.hash&#8217; in order to detect which post to display. So when a browser tries to solve a post url it gets redirected to the index page with a special anchor that tell the main application which post has to be loaded first.</p>
<p>Here&#8217;s the part that handle this &#8216;anchor recognition&#8217; in the main application:</p>
<p><code class="javascript"> </code></p>
<pre><code class="javascript">onReady: function() {
  if (window.location.hash == ''){
    wipad.Main.init();
  }else{
    Ext.Ajax.request({
       // Here I call single.php simulating a single post navigation
        url: "&lt;?php echo get_bloginfo('wpurl')?&gt;" + window.location.hash.substring(1),
        success: function(response) {
          item_array = eval(response.responseText);
          wipad.Main.init((item_array[0]=="") ? null : item_array[0], item_array[1]);
        }
    });
  }
}
</code></pre>
<p>And here&#8217;s how I wrote single.php in order to handle both redirect and post rendering:</p>
<p><code class="php"> </code></p>
<pre><code class="php">&lt;?php
 // determine if we're answering an AJAX call or NO
 global $is_ajax; $is_ajax = isset($_SERVER['HTTP_X_REQUESTED_WITH']);

// if we're answering an Ajax call this means we need to render back the requested post
 if($is_ajax){
   the_post();
   $the_content = json_encode("&lt;div class='x-htmlcontent the_content'&gt;".apply_filters('the_content',get_the_content())."&lt;/div&gt;");
   $the_title   = json_encode(get_the_title());
   echo "[".$the_title.", ".$the_content."]";
   exit(0);
 }

 // Otherwise redirect to the mail app with the anchor setted
 header('Location: '.str_replace(get_bloginfo('wpurl')."/", get_bloginfo('wpurl')."/#/", get_permalink()));
?&gt;
</code></pre>
<p>Hope this may be useful to someone trying to figure out how to deal permalink related problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://sandropaganotti.com/2010/10/16/wipad-0-3-aka-how-to-handle-permalinks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An iPad plugin theme for wordpress: working alpha</title>
		<link>http://sandropaganotti.com/2010/07/25/an-ipad-plugin-theme-for-wordpress-working-alpha/</link>
		<comments>http://sandropaganotti.com/2010/07/25/an-ipad-plugin-theme-for-wordpress-working-alpha/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 12:45:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Annunci]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[Sencha]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[WpTouch]]></category>

		<guid isPermaLink="false">http://sandropaganotti.com/?p=425</guid>
		<description><![CDATA[Update 01/09/2010: WiPad is now published and available on the official WordPress plugin directory. I&#8217;ve started deploying an iPad wordpress theme/plugin based on wptouch and powered by Sencha. Today I&#8217;ve reached the first working alpha and so I&#8217;ve decided to use it against this blog. You can try out this theme by surfing here with [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update 01/09/2010: </strong>WiPad is now published and available on <a title="WiPad is a WordPress theme/plugin designed for iPad, based on WpTouch and powered by Sencha Touch" href="http://wordpress.org/extend/plugins/wipad/" target="_blank">the official WordPress plugin</a> directory.<strong> </strong></p>
<p>I&#8217;ve started deploying an iPad wordpress theme/plugin based on <a href="http://wordpress.org/extend/plugins/wptouch/">wptouch</a> and powered by <a href="http://www.sencha.com/">Sencha</a>. Today I&#8217;ve reached the first working alpha and so I&#8217;ve decided to use it against this blog. You can try out this theme by surfing here with an iPad or a simulator; two screenshots are also available after the jump.</p>
<p><span id="more-425"></span></p>
<p><a href="http://sandropaganotti.com/wp-content/uploads/2010/07/ishot-2241.png"><img class="alignnone size-full wp-image-430" title="ishot-224" src="http://sandropaganotti.com/wp-content/uploads/2010/07/ishot-2241.png" alt="" width="600" height="465" /></a></p>
<p><a href="http://sandropaganotti.com/wp-content/uploads/2010/07/Screen-shot-2010-07-25-at-14.27.471.png"><img class="alignnone size-full wp-image-429" title="Screen shot 2010-07-25 at 14.27.47" src="http://sandropaganotti.com/wp-content/uploads/2010/07/Screen-shot-2010-07-25-at-14.27.471.png" alt="" width="462" height="599" /></a></p>
<p>I&#8217;ve planned to release a first version of this plugin as soon as it include some basic features, such as permalink navigation and pages support.</p>
]]></content:encoded>
			<wfw:commentRss>http://sandropaganotti.com/2010/07/25/an-ipad-plugin-theme-for-wordpress-working-alpha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

