<?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>Sanjeev Shrestha &#187; javascript</title>
	<atom:link href="http://www.sanjeevshrestha.com.np/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sanjeevshrestha.com.np</link>
	<description>Blogging on Joomla Development /Codeigniter/JQuery/Mootools/Wordpress - All Related to Web</description>
	<lastBuildDate>Sun, 09 May 2010 08:15:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using Mootools 1.2 in Joomla1.5.x</title>
		<link>http://www.sanjeevshrestha.com.np/2009/07/using-mootools-12-in-joomla15x/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/07/using-mootools-12-in-joomla15x/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 03:46:04 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools 1.2]]></category>
		<category><![CDATA[Using mootools 1.2.x with joomla]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2009/07/using-mootools-12-in-joomla15x/</guid>
		<description><![CDATA[Yes! Joomla 1.5.x comes with mootools 1.1.x and it is a pity when you cannot use best of the latest mootools widgets with joomla 1.5.x.  To make the matter worse, you will rarely find forums and blogs that discusses about mootools 1.1. In this case you will definitely want to use mootools 1.2.x with Joomla [...]]]></description>
			<content:encoded><![CDATA[<p><img style="max-width: 800px; float: right; margin-top: 10px; margin-bottom: 10px; margin-left: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/06/mootools-new-logo.jpg" alt="" />Yes! <strong>Joomla 1.5.x</strong> comes with <strong>mootools 1.1.x</strong> and it is a pity when you cannot use best of the latest mootools widgets with joomla 1.5.x.  To make the matter worse, you will rarely find forums and blogs that discusses about mootools 1.1. In this case you will definitely want to use mootools 1.2.x with Joomla in the frontend. So in this small tutorial, we will talk about how to use mootools1.2.x with Joomla 1.5.x. Remember the admin panel of Joomla will still use mootools 1.1.x.</p>
<p>I have written a post about how to use <a href="http://www.sanjeevshrestha.com.np/2009/05/using-jquery-with-joomla/">jQuery with Joomla</a> earlier. This tutorial is just a slight modification of the codes from the earlier post.<br />
<span id="more-253"></span>To use <strong>mootools 1.2.x</strong> with <strong>Joomla 1.5.x</strong>, follow the following steps.</p>
<ol>
<li>Download the mootools core from the mootools <a href="http://mootools.net/core">core builder site</a></li>
<li>Also Download the additional plugins you will use with your installation from <a href="http://mootools.net/more">more builder</a>. I recommend downloading both compressed and uncompressed files from the mootools builder. We may need uncompressed files in debuggin mode.</li>
<li>Copy these files in a folder that can be accessed by Joomla. I recommend media-&gt;system-&gt;js folder of joomla installation. The choice is yours! <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
</ol>
<p>I copied four <strong>files mootools-1.2.3-core.js</strong>, <strong>mootools-1.2.3-core-compressed.js</strong>, <strong>mootools-1.2.3.1-more.js</strong> and <strong>mootools-1.2.3.1-more-compressed.js</strong> to <strong>media-&gt;system-&gt;js</strong> folder. Now locate and open a file named <strong>behavior.php</strong> which is inside <strong>libraries-&gt;joomla-&gt;html-&gt;html</strong> folder. Now find a method named <strong>mootools($debug=null) </strong>and modify it as below.</p>
<blockquote><p>function mootools($debug = null)<br />
{<br />
static $loaded;<br />
$mainframe=&amp;JFactory::getApplication();<br />
// Only load once<br />
if ($loaded) {<br />
return;<br />
}</p>
<p>// If no debugging value is set, use the configuration setting<br />
if ($debug === null) {<br />
$config = &amp;JFactory::getConfig();<br />
$debug = $config-&gt;getValue(&#8216;config.debug&#8217;);<br />
}</p>
<p>$konkcheck = isset($_SERVER['HTTP_USER_AGENT']) ? strpos(strtolower($_SERVER['HTTP_USER_AGENT']), &#8220;konqueror&#8221;) : null;</p>
<p>if($mainframe-&gt;isSite())<br />
{<br />
if ($debug || $konkcheck)<br />
{<br />
JHTML::script(&#8216;mootools-1.2.3-core.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />
JHTML::script(&#8216;mootools-1.2.3.1-more.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />
}<br />
else<br />
{<br />
JHTML::script(&#8216;mootools-1.2.3-core-compressed.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />
JHTML::script(&#8216;mootools-1.2.3.1-more-compressed.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />
}<br />
$loaded = true;<br />
return;</p>
<p>}<br />
else<br />
{</p>
<p>if ($debug || $konkcheck)<br />
{<br />
JHTML::script(&#8216;mootools-uncompressed.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />
}<br />
else<br />
{<br />
JHTML::script(&#8216;mootools.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />
}<br />
$loaded = true;<br />
return;<br />
}<br />
}</p></blockquote>
<p>This modified mootools behavior checks if the site is accessed from frontend or is it admin. if it is frontend it loads the mootools 1.2.x depending upon the debug mode. It will load uncompressed files in debug mode. This will load both core and more files in frontend. The admin still uses mootools 1.1.x as it heavily depends on it.</p>
<p>This is all! It worked for me. Let me know if it did or not for you. Happy reading!</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=80c86ad4-b30e-8266-8f30-316fefe92af5" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/07/using-mootools-12-in-joomla15x/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Implementing Element.getSiblings() in mootools1.1</title>
		<link>http://www.sanjeevshrestha.com.np/2009/06/implementing-elementgetsiblings-in-mootools11/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/06/implementing-elementgetsiblings-in-mootools11/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 05:43:18 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[getSiblings()]]></category>
		<category><![CDATA[mootools 1.1]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2009/06/implementing-elementgetsiblings-in-mootools11/</guid>
		<description><![CDATA[I found a nice mootools code in David Walsh&#8217;s Blog. This code gathers all the siblings of an element but this code is compatible with mootools1.2 and above. I have modified the code a little to implement it in mootools1.1. Why mootools 1.1? because Joomla1.5 still uses mootools1.1. (Joomla1.6 will have mootools1.2). So here is [...]]]></description>
			<content:encoded><![CDATA[<p>I found a nice mootools code in <a href="http://davidwalsh.name/mootools-element-siblings">David Walsh&#8217;s Blog</a>. This code gathers all the siblings of an element but this code is compatible with mootools1.2 and above. I have modified the code a little to implement it in mootools1.1. Why mootools 1.1? because Joomla1.5 still uses mootools1.1. (Joomla1.6 will have mootools1.2). So here is the little modification of the code as presented by <a href="http://davidwalsh.name">David Walsh</a>.</p>
<blockquote><p>Element.extend({<br />&nbsp;&nbsp;&nbsp; getSiblings: function() {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return this.getParent().getChildren().remove(this);<br />&nbsp;&nbsp;&nbsp; }<br />});</p></blockquote>
<p>Yes, this small code gathers all the siblings of the element except for itself. Isn&#8217;t it simple? <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/06/implementing-elementgetsiblings-in-mootools11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajaxifying Joomla Links with Mootools</title>
		<link>http://www.sanjeevshrestha.com.np/2009/06/ajaxifying-joomla-links-with-mootools/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/06/ajaxifying-joomla-links-with-mootools/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 18:21:21 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Ajaxifying joomla]]></category>
		<category><![CDATA[Implementing ajax in joomla]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2009/06/ajaxifying-joomla-links-with-mootools/</guid>
		<description><![CDATA[
Have you ever wanted to automatically ajaxify joomla links? This is to say if you ever wished that all the links would open with ajax request in your main component area! If yes, then read on! This small tutorial will teach you how to automatically implement ajax requests in every link on a joomla page.
To [...]]]></description>
			<content:encoded><![CDATA[<div align="left"><img style="max-width: 800px; float: left; margin-top: 10px; margin-bottom: 10px; margin-right: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/06/mootools-new-logo.jpg" /></div>
<p>Have you ever wanted to automatically ajaxify joomla links? This is to say if you ever wished that all the links would open with ajax request in your main component area! If yes, then read on! This small tutorial will teach you how to automatically implement ajax requests in every link on a joomla page.</p>
<p>To implement Ajax request in every link in a joomla page you need to modify index.php of joomla template. <span id="more-227"></span></p>
<p>Add the code below in index.php</p>
<blockquote><p>&lt;script&gt;<br/><!--<br/>window.addEvent(&#8216;domready&#8217;,function(){<br/>ajaxify();<br/>});<br/><br/>function ajaxify()<br/>{<br/>&nbsp;&nbsp;&nbsp; $$(&#8216;a&#8217;).addEvent(&#8216;click&#8217;,function(e){<br/><br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var e=new Event(e);<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e.stop();<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $(&#8216;ajaxstage&#8217;).setHTML(&#8216;Loading&#8230;&#8217;);<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; req=new Ajax(this.href+&#8217;&amp;tmpl=component&#8217;,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; update:&#8217;ajaxstage&#8217;,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; method:&#8217;get&#8217;,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; onComplete:ajaxify<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; );<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; req.request();<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; });<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; }<br/>&#8211;><br/>&lt;/script&gt;
</p></blockquote>
<p>This code will implement ajax in every link it finds in a page. The function is recursive, in the sense it will call itself to ajaxify the newly added links by ajax request. Wait, you need to wrap the component in a div to make this work. Find a code similar to </p>
<blockquote><p>
&lt;jdoc:include type=&#8221;component&#8221; /&gt;
</p></blockquote>
<p>and replace it with</p>
<blockquote><p>&lt;div id=&#8221;ajaxstage&#8221;&gt;<br />
&lt;jdoc:include type=&#8221;component&#8221;><br />
&lt;/jdoc:include&gt;&lt;/div&gt;
</p></blockquote>
<p>This div is the stage where the content that is fetched with ajax is updated with. Yes it is this simple. But make sure you have mootools included in your template. If not add the code below to add mootools support in your template.</p>
<blockquote><p>
&lt;?php JHTML::_(&#8216;behavior.mootools&#8217;); ?&gt;
</p></blockquote>
<p>Yes, this concludes the tutorial. Isn&#8217;t it a nifty hack to implement ajax in a joomla page.<br />
Keep coming back for more tips and tricks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/06/ajaxifying-joomla-links-with-mootools/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
