<?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>Development Blog of PowerHour.at - Austrias first Happy Hour Search Engine</title>
	<atom:link href="http://devblog.powerhour.at/feed/" rel="self" type="application/rss+xml" />
	<link>http://devblog.powerhour.at</link>
	<description>This Blog is about all kind of technical stuff from www.powerhour.at</description>
	<lastBuildDate>Sun, 01 Apr 2012 19:26:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Compress images with ImageAlpha and ImageOptim</title>
		<link>http://devblog.powerhour.at/compress-images-with-imagealpha-and-imageoptim/</link>
		<comments>http://devblog.powerhour.at/compress-images-with-imagealpha-and-imageoptim/#comments</comments>
		<pubDate>Sun, 11 Mar 2012 11:00:58 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[adobe photoshop]]></category>
		<category><![CDATA[image compression]]></category>
		<category><![CDATA[image optimization]]></category>
		<category><![CDATA[image size reduction]]></category>
		<category><![CDATA[ImageAlpha]]></category>
		<category><![CDATA[ImageOptim]]></category>

		<guid isPermaLink="false">http://devblog.powerhour.at/?p=717</guid>
		<description><![CDATA[A few days ago we came across two really helpful tools for web development. It is very important that a website loads fast, so it is obvious that you should compress all your images to a minimum of its size. A lot of people (we too) just saved the pictures via Photoshop and &#8220;Save for [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago we came across two really helpful tools for web development. It is very important that a website loads fast, so it is obvious that you should compress all your images to a minimum of its size.</p>
<p>A lot of people (we too) just saved the pictures via Photoshop and &#8220;Save for Web&#8221;. But unfortunately this compression is not very good. You can save up to further 40-70% of the size.<br />
<span id="more-717"></span><br />
How can you do that? With two very simple and free applications: <a href="http://pngmini.com/" target="_blank">ImageAlpha</a> for PNG images only and <a href="http://imageoptim.pornel.net/" target="_blank">ImageOptim</a> for PNG, animated GIF and JPG. You can download it directly from the creators websites where you also can find a documentation.</p>
<h2>Example</h2>
<p>Here is an example of the compression rates on one of our simple graphics:</p>
<p><a href="http://devblog.powerhour.at/wp-content/uploads/2012/03/Compression_Comparison.png"><img class="aligncenter size-full wp-image-723" title="Compression Comparison" src="http://devblog.powerhour.at/wp-content/uploads/2012/03/Compression_Comparison.png" alt="" width="522" height="138" /></a></p>
<h2>Compression on PowerHour.at</h2>
<p>As I said at the beginning, we used it now for <a href="www.powerhour.at" target="_blank">PowerHour.at</a>. Our (few) images were pretty good compressed but we also were able to optimize them even more. At the table below you can find some examples of our comparing results.</p>
<table>
<tbody>
<tr>
<th>Page</th>
<th>Before [kB]</th>
<th>After [kB]</th>
<th>Saving [%]</th>
</tr>
<tr>
<td><a href="http://www.powerhour.at/" target="_blank">Front Page</a></td>
<td>383,3</td>
<td>344,1</td>
<td>10,23</td>
</tr>
<tr>
<td><a href="http://www.powerhour.at/documentation/mobilewebapp" target="_blank">Documentation WebApp</a></td>
<td>980,2</td>
<td>637,2</td>
<td>35</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://devblog.powerhour.at/compress-images-with-imagealpha-and-imageoptim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Save users settings in IsolatedStorage on Windows Phone 7</title>
		<link>http://devblog.powerhour.at/save-users-settings-in-isolatedstorage-on-windows-phone-7/</link>
		<comments>http://devblog.powerhour.at/save-users-settings-in-isolatedstorage-on-windows-phone-7/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 12:24:43 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[isolatedstorage]]></category>
		<category><![CDATA[phone 7]]></category>
		<category><![CDATA[windows phone]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://devblog.powerhour.at/?p=428</guid>
		<description><![CDATA[Windows Phone 7 provides three different opportunities for data storage. The persistent storage on the phone is managed by the IsolatedStorageSettings-Class. This storage, which is a simple Dictionary, is the perfect way to save different individual user settings. Those settings are saved permanently, independent of whether the app is running or not. To give your [...]]]></description>
			<content:encoded><![CDATA[<p>Windows Phone 7 provides three different opportunities for data storage. The persistent storage on the phone is managed by the <strong>IsolatedStorageSettings</strong>-Class.<br />
This storage, which is a simple <strong>Dictionary</strong>, is the perfect way to save different individual user settings. Those settings are <strong>saved permanently</strong>, independent of whether the app is running or not.<span id="more-428"></span><br />
To give your user the possibility to change settings for your app do the following:</p>
<h3>XAML Code</h3>
<p>In our XAML-File we added a CheckBox that defines wether your app should refresh data automatically or not and a Save-Button:</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;button</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;btnSave&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/button<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h3>Load current settings when page is loaded</h3>
<p>In the next step we load the current setting from the storage and set the state of the CheckBox.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> SettingsPage<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
   <span style="color: #008080; font-style: italic;">// Get the StorageData (Dictionary)</span>
   IsolatedStorageSettings userSettings <span style="color: #008000;">=</span> IsolatedStorageSettings<span style="color: #008000;">.</span><span style="color: #0000FF;">ApplicationSettings</span><span style="color: #008000;">;</span>
   <span style="color: #6666cc; font-weight: bold;">bool</span> bAutoRefresh <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">;</span>
   <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">!</span>userSettings<span style="color: #008000;">.</span><span style="color: #0000FF;">TryGetValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;settings_AutoRefresh&quot;</span>, <span style="color: #0600FF; font-weight: bold;">out</span> bAutoRefresh<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
       bAutoRefresh <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">;</span>
   <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">cbAutoRefresh</span><span style="color: #008000;">.</span><span style="color: #0000FF;">IsChecked</span> <span style="color: #008000;">=</span> bAutoRefresh<span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<h3>Save current settings</h3>
<p>Finally we save the setting when the user taps on the Save-Button:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> btnSave_Click<span style="color: #009900;">&#40;</span>object sender, RoutedEventArgs e<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
   <span style="color: #666666; font-style: italic;">//Save settings in the storage</span>
   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>userSettings.<span style="color: #006633;">Contains</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;settings_AutoRefresh&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
       userSettings.<span style="color: #006633;">Add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;settings_AutoRefresh&quot;</span>, <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">cbAutoRefresh</span>.<span style="color: #006633;">IsChecked</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000000; font-weight: bold;">else</span>
       userSettings<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;settings_AutoRefresh&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">cbAutoRefresh</span>.<span style="color: #006633;">IsChecked</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><a href="http://devblog.powerhour.at/wp-content/uploads/2012/02/settings-page.png"><img class="alignnone size-medium wp-image-710" title="PowerHour Windows Phone 7 Settings Page" src="http://devblog.powerhour.at/wp-content/uploads/2012/02/settings-page-181x300.png" alt="" width="181" height="300" /></a></p>
<p>More information: <a href="http://msdn.microsoft.com/de-de/library/system.io.isolatedstorage.isolatedstoragesettings(v=VS.95).aspx" target="_blank">http://msdn.microsoft.com/de-de/library/system.io.isolatedstorage.isolatedstoragesettings(v=VS.95).aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.powerhour.at/save-users-settings-in-isolatedstorage-on-windows-phone-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking availability of internet connection on Windows Phone 7</title>
		<link>http://devblog.powerhour.at/checking-availability-of-internet-connection-on-windows-phone-7/</link>
		<comments>http://devblog.powerhour.at/checking-availability-of-internet-connection-on-windows-phone-7/#comments</comments>
		<pubDate>Thu, 23 Feb 2012 12:13:43 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[check internet connection]]></category>
		<category><![CDATA[windows phone 7]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://devblog.powerhour.at/?p=478</guid>
		<description><![CDATA[Most mobile applications need access to the internet to get data from a webservice. The WP7 PowerHour App receives its data from the PowerHour webservice and hence needs to check whether there is internet connection available. Checking the availability of an internet connection on Windows Phone 7 is quite easy, you can just realize that [...]]]></description>
			<content:encoded><![CDATA[<p>Most mobile applications need access to the internet to get data from a webservice. The WP7 PowerHour App receives its data from the PowerHour webservice and hence needs to check whether there is internet connection available. Checking the availability of an internet connection on Windows Phone 7 is quite easy, you can just realize that with a few lines of code:<span id="more-478"></span></p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">Microsoft.Phone.Net.NetworkInformation</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> Availability
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">bool</span> HasInternetConection
    <span style="color: #008000;">&#123;</span>
        get
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #008000;">&#40;</span>NetworkInterface<span style="color: #008000;">.</span><span style="color: #0000FF;">NetworkInterfaceType</span> <span style="color: #008000;">!=</span> NetworkInterfaceType<span style="color: #008000;">.</span><span style="color: #0000FF;">None</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>We created a static class and added a static property that checks whether internet connection is available.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.powerhour.at/checking-availability-of-internet-connection-on-windows-phone-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Translate with gettext (Poedit)</title>
		<link>http://devblog.powerhour.at/zend-translate-with-gettext-poedit/</link>
		<comments>http://devblog.powerhour.at/zend-translate-with-gettext-poedit/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 10:48:18 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[multilanguage]]></category>
		<category><![CDATA[multilingual]]></category>
		<category><![CDATA[poedit]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://devblog.powerhour.at/?p=648</guid>
		<description><![CDATA[As we plan to provide our services for more countries, we need to translate our website in several languages. The Zend Framework already includes several adapters for translation like e.g. Array, Csv, Gettext, etc. As we already had a basic knowledge about the gettext version, and it is also used by wordpress, we decided to [...]]]></description>
			<content:encoded><![CDATA[<p>As we plan to provide our services for more countries, we need to translate our website in several languages. The Zend Framework already includes several adapters for translation like e.g. Array, Csv, Gettext, etc. As we already had a basic knowledge about the gettext version, and it is also used by wordpress, we decided to use this type:</p>
<p>To translate the page with gettext it is necessary to install Poedit (Download here: <a title="Poedit" href="http://www.poedit.net/download.php" target="_blank">http://www.poedit.net/download.php</a>)<br />
<span id="more-648"></span><br />
After successfully downloading and installing Poedit you will need to <strong>make some changes to make it work with Zend Framework</strong>.</p>
<ol>
<li>Open Poedit and go to <em>Poedit &gt; Preferences</em></li>
<li>Choose the tab &#8220;<em>Parsers</em>&#8220;</li>
<li>Select &#8220;<em>PHP</em>&#8221; and click &#8220;<em>edit</em>&#8220;</li>
<li>Extend the textbox for extensions by <em>&#8220;.phtml&#8221;</em> (see Screenshot)</li>
<li>Extend the textbox parser command by <em>&#8220;-L php&#8221;</em> (see Screenshot)</li>
<li>Save settings</li>
</ol>
<p><a href="http://devblog.powerhour.at/wp-content/uploads/2012/02/Screenshot-Poedit-Parser-Setup.png"><img class="alignnone size-full wp-image-659" title="Poedit Parser Setup" src="http://devblog.powerhour.at/wp-content/uploads/2012/02/Screenshot-Poedit-Parser-Setup.png" alt="" width="556" height="398" /></a></p>
<p>In the next step you need create an instance of Zend_Translate in the bootstrap process as follows to your bootstrap.php:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> _initTranslation<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Define the path where the language files are</span>
    <span style="color: #000088;">$langPath</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/Users/yourname/your/zend/workspace/yourapplication/languages/'</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Create an instance of Zend's gettext adapter</span>
    <span style="color: #000088;">$translate</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Translate_Adapter_Gettext<span style="color: #009900;">&#40;</span><span style="color: #000088;">$langPath</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'powerhour-en.mo'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'en'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Set the location to 'en' just to check wheter the english translation is working</span>
    <span style="color: #000088;">$translate</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setLocale<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'en'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Set this Translation as global translation for the view helper</span>
    Zend_Registry<span style="color: #339933;">::</span><span style="color: #004000;">set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Zend_Translate'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$translate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>After setting all necessary preferences in the bootstrap process we can now make use of Zend&#8217;s ViewHelper for translation as follows:</p>
<ol>
<li>Open any view with text you want to translate</li>
<li>Wrap any piece of text with <code>&lt;?php echo $this-&gt;translate(""); ?&gt;</code></li>
<li>e.g.

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;strong&gt;&quot;Wohin&quot;&lt;/strong&gt;</pre></div></div>

<p>will from now on be</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;</pre></div></div>

</li>
</ol>
<p>Our Zend application is now ready to be translated. To do the translation open Poedit click <em>File &gt; New catalog</em> and follow this steps:</p>
<p>1. Enter some information about your project and your translation<br />
<a href="http://devblog.powerhour.at/wp-content/uploads/2012/02/Screenshot-Poedit-New-Catalog-1.png"><img class="alignnone size-full wp-image-657" title="Poedit New Catalog - Project info" src="http://devblog.powerhour.at/wp-content/uploads/2012/02/Screenshot-Poedit-New-Catalog-1.png" alt="" width="523" height="441" /></a></p>
<p>2. Enter the path to your project on your computer, so that Poedit knows where to look for your files to translate.<br />
<a href="http://devblog.powerhour.at/wp-content/uploads/2012/02/Screenshot-Poedit-New-Catalog-2.png"><img class="alignnone size-full wp-image-658" title="Poedit New Catalog - Paths" src="http://devblog.powerhour.at/wp-content/uploads/2012/02/Screenshot-Poedit-New-Catalog-2.png" alt="" width="523" height="441" /></a></p>
<p>3. Next we need to add the keywords for which Poedit has to look to find the phrases to translate<br />
<a href="http://devblog.powerhour.at/wp-content/uploads/2012/02/Screenshot-Poedit-New-Catalog-3.png"><img class="alignnone size-full wp-image-665" title="Poedit New Catalog - Keywords" src="http://devblog.powerhour.at/wp-content/uploads/2012/02/Screenshot-Poedit-New-Catalog-3.png" alt="" width="523" height="441" /></a></p>
<p>4. Now choose <em>Catalog &gt; Update from sources</em>. That should show a result like this:<br />
<a href="http://devblog.powerhour.at/wp-content/uploads/2012/02/Screenshot-Poedit-Update-Catalog-From-Sources.png"><img class="alignnone size-full wp-image-685" title="Poedit Update Catalog From Sources" src="http://devblog.powerhour.at/wp-content/uploads/2012/02/Screenshot-Poedit-Update-Catalog-From-Sources.png" alt="" width="596" height="358" /></a></p>
<p>5. Last but not least save the files to e.g. <em>/Users/yourname/your/zend/workspace/yourapplication/languages</em><br />
(in the case of the example above the filename is powerhour-en.po and powerhour-en.mo)</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.powerhour.at/zend-translate-with-gettext-poedit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clear Facebook Like Cache</title>
		<link>http://devblog.powerhour.at/clear-facebook-like-cache/</link>
		<comments>http://devblog.powerhour.at/clear-facebook-like-cache/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 09:30:09 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebook cache]]></category>
		<category><![CDATA[like]]></category>
		<category><![CDATA[share]]></category>

		<guid isPermaLink="false">http://devblog.powerhour.at/?p=627</guid>
		<description><![CDATA[You changed the values for your Open Graph tags on your website but Facebook still shows an old (obviously cached) version of your shared or liked page? We came across that problem and here is what you can do: 1. Add query parameter to liked/shared URL One way is to simply change the URL of [...]]]></description>
			<content:encoded><![CDATA[<p>You changed the values for your Open Graph tags on your website but Facebook still shows an old (obviously cached) version of your shared or liked page?<br />
<span id="more-627"></span><br />
We came across that problem and here is what you can do:</p>
<h3>1. Add query parameter to liked/shared URL</h3>
<p>One way is to simply change the URL of your page by adding a URL query parameter e.g. ?v=1<br />
This means you&#8217;ve got to share <em>http://www.mypage.com/fbapp/?v=1</em> instead of <em>http://www.mypage.com/fbapp/</em></p>
<h3>2. Use <a title="Facebook Debugger" href="https://developers.facebook.com/tools/debug" target="_blank">Facebook URL Linter</a> (now called debugger)</h3>
<p>Facebook offers the possibility to display the values it extracts from your page. This values are used in the timeline when a friend likes or shares your page. Facebook seems to refresh the cache if you submit your page&#8217;s URL to the debugger.</p>
<p>This is what a link looks like in Facebook&#8217;s debugger:</p>
<p><a href="http://devblog.powerhour.at/wp-content/uploads/2011/11/Bildschirmfoto-2011-11-23-um-23.35.05.png"><img class="alignnone size-full wp-image-640" title="Facebook like/share in debugger" src="http://devblog.powerhour.at/wp-content/uploads/2011/11/Bildschirmfoto-2011-11-23-um-23.35.05.png" alt="" width="371" height="235" /></a></p>
<p>And this is what it looks like in your newsfeed:</p>
<p><a href="http://devblog.powerhour.at/wp-content/uploads/2011/11/Bildschirmfoto-2011-11-23-um-23.34.27.png"><img class="alignnone size-full wp-image-639" title="Facebook share/like in newsfeed" src="http://devblog.powerhour.at/wp-content/uploads/2011/11/Bildschirmfoto-2011-11-23-um-23.34.27.png" alt="" width="471" height="234" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.powerhour.at/clear-facebook-like-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Including Google Map into jQuery Mobile websites</title>
		<link>http://devblog.powerhour.at/including-google-map-into-jquery-mobile-websites/</link>
		<comments>http://devblog.powerhour.at/including-google-map-into-jquery-mobile-websites/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 19:24:24 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[Google API]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Mobile]]></category>
		<category><![CDATA[Google Map]]></category>

		<guid isPermaLink="false">http://devblog.powerhour.at/?p=606</guid>
		<description><![CDATA[As I explained already in this blog entry, we came across a problem as we wanted to use a Google Map on our mobile website. The problem again: The Google Map just worked fine for the first time, if we loaded another page, with other data and a new map, it did not worked. Why? [...]]]></description>
			<content:encoded><![CDATA[<p>As I explained already <a href="http://devblog.powerhour.at/jquery-mobile-execute-javascript-after-loading-a-page-with-ajax">in this blog entry</a>, we came across a problem as we wanted to use a Google Map on our mobile website.<span id="more-606"></span><br />
The problem again:<br />
The Google Map just worked fine for the first time, if we loaded another page, with other data and a new map, it did not worked.<br />
Why? You are asking. Yeah we needed a bit of time to realize too. But in fact it is really logic. The Google Map is bond to a div with an unique ID. So there is the problem. If we open one page after another, all of these pages have this ID and stay in our HTML-DOM. So we needed to handle this&#8230;<br />
I  think there are maybe better and more beautiful solutions for that but I did not had the time to make it more beautiful &#8211; it just should work, and it did at the end <img src='http://devblog.powerhour.at/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
So what did I do? Right, I just removed the Google Map Div and included it just on the active page of the jQuery Mobile framework.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Remove Google Map Divs - there is only one allowed (= ID)</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.gMaps'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Add a new Google Map Div at the active page</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div id=&quot;divGoogleMap&quot; class=&quot;gMaps removeMarginTop&quot;&gt;loading Map...&lt;/div&gt;'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">insertBefore</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.ui-page-active .googleMapFunctions'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Initialize the Google Map with a marker</span>
map <span style="color: #339933;">=</span> PowerHour.<span style="color: #660066;">GoogleMap</span>.<span style="color: #660066;">initializeWithMarker</span><span style="color: #009900;">&#40;</span>	<span style="color: #3366CC;">&quot;divGoogleMap&quot;</span><span style="color: #339933;">,</span>	locationMarker<span style="color: #339933;">,</span> <span style="color: #CC0000;">16</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This code has to be executed on the same site you want to display your Google Map and of course before you initialize the Google Map. Of course you need to include the Google Map javascript API files.<br />
And now we can load page after page and the Map is shown on the right (and active) page.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.powerhour.at/including-google-map-into-jquery-mobile-websites/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery Mobile &#8211; Execute javascript after loading a page with AJAX</title>
		<link>http://devblog.powerhour.at/jquery-mobile-execute-javascript-after-loading-a-page-with-ajax/</link>
		<comments>http://devblog.powerhour.at/jquery-mobile-execute-javascript-after-loading-a-page-with-ajax/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 19:24:40 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Mobile]]></category>
		<category><![CDATA[ajax calls]]></category>
		<category><![CDATA[execute javascript]]></category>
		<category><![CDATA[javascript in jQuery Mobile]]></category>

		<guid isPermaLink="false">http://devblog.powerhour.at/?p=599</guid>
		<description><![CDATA[As we developed our mobile WebApp we came across some minor problems. One of them was that we need a Google Map in one of our pages. But all pages are loaded via AJAX. So the Google Map did not load, we had to refresh it, with custom data which was provided via PHP. So [...]]]></description>
			<content:encoded><![CDATA[<p>As we developed our mobile WebApp we came across some minor problems. One of them was that we need a Google Map in one of our pages. But all pages are loaded via AJAX. So the Google Map did not load, we had to refresh it, with custom data which was provided via PHP.<span id="more-599"></span><br />
So we used a little trick to execute all of our custom javascript on these pages. We just loaded a javascript file (which we needed anyway) via the $.getScript method from jQuery and put all of our magic javascript code into the callback function of it.<br />
It looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">getScript</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'/minify/?g=countdown'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>	
	<span style="color: #003366; font-weight: bold;">var</span> similarLocationsVisible <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> userAddress <span style="color: #339933;">=</span> PowerHour.<span style="color: #660066;">User</span>.<span style="color: #660066;">GetGeolocation</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">lat</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">','</span> <span style="color: #339933;">+</span> PowerHour.<span style="color: #660066;">User</span>.<span style="color: #660066;">GetGeolocation</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">lng</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> locationLatLng <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #339933;">&lt;?</span>php echo $this<span style="color: #339933;">-&gt;</span>locationData<span style="color: #339933;">-&gt;</span>positionX.<span style="color: #3366CC;">&quot;,&quot;</span>.$this<span style="color: #339933;">-&gt;</span>locationData<span style="color: #339933;">-&gt;</span>positionY<span style="color: #339933;">;</span> <span style="color: #339933;">?&gt;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> map<span style="color: #339933;">;</span>
        <span style="color: #006600; font-style: italic;">// Add a new Google Map Div at the active page</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div id=&quot;divGoogleMap&quot; class=&quot;gMaps removeMarginTop&quot;&gt;loading Map...&lt;/div&gt;'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">insertBefore</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.ui-page-active .googleMapFunctions'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	map <span style="color: #339933;">=</span> PowerHour.<span style="color: #660066;">GoogleMap</span>.<span style="color: #660066;">initializeWithMarker</span><span style="color: #009900;">&#40;</span>	<span style="color: #3366CC;">&quot;divGoogleMap&quot;</span><span style="color: #339933;">,</span> locationMarker<span style="color: #339933;">,</span> <span style="color: #CC0000;">16</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #006600; font-style: italic;">// and so on...</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And now our Google Map loaded without any problems. STOP. There was another problem. It just worked fine for the first time, if we loaded another page, with other data and a new map, it did not worked.<br />
Why? You are asking. Yeah, we needed a bit of time to realize that too. But in fact is really logic. The Google Map is bond to a div with an unique ID. So there is the problem. If we open one page after another, all of these pages have this ID and stay in our HTML-DOM. So we needed to handle this&#8230;<br />
I put that solution in a new blog entry, because I think this is another problem which should be answered on its own. Click <a href="http://devblog.powerhour.at/including-google-map-into-jquery-mobile-websites">HERE</a> to read the solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.powerhour.at/jquery-mobile-execute-javascript-after-loading-a-page-with-ajax/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating plugins for TinyMCE</title>
		<link>http://devblog.powerhour.at/creating-plugins-for-tinymce/</link>
		<comments>http://devblog.powerhour.at/creating-plugins-for-tinymce/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 10:45:00 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[tiny mce]]></category>
		<category><![CDATA[tinymce]]></category>

		<guid isPermaLink="false">http://devblog.powerhour.at/?p=614</guid>
		<description><![CDATA[The official TinyMCE website offers a documentation/tutorial to develop a plugin for the popular WYSIWYG Editor. Unfortunately the tutorial is quite poor and we&#8217;d love to have a template instead of a step-by-step tutorial. Hence we created a kind of boilerplate for TinyMCE plugin development you can download here: &#62;&#62; DOWNLOAD TinyMCE plugin boilerplate &#60;&#60; [...]]]></description>
			<content:encoded><![CDATA[<p>The official TinyMCE website offers a <a href="http://www.tinymce.com/wiki.php/Creating_a_plugin" target="_blank">documentation/tutorial</a> to develop a plugin for the popular WYSIWYG Editor. Unfortunately the tutorial is quite poor and we&#8217;d love to have a template instead of a step-by-step tutorial.<span id="more-614"></span></p>
<p>Hence we created a kind of boilerplate for TinyMCE plugin development you can download here:</p>
<p><a href='http://devblog.powerhour.at/wp-content/uploads/2011/11/tiny-mce-plugin-boilerplate.zip'>&gt;&gt; DOWNLOAD TinyMCE plugin boilerplate &lt;&lt;</a></p>
<p>To register your plugin to TinyMCE you need to create a folder in tiny_mce/plugins/ for your plugin and copy the boilerplates content to that folder. After modifying your plugin&#8217;s files you can add your plugin to your editor by adding your plugin in advanced mode to the init method.<br />
For example:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">tinyMCE.<span style="color: #006633;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	mode <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;textareas&quot;</span>,
	theme <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;advanced&quot;</span>,
	plugins <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;example&quot;</span>,
        theme_advanced_buttons1 <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;save,newdocument,|,bold,italic,underline,strikethrough&quot;</span>,
	theme_advanced_buttons2 <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;justifyleft,justifycenter,justifyright,justifyfull,|,example&quot;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://devblog.powerhour.at/creating-plugins-for-tinymce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Mobile &#8211; Scrolling with a swipe</title>
		<link>http://devblog.powerhour.at/jquery-mobile-scrolling-with-a-swipe/</link>
		<comments>http://devblog.powerhour.at/jquery-mobile-scrolling-with-a-swipe/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 19:22:15 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Mobile]]></category>
		<category><![CDATA[mobile website]]></category>
		<category><![CDATA[scroll through lists]]></category>
		<category><![CDATA[swipe]]></category>

		<guid isPermaLink="false">http://devblog.powerhour.at/?p=592</guid>
		<description><![CDATA[In our new mobile WebApp for our website www.powerhour.at which we realized with the popular jQuery Mobile Framework, we included some cool stuff. One of them is the possibility to scroll through the result entries with an easy swipe to left on the mobile phone. With jQuery Mobile this isn´t really a problem, you just [...]]]></description>
			<content:encoded><![CDATA[<p>In our new mobile WebApp for our website www.powerhour.at which we realized with the popular jQuery Mobile Framework, we included some cool stuff. One of them is the possibility to scroll through the result entries with an easy swipe to left on the mobile phone.<span id="more-592"></span><br />
With jQuery Mobile this isn´t really a problem, you just have to do implement the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mobileinit'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.swipePage.ui-page-active'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'swipeleft'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
    <span style="color: #009900;">&#123;</span>
        $.<span style="color: #660066;">mobile</span>.<span style="color: #660066;">changePage</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'/url/to/your/website?page=2);
    });
});</span></pre></div></div>

<p>Include this few javascript lines of code into your mobile jQuery Website. We bind the swipe Event to the active page with the class “swipePage” (because not all of our sub sites need to scroll).<br />
If the event is triggered you just have to load the new page withe the changePage method from the jQuery Mobile framework. For a productive usage of this, the url may be dynamic and not hard coded like in our example.<br />
A swipe able page would look something like that:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;swipePage&quot; data-role=&quot;page&quot; data-theme=&quot;b&quot;&gt;
    // other page objects
&lt;/div&gt;</pre></div></div>

<p>Of course you can also use other events to trigger the loading of a new site. For example if you would like to scroll back to the last page, you can use the “swiperight” event, so the user can switch between both pages, just with a simple swipe on the smartphone display.</p>
<p>A detailled documentation of the events in jQuery  Mobile you can find here: <a href="http://jquerymobile.com/demos/1.0rc2/docs/api/events.html" target="_blank">http://jquerymobile.com/demos/1.0rc2/docs/api/events.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.powerhour.at/jquery-mobile-scrolling-with-a-swipe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making a phone call with your Windows Phone 7 App</title>
		<link>http://devblog.powerhour.at/making-a-phone-call-with-your-windows-phone-7-app/</link>
		<comments>http://devblog.powerhour.at/making-a-phone-call-with-your-windows-phone-7-app/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 19:40:39 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[phone call]]></category>
		<category><![CDATA[windows phone]]></category>

		<guid isPermaLink="false">http://devblog.powerhour.at/?p=564</guid>
		<description><![CDATA[Making a phone call with your Windows Phone 7 App Calling a phone number from your App is really easy. You just need a text field (in our case: txtTelephone) with the value of the number you want to call. Then add the following code to the C# code of this page: private void txtTelephone_MouseLeftButtonDown&#40;object [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://devblog.powerhour.at/wp-content/uploads/2011/10/call_via_windows_phone7.png"><img class="alignright size-full wp-image-568" title="Make a call with your Windows Phone 7 App" src="http://devblog.powerhour.at/wp-content/uploads/2011/10/call_via_windows_phone7.png" alt="Make a call with your Windows Phone 7 App" width="350" height="147" /></a>Making a phone call with your Windows Phone 7 App<br />
Calling a phone number from your App is really easy. You just need a text field (in our case: txtTelephone) with the value of the number you want to call.<span id="more-564"></span><br />
Then add the following code to the C# code of this page:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> txtTelephone_MouseLeftButtonDown<span style="color: #009900;">&#40;</span>object sender, MouseButtonEventArgs e<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">Call</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">ViewModel</span>.<span style="color: #006633;">Telephone</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>In our example the phone number comes from our view model, but of course you can take the value directly from your text field.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> Call<span style="color: #009900;">&#40;</span>string number<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    PhoneCallTask t <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PhoneCallTask<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    t.<span style="color: #006633;">PhoneNumber</span> <span style="color: #339933;">=</span> number<span style="color: #339933;">;</span>
    t.<span style="color: #006633;">DisplayName</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">ViewModel</span>.<span style="color: #003399;">Name</span><span style="color: #339933;">;</span>
    t.<span style="color: #006633;">Show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://devblog.powerhour.at/making-a-phone-call-with-your-windows-phone-7-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

