<?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>pro-web.at &#187; JavaScript</title>
	<atom:link href="http://pro-web.at/archives/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://pro-web.at</link>
	<description></description>
	<lastBuildDate>Sat, 06 Mar 2010 13:40:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Facebook Connect: Display login button only when not connected to site</title>
		<link>http://pro-web.at/archives/facebook-connect-display-login-button-only-when-not-connected-to-site</link>
		<comments>http://pro-web.at/archives/facebook-connect-display-login-button-only-when-not-connected-to-site#comments</comments>
		<pubDate>Wed, 23 Dec 2009 09:41:12 +0000</pubDate>
		<dc:creator>Daniel Prieler</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Facebook Connect]]></category>

		<guid isPermaLink="false">http://pro-web.at/?p=163</guid>
		<description><![CDATA[Currently i&#8217;m testing the features of Facebook Connect and i ran into troubles:

how to display the login button only if a user has not connected
how to display the image only if a user has connected

My simplest solution was to add some custom css classes:

fb-connecting: when the status of facebook connect is not known. e.g. display [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Currently i&#8217;m testing the features of Facebook Connect and i ran into troubles:</p>
<ul>
<li>how to display the login button only if a user has not connected</li>
<li>how to display the image only if a user has connected</li>
</ul>
<p>My simplest solution was to add some custom css classes:</p>
<ul>
<li>fb-connecting: when the status of facebook connect is not known. e.g. display a &#8220;connecting&#8230;&#8221; message </li>
<li>fb-not-connected: when user is not connected to facebook. e.g. show connect button</li>
<li>fb-connected: when user is connected to facebook. e.g. show user picture and name</li>
</ul>
<p><a href="/blog-content/facebook-connect/">View the demo page</a></p>
<p><span id="more-163"></span></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span> xmlns:fb<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.facebook.com/2008/fbml&quot;</span>&gt;</span> 
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
&nbsp;
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_GB&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
&nbsp;
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
  $(function() {
    FB_RequireFeatures([&quot;XFBML&quot;], function() {
      FB.Facebook.init(&quot;[[[INSERT APP ID HERE]]]&quot;, &quot;/xd_receiver.htm&quot;);
      FB.Connect.ifUserConnected(function(){
        $('body').addClass('fb-is-connected').removeClass('fb-is-not-connected');
      }, function(){
        $('body').removeClass('fb-is-connected').addClass('fb-is-not-connected');
      });
    });
  });
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
&nbsp;
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span>&gt;</span>
  .fb-connected, .fb-not-connected {
    display: none;
  }
  .fb-is-connected .fb-connecting, .fb-is-not-connected .fb-connecting {
    display: none;
  }
  .fb-is-connected .fb-connected {
    display: block;
  }
  .fb-is-not-connected .fb-not-connected {
    display: block;
  }
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!-- fb-connecting: display while facebook is connecting --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fb-connecting&quot;</span>&gt;</span>Connecting to Facebook<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!-- fb-not-connected: display when user is not connected to facebook --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fb-not-connected&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;fb:login-button v<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #000066;">size</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;medium&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>fb:login-button&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!-- fb-connected #1: display when user is connected to facebook --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fb-connected&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;fb:profile-pic uid<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;loggedinuser&quot;</span> <span style="color: #000066;">size</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;square&quot;</span> facebook-logo<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>fb:profile-pic&gt;</span>
  <span style="color: #009900;">&lt;fb:<span style="color: #000066;">name</span> uid<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;loggedinuser&quot;</span> useyou<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;false&quot;</span> linked<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>fb:name&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!-- fb-connected #2: actually, you can add the class to the xfbml-tags and do not need a sourrounding div-tag --&gt;</span>
<span style="color: #009900;">&lt;fb:<span style="color: #000066;">name</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fb-connected&quot;</span> uid<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;loggedinuser&quot;</span> useyou<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;false&quot;</span> linked<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>fb:name&gt;</span></pre></div></div>



<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://pro-web.at/archives/facebook-connect-display-login-button-only-when-not-connected-to-site/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jsSO 0.2 released</title>
		<link>http://pro-web.at/archives/jsso-02-released</link>
		<comments>http://pro-web.at/archives/jsso-02-released#comments</comments>
		<pubDate>Wed, 15 Apr 2009 12:03:02 +0000</pubDate>
		<dc:creator>Daniel Prieler</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jsSO]]></category>
		<category><![CDATA[Red5]]></category>
		<category><![CDATA[rtmp]]></category>

		<guid isPermaLink="false">http://pro-web.at/?p=117</guid>
		<description><![CDATA[New updates to jsSO-library:
It now allows calling Server-Side functions.
Go to the jsSO page


Related posts:jsSO &#8211; Flash Shared Objects in Javascript


Related posts:<ol><li><a href='http://pro-web.at/archives/jsso-flash-shared-objects-in-javascript' rel='bookmark' title='Permanent Link: jsSO &#8211; Flash Shared Objects in Javascript'>jsSO &#8211; Flash Shared Objects in Javascript</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>New updates to jsSO-library:<br />
It now allows calling Server-Side functions.</p>
<p><a href="/projects/jsso">Go to the jsSO page</a></p>


<p>Related posts:<ol><li><a href='http://pro-web.at/archives/jsso-flash-shared-objects-in-javascript' rel='bookmark' title='Permanent Link: jsSO &#8211; Flash Shared Objects in Javascript'>jsSO &#8211; Flash Shared Objects in Javascript</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://pro-web.at/archives/jsso-02-released/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto numbering your google docs headings / headlines</title>
		<link>http://pro-web.at/archives/auto-numbering-your-google-docs-headings</link>
		<comments>http://pro-web.at/archives/auto-numbering-your-google-docs-headings#comments</comments>
		<pubDate>Fri, 03 Apr 2009 08:48:45 +0000</pubDate>
		<dc:creator>Daniel Prieler</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Google Docs]]></category>

		<guid isPermaLink="false">http://v2.pro-web.at/?p=74</guid>
		<description><![CDATA[Google-docs-writer is great for collaborating, but it lacks of many features.
At least i created a small bookmarklet to add numbering to all headlines in your document.

The numbering is done in the style of:
1. headline
1.1. subheadline 1
1.2. subheadline 2
&#8230;
How to use / install
Just drag the link below to your bookmarks-bar, open your google document and press [...]


Related posts:<ol><li><a href='http://pro-web.at/archives/css-counter-test-auto-numbering-your-google-docs-headlines-with-css' rel='bookmark' title='Permanent Link: CSS Counter Test / Auto numbering your google docs headlines with CSS'>CSS Counter Test / Auto numbering your google docs headlines with CSS</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Google-docs-writer is great for collaborating, but it lacks of many features.<br />
At least i created a small bookmarklet to add numbering to all headlines in your document.<br />
<span id="more-74"></span><br />
The numbering is done in the style of:</p>
<p>1. headline<br />
1.1. subheadline 1<br />
1.2. subheadline 2<br />
&#8230;</p>
<h2>How to use / install</h2>
<p>Just drag the link below to your bookmarks-bar, open your google document and press the &#8220;gDocs: headline numbering&#8221; button.<br />
<a title="blub" href="javascript:(function(){var doc=window.frames['wys_frame'].document;var elements=doc.getElementsByTagName('*');var numbers=[0,0,0,0,0,0,0];for(var i in elements){var e=elements[i];if(!e||!e.tagName||!e.tagName.match(/^H([1-6])$/)){continue}var eLevel=RegExp.$1;var txt='';numbers[eLevel]++;for(var l=1;l<=6;l++){if(l<=eLevel){txt+=numbers[l]+'.'}else{numbers[l]=0}}e.textContent=txt+' '+e.textContent.replace(/^[0-9\.\s]+/,'')}})();">gDocs: headline numbering</a></p>
<h2>Source</h2>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</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>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> doc <span style="color: #339933;">=</span> window.<span style="color: #660066;">frames</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'wys_frame'</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">document</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> elements <span style="color: #339933;">=</span> doc.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'*'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> numbers <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> elements<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> e <span style="color: #339933;">=</span> elements<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>e <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>e.<span style="color: #660066;">tagName</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>e.<span style="color: #660066;">tagName</span>.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^H([1-6])$/</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">continue</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> eLevel <span style="color: #339933;">=</span> RegExp.$<span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> txt <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
&nbsp;
    numbers<span style="color: #009900;">&#91;</span>eLevel<span style="color: #009900;">&#93;</span><span style="color: #339933;">++;</span>
    <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> l <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span> l<span style="color: #339933;">&lt;=</span><span style="color: #CC0000;">6</span><span style="color: #339933;">;</span> l<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>l <span style="color: #339933;">&lt;=</span> eLevel<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            txt <span style="color: #339933;">+=</span> numbers<span style="color: #009900;">&#91;</span>l<span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'.'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            numbers<span style="color: #009900;">&#91;</span>l<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    e.<span style="color: #660066;">textContent</span> <span style="color: #339933;">=</span> txt<span style="color: #339933;">+</span><span style="color: #3366CC;">' '</span><span style="color: #339933;">+</span>e.<span style="color: #660066;">textContent</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^[0-9\.\s]+/</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Updates</h2>
<ul>
<li>because of changes in google-docs i modified how the document is accessed</li>
</ul>


<p>Related posts:<ol><li><a href='http://pro-web.at/archives/css-counter-test-auto-numbering-your-google-docs-headlines-with-css' rel='bookmark' title='Permanent Link: CSS Counter Test / Auto numbering your google docs headlines with CSS'>CSS Counter Test / Auto numbering your google docs headlines with CSS</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://pro-web.at/archives/auto-numbering-your-google-docs-headings/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>jsSO &#8211; Flash Shared Objects in Javascript</title>
		<link>http://pro-web.at/archives/jsso-flash-shared-objects-in-javascript</link>
		<comments>http://pro-web.at/archives/jsso-flash-shared-objects-in-javascript#comments</comments>
		<pubDate>Tue, 24 Feb 2009 11:59:23 +0000</pubDate>
		<dc:creator>Daniel Prieler</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jsSO]]></category>
		<category><![CDATA[Red5]]></category>
		<category><![CDATA[rtmp]]></category>

		<guid isPermaLink="false">http://pro-web.at/?p=115</guid>
		<description><![CDATA[I just released the initial version of a javascript rtmp/sharedObject client library.
Go to the jsSO page


Related posts:jsSO 0.2 released


Related posts:<ol><li><a href='http://pro-web.at/archives/jsso-02-released' rel='bookmark' title='Permanent Link: jsSO 0.2 released'>jsSO 0.2 released</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I just released the initial version of a javascript rtmp/sharedObject client library.</p>
<p><a href="/projects/jsso">Go to the jsSO page</a></p>


<p>Related posts:<ol><li><a href='http://pro-web.at/archives/jsso-02-released' rel='bookmark' title='Permanent Link: jsSO 0.2 released'>jsSO 0.2 released</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://pro-web.at/archives/jsso-flash-shared-objects-in-javascript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

