Advertisement

[31]Option to turn off Mootools

User avatar
ltempest
Joomla! Guru
Joomla! Guru
Posts: 605
Joined: Thu Aug 25, 2005 11:16 am
Location: Gloucester, UK
Contact:

[31]Option to turn off Mootools

Post by ltempest » Tue Feb 19, 2008 9:13 am

Is it possible to have a Global Configuration option to disable the Mootools java that is loaded when the frontend is viewed. If the site does not use any Mootools java this is an unnecessary requirement and adds to the page load speed.

Even better would be an option to turn it off and load your own Mootools script that has been built to run the java you require. So thinking aloud, a check box to turn off the Joomla Mootools with an option box to specify the url of another custom Mootools file.

Thanks

Lee

Advertisement
User avatar
masterchief
Joomla! Hero
Joomla! Hero
Posts: 2247
Joined: Fri Aug 12, 2005 2:45 am
Location: Brisbane, Australia
Contact:

Re: Option to turn off Mootools

Post by masterchief » Tue Feb 19, 2008 9:18 am

The frontend shouldn't be loading Mootools unless it's using something that actually uses Mootools. If it is loading it whether it needs it or not there is either a problem with your installation or it's a bug.
Andrew Eddie - Tweet @AndrewEddie
<><
http://eddify.me
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.

User avatar
Hackwar
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3790
Joined: Fri Sep 16, 2005 8:41 pm
Location: NRW - Germany
Contact:

Re: Option to turn off Mootools

Post by Hackwar » Tue Feb 19, 2008 11:46 am

The caption script needs mootools, why all com_content screens load mootools. I don't like this either... maybe we can change this?
god doesn't play dice with the universe. not after that drunken night with the devil where he lost classical mechanics in a game of craps.

Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.

Stian
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 247
Joined: Sat May 20, 2006 7:58 am
Location: Norway

Re: Option to turn off Mootools

Post by Stian » Tue Feb 19, 2008 12:05 pm

While on the subject of captions: if you include caption in a Custom HTML module and displays it on for example com_weblinks, the caption.js isn't loaded. Bug?

And yes, Hackwar, loading mootools because of a caption that is MAYBE there is overkill. Perhaps a regexp on the content item to check for caption is in place?

Stian

user deleted

Re: Option to turn off Mootools

Post by user deleted » Tue Feb 19, 2008 12:07 pm

masterchief wrote:The frontend shouldn't be loading Mootools unless it's using something that actually uses Mootools. If it is loading it whether it needs it or not there is either a problem with your installation or it's a bug.
It could also be part of a template where it is hardcoded to load that script.

positiveg
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Sun Jan 20, 2008 3:50 pm

Re: Option to turn off Mootools

Post by positiveg » Wed Feb 20, 2008 3:29 pm

no one actually said if it's possible to turn off mootools
I'm running flash scripts on the front page
now it works in Firefox but in IE it doesn't and I was told because mootools causes this operation error
I'm using flash image rotator
so anyone ever seen this error.

Stian
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 247
Joined: Sat May 20, 2006 7:58 am
Location: Norway

Re: Option to turn off Mootools

Post by Stian » Wed Feb 20, 2008 7:00 pm

positiveg,

please read the guidelines for this forum. This is a forum for white papers, and as stated earlier it is not possible to turn of mootools. This thread is a "request" for that feature ;)

Stian

ghazal
Joomla! Explorer
Joomla! Explorer
Posts: 351
Joined: Fri Aug 19, 2005 12:12 pm
Location: Out of my mind ...sometimes

Re: Option to turn off Mootools

Post by ghazal » Sat Feb 23, 2008 9:48 am

Watch this discussion, maybe you'll find what you are looking for:
http://forum.joomla.org/viewtopic.php?f=433&t=255433

positiveg
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Sun Jan 20, 2008 3:50 pm

Re: Option to turn off Mootools

Post by positiveg » Sun Feb 24, 2008 2:04 am

Thanks this helped a lot
I was able to get one feature worked by editing some script but it seemed like that feature disabled the mootolls form teh back end so my videos and scroller not working now
But thanks for the help
sure something else might

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: Option to turn off Mootools

Post by newart » Wed Feb 27, 2008 3:19 pm

I'd like to see an option for enabling or not the mootools when necessary... please see also an interesting thread on http://forum.joomla.org/viewtopic.php?f=304&t=194274 as you can see the problem isn't solved. I hope this thread is open for discussing better, but please before writing something else please read the above link ;)
former Q&T WorkGroup Joomla member - Italian Translation Team Member

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: Option to turn off Mootools

Post by newart » Sat Mar 01, 2008 4:52 pm

masterchief wrote:The frontend shouldn't be loading Mootools unless it's using something that actually uses Mootools. If it is loading it whether it needs it or not there is either a problem with your installation or it's a bug.
Sorry if I "dare" to talk with you about this thread as you're an expert (with the first "e" in block capital) and I'm a simple joomler...

I tested a site with a fresh new installation and I tryed to lite my site reducing whatever reducable... but mootools cannot do that. I went to the mootools site for downloading a small file but I didn't understand what suited my needs...

My need for a liter site is about mootools size too, first idea was to use a script for avoding an upload of those files. Then my idea was, how to upload an mootool file only when necessary?!

In short is it possible, if joomla cannot change its behavioural system, a more lighter mootool file and not the entire package? It should be fine to see a mootool for admin part and another for the live site, that is a separate system, in order to avoid problems of what we can and what we cannot do.

Please read my reply as a simple asking for more info about and not else. Now my site has 1.4 Kb HTML, 1Kb CSS and NO mootool (circa 70Kb!) in joomla 1.5 (the best version ever!!!!!!!)
former Q&T WorkGroup Joomla member - Italian Translation Team Member

User avatar
masterchief
Joomla! Hero
Joomla! Hero
Posts: 2247
Joined: Fri Aug 12, 2005 2:45 am
Location: Brisbane, Australia
Contact:

Re: Option to turn off Mootools

Post by masterchief » Tue Mar 04, 2008 9:54 am

I'm certainly no expert on Mootools (not sure where that came from).

In the context of the topic, I think what you are asking is that the built-in Mootools support needs to handle loading different combinations of the Mootools framework, right?

If that's the case can you provide some examples of where and when you'd use this. You'd probably also need to look at when it's better to load the whole framework as well because you would reach a point where the time taken to load all the individual smaller parts exceeds loading the whole framework (that is, the request times blow out).
Andrew Eddie - Tweet @AndrewEddie
<><
http://eddify.me
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: Option to turn off Mootools

Post by newart » Tue Mar 04, 2008 10:42 am

masterchief wrote: ...I think what you are asking is that the built-in Mootools support needs to handle loading different combinations of the Mootools framework, right?

If that's the case can you provide some examples of where and when you'd use this. You'd probably also need to look at when it's better to load the whole framework as well because you would reach a point where the time taken to load all the individual smaller parts exceeds loading the whole framework (that is, the request times blow out).
I've inserted in my site the script written by _Sash@ on Fri Feb 08, 2008 at http://forum.joomla.org/viewtopic.php?f ... 7#p1218907
<?php
$user =& JFactory::getUser();
if($user->get('guest') == 1) {
$search = array('mootools', 'caption.js');
// remove the js files
foreach($this->_scripts as $key => $script) {
foreach($search as $findme) {
if(stristr($key, $findme) !== false) {
unset($this->_scripts[$key]);
}
}
}
}
So the site is without a mootools size stuff and the admin part has its own mootools system available.

I used my site as a test site as I use the Great Joomla for sites (in this case for free only) around the world for parishes, missionaries, humanitarians and so on. Often they are in countries where internet is wired by cables on trees, or simply on the ground (!) with a big gap in speed (no adsl, impossible) and sundry other technological problems too. So it is important the lightness of a site, the content despite the facility of a site...

I need for a fast and light joomla and I tested the "perfect" site in joomla but in j1.5 we have the mootool problem. We know that the entire package is too for a site and I searched how to reduce all those 70/80 Kb to be downloaded...

My first attempt was to delete the package in the directory but the administration was impossible, then to avoid those script via template system but the problem was, when I do need some small parts (as it is integrated into joomla) of it, how to do?

I simply don't know what "core" mootools lighter file is needed for a simple new fresh installation (maybe for metadata system?). In the forum nobody replied to me clearly...

I started a thread at http://forum.joomla.org/viewtopic.php?f ... s#p1139774 entitled "80k loaded on every page for java not wanted - pls more control on that" (please read that if you can) and another without any reply at http://forum.joomla.org/viewtopic.php?f ... s#p1148342 entitled "How to reduce mootools file to a basic one".

My idea is now to solve this problem, maybe like a whitepaper for mootools:
- separate the system into 2 parts: admin & live site
- using more specific files for specific behaviours or the entire package, but with a control / option by admins
- using a core lighter file for new fresh installation as Joomla needs for some tasks (I don't know which are) and it is ugly to miss something useful for speedy sites too...

A question, if I avoid the mootools in a site for the public (not registered) what functionality doesn't work?

Here is my problem, I hope to be clear... I speak a bad english, I know it, sorry.
former Q&T WorkGroup Joomla member - Italian Translation Team Member

User avatar
hotnuts21
Joomla! Explorer
Joomla! Explorer
Posts: 315
Joined: Wed Aug 17, 2005 11:11 pm

Re: Option to turn off Mootools

Post by hotnuts21 » Tue Mar 04, 2008 11:51 am

I would like to support the original topic of this thread, to be able to -
- Disable Mootools
- Specify a seperate mootools file (maybe in templates folder)
- Specify more than one JS file for inclusion for example I use ExtJS for a lot of features and it would be good to be able to upload it to the templates folder and have it inlcuded automatically. Plus it causes problems when used with mootools.

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: Option to turn off Mootools

Post by newart » Wed Mar 05, 2008 7:07 am

I don't think of being Off Topic, you can have got your own option on/off for mootools too. Moreover if we are in this issue, maybe it is useful to improve the system itself! Why not?!
former Q&T WorkGroup Joomla member - Italian Translation Team Member

ghazal
Joomla! Explorer
Joomla! Explorer
Posts: 351
Joined: Fri Aug 19, 2005 12:12 pm
Location: Out of my mind ...sometimes

Re: Option to turn off Mootools

Post by ghazal » Wed Mar 05, 2008 10:59 am

I use my little tricks like newark.
The code I use to remove mootools for guests, registered users AND Administrator on front-end is, to place after <head> in index.php of the template :

Code: Select all

<?php
// Remove mootool sripts for guest and registered
    $user =& JFactory::getUser();
    if ($user->get('guest') == 1 or $user->usertype == 'Registered' or $user->usertype == 'Super Administrator') {
        $headerstuff = $this->getHeadData();
        $headerstuff['scripts'] = array();
        $this->setHeadData($headerstuff);
    }
?>
I got it here, in a thread about Mootools optimization:
http://forum.joomla.org/viewtopic.php?f ... &p=1220815

Then , according to my needs, I use switch/case to get to section/category/article with or without the motools library of joomla. Main goal is to test the latest version of Mootools (1.2Beta), or try some jQuery functionalities. But this is just a workaround. I am sure its possible to add a JS file to the head of a template using the Joomla! 1.5 API calls.

Then now I am testing this:

Code: Select all

<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
$js = "/templates/".$this->template."/js/myscript.js";
$this->addScript(JURI::base() . $js);
?>
to add a specific script to a template.

Still a work in progress.

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: Option to turn off Mootools

Post by newart » Wed Mar 05, 2008 11:47 am

ghazal wrote: I got it here, in a thread about Mootools optimization:
http://forum.joomla.org/viewtopic.php?f ... &p=1220815
thank you very much for your post, I fear my voice was a little "alone"... or not "fully understandable" :)
former Q&T WorkGroup Joomla member - Italian Translation Team Member

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: Option to turn off Mootools

Post by newart » Tue Mar 11, 2008 9:01 am

After having long tested my site, I'm pretty sure that a mootools loading isn't necessary for a live site (without 3D party components). The problen can arise if you have authors registered in your site and they need to insert articles... but in that case you can use a script for downloading the stuff.

Now I'm considering a question, if I have tested the site and I know that those mootools files aren't so necessary, well, why are they considered as necessary? So an option for disabling them or not should be a good solution!
former Q&T WorkGroup Joomla member - Italian Translation Team Member

User avatar
Hackwar
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3790
Joined: Fri Sep 16, 2005 8:41 pm
Location: NRW - Germany
Contact:

Re: Option to turn off Mootools

Post by Hackwar » Tue Mar 11, 2008 9:17 am

Do you use captions in your site for images? Those are mootools powered.
god doesn't play dice with the universe. not after that drunken night with the devil where he lost classical mechanics in a game of craps.

Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: Option to turn off Mootools

Post by newart » Tue Mar 11, 2008 4:01 pm

No, I don't - all images are directly inserted in the content without the joomla image button. When I used an image, so, I've written the full html code such as <img ... url... height&lenght... alt... and so on "by hand" and I see no problem without an active mootools system!

I know that who uses a mootools option has to be aware of what it is a consequence of his choice... in admin we can see some "warnings" about what it is the result of enabling/disabling something (sundry clear examples are in the global configuration site part). So you can have an option like that in which you can state what "problem" or limit you can have in your decision. For avoiding eventual problem for every reason you can install this feature with mootools enabled by default, and only who wants to disable that, of course, can do it without hack or "break" a very good joomla framework.

Moreover you have to consider that in this case, an option like that would be a plus for joomla as some joomlers declare that joomla is a little slow... and without those 70/100 Kb in the first page od your site I'm sure that, in this case, the guilty (if a site is slow with that option disabled, that is no mootools) is only up to the "manager" of that site and it isn't a joomla concern!!
former Q&T WorkGroup Joomla member - Italian Translation Team Member

User avatar
prova
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 181
Joined: Thu Oct 13, 2005 6:30 pm

Re: Option to turn off Mootools

Post by prova » Tue Mar 11, 2008 4:57 pm

I like Joomla and I am not a developer or a programmer. I am a Joomla fan, I use Joomla. I have read this forum and I agree with an option to turn off Mootools. I hope it is possible to develop an option like that because I like to see a faster Joomla site. I have downloaded a template in CSS with 3 small images and after having enabled this template I see that my site is already slow!!!!!! I have seen in another forum a link for a test site for understanding the problem in your site and I have seen these files from Mootools. Now newart says that it is possible not to use these files but I don't understand ANYTHING about doing and so please give an option to switch off all together.

I agree with newart and above all with ltempest, they have said that it is important to have this option. I am not able to say what you can develop a solution for this option but I hope to see somebody that it is clever and that it is able to find out a good solution for all fan joomlers!! And thank you very much for your work, I like Joomla very much!!!!!!
Vorrei ringraziare http://www.joomla.org per avermi dato la possibilità di essere presente su internet anche se non ci capisco niente di programmazione.

User avatar
prova
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 181
Joined: Thu Oct 13, 2005 6:30 pm

Re: Option to turn off Mootools

Post by prova » Tue Mar 11, 2008 5:07 pm

This is my data:

Object Size Totals
Object type Size (bytes)
HTML: 4479
HTML Images: 0
CSS Images: 4562
Total Images: 4562
Javascript: 77441
CSS: 3845
Multimedia: 0
Other: 0

In my Home page, Mootools is too much (my template has CSS only) and if you click on Javascript link you can see that they are all Mootools files!!!!!!!

I have forgotten to say that I use a 56K modem!!!!!!!
Vorrei ringraziare http://www.joomla.org per avermi dato la possibilità di essere presente su internet anche se non ci capisco niente di programmazione.

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: Option to turn off Mootools

Post by newart » Tue Mar 11, 2008 5:35 pm

Your post is almost similar to a petition for a MooTools option. I'd like to point that out ;) too. I've written in another thread about a MooTools issue in J1.5 for getting a Jsite more "speedy" but here we need to be more formal, more technical, we need to understand the pros and cons about an "idea" and then if it is developpable in this actual framework. I think so but it's my own idea, up to now we don't know whether that option is "a coming soon"...

Thanx for yr posts anyway, reading your data, well, it is clear how much a MooTools size is! Moreover, reading your 56K connection, well, I do understand your "ASAP please".
former Q&T WorkGroup Joomla member - Italian Translation Team Member

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: Option to turn off Mootools

Post by newart » Tue Mar 11, 2008 6:46 pm

I don't like to post twice without posting something new but I'd like to share with you my data me too. Posting here what optimized (and hacked) by me in my (testing) J1.5.1 live site: I have 2 HTTP requests only with a totale size of 2362 bytes! :) ;) That is I have 1417 bytes HTML and 945 bytes CSS.

Please take into account that my numbers are exceptional ones as they are highly optimized and not easy to develop in a site. Nevertheless it's a way for showing that an option (instead of hacking joomla) for disabling MooTools would be a Great plus! Considering that in that site if you have them enabled, well, the MooTools size would be more than 95% of the entire site :eek:
former Q&T WorkGroup Joomla member - Italian Translation Team Member

User avatar
MorfiusX
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Thu Dec 13, 2007 3:30 pm
Location: Ohio
Contact:

Re: Option to turn off Mootools

Post by MorfiusX » Sun Mar 16, 2008 3:57 pm

I thought I should comment on my thoughts about this topic. I started the original Mootools optimization thread linked above.

I think the bigger picture here is giving the user control of the inclusion of Mootools on the front end. A lot of sites don't use any of the Mootools functionality. There are a couple of points I would like to make:

- The user should have an easy way to chose whether or not to include the two default javascript files: mootools.js and caption.js
- The user should have the ability to specify an alternate set of files.

Because mootools can be customized, the user may wish to generate a smaller customized file with only the functions they need included. A few ideas on how to implement an option to specify the custom file location:

- The first option would be no path option, just and enable/disable from the global config. The user would then have to specify the path in their template.
- The second option would be to have a path option in the global config close to the enable/disable option.
- The third option would be to use a "template overrides" type of option. This would mean that if the template directory had a "js/mootools.js" or "js/caption.js", these would be used instead of the default files on the front end.

I think the decision to include Mootools in J1.5 was a debated one. I feel the right solution gives control of that answer to the use.

User avatar
prova
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 181
Joined: Thu Oct 13, 2005 6:30 pm

Re: Option to turn off Mootools

Post by prova » Sat Mar 22, 2008 7:37 am

MorfiusX wrote: - The first option would be no path option, just and enable/disable from the global config. The user would then have to specify the path in their template.
- The second option would be to have a path option in the global config close to the enable/disable option.
- The third option would be to use a "template overrides" type of option. This would mean that if the template directory had a "js/mootools.js" or "js/caption.js", these would be used instead of the default files on the front end.
and so joomla can be flexible for us!
Vorrei ringraziare http://www.joomla.org per avermi dato la possibilità di essere presente su internet anche se non ci capisco niente di programmazione.

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: Option to turn off Mootools

Post by newart » Mon Mar 24, 2008 8:15 pm

just a simple opinion, that option maybe can be made in a 1.5.x releases - without waiting for the 1.6 joomla...
former Q&T WorkGroup Joomla member - Italian Translation Team Member

Biscuit
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Mar 08, 2008 10:02 am

Re: [31]Option to turn off Mootools

Post by Biscuit » Tue Mar 25, 2008 3:58 am

This Joomla n00b would like to cast a vote for having the option to disable/choose Mootool options.

I think Mootools is great, but JQuery is (IMHO) better, lighter, more flexible and easier to learn (compared to MT1.11, anyway).

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7018
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: [31]Option to turn off Mootools

Post by AmyStephen » Tue Mar 25, 2008 9:58 pm

Someone should take the time to write this as a whitepaper and consider the implications.

This is not a whitepaper. It would take thought to add this option. It would have implications. If one wants this option available, they should spend time considering that.

User avatar
Hackwar
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3790
Joined: Fri Sep 16, 2005 8:41 pm
Location: NRW - Germany
Contact:

Re: [31]Option to turn off Mootools

Post by Hackwar » Tue Mar 25, 2008 10:45 pm

I already thought about this and I also know how to implement it, but this is not something that we can do in 1.5, since it would mean a slight content conversion to allow this. Besides that, its got to do with parameters. (Don't want to spoil all the fun of you guys figuring a way for this one. ;) )
god doesn't play dice with the universe. not after that drunken night with the devil where he lost classical mechanics in a game of craps.

Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.

Advertisement

Locked

Return to “Under Review - Archived”