<?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>(function() { &#187; dilbert</title>
	<atom:link href="http://maxb.net/blog/category/dilbert/feed/" rel="self" type="application/rss+xml" />
	<link>http://maxb.net/blog</link>
	<description>// MAXB.NET LABS</description>
	<lastBuildDate>Fri, 25 Jun 2010 07:26:01 +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>jQuery Dilbert Plugin</title>
		<link>http://maxb.net/blog/2008/05/09/jquery-dilbert-plugin/</link>
		<comments>http://maxb.net/blog/2008/05/09/jquery-dilbert-plugin/#comments</comments>
		<pubDate>Fri, 09 May 2008 11:35:59 +0000</pubDate>
		<dc:creator>Massimiliano Balestrieri</dc:creator>
				<category><![CDATA[dilbert]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://maxb.net/blog/?p=23</guid>
		<description><![CDATA[Corretto l&#8217;evento onkeydown della 1.0 e la multi istanza. DEMO ZIP &#160; jQuery(document).ready(function(){ jQuery("#dilbert2").dilbert({proxy : '/scripts/dilbert-1.2/proxy.php'}); });]]></description>
			<content:encoded><![CDATA[<p>Corretto l&#8217;evento onkeydown della <a href="http://maxb.net/blog/2008/04/28/jquery-dilbert-10/">1.0</a> e la multi istanza.  </p>
<p><a href="http://maxb.net/scripts/dilbert-1.2/doc/">DEMO</a></p>
<p><a href="http://maxb.net/scripts/dilbert-1.2/dilbert-1.2.zip">ZIP</a></p>
<div id="dilbert2">&nbsp;</div>
<link type="text/css" rel="stylesheet" href="/scripts/dilbert-1.2/dilbert.css" media="screen" />
<script src="/scripts/dilbert-1.2/lib/jquery-1.2.3.min.js" type="text/javascript"></script><br />
<script src="/scripts/dilbert-1.2/dilbert.js" type="text/javascript"></script><br />
<script type="text/javascript">
jQuery(document).ready(function(){
	jQuery("#dilbert2").dilbert({proxy : '/scripts/dilbert-1.2/proxy.php'});
});
</script></p>
<img src="http://maxb.net/blog/?ak_action=api_record_view&id=23&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://maxb.net/blog/2008/05/09/jquery-dilbert-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Dilbert 1.0</title>
		<link>http://maxb.net/blog/2008/04/28/jquery-dilbert-10/</link>
		<comments>http://maxb.net/blog/2008/04/28/jquery-dilbert-10/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 21:20:35 +0000</pubDate>
		<dc:creator>Massimiliano Balestrieri</dc:creator>
				<category><![CDATA[dilbert]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://maxb.net/blog/?p=16</guid>
		<description><![CDATA[Da un&#8217;idea di Carlo&#8230; un plugin senza troppi fronzoli e soprattutto senza flash Proxy php per il recupero del feed Navigabile da tastiera con il tasto &#8220;&#62;&#8221; e il tasto &#8220;&#60;&#8221; DEMO ZIP /* * * Dilbert plugin 1.0 * $Date: 2008-04-29 10:20:55 +0200 (mar, 29 apr 2008) $ * $Rev: 10 $ * @requires [...]]]></description>
			<content:encoded><![CDATA[<p>Da un&#8217;idea di <a href="http://perassi.org/p/dilw/">Carlo</a>&#8230; un plugin senza troppi fronzoli e soprattutto senza flash</p>
<ul>
<li>Proxy php per il recupero del feed</li>
<li>Navigabile da tastiera con il tasto &#8220;&gt;&#8221; e il tasto &#8220;&lt;&#8221;</li>
</ul>
<p><a href="http://maxb.net/scripts/dilbert/doc/">DEMO</a></p>
<p><a href="http://maxb.net/scripts/dilbert/dilbert-jquery-1.0.0.zip">ZIP</a></p>
<pre><code class="javascript">
/*
 *
 * Dilbert plugin 1.0
 * $Date: 2008-04-29 10:20:55 +0200 (mar, 29 apr 2008) $
 * $Rev: 10 $
 * @requires jQuery v1.2.3
 *
 * Copyright (c) 2008 Massimiliano Balestrieri
 * Examples and docs at: http://maxb.net/blog/
 * Licensed GPL licenses:
 * http://www.gnu.org/licenses/gpl.html
 *
 */

//if(!window.console)window.console = {log : function(){}};

Dilbert = {
    date      : '',
    title     : 'Dilbert Daily Strip',
    link      : '',
    desc      : '',
    pages     : 1,
    jpages    : [],
    current   : 1,
    options   : {},
    build     : function(options)
    {

        Dilbert.options = options || {};
        return this.each(
            function(nr)
            {
                //setto un po' di variabili
                if(!Dilbert.options.feed)
                    Dilbert.options.feed  = 'http://feeds.feedburner.com/DilbertDailyStrip';
                if(!Dilbert.options.proxy)
                     Dilbert.options.proxy || 'proxy.php';

                var that = this;
                Dilbert.get(1,that);
            }
        );

    },
    get : function(num,el){
        //console.log(num);
        jQuery.ajax({
            dataType : 'xml',
            url      :  Dilbert.options.proxy,
            data     : 'url=' + Dilbert.options.feed,
            success: function(rss){
                //console.log(data.firstChild);
                var titles = rss.getElementsByTagName(&quot;title&quot;);
                var link = rss.getElementsByTagName(&quot;link&quot;);
                var desc = rss.getElementsByTagName(&quot;description&quot;);
                Dilbert.pages = titles.length - 1;
                Dilbert.title = titles[0].firstChild.nodeValue;
                Dilbert.date  = titles[num].firstChild.nodeValue;
                //Dilbert.link = link[num].firstChild.nodeValue;
                Dilbert.desc = desc[num].firstChild.nodeValue;

                //console.log(Dilbert.title);
                //console.log(Dilbert.date);
                if(el){
                    Dilbert.gui(el);
                }else{
                    jQuery(&quot;.dilbert-title&quot;, el).text(Dilbert.title + ' - ' + Dilbert.date);
                    jQuery(&quot;.dilbert-desc&quot;, el).html(Dilbert.desc);
                    Dilbert.reset_toolbar(el);
                    //console.log(Dilbert.current);
                    Dilbert.jpages[(Dilbert.current - 1)].css({&quot;color&quot;:&quot;red&quot;,&quot;text-decoration&quot;:&quot;none&quot;});

                }
            }
         });
    },
    gui : function(el)
    {
        jQuery(el).append('&lt;div class=&quot;dilbert-jquery&quot;&gt;');
        var jcontainer = jQuery(&quot;.dilbert-jquery&quot;, el);
        jcontainer.append('&lt;div class=&quot;dilbert-title-cont&quot;&gt;&lt;div class=&quot;dilbert-title&quot; re=&quot;#&quot;&gt;&lt;/div&gt;&lt;div class=&quot;dilbert-pager&quot;&gt;&lt;/div&gt;');
        jQuery(&quot;.dilbert-title&quot;, el).text(Dilbert.title + ' - ' + Dilbert.date);
        //console.log(Dilbert.title);
        //console.log(Dilbert.date);
        jcontainer.append('&lt;div class=&quot;dilbert-desc&quot;&gt;');
        jQuery(&quot;.dilbert-desc&quot;, el).html(Dilbert.desc);

        jcontainer.append('');
        var pager = jQuery(&quot;.dilbert-pager&quot;, el);

        var first = jQuery('&lt;a href=&quot;#&quot;&gt;&lt;/a&gt;')
            .text(&quot;&lt;&lt;&quot;)
            .click(function(){
                Dilbert.current = 1;
                Dilbert.get(1);
                return false;
            });
        var prev = jQuery('&lt;a href=&quot;#&quot;&gt;&lt;/a&gt;')
            .text(&quot;&lt;&quot;)
            .click(function(){
                if(Dilbert.current &gt; 1)
                    Dilbert.get(--Dilbert.current);
                return false;
            });
        var next = jQuery('&lt;a href=&quot;#&quot;&gt;&lt;/a&gt;')
            .text(&quot;&gt;&quot;)
            .click(function(){
                if(Dilbert.current &lt; Dilbert.pages)
                    Dilbert.get(++Dilbert.current);
                return false;
            });
        var last = jQuery('&lt;a href=&quot;#&quot;&gt;&lt;/a&gt;')
            .text(&quot;&gt;&gt;&quot;)
            .click(function(){
                Dilbert.current = Dilbert.pages;
                Dilbert.get(Dilbert.pages);
            return false;
            });            

        pager.append(first);
        pager.append(prev);
        for(var i = 0;i &lt; Dilbert.pages;i++){
            var link = jQuery('&lt;a href=&quot;#&quot;&gt;&lt;/a&gt;')
                .text((i + 1))
                .click(function(){
                	Dilbert.current = parseInt(jQuery(this).text());
                    Dilbert.get(Dilbert.current);
                    return false;
                });
            if((Dilbert.current-1) == i)
                link.css({&quot;color&quot;:&quot;red&quot;,&quot;text-decoration&quot;:&quot;none&quot;});

            Dilbert.jpages[i] = link;
            pager.append(link);
        }
        pager.append(next);
        pager.append(last);

        document.onkeydown = function(e){
            if (e == null) { // ie
                keycode = event.keyCode;
            } else { // mozilla
                keycode = e.which;
            }
            if(keycode == 190){ // display previous image
                if(Dilbert.current &gt; 1){
                     //console.log(Dilbert.current);
                    Dilbert.get(--Dilbert.current);
                }
            } else if(keycode == 188){ // display next image
                if(Dilbert.current &lt; Dilbert.pages){
                    //console.log(Dilbert.current);
                    Dilbert.get(++Dilbert.current);
                }
            }
        };

    },
    reset_toolbar : function(el){
        jQuery(&quot;.dilbert-pager&gt;a&quot;, el).css({&quot;color&quot;:&quot;black&quot;,&quot;text-decoration&quot;:&quot;underline&quot;});
    }
};
jQuery.fn.dilbert = Dilbert.build;
</code></pre>
<img src="http://maxb.net/blog/?ak_action=api_record_view&id=16&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://maxb.net/blog/2008/04/28/jquery-dilbert-10/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
