<?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>fusi0n &#187; javascript</title>
	<atom:link href="http://fusi0n.org/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://fusi0n.org</link>
	<description>pL&#039;s blog on tech/mobile</description>
	<lastBuildDate>Wed, 29 Feb 2012 20:19:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>#Newnewtwitter Keyboard Shortcuts</title>
		<link>http://fusi0n.org/internets/newnewtwitter-keyboard-shortcuts</link>
		<comments>http://fusi0n.org/internets/newnewtwitter-keyboard-shortcuts#comments</comments>
		<pubDate>Sun, 15 Jan 2012 08:28:49 +0000</pubDate>
		<dc:creator>pluc</dc:creator>
				<category><![CDATA[From the Intenets]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://fusi0n.org/?p=2004</guid>
		<description><![CDATA[Twitter's new design, the second one since the mass adoption of the platform, lovingly called #newnewtwitter was just enabled on my account. You can get a nicer output than what's below by pressing '?' in #newnewtwitter. They're pretty useful keyboard shortcuts - if you, like me, find yourself using the Web version more often than [...]]]></description>
			<content:encoded><![CDATA[<p>Twitter's new design, the second one since the mass adoption of the platform, lovingly called #newnewtwitter was just enabled on my account. You can get a nicer output than what's below by pressing '?' in #newnewtwitter. They're pretty useful keyboard shortcuts - if you, like me, find yourself using the Web version more often than anything else.</p>
<table>
<thead>
<tr>
<th colspan="2">Actions</th>
<th colspan="2">Navigation</th>
<th colspan="2">Timelines</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>F</strong></td>
<td>Favorite</td>
<td><strong>?</strong></td>
<td>This menu</td>
<td><strong>G</strong> <strong>H</strong></td>
<td>Home</td>
</tr>
<tr>
<td><strong>R</strong></td>
<td>Reply</td>
<td><strong>J</strong></td>
<td>Next Tweet</td>
<td><strong>G</strong> <strong>C</strong></td>
<td>Connect</td>
</tr>
<tr>
<td><strong>T</strong></td>
<td>Retweet</td>
<td><strong>K</strong></td>
<td>Previous Tweet</td>
<td><strong>G</strong> <strong>A</strong></td>
<td>Activity</td>
</tr>
<tr>
<td><strong>M</strong></td>
<td>Direct message</td>
<td><strong>Space</strong></td>
<td>Page down</td>
<td><strong>G</strong> <strong>R</strong></td>
<td>Mentions</td>
</tr>
<tr>
<td><strong>N</strong></td>
<td>New Tweet</td>
<td><strong>/</strong></td>
<td>Search</td>
<td><strong>G</strong> <strong>D</strong></td>
<td>Discover</td>
</tr>
<tr>
<td><strong>Enter</strong></td>
<td>Open Tweet details</td>
<td><strong>.</strong></td>
<td>Load new Tweets</td>
<td><strong>G</strong> <strong>P</strong></td>
<td>Profile</td>
</tr>
<tr>
<td><strong>L</strong></td>
<td>Close all open Tweets</td>
<td><strong>G</strong> <strong>F</strong></td>
<td>Favorites</td>
<td><strong>G</strong> <strong>M</strong></td>
<td>Messages</td>
</tr>
<tr>
<td colspan="4"></td>
<td><strong>G</strong> <strong>U</strong></td>
<td>Go to user...</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://fusi0n.org/internets/newnewtwitter-keyboard-shortcuts/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter Direct Messages Bulk Deleter</title>
		<link>http://fusi0n.org/coding/twitter-direct-messages-bulk-deleter</link>
		<comments>http://fusi0n.org/coding/twitter-direct-messages-bulk-deleter#comments</comments>
		<pubDate>Wed, 08 Jun 2011 04:40:16 +0000</pubDate>
		<dc:creator>pluc</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://fusi0n.org/?p=1804</guid>
		<description><![CDATA[If you're a Twitter user and a organisation freak, you're certainly aware that Twitter doesn't give you the ability to bulk-delete direct messages. Back in the days, Damon Cortesi had built a nifty bookmarklet that allowed you to stick it to the man. Problem is, that bookmarklet is now deprecated, due to Twitter's change of [...]]]></description>
			<content:encoded><![CDATA[<p>If you're a Twitter user and a organisation freak, you're certainly aware that Twitter doesn't give you the ability to bulk-delete direct messages. Back in the days, <a href="http://dcortesi.com/" target="_blank">Damon Cortesi</a> had <a href="http://dcortesi.com/tools/dm-deleter/" target="_blank">built a nifty bookmarklet</a> that allowed you to stick it to the man. Problem is, that bookmarklet is now deprecated, due to Twitter's change of layout - most of the stuff just doesn't work the way it used to, so the infamous DM Whacker was laid to rest.</p>
<p>Until I got really fucking tired of all the direct messages. Here's a reboot of Damon Cortesi's DM Whacker: <strong>DMDelete-v2.0</strong>. It's fast, uses Twitter-specific resources (such as their jQuery and dialogs), and is merciless. Give it a try, all you have to do is drag the link blow to your bookmark toolbar (or wherever you want really), go to <a href="https://twitter.com/#!/messages">your Twitter inbox</a> and click it!</p>
<p><strong>This is beta software!</strong> Feel free to <a href="http://fusi0n.org/contact">relay any feedback</a> you might have after using - it's rather challenging to thoroughly test this piece of code on my own, so there may be random hiccups.</p>
<p><a href="javascript:(function(){if(!location.href.match(/^http(s)?:\/\/twitter\.com(\/#!)?\/messages$/)) {location.href='https://twitter.com/#!/messages';return false;};var e=document.createElement('script');e.charset='utf-8';e.type='text/javascript';e.src='http://fusi0n.org/dmdelete-v2.0-min.js';document.body.appendChild(e);})();void(0);">DMDeleter-v2.0</a></p>
<p><a href="http://svn.eratech.ca/public.dmdelete?">Browse the source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fusi0n.org/coding/twitter-direct-messages-bulk-deleter/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>10 of the Best WordPress Plugins</title>
		<link>http://fusi0n.org/coding/10-of-the-best-wordpress-plugins</link>
		<comments>http://fusi0n.org/coding/10-of-the-best-wordpress-plugins#comments</comments>
		<pubDate>Fri, 12 Nov 2010 03:23:07 +0000</pubDate>
		<dc:creator>pluc</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[WP-prettyPhoto]]></category>

		<guid isPermaLink="false">http://fusi0n.org/?p=1452</guid>
		<description><![CDATA[WordPress is an extremely powerful and popular blogging platform. There are over 27 million WordPress publishers as of September 2010: 13.9 million blogs hosted on WordPress.com plus 13.8 million active installations of the WordPress.org software (source). If that's not enough, there are 17,428 registered plugins to extend its functionality and 4,406 registered themes to modify [...]]]></description>
			<content:encoded><![CDATA[<p><a title="WordPress.org" href="http://www.wordpress.org" target="_blank"></a>WordPress is an extremely powerful and popular blogging <a title="WordPress.com" href="http://www.wordpress.com" target="_blank">platform</a>. There are over <strong>27 million</strong> WordPress publishers as of September 2010: <strong> 13.9 million</strong> blogs hosted on <a title="WordPress.com" href="http://www.wordpress.com" target="_blank">WordPress.com</a> plus <strong>13.8 million</strong> active  installations of the <a title="WordPress.org" href="http://www.wordpress.org" target="_blank">WordPress.org software</a> (<a title="WordPress Stats" href="http://en.wordpress.com/stats/" target="_blank">source</a>). If that's not enough, there are <strong>17,428</strong> registered <a title="WordPress Plugins" href="http://wordpress.org/extend/plugins/" target="_blank">plugins</a> to extend its functionality and <strong>4,406</strong> registered <a title="WordPress Themes" href="http://wordpress.org/extend/themes/" target="_blank">themes</a> to modify its look. With all that, it can get complicated to choose the best plugins to achieve what you want. Here's a list of my personal favourites.  <span id="more-1452"></span></p>
<h3><a title="Disqus Comment System" href="http://wordpress.org/extend/plugins/disqus-comment-system/" target="_blank">Disqus Comment System</a></h3>
<p><a title="Disqus" href="http://www.disqus.com" target="_blank">Disqus</a> is a third-party commenting platform that facilitates user interaction by providing a single log in for every Disqus-enabled site. They also offer various login options (Twitter, Facebook, etc) as well as content appreciation features. Essentially, it's a very simple comment system that doesn't require local registrations or theming. One of its great feature is the ability to export all the local WordPress-based comments into their database for a smooth transition.</p>
<h3><a title="Google Analytics for WordPress" href="http://wordpress.org/extend/plugins/google-analytics-for-wordpress/" target="_blank">Google Analytics for WordPress</a></h3>
<p>I'm not much of an SEO person, but I'm still aware it has a definitive importance and impact to have a properly indexed website. There's a bunch of options that I don't understand, but luckily I have friends who make a living of <a title="AOD Marketing" href="http://www.aodmarketing.com" target="_blank">SEO and Analytics</a> and they insist <a title="Joost de Valk" href="http://yoast.com/" target="_blank">Joost de Valk</a>'s <a title="Google Analytics for WordPress" href="http://yoast.com/wordpress/google-analytics/" target="_blank">Google Analytics for WordPress</a> is there best option available.</p>
<h3><a title="Google XML Sitemaps" href="http://wordpress.org/extend/plugins/google-sitemap-generator/" target="_blank">Google XML Sitemaps</a></h3>
<p>In June 2005, Google announced a new service called <a href="https://www.google.com/webmasters/sitemaps">Google Sitemaps</a>.  This plugin allows webmasters to submit an index of URLs which they  want to have included in Googles web search. It's free to use and helps  Google to get a <a href="#" onclick="$.prettyPhoto.open('/wp-content/uploads/2010/11/sitemaps.png', 'Google XML Sitemaps', 'Google Webmaster Tool Sitemaps');return false;">more complete overview</a> of your website. More information regarding Google Sitemaps and how this plugin implements it over at <a title="Google Sitemaps FAQ (Sitemap Issues And Errors)" href="http://www.arnebrachhold.de/2006/04/07/google-sitemaps-faq-sitemap-issues-errors-and-problems/" target="_blank">Arne Brachhold's FAQ</a></p>
<h3><a title="SyntaxHighlighter Evolved" href="http://wordpress.org/extend/plugins/syntaxhighlighter/" target="_blank">SyntaxHighlighter Evolved</a></h3>
<p>My blog can get somewhat <a title="Coding" href="http://fusi0n.org/category/coding" target="_self">technical</a> when I write about <a title="WordPress" href="http://fusi0n.org/tag/wordpress" target="_self">WordPress</a>, <a title="PHP" href="http://fusi0n.org/tag/php" target="_self">PHP</a>, <a title="Linux" href="http://fusi0n.org/tag/linux" target="_self">Linux</a> or <a title="JavaScript" href="http://fusi0n.org/tag/javascript" target="_self">JavaScript</a>. <a title="SyntaxHighlighter Evolved" href="http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/" target="_blank">SyntaxHighlighter Evolved</a> allows code to be highlighted and formatted nicely using a predefined set of language-based shortcodes.</p>
<h3><a title="Widget Logic" href="http://wordpress.org/extend/plugins/widget-logic/" target="_blank">Widget Logic</a></h3>
<p>This one is kind of complicated to get your head around. Essentially, Widget Logic will <a href="#" onclick="$.prettyPhoto.open('/wp-content/uploads/2010/11/widgets.png', 'Widget Logic', 'Widget Logic');return false;">add an input box</a> inside every widget that allows you to use WordPress template tags to conditionally display (or not) the widget's content.</p>
<h3><a title="WordPress Admin Bar" href="http://wordpress.org/extend/plugins/wordpress-admin-bar/" target="_blank">WordPress Admin Bar</a></h3>
<p>I have to admit I found this little gem only today, and I don't know how I was able to live without it before. <a title="WordPress Admin Bar" href="http://www.viper007bond.com/wordpress-plugins/wordpress-admin-bar/" target="_blank">WordPress Admin Bar</a> will, if configured to do so, add a nice little bar at the top your WordPress content <a href="#" onclick="$.prettyPhoto.open('/wp-content/uploads/2010/11/adminbar.png', 'WordPress Admin Bar', 'WordPress Admin Bar');return false;">like this</a> giving you easy access to all your administrative functions while surfing the non-admin part of your blog. It's worth noting that WordPress Admin Bar is made by the same developer who makes SyntaxHighlighter Evolved (and who works for <a title="Automattic" href="http://automattic.com/" target="_blank">Automattic</a>). For more of Alex's plugins, check out the full list <a title="Viper007Bond's WordPress Plugins" href="http://www.viper007bond.com/wordpress-plugins/" target="_blank">on his website</a></p>
<h3><a title="WPtouch" href="http://wordpress.org/extend/plugins/wptouch/" target="_blank">WPtouch</a></h3>
<p>The guys at <a title="BraveNewCode" href="http://www.bravenewcode.com/" target="_blank">BraveNewCode</a> have been around ever since there was an interest for mobile-friendly versions of standard websites. It was the first mobile-rendering plugin that WordPress had, and as far as I'm concerned, it's still the very best. The only downside is that it lacks a design modification aspect - but then again, how else are you going to render if not <a href="#" onclick="$.prettyPhoto.open('/wp-content/uploads/2010/11/wptouch.png', 'WPtouch', 'WPtouch render of fusi0n.org');return false;">this way</a>? In today's mobile-crazed world, it's a pretty good idea to use <a title="WPtouch" href="http://www.bravenewcode.com/products/wptouch-pro/" target="_blank">WPtouch</a> to render a mobile-friendly version to known mobile browsers.</p>
<h3><a title="WP Super Cache" href="http://wordpress.org/extend/plugins/wp-super-cache/" target="_blank">WP Super Cache</a></h3>
<p>WordPress <a title="WordPress Optimization/Caching" href="http://codex.wordpress.org/WordPress_Optimization/Caching" target="_blank">does not come</a> with a file caching system by default. If your blog has high pageviews, using <a title="WP Super Cache" href="http://ocaoimh.ie/wp-super-cache/" target="_blank">WP Super Cache</a> will significantly reduce the load on your server, which can then stay responsive longer because it doesn't have to call and process the files queued for serving.</p>
<h3><a title="Akismet" href="http://wordpress.org/extend/plugins/akismet/" target="_blank">Akismet</a></h3>
<p>One of the very few plugin that comes bundled with WordPress by default, <a title="Akismet" href="http://akismet.com/" target="_blank">Akismet</a> is a merciless spam filter for your comments. It's been <a href="#" onclick="$.prettyPhoto.open('/wp-content/uploads/2010/11/akismet.png', 'Akismet Stats', 'Akismet');return false;">pretty good</a> to me since I've started using it. It can also be used in various independent user-input-based plugins like <a title="Contact Form 7" href="http://wordpress.org/extend/plugins/contact-form-7/" target="_blank">Contact Form 7</a>.</p>
<h3><a title="WP-prettyPhoto" href="http://wordpress.org/extend/plugins/wp-prettyphoto/" target="_blank">WP-prettyPhoto</a></h3>
<p>Obligatory self-promotion, yes, but I genuinely believe it my plugin deserves a spot on this list. <a title="StÃ©phane Caron" href="http://www.no-margin-for-errors.com/" target="_blank">StÃ©phane Caron</a> did a fantastic job with his <a title="prettyPhoto" href="http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/" target="_blank">prettyPhoto jQuery plugin</a>, (<a title="StÃ©phane Caron's Projects" href="http://www.no-margin-for-errors.com/projects/" target="_blank">more StÃ©phane projects</a>) even more so with the <a title="prettyPhoto 3.0" href="http://www.no-margin-for-errors.com/blog/2010/09/15/prettyphoto-3-0-is-live/" target="_blank">3.0 release</a> which will be implemented in <a title="WP-prettyPhoto" href="http://fusi0n.org/category/wp-prettyphoto" target="_blank">WP-prettyPhoto</a> soon. This plugin automatically makes all self-linked images open in a cute <a href="#" onclick="$.prettyPhoto.open('/wp-content/uploads/2010/11/prettyphoto.png', 'prettyPhoto Gallery', 'prettyPhoto Window');return false;">prettyPhoto inline window</a> that supports multiple media formats, YouTube, Vimeo, QuickTime and Flash videos, external sites and even inline (textual!) content. Read up on the <a title="WP-prettyPhoto Technical Information and Usage Instructions" href="http://fusi0n.org/wp-prettyphoto/technical-information-and-usage-instructions" target="_blank">current version's usage instructions </a>to get an idea of what it's capable of!</p>
]]></content:encoded>
			<wfw:commentRss>http://fusi0n.org/coding/10-of-the-best-wordpress-plugins/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Consolidating Facebook&#8217;s Takeover of the Net: Bookmarklet to &#8220;Like&#8221; Anything!</title>
		<link>http://fusi0n.org/internets/consolidating-facebooks-takeover-of-the-net-bookmarklet-to-like-anything</link>
		<comments>http://fusi0n.org/internets/consolidating-facebooks-takeover-of-the-net-bookmarklet-to-like-anything#comments</comments>
		<pubDate>Fri, 23 Apr 2010 14:08:48 +0000</pubDate>
		<dc:creator>pluc</dc:creator>
				<category><![CDATA[From the Intenets]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.fusi0n.org/?p=1133</guid>
		<description><![CDATA[I was wondering, last night, if I'd really have to wait for everyone to implement the new Facebook Social Plugins, more specifically, the new embeddable "Like Button". I think it's a pretty cool alternative to replace everyone's "Share on Facebook" annoying popup link. That being said, I decided I'd throw a little JavaScript together, actually [...]]]></description>
			<content:encoded><![CDATA[<p>I was wondering, last night, if I'd really have to wait for everyone to implement the new Facebook Social Plugins, more specifically, the new embeddable "Like Button". I think it's a pretty cool alternative to replace everyone's "Share on Facebook" annoying popup link. That being said, I decided I'd throw a little JavaScript together, actually inspired by <a href="http://dcortesi.com/tools/dm-deleter/" target="_blank">Damon Cortesi's DM Deleter</a> for Twitter, I put together a bookmarklet to insert a "Like" button virtually anywhere (and by that, I mean on any site/page you visit).</p>
<p>First, for those who want the result before the explanation, drag this link to your browser's bookmark toolbar: <a title="Like This" href="javascript:(function(){var%20h=document.getElementsByTagName('head')[0];var%20m1=document.createElement('meta');m1.setAttribute('property','og:title');m1.content=document.title;h.appendChild(m1);var%20m2=document.createElement('meta');m2.setAttribute('property','og:site_name');m2.content=window.location.hostname;h.appendChild(m2);var%20m3=document.createElement('meta');m3.setAttribute('property','og:url');m3.content=window.location;h.appendChild(m3);var%20s=document.createElement('iframe');s.scrolling='no';s.frameborder='0';s.allowTransparency='true';s.style.border='none';s.style.overflow='hidden';s.style.position='absolute';s.style.zIndex='100';s.src='http://www.facebook.com/plugins/like.php?href='+encodeURIComponent(window.location)+'&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light';var%20a=document.body.firstChild;document.body.insertBefore(s,a);})();void(0);">Like This</a></p>
<p>Alright, now for the smart people, here's a breakdown of what this puppy does:</p>
<pre class="brush: jscript; title: ; notranslate">

javascript:(function(){
var h=document.getElementsByTagName('head')[0];
var m1=document.createElement('meta');
m1.setAttribute('property','og:title');
m1.content=document.title;
h.appendChild(m1);

var m2=document.createElement('meta');
m2.setAttribute('property','og:site_name');
m2.content=window.location.hostname;
h.appendChild(m2);

var m3=document.createElement('meta');
m3.setAttribute('property','og:url');
m3.content=window.location;
h.appendChild(m3);

var s=document.createElement('iframe');
s.scrolling='no';
s.frameborder='0';
s.allowTransparency='true';
s.style.border='none';
s.style.overflow='hidden';
s.style.position='absolute';
s.style.zIndex='100';
s.src='http://www.facebook.com/plugins/like.php?href='+encodeURIComponent(window.location)+'&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light';
var a=document.body.firstChild;
document.body.insertBefore(s,a);
})();void(0);
</pre>
<p>What that is gonna do is relatively simple and most of you will be able to guess it just by looking at the code above. It creates three META tags, one for og:title, one for og:site_name, and one for og:url which are all required by Facebook to display the data that you actually like.<br />
Once that's done, it creates an iframe, exactly the same as just getting the <a href="http://developers.facebook.com/docs/reference/plugins/like" target="_blank">Like Button code from Facebook</a> and puts it as the first element of the body tag, making it the first thing you see on the page, technically.</p>
<p>This is mostly a little toy, but feel free to use it if you'd like! I'm not too sure why, but when I tried this at home, it would pop up a Facebook login window instead of just "Liking" whatever I was supposed to be Liking... this morning, it doesn't. So let me know what you experience if you try it out.</p>
<p>Edit: ReadWriteWeb is <a href="http://www.readwriteweb.com/archives/how_to_like_anything_on_the_web_safely.php" target="_blank">also saying</a> they've got a "Safe" bookmarklet. But theirs don't add meta tags <img src='http://fusi0n.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://fusi0n.org/internets/consolidating-facebooks-takeover-of-the-net-bookmarklet-to-like-anything/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Make your WordPress plugins use a different version of a bundled JavaScript library</title>
		<link>http://fusi0n.org/coding/make-your-wordpress-plugins-use-a-different-version-of-a-bundled-javascript-library</link>
		<comments>http://fusi0n.org/coding/make-your-wordpress-plugins-use-a-different-version-of-a-bundled-javascript-library#comments</comments>
		<pubDate>Fri, 13 Feb 2009 05:45:10 +0000</pubDate>
		<dc:creator>pluc</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[WP-prettyPhoto]]></category>

		<guid isPermaLink="false">http://blog.fusi0n.org/?p=575</guid>
		<description><![CDATA[I've recently coded my first WordPress plugin, for the fun of it. I've been using WordPress for some time, and I know PHP quite well, so I figured it'd be fun. WordPress has a weird/interesting way of being extendable. I won't go into too much technical details about that, but suffices to say that it's [...]]]></description>
			<content:encoded><![CDATA[<p>I've recently coded my first <a href="http://codex.wordpress.org/Plugins" target="_blank">WordPress plugin</a>, for the fun of it. I've been using <a href="http://wordpress.org/" target="_blank">WordPress</a> for some time, and I know <a title="PHP" href="http://www.php.net" target="_blank">PHP</a> quite well, so I figured it'd be fun. WordPress has a <a href="http://codex.wordpress.org/Developer_Documentation" target="_blank">weird/interesting</a> way of being <em>extendable</em>. I won't go into too much technical details about that, but suffices to say that it's easy yet complicated to perform tasks you want to. Yeah, <em>that</em> weird.</p>
<p>All that being said, I upgraded my WordPress from 2.7 to <a href="http://wordpress.org/download/" target="_blank">2.7.1</a> in the middle of coding some new features for the latest release of <a title="WP-prettyPhoto" href="http://wordpress.org/extend/plugins/wp-prettyphoto" target="_blank">WP-prettyphoto</a>, 1.1. That made me realize that updating WordPress' core also <em>updates</em> the installed JavaScript modules, namely <a href="http://jquery.com/" target="_self">jQuery</a> (among <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Parameters" target="_blank">many others</a>). When I first coded <a title="WP-prettyPhoto" href="http://wordpress.org/extend/plugins/wp-prettyphoto" target="_blank">WP-prettyphoto</a>, when things weren't working I just replaced the <a href="http://jquery.com" target="_blank">jQuery</a> I had with the <a href="http://docs.jquery.com/Downloading_jQuery" target="_blank">latest official stable releas</a>e and things worked fine. I didn't give it much thought. So when I updated WordPress,  all hell broke loose and <a title="WP-prettyPhoto" href="http://wordpress.org/extend/plugins/wp-prettyphoto" target="_blank">WP-prettyphoto</a> was metaphorically crying in agony because jQuery wasn't man enough for it. I then tried performing the same manual updating procedure, and without really surprising anyone -- I was alone anyway -- <a title="WP-prettyPhoto" href="http://wordpress.org/extend/plugins/wp-prettyphoto" target="_blank">WP-prettyphoto</a> was back prettyfying my stuff like a starving fat kid eats a cheesecake.</p>
<p><span id="more-575"></span></p>
<p>Morale of the story, I needed to code a jQuery version check in my <a title="WP-prettyPhoto" href="http://wordpress.org/extend/plugins/wp-prettyphoto" target="_blank">WP-prettyphoto</a> code, and if jQuery's version wasn't matching what I wanted, I had to replace the script with one that would make <a title="WP-prettyPhoto" href="http://wordpress.org/extend/plugins/wp-prettyphoto/" target="_blank">WP-prettyPhoto</a> work the way it's supposed to. The goal's clear, the execution, however, was somewhat more obscure. Obviously, not being a WordPress plugin genius, I googled for solutions or anything that could help me achieve what I wanted. I didn't find much on how to replace a bundled script loaded by default. I found what I was looking for in a competing (and I use that term very, very loosely!) plugin for a jQuery Lightbox clone cleverly called <a href="http://wordpress.org/extend/plugins/jquery-lightbox-balupton-edition/" target="_blank">jQuery Lightbox</a> by <a href="http://www.pedrolamas.com/" target="_blank">Pedro Lamas</a>. It's basically de-registering the default WordPress jQuery plugin and replacing it with one bundled with the plugin. Using native functions. Nice. Here's the code:</p>
<pre class="brush: php; title: ; notranslate">// jQuery - removing to make sure we're using 1.3.1
//Deregister bundled jQuery (1.2.6 as of WP 2.7.1)
wp_deregister_script('jquery');
//Registering our up to date jQuery
//$wppp_url is WP_CONTENT_URL.'/plugins/'.plugin_basename(dirname(__FILE__));
wp_register_script('jquery', (&quot;$wppp_url/js/jquery-1.3.1.min.js&quot;), false, '1.3.1');
//Giving WordPress our new jQuery script to enqueue (display)
wp_enqueue_script('jquery');</pre>
<p>So there you have it. That's how to replace the version of a bundled WordPress JavaScript library.</p>
]]></content:encoded>
			<wfw:commentRss>http://fusi0n.org/coding/make-your-wordpress-plugins-use-a-different-version-of-a-bundled-javascript-library/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

