<?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>Davide Caffaratti blog &#187; Library</title>
	<atom:link href="http://davidecaffaratti.com/category/library/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidecaffaratti.com</link>
	<description>My own personal blog and my works</description>
	<lastBuildDate>Fri, 12 Mar 2010 02:40:56 +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>Simple class for extract browser info</title>
		<link>http://davidecaffaratti.com/2010/03/11/simple-class-for-extract-browser-info/</link>
		<comments>http://davidecaffaratti.com/2010/03/11/simple-class-for-extract-browser-info/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 02:39:01 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[Classes]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=416</guid>
		<description><![CDATA[This is my little class for extract information from the browser with $_SERVER['HTTP_USER_AGENT']. Is very simple to use and can extract the browser name, minor version, and the platform name. Click HERE for see the code of this class]]></description>
			<content:encoded><![CDATA[<p>This is my little class for extract information from the browser with $_SERVER['HTTP_USER_AGENT'].</p>
<p>Is very simple to use and can extract the browser name, minor version, and the platform name.</p>
<p><a title="view class browser info" href="http://davidecaffaratti.com/php-code/cat-browser-info.inc.phps">Click HERE for see the code of this class</a></p>
<a href="http://davidecaffaratti.com/upload/cat-browser-info.inc.zip" title="download Cat_Browser_Info"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 1.42 KB<br /><b>Hits :</b> 9</div><br style="clear:both;" />
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2010/03/11/simple-class-for-extract-browser-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Class Cat_Cache revision 1</title>
		<link>http://davidecaffaratti.com/2010/01/29/class-cat_cache-revision-1/</link>
		<comments>http://davidecaffaratti.com/2010/01/29/class-cat_cache-revision-1/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 01:26:47 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[Classes]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=411</guid>
		<description><![CDATA[I found in my class for cache data an error that return incorrect value if the cache isn&#8217;t in the cache directory. This error return improperly a boolean true value instead of false. I correct the error with a new version of the class. Click HERE for see the code of this class]]></description>
			<content:encoded><![CDATA[<p>I found in my class for cache data an error that return incorrect value if the cache isn&#8217;t in the cache directory. This error return improperly a boolean true value instead of false.</p>
<p>I correct the error with a new version of the class.<br />
<strong><a title="view the class code" href="http://davidecaffaratti.com/php-code/cat-cache.phps">Click HERE for see the code of this class</a></strong></p>
<a href="http://davidecaffaratti.com/upload/cat-cache.inc.zip" title="download cat-cache"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 4.9 KB<br /><b>Hits :</b> 21</div><br style="clear:both;" />
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2010/01/29/class-cat_cache-revision-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mootools Edit In Place</title>
		<link>http://davidecaffaratti.com/2009/10/26/mootools-edit-in-place/</link>
		<comments>http://davidecaffaratti.com/2009/10/26/mootools-edit-in-place/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 03:41:58 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[eip]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=400</guid>
		<description><![CDATA[Here is my Mootools class that I use for make edit in place text. VIEW THE EXAMPLE FILE Use this class is very simple: First need to have mootools 1.2 javascript library Second download MooEip class The class: var MooEip = new Class({ //implements Implements: [Options,Events], //options options: { elements: '.eip', styleHover: 'eip-hover', styleInput: 'eip-input', [...]]]></description>
			<content:encoded><![CDATA[<p>Here is my <a href="http://mootools.net" target="_blank">Mootools</a> class that I use for make edit in place text.</p>
<p><strong><a href="http://davidecaffaratti.com/mootools/moo-eip/">VIEW THE EXAMPLE FILE</a></strong></p>
<p>Use this class is very simple:</p>
<p>First need to have <a href="http://mootools.net/core" target="_blank">mootools 1.2</a> javascript library<br />
Second download MooEip class</p>
<a href="http://davidecaffaratti.com/upload/moo-eip.zip" title="download mootools Eip"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 43.19 KB<br /><b>Hits :</b> 162</div><br style="clear:both;" />
<p><span id="more-400"></span></p>
<h3>The class:</h3>
<pre class="brush: jscript;">
var MooEip = new Class({

    //implements
    Implements: [Options,Events],

    //options
    options: {
        elements: '.eip',
        styleHover: 'eip-hover',
        styleInput: 'eip-input',
        styleTextarea: 'eip-textarea',
        styleLoading: 'eip-loading',
        idPrefix: 'id_',
        inputSave: 'Save',
        inputCanc: 'Cancel',
        saving: 'Saving...',
        empty: 'Click to Edit',
        hoverColor: '#ceffef',
        leaveColor: '#ffffff'
    },

    //initialization
    initialize: function(ajaxUrl, options) {
        // set ajax url
        this.ajaxUrl = ajaxUrl;
        //set options
        this.setOptions(options);

        this.run();
    },

    //a method that does whatever you want
    run: function() {
        //find the editable areas
        $$(this.options.elements).each(function(el) {
            var elId = el.getProperty('id');
            var elValue = el.get('text').trim();

            if (elValue.trim() == ''){
                el.set('text', this.options.empty);
            }

            if (el.getStyle('display') != '') {
                var displayStyle = el.getStyle('display');
            }
            else {
                var displayStyle = el.setStyle('display', 'block');
            }

            var editForm = new Element('form', {
                'name': 'form_' + elId,
                'events': {
                    'submit': function(e) {
                        el.setStyle('display', 'block');
                        //el.fireEvent('mouseleave');
                        e.preventDefault();

                        var request = new Request({
                            url: this.ajaxUrl,
                            data: 'value=' + editForm.fieldValue.value,
                            method: 'post',
                            onRequest: function(){
                                el.addClass(this.options.styleLoading);
                                el.set('text', this.options.saving);
                            }.bind(this),
                            onSuccess: function(){
                                el.removeClass(this.options.styleLoading);
                                el.set('html', (editForm.fieldValue.value.trim() == '' ? this.options.empty : editForm.fieldValue.value.trim().replace(new RegExp('\n', 'gi'), '&lt;br /&gt;')));
                            }.bind(this),
                            onFailure: function(resp){
                                el.removeClass(this.options.styleLoading);
                                alert('ERROR ON THE SERVER !!\nCODE: ' + resp.status + ' - TEXT: ' + resp.statusText + '\nPLEASE SAVE THE TEXT AGAIN !!');
                                el.set('html', (editForm.fieldValue.value.trim() == '' ? this.options.empty : editForm.fieldValue.value.trim().replace(new RegExp('\n', 'gi'), '&lt;br /&gt;')));
                            }.bind(this)
                        });
                        request.send();                        

                        editForm.dispose();

                        // set the new value from submited form value
                        elValue = editForm.fieldValue.value.trim();
                    }.bind(this)
                }
            });

            if(el.hasClass('input')) {
                var editField = new Element('input', {
                    'type': 'text',
                    'name': 'fieldValue',
                    'class': this.options.styleInput
                });
            }
            else {
                var editField = new Element('textarea', {
                    'name': 'fieldValue',
                    'class': this.options.styleTextarea
                });
                if (el.get('style') != '') {
                    editField.set('style', el.get('style'));
                }
            }

            var okButton = new Element('input', {
                'id': 'ok_' + elId,
                'type': 'submit',
                'value': this.options.inputSave,
                'events' : {
                    'click': function() {
                    editForm.dispose();
                    el.setStyle('display', displayStyle);
                    el.fireEvent('mouseleave');
                    }
                }
            });

            var cancelButton = new Element('input', {
                'id': 'cancel_' + elId,
                'type': 'reset',
                'value': this.options.inputCanc,
                'events': {
                    'click': function() {
                    editForm.dispose();
                    el.setStyle('display', displayStyle);
                    el.fireEvent('mouseleave');
                    }
                }
            });

            editField.inject(editForm);
            lb = new Element('br').inject(editField, 'after');
            okButton.inject(editForm);
            cancelButton.inject(editForm);

            var myeffect = new Fx.Tween(el, {duration: 500});

            el.addEvents({
                'mouseenter': function() {
                    el.setStyle('background-color', this.options.hoverColor);
                    el.addClass('eip-hover');
                }.bind(this),

                'mouseleave': function() {
                    myeffect.start('background-color', this.options.hoverColor, this.options.leaveColor);
                    el.removeClass('eip-hover');
                }.bind(this),

                'click': function() {
                    el.setStyle('display', 'none');
                    editField.value = (el.hasClass('input')) ? elValue.trim() : elValue.trim().replace(new RegExp('&lt;br /&gt;', 'gi'),'\n');
                    editForm.inject(el, 'after');
                    editField.focus();
                    el.removeClass('eip-hover');
                }
            });
        }, this);
    }
});
</pre>
<h3>The javascript in the page:</h3>
<pre class="brush: xml;">
&lt;script src=&quot;js/mootools-1.2.3-core.js&quot; type=&quot;text/javascript&quot;  charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;js/moo-eip-min.js&quot; type=&quot;text/javascript&quot;  charset=&quot;utf-8&quot;&gt;&lt;/script&gt;

&lt;script type=&quot;text/javascript&quot;  charset=&quot;utf-8&quot;&gt;
//&lt;![CDATA[
window.addEvent('domready', function() {
    var eip = new MooEip('edit.php');
});
//]]&gt;
&lt;/script&gt;

&lt;!-- style for moo-eip --&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/style.css&quot; /&gt;
&lt;!-- /style for moo-eip --&gt;
</pre>
<h3>The html</h3>
<pre class="brush: xml;">
&lt;div class=&quot;eip input&quot; id=&quot;id_0&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;eip&quot; id=&quot;id_1&quot; style=&quot;overflow:hidden;height:100px&quot;&gt;
this is a editable text 1 with overflow of the text hidden and height fixed in 100px.
&lt;/div&gt;
&lt;div class=&quot;eip&quot; id=&quot;id_2&quot;&gt;
this is a editable text 2.
&lt;/div&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2009/10/26/mootools-edit-in-place/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>MooSkype 1.1</title>
		<link>http://davidecaffaratti.com/2009/07/29/mooskype-1-1/</link>
		<comments>http://davidecaffaratti.com/2009/07/29/mooskype-1-1/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 17:15:18 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[skype]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=372</guid>
		<description><![CDATA[New version of moo-skype Add var ajaxProxy for set ajax proxy Add css file for style the skype buttom Add onLine example : VIEW THE EXAMPLE FILE]]></description>
			<content:encoded><![CDATA[<p>New version of moo-skype</p>
<ul>
<li>Add var <strong>ajaxProxy </strong>for set ajax proxy<strong><br />
</strong></li>
<li>Add css file for style the skype buttom</li>
</ul>
<p>Add onLine example :</p>
<p><strong></strong><strong><a href="../mootools/moo-skype/">VIEW THE EXAMPLE FILE</a></strong></p>
<p><a href="http://davidecaffaratti.com/upload/moo-skype.zip" title="download MooSkype class"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 68.42 KB<br /><b>Hits :</b> 17</div><br style="clear:both;" /><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2009/07/29/mooskype-1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secure image capcha revisited</title>
		<link>http://davidecaffaratti.com/2009/07/10/secure-image-capcha-revisited/</link>
		<comments>http://davidecaffaratti.com/2009/07/10/secure-image-capcha-revisited/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 04:02:21 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[capcha]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=351</guid>
		<description><![CDATA[I found a nice script http://www.phpcaptcha.org/ for made form capcha named secureimage and add some code for have random background and font for the capcha image Here are the class modification that I made on the class: - Porting the class for use in php5 - Remove the define for images: SI_IMAGE_JPEG, SI_IMAGE_PNG, SI_IMAGE_GIF - [...]]]></description>
			<content:encoded><![CDATA[<p>I found a nice script <a href="http://www.phpcaptcha.org/" target="_blank">http://www.phpcaptcha.org/</a> for made form capcha named secureimage and add some code for have random background and font for the capcha image</p>
<p>Here are the class modification that I made on the class:</p>
<p>- Porting the class for use in php5<br />
- Remove the define for images: SI_IMAGE_JPEG, SI_IMAGE_PNG, SI_IMAGE_GIF<br />
- Add define for ttf font path SI_PATH_TTF_FONTS<br />
- Add define for gd font path SI_PATH_GD_FONTS<br />
- Add define for random background imagess path SI_PATH_BACKGROUND<br />
- Add define for audio path SI_PATH_AUDIO<br />
- Add define for wordlist path SI_PATH_WORDS<br />
- Set static var for $charset<br />
- Add var $automatic_random for enable / disable random font and background image<br />
- Add var $lang_wordlist for have wordlist for any language<br />
- Delete var $wordlist_file: the file now is on SI_PATH_WORDS.&#8217;wordlist-&#8217;.$lang_wordlist.&#8217;.txt&#8217;<br />
- Add var $use_random_bg_image for set random extraction for the background image<br />
- Modify var $gd_font_file: now can set only filename<br />
- Modify var $gd_font_file: now can set only filename<br />
- Modify var $audio_path: now can set only filename<br />
- Add options array to the constructor function: $img = new Securimage(array(&#8216;automatic_random&#8217;=&gt;false,&#8217;lang_wordlist&#8217;=&gt;&#8217;it&#8217;));<br />
- Add generic function for set var in the class: (void)setOption($name, $value);<br />
- Add generic function for set var in the class: (void)setBgImage(&#8216;/path-to-my-bg-image/image-name.jpg&#8217;);<br />
- Modify function show() and added the code for have random background and font in the class<br />
- Added function getRandom() for charge random files</p>
<a href="http://davidecaffaratti.com/upload/captcha.zip" title="download Secureimage capcha"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 846.85 KB<br /><b>Hits :</b> 54</div><br style="clear:both;" />
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2009/07/10/secure-image-capcha-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP pdf invoice</title>
		<link>http://davidecaffaratti.com/2009/06/30/php-pdf-invoice/</link>
		<comments>http://davidecaffaratti.com/2009/06/30/php-pdf-invoice/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 01:58:51 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[invoice]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=335</guid>
		<description><![CDATA[I need for my cms a class that can print invoice payment in pdf format. Wel I find a nice script for oscommerce ( http://www.oscommerce.com/community/contributions,5321/category,12/search,pdf_customer_invoice ) that have a nice view of  the pdf invoice; Than I port this script and make a class for use in all indipendent cms &#8230; Here can download the [...]]]></description>
			<content:encoded><![CDATA[<p>I need for my cms a class that can print invoice payment in pdf format.</p>
<p>Wel I find a nice script for oscommerce (<a href="http://www.oscommerce.com/community/contributions,5321/category,12/search,pdf_customer_invoice" target="_blank"> http://www.oscommerce.com/community/contributions,5321/category,12/search,pdf_customer_invoice</a> ) that have a nice view of  the pdf invoice; Than I port this script and make a class for use in all indipendent cms &#8230;<img title="More..." src="http://davidecaffaratti.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p>
<p>Here can download the example output of the invoice class:</p>
<p><a href="http://davidecaffaratti.com/wp-content/uploads/2009/06/example.pdf">In</a><a href="http://davidecaffaratti.com/wp-content/uploads/2009/06/example.pdf">invoice pdf</a></p>
<a href="http://davidecaffaratti.com/upload/invoice.zip" title="download Cat_Pdf_Invoice - Class for make invoice pdf"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 81.96 KB<br /><b>Hits :</b> 124</div><br style="clear:both;" />
<p><span id="more-335"></span>Here is an example of use:</p>
<pre class="brush: php;">&lt;?php
$dir = dirname(__FILE__).'/';
define('FPDF_FONTPATH', $dir.'font/');
include($dir.'fpdf.php');
include($dir.'cat-pdf-invoice.inc.php');

$pdf = new Pdf_Invoice(array('locale'=&gt;false,'lang'=&gt;'en','show_watermark'=&gt;true,'watermark_text'=&gt;'Invoice copy'));
$params = array(
'customer_id'=&gt;1,
'payment_method'=&gt;'Paypal',
'carrier_method'=&gt;'Flat rate',
'carrier_price'=&gt;5.25,
'order_id'=&gt;222,
'order_date'=&gt;'2009/02/11',
'invoice_address'=&gt;&quot;street name\ncity zip\nstate\ncountry\n&quot;,
'delivery_address'=&gt;&quot;street name\ncity zip\nstate\ncountry\n&quot;,
'store_name'=&gt;'My store name',
'store_address'=&gt;&quot;store street name\nstore city zip\nstore state\nstore country\n&quot;,
'store_tel'=&gt;'+39 011222222',
'store_fax'=&gt;'+39 011333333',
'store_email'=&gt;'info@mystore.com',
'store_web'=&gt;'http://mystore.com',
'store_tax_number'=&gt;87039097397390,
'img_logo'=&gt;$dir.'invoice-logo.jpg',
'img_logo_correction'=&gt;0.18,
'invoice_footer'=&gt;'Thank you for your purchase'
);
$pdf-&gt;SetInvoiceParams($params);

$product = array(
'qty'=&gt;2,
'name'=&gt;'product 1 name',
'model'=&gt;'product 1 model',
'attributes'=&gt;'color: red, size: xl',
'price'=&gt;23.00,
'tax'=&gt;20.00
);
$pdf-&gt;SetProduct($product);
$product = array(
'qty'=&gt;10,
'name'=&gt;'product 2 name',
'model'=&gt;'product 2 model',
'attributes'=&gt;'color: blue, size: xxl',
'price'=&gt;13.00,
'tax'=&gt;18.00
);
$pdf-&gt;SetProduct($product);
$product = array(
'qty'=&gt;3,
'name'=&gt;'product 3 name',
'model'=&gt;'product 3 model',
'attributes'=&gt;'color: blue, size: xxl',
'price'=&gt;5.00,
'tax'=&gt;18.00
);
$pdf-&gt;SetProduct($product);
$product = array(
'qty'=&gt;10,
'name'=&gt;'product 4 name',
'model'=&gt;'product 4 model',
'attributes'=&gt;'color: blue, size: xxl',
'price'=&gt;90.00,
'tax'=&gt;18.00
);
$pdf-&gt;SetProduct($product);
$product = array(
'qty'=&gt;10,
'name'=&gt;'product 5 name',
'model'=&gt;'product 5 model',
'attributes'=&gt;'color: blue, size: xxl',
'price'=&gt;43.00,
'tax'=&gt;22.00
);
$pdf-&gt;SetProduct($product);

$pdf-&gt;GetInvoice($dir.'lang/');
?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2009/06/30/php-pdf-invoice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mootools fValidator with Asset</title>
		<link>http://davidecaffaratti.com/2009/06/19/mootools-fvalidator-with-asset/</link>
		<comments>http://davidecaffaratti.com/2009/06/19/mootools-fvalidator-with-asset/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 19:03:30 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[fvalidator]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=332</guid>
		<description><![CDATA[I made some modifications on the great scrip fValidator (http://pilon.nl) for charge with Assets only used languages files. Add too a compressed version of the class.]]></description>
			<content:encoded><![CDATA[<p>I made some modifications on the great scrip fValidator (<a href="http://pilon.nl" target="_blank">http://pilon.nl</a>) for charge with Assets only used languages files.</p>
<p>Add too a compressed version of the class.</p>
<a href="http://davidecaffaratti.com/upload/fValidator.zip" title="download fValidator with Asset language"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 8.48 KB<br /><b>Hits :</b> 89</div><br style="clear:both;" />
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2009/06/19/mootools-fvalidator-with-asset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MooSkype</title>
		<link>http://davidecaffaratti.com/2009/06/13/mooskype/</link>
		<comments>http://davidecaffaratti.com/2009/06/13/mooskype/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 02:52:56 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[skype]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=327</guid>
		<description><![CDATA[This is my new little class fot print Skype button status with mootools library. It have a nice effect for the button taken from http://davidwalsh.name/skype-mootools. Thanks David Your site is a good reference for me VIEW THE EXAMPLE FILE var MooSkype = new Class({ Implements: [Options], options: { // Flag use efect useEffect: true, // [...]]]></description>
			<content:encoded><![CDATA[<p>This is my new little class fot print Skype button status with mootools library.</p>
<p>It have a nice effect for the button taken from <a href="http://davidwalsh.name/skype-mootools" target="_blank">http://davidwalsh.name/skype-mootools</a>.</p>
<p>Thanks David Your site is a good reference for me <img src='http://davidecaffaratti.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong><a href="../mootools/moo-skype/">VIEW THE EXAMPLE FILE</a></strong></p>
<a href="http://davidecaffaratti.com/upload/moo-skype.zip" title="download MooSkype class"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 68.42 KB<br /><b>Hits :</b> 17</div><br style="clear:both;" />
<p><span id="more-327"></span></p>
<pre class="brush: plain;">var MooSkype = new Class({

Implements: [Options],

options: {
// Flag use efect
useEffect: true,
// Class name for hock skype button action
element: 'skype-button',
// Class name for the skype image
image: 'skype-image',
// Default action when user is disponible
defaultAction: 'call',
// Default language, possibles: 'en','de','fr','it','pl','ja','es','pt','pt-br','se','zh-cn','zh-tw'
language: 'en',
// Path to images
imagesPath: 'img/',
// Path to languages
languagesPath: './languages/'
},

initialize: function(options) {
this.setOptions(options);

this.setSkype();
},

setSkype: function() {
// charge js language
new Asset.javascript(this.options.languagesPath + this.options.language + '.js', {id: 'skypeLanguage'});

var href = $(this.options.element).getProperty('href');
var tmpUser = href.replace('skype:', '');
var user = tmpUser.replace(tmpUser.substring(tmpUser.lastIndexOf('?'),tmpUser.length), '');

var request = new Request({
url: 'http://localhost/moo-skype/proxy.php',
method: 'get',
data: 'user=' + user,
onFailure: function() {
this.getButton(user, 0);
}.bind(this),
onSuccess: function(resp){
this.getButton(user, resp.toInt());
}.bind(this)
});
request.send();
},

getButton: function(user, status) {
var link = $(this.options.element);
var img = $(this.options.image).clone();
var statusText = i18n[status];

switch(status){
case 2:
case 3:
case 7:
var href = link.set({'href': 'skype:' + user + '?' + this.options.defaultAction, 'title': statusText, 'text': statusText});
break;
default:
var href = link.set({'href': 'skype:' + user + '?add', 'title': statusText, 'text': statusText});
}

img.set({'src': this.options.imagesPath + status + '.gif', 'alt': statusText}).inject(href, 'top');

if (this.options.useEffect) {
this.setEffect(img);
}
},

setEffect: function(img) {
var running = false;

var fx2 = new Fx.Morph(img, {duration: 100, link: 'chain', onChainComplete:function() { running = false; } });
var fx1 = new Fx.Morph(img, {duration: 200, link: 'chain', onComplete:function() {
fx2.start({'top':'-7px'}).start({'top':'-4px'}).start({'top':'-6px'}).start({'top':'-4px'});
}
});
img.addEvent('mouseenter',function() {
if(!running) {
fx1.start({'top':'-10px'}).start({'top':'-4px'});
running = true;
}
});
}
})</pre>
<p><strong>For initialize the class use this:</strong></p>
<pre class="brush: plain;">window.addEvent('domready', function() {
var skype = new MooSkype({'language':'es'});
});</pre>
<p><strong>The html is here:</strong></p>
<pre class="brush: plain;">&lt;div&gt;
&lt;a href=&quot;skype:davcaffa?call&quot; id=&quot;skype-button&quot;&gt;
&lt;img src=&quot;img/2.gif&quot; alt=&quot;Call me&quot; id=&quot;skype-image&quot; /&gt;Call me&lt;/a&gt;
&lt;/div&gt;</pre>
<p>For use the ajax call need to use a proxy that read the state of users on skype server.</p>
<p>Here is the script:</p>
<pre class="brush: plain;">&lt;?php
if (!isset($_GET['user'])) {
echo 0;
}
else {
echo file_get_contents('http://mystatus.skype.com/'.$_GET['user'].'.num');
}
?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2009/06/13/mooskype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mootools swap image 1.1.1</title>
		<link>http://davidecaffaratti.com/2009/06/11/mootools-swap-image-111/</link>
		<comments>http://davidecaffaratti.com/2009/06/11/mootools-swap-image-111/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 00:19:34 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[images]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=311</guid>
		<description><![CDATA[Little optimization for the class code and add optional transation for the images. Add example in the zip file VIEW THE EXAMPLE FILE]]></description>
			<content:encoded><![CDATA[<p>Little optimization for the class code and add optional transation for the images.</p>
<p>Add example in the zip file <img src='http://davidecaffaratti.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong><a href="http://davidecaffaratti.com/mootools/moo-swap-images/">VIEW THE EXAMPLE FILE</a></strong></p>
<a href="http://davidecaffaratti.com/upload/moo-swap-images1.zip" title="download Mootools swap images"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 98.12 KB<br /><b>Hits :</b> 440</div><br style="clear:both;" />
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2009/06/11/mootools-swap-image-111/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moo Slider</title>
		<link>http://davidecaffaratti.com/2009/06/09/moo-slider/</link>
		<comments>http://davidecaffaratti.com/2009/06/09/moo-slider/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 22:21:32 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[Classes]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=290</guid>
		<description><![CDATA[This is my simple class for make content slider more simple. With this class can made multiple text slider and configure text, styles and more. VIEW THE EXAMPLE FILE var MooSlider = new Class({ Implements: [Options], options: { createToggle: true, tagToggle: 'a', cssHide: '.hide', cssToggle: '.toggle', slideDuration: 340, slideMode: 'vertical', slideTransitions: Fx.Transitions.Bounce.easeOut, textOpen: '+ Open', [...]]]></description>
			<content:encoded><![CDATA[<p>This is my simple class for make content slider more simple.</p>
<p>With this class can made multiple text slider and configure text, styles and more.</p>
<p><strong><a href="../mootools/moo-slider/">VIEW THE EXAMPLE FILE</a></strong></p>
<a href="http://davidecaffaratti.com/upload/moo-slider.zip" title="download Mootools slider"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 42.03 KB<br /><b>Hits :</b> 285</div><br style="clear:both;" />
<pre class="brush: plain;">
var MooSlider = new Class({

Implements: [Options],

options: {
createToggle: true,
tagToggle: 'a',
cssHide: '.hide',
cssToggle: '.toggle',
slideDuration: 340,
slideMode: 'vertical',
slideTransitions: Fx.Transitions.Bounce.easeOut,
textOpen: '+ Open',
textClose: '- Close',
elementsOpen: []
},

initialize: function(elements, options) {
this.setOptions(options);

// Set elements
this.setSlide(elements);
},

setSlide: function(elements) {
var status = {
'true': this.options.textOpen,
'false': this.options.textClose
};

$$(elements).each(function(div){

var isClose = (this.options.elementsOpen.indexOf(div.getProperty('id')) == -1);

if (this.options.createToggle) {
var link = new Element(this.options.tagToggle, { 'html': isClose?this.options.textOpen:this.options.textClose, 'class': this.options.cssToggle.replace('.',''), 'style': 'cursor:pointer;' } ).inject(div, 'top');
}
else {
var link = div.getElement(this.options.cssToggle).setStyle('cursor', 'pointer').set('class', this.options.cssToggle.replace('.',''));
}

this.hide = div.getElement(this.options.cssHide);

var fx = new Fx.Slide(this.hide, {
duration: this.options.slideDuration,
mode: this.options.slideMode,
transition: this.options.slideTransitions
})

fx.addEvent('complete', function() {
link.set('html', fx.open?status[false]:status[true]);
});

if (isClose) {
fx.hide();
}
else {
fx.show();
}

link.addEvent('click', function(e){
e.stop();
fx.toggle();
});

}, this);
}
})
</pre>
<p>For init the class use this:</p>
<pre class="brush: plain;">
&lt;script src=&quot;mootools-1.2.2-core.js&quot; type=&quot;text/javascript&quot;  charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;mootools-1.2.2.2-more.js&quot; type=&quot;text/javascript&quot;  charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;moo-slider-min.js&quot; type=&quot;text/javascript&quot;  charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;  charset=&quot;utf-8&quot;&gt;
//&lt;![CDATA[
window.addEvent('domready', function() {
&lt;pre id=&quot;line1&quot;&gt;    var slider = new MooSlider('.slide', {
    createToggle: true,
    tagToggle: 'a',
    cssHide: '.hide',
    cssToggle: '.toggle',
    slideDuration:340,
    slideMode: 'vertical',
    slideTransitions: Fx.Transitions.Pow.easeOut,
    textOpen: '+ View more',
    textClose: '- Close more',
    elementsOpen: []
    });
});
//]]&gt;&lt;/pre&gt;
&lt;/script&gt;
</pre>
<p>And this is the html for the sliders contents:</p>
<pre class="brush: plain;">
&lt;div class=&quot;slide&quot;&gt;
&lt;div class=&quot;hide&quot;&gt;
&lt;h1&gt;Slide 1&lt;/h1&gt;
This is my html code for this slide
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;slide&quot;&gt;
&lt;div class=&quot;hide&quot;&gt;
&lt;h1&gt;Slide 2&lt;/h1&gt;
This is my html code for this slide
&lt;/div&gt;
&lt;/div&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2009/06/09/moo-slider/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
