how can I disable mootool.js ?

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
gitawego
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Sep 24, 2007 11:50 am

how can I disable mootool.js ?

Post by gitawego » Mon Sep 24, 2007 11:59 am

I noticed that everytime when I open com_frontpage and com_content pages, Joomla 1.5 generates the mootool.js automatically in the HEAD tags if I use "".
It has conflict with my jquery effects.  I'd like to know how can I disable it ? It's not a good thing that Joomla adds such things in it, these should be chosen by users but not Joomla (you can of course use them in the backend, but please don't in the front-end). It took me 2 hours to figure out why my jquery effect doesn't work. :(

witl
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Oct 10, 2007 5:10 am

Re: how can I disable mootool.js ?

Post by witl » Wed Oct 10, 2007 5:19 am

Certainly interested! Are you solve this problem?

Thanks.

User avatar
Tonie
Joomla! Master
Joomla! Master
Posts: 16556
Joined: Thu Aug 18, 2005 7:13 am

Re: how can I disable mootool.js ?

Post by Tonie » Wed Oct 10, 2007 5:49 am

What version of 1.5 are you using? To my knowledge, mootools is only loaded on the backend automatically and not on the  frontend any more.

gitawego
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Sep 24, 2007 11:50 am

Re: how can I disable mootool.js ?

Post by gitawego » Wed Oct 10, 2007 6:41 am

no, I haven't found the solution. I'm using joomla1.5 RC3  :'(

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19122
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: how can I disable mootool.js ?

Post by infograf768 » Wed Oct 10, 2007 8:26 am

mottools is loaded in frontend because the editor image uploader uses it...
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

witl
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Oct 10, 2007 5:10 am

Re: how can I disable mootool.js ?

Post by witl » Thu Oct 11, 2007 4:12 am

May be we can use other JQuery initiation, not $().
Hmm, I think Joomla developers must use not default descriptor for mootools. It's hard of maintains (may be, may be not), but solve many problems in future.

So, I solve my problem, I should load my JQuery application on only needed pages.

Have some told me how can I add some code in HEAD from my extension? Thanks.

User avatar
jazbek
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Thu Nov 16, 2006 7:47 pm

Re: how can I disable mootool.js ?

Post by jazbek » Thu Oct 11, 2007 9:46 am

It would be really awesome if we could disable mootools.js from being loaded. I don't know why it has to be added to every single page in my site if I'm using it nowhere. I understand some people may use it, so maybe it should be there by default, but I definitely think there should be an option to disable it.

User avatar
Tonie
Joomla! Master
Joomla! Master
Posts: 16556
Joined: Thu Aug 18, 2005 7:13 am

Re: how can I disable mootool.js ?

Post by Tonie » Thu Oct 11, 2007 9:47 am

Moving to 1.5 developer forum.

gitawego
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Sep 24, 2007 11:50 am

Re: how can I disable mootool.js ?

Post by gitawego » Thu Oct 11, 2007 10:24 am

It's been discussed several times, some Devs think it should be placed in every page... which I can't and will never understand :(
Hope they can give the people like me an option to disable it :(

User avatar
55thinking
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 186
Joined: Mon Sep 05, 2005 8:58 am
Location: Madrid
Contact:

Re: how can I disable mootool.js ?

Post by 55thinking » Thu Oct 11, 2007 2:17 pm

Place

Code: Select all

<?php 
	$user =& JFactory::getUser();

	if ($user->get('guest') == 1) {
		$headerstuff = $this->getHeadData();
		$headerstuff['scripts'] = array();
		$this->setHeadData($headerstuff);
	}
?>
In the header of your template
55 Thinking - Strategy Design Technology 
Good looking, Fast and Usable web solutions   
http://www.55thinking.com/

User avatar
jazbek
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Thu Nov 16, 2006 7:47 pm

Re: how can I disable mootool.js ?

Post by jazbek » Thu Oct 11, 2007 7:31 pm

YOU ARE AWESOME. thank you. :D

User avatar
dkarlovi
Joomla! Intern
Joomla! Intern
Posts: 95
Joined: Wed Sep 26, 2007 10:59 am
Contact:

Re: how can I disable mootool.js ?

Post by dkarlovi » Fri Oct 12, 2007 12:22 pm

I need just the opposite, my module need it on every page it's loaded on, how can I check for MooTools?

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: how can I disable mootool.js ?

Post by ianmac » Fri Oct 12, 2007 6:45 pm


User avatar
dkarlovi
Joomla! Intern
Joomla! Intern
Posts: 95
Joined: Wed Sep 26, 2007 10:59 am
Contact:

Re: how can I disable mootool.js ?

Post by dkarlovi » Sat Oct 13, 2007 9:03 pm

Thank you Ian, I've read it twice, but didn't find how to make sure from a module that mootools are loaded, just found the template bit (which I also needed, though  ;) )

User avatar
Pentacle
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 165
Joined: Wed Oct 25, 2006 12:34 pm
Location: Turkey

Re: how can I disable mootool.js ?

Post by Pentacle » Sat Oct 13, 2007 10:08 pm

As some people know, JQuery has a no conflict mode.

What about Mootools? This would save a lot of namespace issues.

@dkarlovi
JHTML::('behavior.mootools'); should be enough, I think.
My Joomla! 1.5 extensions - http://ercan.us
Progress is made by lazy men looking for easier ways to do things.

User avatar
dkarlovi
Joomla! Intern
Joomla! Intern
Posts: 95
Joined: Wed Sep 26, 2007 10:59 am
Contact:

Re: how can I disable mootool.js ?

Post by dkarlovi » Sat Oct 13, 2007 10:16 pm

Pentacle wrote: As some people know, JQuery has a no conflict mode.

What about Mootools? This would save a lot of namespace issues.

@dkarlovi
JHTML::('behavior.mootools'); should be enough, I think.
Yeah, I've added it to the wrong place the first time.  :-[

User avatar
dkarlovi
Joomla! Intern
Joomla! Intern
Posts: 95
Joined: Wed Sep 26, 2007 10:59 am
Contact:

Re: how can I disable mootool.js ?

Post by dkarlovi » Thu Oct 25, 2007 11:34 am

Pentacle wrote: As some people know, JQuery has a no conflict mode.

What about Mootools? This would save a lot of namespace issues.

@dkarlovi
JHTML::('behavior.mootools'); should be enough, I think.
Anyway, I have answers to both my questions (yes, cache get done automagically and this answer), but now another problem:

My module adds a JS file and a stylesheet. When I turn on the cache it works the first time, but all other times it does not (it's contents gets pulled from cache) and my code is not executed. How can I cache everything, but still get some of my PHP executed every single time?

whurley
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 103
Joined: Thu Aug 24, 2006 3:59 pm

Re: how can I disable mootool.js ?

Post by whurley » Thu Oct 25, 2007 2:06 pm

I have a plugin that loads jQuery, and the key is to call mootools before jQuery and then initiate no conflicts mode on jQuery, which will revert the $ function back to the originally declared namespace.  After that all jQuery plugins should handle no conflicts mode by using the following pattern:

Code: Select all

jQuery.noConflict();
(function($) { 
  $(function() {
    // more code using $ as alias to jQuery
  });
})(jQuery);
To add jQuery after mootools use something like the following:

Code: Select all

JHTML::script( 'jquery-1.2.1.pack', 'media/jquery/scripts/', true );
The above code loads the packed version of jQuery 1.2.1 from the media folder I've deployed it to and tags it as requiring mootools, which will cause mootools.js to be placed higher in the scripts declarations ensuring that jQuery.noConflict() works correctly.

User avatar
Devil
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Sat Aug 20, 2005 2:18 pm
Location: Localhost @ Ruhrgebiet
Contact:

Re: how can I disable mootool.js ?

Post by Devil » Thu Nov 01, 2007 8:50 am

Hi,

I think for loading Mootools on each side, particularly if one does not need it on the side is no good solution...
~80kb only for the mootools as compressed and ~200kb for the uncompressed?  ??? why ???

infograf768 wrote: mottools is loaded in frontend because the editor image uploader uses it...
This is to be loaded however still no reason the whole Mootools Framework constantly also. Why not use only the mootools core and the needed xxx.js ?  The better way is the Editor uses his own Method/Function for this...

The best way ( i think) is to give the Users the possibility to choose between 2 Versions:

1. With the complet Mootools Framework
2. Only with the needed Functions of the Mootools  Framework

greetings, Devil
Last edited by Devil on Thu Nov 01, 2007 8:52 am, edited 1 time in total.
mfg Devil


http://www.joomla-aktuell.de - Joomla-Aktuell - a German Joomla News Site

User avatar
jmatt
Joomla! Intern
Joomla! Intern
Posts: 73
Joined: Sat Jul 26, 2008 5:41 am
Contact:

Re: how can I disable mootool.js ?

Post by jmatt » Sun Aug 17, 2008 1:29 am

WOW!!
55thinking
MAN!!!
I LOVE YOU!!! 8)
Download popular free ebooks, classical free ebooks, new releases and more.http://www.ebook-x.com/
Home of online games, online game, flash games, free online game, free online games, flash game:http://www.online-flash-game.com/

chas
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 178
Joined: Thu Feb 02, 2006 9:45 am

Re: how can I disable mootool.js ?

Post by chas » Mon Aug 18, 2008 8:20 am

if the editor is the only thing that uses mootools, why cant the editor page load it on request??


Locked

Return to “Joomla! 1.5 Coding”