<?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>Konstantin Kovshenin &#187; jquery</title>
	<atom:link href="http://kovshenin.com/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://kovshenin.com</link>
	<description>WordPress, Automattic and Open Source</description>
	<lastBuildDate>Mon, 21 May 2012 15:59:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>External Links with CSS3 or jQuery</title>
		<link>http://kovshenin.com/2011/external-links-with-css3-or-jquery/</link>
		<comments>http://kovshenin.com/2011/external-links-with-css3-or-jquery/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 12:42:49 +0000</pubDate>
		<dc:creator>Konstantin Kovshenin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://kovshenin.com/?p=3627</guid>
		<description><![CDATA[Here&#8217;s how I marked external links using CSS throughout my blog with a few simple selectors one of which is a level 3 meaning this solution will probably fail in some version of IE and other browsers with limited CSS3 support. a { background: url('http://kovshenin.com/core/wp-content/themes/publish/images/external-link.png') right center no-repeat; padding-right: 14px; } a[href^="http://kovshenin.com"], a[href^="/"], a[href^="#"] { background: [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how I marked external links using CSS throughout my blog with a few simple selectors one of which is a <a href="http://www.w3.org/TR/selectors/">level 3</a> meaning this solution will probably fail in some version of IE and other browsers with limited CSS3 support.</p>
<pre>a {
    background: url('http://kovshenin.com/core/wp-content/themes/publish/images/external-link.png') right center no-repeat;
    padding-right: 14px;
}

a[href^="http://kovshenin.com"], a[href^="/"], a[href^="#"] {
    background: none;
    padding-right: inherit;
}</pre>
<p>The first one selects all the links on the page, gives them the external link icon and a padding on the right. The second selector fetches all links that begin with my domain name, relative links and empty links and then removes the background and padding set by the first selector.</p>
<p>This solution might need a few tweaks depending on your linking structure and perhaps a fallback stylesheet for browsers with no CSS3 support. Another option can be jQuery, somewhere in your head section after jQuery has been loaded:</p>
<pre>jQuery(document).ready(function($) {
    $.expr[':'].external = function(obj) {
        return !obj.href.match(/^mailto:/) &amp;&amp; (obj.hostname != location.hostname);
    };
    $('a:external').addClass('external');
});</pre>
<p>Which would add an <strong>external</strong> class name to all links where hosts don&#8217;t match the current host, and then use the <code>a.external</code> selector to style your external links as shown in the example earlier. This solution will &#8220;blink&#8221; though because jQuery has to first load and initialize before it can read all the contents of your page. It&#8217;s a matter of milliseconds so most people won&#8217;t mind. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://kovshenin.com/2011/external-links-with-css3-or-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Experiments: Visual Styles Editor</title>
		<link>http://kovshenin.com/2011/wordpress-experiments-visual-styles-editor/</link>
		<comments>http://kovshenin.com/2011/wordpress-experiments-visual-styles-editor/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 08:46:54 +0000</pubDate>
		<dc:creator>Konstantin Kovshenin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery ui]]></category>
		<category><![CDATA[themes]]></category>

		<guid isPermaLink="false">http://kovshenin.com/?p=3320</guid>
		<description><![CDATA[In a previous blog post I demonstrated a video of the color wheel concept. Today I&#8217;d like to show you another WordPress themes experiment &#8212; visual styles editor. As shown in the video, the styles editor pops out as a dialog box which you can move around the page. The dialog itself contains a select [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://kovshenin.com/2011/wordpress-experiments-colors-the-color-wheel/">previous blog post</a> I demonstrated a video of the color wheel concept. Today I&#8217;d like to show you another WordPress themes experiment &#8212; visual styles editor.</p>
<p><iframe width="580" height="326" src="http://www.youtube.com/embed/B_bf2Q-KTls?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>As shown in the video, the styles editor pops out as a dialog box which you can move around the page. The dialog itself contains a select box where you get to pick a certain style (like headings, menu anchors, etc) and the actual properties below. An &#8220;element picker&#8221; might also be introduced, but has to be very well implemented in order to work.</p>
<p>So yeh, editing WordPress themes on the fly is possible, the parameters are saved when the save button is clicked via a short AJAX call and the next page will contain the modified CSS. Next up is column widths, probably the most dangerous thing to mess around with ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://kovshenin.com/2011/wordpress-experiments-visual-styles-editor/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>WordPress Experiments: Colors &amp; The Color Wheel</title>
		<link>http://kovshenin.com/2011/wordpress-experiments-colors-the-color-wheel/</link>
		<comments>http://kovshenin.com/2011/wordpress-experiments-colors-the-color-wheel/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 07:00:58 +0000</pubDate>
		<dc:creator>Konstantin Kovshenin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[videos]]></category>

		<guid isPermaLink="false">http://kovshenin.com/?p=3314</guid>
		<description><![CDATA[I&#8217;ve been working on a free theme called Minimal Georgia lately and based on it, I&#8217;m now running a few experiments for theme customization, of course inspired by Squarespace. One of my first experiments is the color wheel and there are plenty of jQuery plugins and code snippets that could do that. With a few [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a free theme called <a href="http://kovshenin.com/2011/introducing-minimal-georgia-for-wordpress/">Minimal Georgia</a> lately and based on it, I&#8217;m now running a few experiments for theme customization, of course inspired by <a href="http://www.squarespace.com/">Squarespace</a>.</p>
<p>One of my first experiments is the color wheel and there are plenty of jQuery plugins and code snippets that could do that. With a few more research about colors and their hex codes, I found a way to determine a color darker or lighter than the chosen once, enabling me to do the gradient fill, drop-down menu colors. The HSL values returned by the color wheel let me switch the font color, so that the text appears white on a dark background and black on a light one.</p>
<p><iframe width="580" height="326" src="http://www.youtube.com/embed/BS7IZHUAf0U?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>As you can see the color wheel not only affects the website header, but also the links on the page, giving them a darker color than the one chosen, giving a better contrast. Of course it is not perfect, but I&#8217;ll get there eventually ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://kovshenin.com/2011/wordpress-experiments-colors-the-color-wheel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snippet: Using jQuery 1.5 in WordPress</title>
		<link>http://kovshenin.com/2011/snippet-using-jquery-1-5-in-wordpress/</link>
		<comments>http://kovshenin.com/2011/snippet-using-jquery-1-5-in-wordpress/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 08:22:40 +0000</pubDate>
		<dc:creator>Konstantin Kovshenin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://kovshenin.com/?p=3169</guid>
		<description><![CDATA[Yes! jQuery 1.5 was released and I&#8217;m sure some of you can&#8217;t wait to start using it in their WordPress themes and plugins. So, with a few filters magic, we can get jQuery 1.5 up and running. Add the following code to your theme&#8217;s function.php file: add_filter( 'script_loader_src', 'my_script_loader_src', 10, 2 ); function my_script_loader_src( $src, [...]]]></description>
			<content:encoded><![CDATA[<p>Yes! <a href="http://blog.jquery.com/2011/01/31/jquery-15-released/">jQuery 1.5 was released</a> and I&#8217;m sure some of you can&#8217;t wait to start using it in their WordPress themes and plugins. So, with a few filters magic, we can get jQuery 1.5 up and running. Add the following code to your theme&#8217;s function.php file:</p>
<pre>add_filter( 'script_loader_src', 'my_script_loader_src', 10, 2 );
function my_script_loader_src( $src, $handle ) {
    if ( $handle == "jquery" )
        return "http://code.jquery.com/jquery-1.5.min.js";
    return $src;
}</pre>
<p>And that&#8217;s it! Now every call to wp_enqueue_script jquery will pass through this filter and load up 1.5 instead of the one shipped with your WordPress bundle. Feel free to change the URL of the jQuery script to different CDNs including <a href="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.min.js">Microsoft&#8217;s</a> and <a href="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js">Google&#8217;s</a>.</p>
<p>I guess this post will be outdated upon the next WordPress release, but it still may be valuable, since the same trick is used to run jQuery and other libraries shipped with WordPress from different sources like Google or Amazon CloudFront.</p>
]]></content:encoded>
			<wfw:commentRss>http://kovshenin.com/2011/snippet-using-jquery-1-5-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>qrTip: A jQuery Plugin to Display QR Codes for Links</title>
		<link>http://kovshenin.com/2011/qrtip-a-jquery-plugin-to-display-qr-codes-for-links/</link>
		<comments>http://kovshenin.com/2011/qrtip-a-jquery-plugin-to-display-qr-codes-for-links/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 08:55:47 +0000</pubDate>
		<dc:creator>Konstantin Kovshenin</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[qr]]></category>

		<guid isPermaLink="false">http://kovshenin.com/?p=3011</guid>
		<description><![CDATA[Hey. I was doing some experimenting earlier this week with the new Google URL Shortener API and then found out that they can display QR codes for their shortened links using Google&#8217;s Chart API which is awesome. So today, I present to you qrTip &#8212; a jQuery plugin that can display QR tooltips for links [...]]]></description>
			<content:encoded><![CDATA[<p>Hey. I was doing some experimenting earlier this week with the new <a href="http://code.google.com/apis/urlshortener/overview.html">Google URL Shortener API</a> and then found out that they can display QR codes for their shortened links using Google&#8217;s <a href="http://code.google.com/apis/chart/">Chart API</a> which is awesome. So today, I present to you <strong>qrTip</strong> &#8212; a jQuery plugin that can display <strong>QR tooltips</strong> for links on your page:</p>
<p><img class="border size-full wp-image-3021 alignnone" src="http://kovshenin.com/files/2011/01/qrtip-screenshot.png" alt="qrTip jQuery Plugin" width="680" height="172" /></p>
<p>Check out the <a href="http://kovshenin.com/public/qrtip/example.html">qrTip Demo</a> and hover over the links to feel the taste of what it&#8217;s like.</p>
<p>Why would you ever need this? Well mainly be cause it&#8217;s cool, and with this plugin you can provide a link to a mobile version of your website, so that people could hover, scan the QR code using their mobile and fire up the link on their device! Yeah, a little bit inspired by the <a href="https://chrome.google.com/extensions/detail/oadboiipflhobonjjffjbfekfjcgkhco?hl=ru">Chrome to Phone extension</a> which is quite awesome but not yet compatible with all browsers and devices out there.</p>
<p>Here&#8217;s a quote from the behind the scenes of this plugin section if you&#8217;re into development:</p>
<p>Well, I basically took the <a href="http://goo.gl/ji3Iw">ColorTip jQuery</a> plugin and wrote a little bit of extra code inside that injects images inside the tooltips. The actual images are coming from the <a href="http://goo.gl/coY6A">Google Charts API</a>! I also use the <a href="http://goo.gl/R6NNJ">js-uri</a> to get the relative links right.</p>
<p>You can <a href="http://goo.gl/JHWe3">download the sources</a> in an archive or use git to grab it directly from <a href="http://github.com/kovshenin">my github account</a>:</p>
<pre>$ git clone http://github.com/kovshenin/qrtip.git</pre>
<p>That&#8217;s all there is to it! Hope you like the plugin and find it useful in some way. You might want to tweet it too! I would also appreciate if you commented on bugs under Windows and Mac browsers. I didn&#8217;t test it on anything but Chromium on Ubuntu ;) Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://kovshenin.com/2011/qrtip-a-jquery-plugin-to-display-qr-codes-for-links/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Facebook-style Lightbox with jQuery and Facebox</title>
		<link>http://kovshenin.com/2010/facebook-style-lightbox-with-jquery-and-facebox/</link>
		<comments>http://kovshenin.com/2010/facebook-style-lightbox-with-jquery-and-facebox/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 20:19:36 +0000</pubDate>
		<dc:creator>Konstantin Kovshenin</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebox]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://kovshenin.com/?p=2034</guid>
		<description><![CDATA[I recently came across an awesome plugin for jQuery which is called Facebox. Facebox produces a clean lightbox that can be a container for popup images, text and basically any HTML layout as well as AJAX powered content. The problem with Facebox is the lightbox placement. The dialog itself is placed in the center of [...]]]></description>
			<content:encoded><![CDATA[<p>I recently came across an awesome plugin for jQuery which is called <a href="http://famspam.com/facebox">Facebox</a>. Facebox produces a clean lightbox that can be a container for popup images, text and basically any HTML layout as well as AJAX powered content.</p>
<p>The problem with Facebox is the lightbox placement. The dialog itself is placed in the center of the page horizontally with a preset margin from the top, which looks good, but what I did notice is that the box containing the loading icon is being placed somewhere to the left part of the page. Well at least on Firefox 3.5.7.</p>
<p>I couldn&#8217;t help but noticing that <a href="http://famspam.com/">FamSpam</a> and <a href="http://stafftool.com/">StaffTool</a> are using a different set of functions and styles for the lightbox placement and copying them into my code solved the issue.</p>
<p>The two functions are called getPageScroll() and getPageHeight() and are marked as quirksmode.com inside the code. The #facebox style in the CSS lacked a width: 100% which seems to have solved the issue for now. There&#8217;s also a certain overlay in the original version which includes an interesting IE6 hack:</p>
<pre>height: expression(document.body.scrollHeight &gt; document.body.offsetHeight ?
	document.body.scrollHeight : document.body.offsetHeight + 'px');</pre>
<p>The versions at Stafftool and FamSpam however don&#8217;t mention any overlays in there code. Pretty messy, huh? Well, other than that, the plugin is very lightweight and cross-browser, works well in IE and closes the popup when pressing Esc, which unfortunately has to be hand-coded in other versions of the Facebook-style dialog boxes.</p>
<p>Grab the code at GitHub and enjoy: <a href="http://github.com/defunkt/facebox">Facebox for jQuery</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kovshenin.com/2010/facebook-style-lightbox-with-jquery-and-facebox/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery Cycle: Pager and pagerAnchorBuilder</title>
		<link>http://kovshenin.com/2010/jquery-cycle-pager-and-pageranchorbuilder/</link>
		<comments>http://kovshenin.com/2010/jquery-cycle-pager-and-pageranchorbuilder/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 15:12:26 +0000</pubDate>
		<dc:creator>Konstantin Kovshenin</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://kovshenin.com/?p=2024</guid>
		<description><![CDATA[One very awesome and useful plugin for jQuery is jQuery Cycle, which pretty much works out of the box, but browsing through the second part of the Intermediate Demos we&#8217;ve seen a click transition called Pager, which is somewhat tricky. Pager is nothing but a few links next to your cycling block with page numbers, [...]]]></description>
			<content:encoded><![CDATA[<p>One very awesome and useful plugin for jQuery is <a href="http://malsup.com/jquery/cycle/">jQuery Cycle</a>, which pretty much works out of the box, but browsing through the second part of the <a href="http://malsup.com/jquery/cycle/int2.html">Intermediate Demos</a> we&#8217;ve seen a click transition called Pager, which is somewhat tricky.</p>
<p>Pager is nothing but a few links next to your cycling block with page numbers, which switch the cycle upon click. It&#8217;s very useful when you have to create, say a list of services a company provides, with sweet lightboxes (don&#8217;t confuse with the Lightbox plugin), perhaps with some images, cycling through their descriptions, yet we&#8217;d like our visitors to be able to switch through the services manually, without having to wait. This is exactly what the Pager transition does, but hey, who the hell would want page numbers instead of their services names?</p>
<p>This is where pageAnchorBuilder comes in, and it&#8217;s not quite obvious what has to be done to make this work. According to the jQuery Cycle documentation it&#8217;s:</p>
<blockquote><p>
pageAnchorBuilder &#8211; callback function for building anchor links: function(index, DOMelement)
</p></blockquote>
<p>So here&#8217;s a demonstration of how this would work. Let&#8217;s setup a quick cycle, with a few options. Perhaps you&#8217;ll need more than I listed below ;)</p>
<pre>jQuery('#fade').before('&lt;div id="nav" class="nav"&gt;&lt;/div&gt;').cycle({
	pager: '#nav',
	pagerAnchorBuilder: paginate
});
</pre>
<p>So paginate is a callback function which takes two arguments, the index and the DOM element. Using the index will work just fine. Let&#8217;s see how this works with text:</p>
<pre>function paginate(ind, el) {
	if (ind == 0) return '&lt;span&gt;Service One&lt;/span&gt;';
	else if (ind == 1) return '&lt;span&gt;Service Two&lt;/span&gt;';
	// and so on
}
</pre>
<p>I think that&#8217;s pretty straightforward once you understand how it works. Let&#8217;s try some images:</p>
<pre>function paginate(ind, el) {
	return '&lt;img src="http://whatever.com/services/service' + ind + '.jpg" /&gt;';
}
</pre>
<p>So name your images service0.jpg, service1.jpg, etc. And my favourite, CSS classes:</p>
<pre>function paginate(ind, el) {
	return '&lt;div class="service' + ind + '"&gt;&lt;/div&gt;';
}
</pre>
<p>Then just add a few .service0, .service1, etc. classes in your stylesheet, voila! Hope that helps, and don&#8217;t forget about the other useful options. Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://kovshenin.com/2010/jquery-cycle-pager-and-pageranchorbuilder/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WordPress 2.9: From a Developer&#039;s Point of View</title>
		<link>http://kovshenin.com/2009/wordpress-2-9-from-a-developers-point-of-view/</link>
		<comments>http://kovshenin.com/2009/wordpress-2-9-from-a-developers-point-of-view/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 10:11:43 +0000</pubDate>
		<dc:creator>Konstantin Kovshenin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[metabox]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://kovshenin.com/?p=1715</guid>
		<description><![CDATA[Yup, WordPress 2.9 is finally out and I&#8217;ve seen a lot of people upgrade immediately &#8211; sweet thing to do, I did so too and hadn&#8217;t had any problems here (I&#8217;m not using too much plugins), then I switched over to the 3.0 branch, all good! The semi-square buttons in the admin interface are fixed [...]]]></description>
			<content:encoded><![CDATA[<p>Yup, <a href="http://codex.wordpress.org/Version_2.9">WordPress 2.9</a> is finally out and I&#8217;ve seen a lot of people upgrade immediately &#8211; sweet thing to do, I did so too and hadn&#8217;t had any problems here (I&#8217;m not using too much plugins), then I switched over to the 3.0 branch, all good! The semi-square buttons in the admin interface are fixed by the way ;) Anyways, this post is not about my blog, but about something I&#8217;m working on locally in the intranet of a company. And here&#8217;s a quick reminder: do not upgrade the running instance before you checked everything on a duplicate testing one, especially if a bunch of plugins there are handwritten ;)</p>
<p>A <strong>Handwritten</strong> WordPress Plugin is a huge set of files, with hundreds of duplicate lines of code and tonnes of commented code. The MVC/MVP models are usually transformed into the AIO (All-In-One) model. The only version control systems used are the &#8220;Copy &amp; Paste&#8221; and &#8220;Undo &amp; Redo&#8221;. The Core Upgrade process does not involve reading the changelog, backing up, etc.</p>
<p>Okay this is not a very smart thing to do, but sometimes you just need to, especially when you&#8217;re in a hurry (duh!). I&#8217;m not going to go in detail about the plugins, because you wouldn&#8217;t understand it anyway (no offence, I don&#8217;t understand most of it either), but let&#8217;s just say that I was using the Post Tags interface that you see in your &#8220;Edit Posts&#8221; admin interface. The sweet little box where you can type some tags or choose from the most used ones. All I did was copy the HTML contents of that little box onto my page, and it used to work (in 2.7 and 2.8), but as soon as I upgraded to 2.9, bang! It suddenly stopped. The javascript bindings were gone!</p>
<p>I figured out that the bindings were all made in the post.js so I took a look at the diff between 2.8 and 2.9 &#8211; completely different. The major change was the jQuery selector from span#ajaxtag to div.ajaxtag (line 99 in post.dev.js) which prevented all the other bindings. A few more ids have changed to include the tax name, and some other minor changes which I didn&#8217;t figure out yet. Although what&#8217;s the point in figuring it out? Wait until 3.0 is released and rewrite the plugin again, meh!</p>
<p>I did a lot of thinking here. This was not the only interface that broke, and rewriting everything on every core upgrade would be pretty difficult. People talk a lot about WordPress upgrades, plugins compatibility, etc. But most of the time they refer to plugins developed by other people, which sooner or later will get an upgrade. So waiting for a few weeks before launching the core upgrade generally does the job. But what if it&#8217;s a completely different page with a completely customized admin interface?</p>
<p>I worked a lot with <a href="http://codex.wordpress.org/Function_Reference/add_meta_box">WordPress metaboxes</a> a few weeks before the upgrade and today I figured out that the best and easiest way of building WordPress admin interfaces would be, that&#8217;s right, metaboxing. The standard components used in the edit posts/pages interface (tags, publishing, categories, custom fields, etc) are simple metaboxes. So why copy HTML if you could simply use the predefined ones? And when a change is on its way, you&#8217;d sleep tight. Unless of course you&#8217;re interacting with the standard components from your customized ones, which involves using certain selectors for ids and classes. In that case you&#8217;ll just have to read the changelog, tickets (over 500 for WordPress 2.9) and of course code diffs.</p>
<p>Creating your own custom metaboxes is not as difficult as it is at first sight (yet I still haven&#8217;t figured out how to save their positions via AJAX, but I will). You will get the hang of it after your third or fourth metabox ;)</p>
<p>P.S. Have you noticed the new post thumbnails here? They used to be wide images, now they&#8217;re h2 text and small thumbnail. I love WordPress shortcodes ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://kovshenin.com/2009/wordpress-2-9-from-a-developers-point-of-view/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Inspired: Javascript &amp; jQuery Love</title>
		<link>http://kovshenin.com/2009/inspired-javascript-jquery-love/</link>
		<comments>http://kovshenin.com/2009/inspired-javascript-jquery-love/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 11:07:55 +0000</pubDate>
		<dc:creator>Konstantin Kovshenin</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[inspired]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[resources]]></category>

		<guid isPermaLink="false">http://kovshenin.com/?p=1675</guid>
		<description><![CDATA[Remember the &#8220;inspired&#8221; blog posts series I started back in November? Well, let&#8217;s keep playing that game and today&#8217;s topic is jQuery and Javascript. The things you can do with javascript today are pretty impressive and sometimes unbelievable. Starting from simple AJAX calls and ending up with complete rich user interfaces with sweet animation (poke [...]]]></description>
			<content:encoded><![CDATA[<p>Remember the &#8220;inspired&#8221; blog posts series I started back in November? Well, let&#8217;s keep playing that game and today&#8217;s topic is jQuery and Javascript. The things you can do with javascript today are pretty impressive and sometimes unbelievable. Starting from simple AJAX calls and ending up with complete rich user interfaces with sweet animation (poke Facebook for instance).</p>
<p>You know I browse the web a lot &#8211; StumbleUpon, Digg, Twitter, etc. I go through tonnes of content, so today I made a short list of a few interesting jQuery and Javascript links that made my day! For rookies and for pros, check them out (ordered randomly):</p>
<ul>
<li><a href="http://www.jquery.wisdomplug.com/jquery-plugins/facebook-jquery-plugins/23-best-jquery-facebook-style-plugins/">23 Best jQuery Facebook Style Plugins</a></li>
<li><a href="http://www.ibm.com/developerworks/web/library/x-feedjquery/index.html">Process XML in the browser using jQuery</a></li>
<li><a href="http://davidwalsh.name/jquery-flot">Dynamically Create Charts Using jQuery Flot and Google Analytics</a></li>
<li><a href="http://www.w3avenue.com/2009/12/01/jquery-sticky-tooltip-script/">jQuery Sticky Tooltip Script</a></li>
<li><a href="http://tutsvalley.com/tutorials/making-a-cool-spotlight-effect-with-jquery/">Making a Cool Spotlight Effect with jQuery</a></li>
<li><a href="http://www.cssnewbie.com/how-to-create-simple-stylish-and-swappable-image-captions/">How To Create Simple, Stylish and Swappable Image Captions</a></li>
<li><a href="http://www.jtutorials.co.cc/featured/creating-a-simple-tagging-system-part-1/">Creating a Simple Photo Tagging System</a></li>
<li><a href="http://tympanus.net/codrops/2009/11/30/beautiful-slide-out-navigation-a-css-and-jquery-tutorial/">Beautiful Slide Out Navigation: A CSS and jQuery Tutorial</a></li>
<li><a href="http://www.bloggingdeveloper.com/post/iPhone-Scrolling-Experience-in-Your-Browser-with-jQuery-Plugin.aspx">iPhone Scrolling Experience in Your Browser with jQuery Plugin</a></li>
</ul>
<p>Now you tell me &#8211; who needs Flash when you have Javascript? ;) Oh and by the way, if you&#8217;ve anything to add to the list (preferably articles published in late 2009) feel free to suggest via comments. If you&#8217;re looking for even more jQuery love, follow the real-time search results for the <a href="http://twitter.com/search?q=%23jquery">#jQuery tag on Twitter</a>. Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://kovshenin.com/2009/inspired-javascript-jquery-love/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Loading jQuery from a CDN in WordPress</title>
		<link>http://kovshenin.com/2009/loading-jquery-from-a-cdn-in-wordpress/</link>
		<comments>http://kovshenin.com/2009/loading-jquery-from-a-cdn-in-wordpress/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 09:25:58 +0000</pubDate>
		<dc:creator>Konstantin Kovshenin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[cloudfront]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://kovshenin.com/?p=1579</guid>
		<description><![CDATA[This may seem like an easy task to do but is quite tricky in WordPress. Using a CDN these days is very popular, cheap and helps speed up your website taking the load off your web server. I personally love Amazon CloudFront! The tips at Google Code suggest you serve all your static content from [...]]]></description>
			<content:encoded><![CDATA[<p>This may seem like an easy task to do but is quite tricky in WordPress. Using a <acronym title="Content Delivery Network">CDN</acronym> these days is very popular, cheap and helps <a href="http://code.google.com/speed/">speed up your website</a> taking the load off your web server. I personally love <a href="http://aws.amazon.com/cloudfront/">Amazon CloudFront</a>! The tips at Google Code suggest you serve all your static content from different domains, preferably ones without cookies, so CDNs are perfect.</p>
<p>All the problem with WordPress is script dependancies, and this applies not only to jQuery but to all the other predefined javascript libraries (prototype, scriptaculous, thickbox, see <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script">wp_enqueue_script</a> for more info). It&#8217;s all about the handles and plugins that use jQuery will probably use the jquery handle in their dependency lists, which will automatically make WordPress include the standard jQuery from its wp-includes directory. This means that using the code:</p>
<pre>wp_enqueue_script("my-handle", "http://s.kovshenin.com/jquery.js");
</pre>
<p>You might end up including two instances of the jQuery library, one from your CDN (s.kovshenin.com) and another one from the WordPress wp-includes directory, which will end up in a total mess. Strange though, that you cannot redefine an already known handle, such as jquery like this:</p>
<pre>wp_enqueue_script("jquery", "http://s.kovshenin.com/jquery.js");
</pre>
<p>The javascript library will still be loaded from the default location (wp-includes on your local web server). So the right way to do it is with a little hack in your functions.php file (in case you&#8217;re doing it within your theme) or any other plugin file (in case you&#8217;re doing it within your plugin):</p>
<pre>add_filter('script_loader_src', 'my_script_loader_src', 10, 2);
function my_script_loader_src($src, $handle) {
	if ($handle == "jquery")
		return "http://s.kovshenin.com/js/jquery.1.3.2.min.js";

	return $src;
}
</pre>
<p>Then any call to wp_enqueue_script with the jquery handler will output the correct path to your CDN version of jQuery. Oh and please, try not to use generic function names like my_script_loader_src, I used that just as an example, we don&#8217;t want any function name conflicts and can&#8217;t expect other plugin/theme developers to use non-generic names ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://kovshenin.com/2009/loading-jquery-from-a-cdn-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

