- Posts: 15
COMMUNITY FORUM
K2 and mootools
- Fred heise
-
Topic Author
- Offline
- New Member
im using the great K2 component. If im setting off mootools.js the comment and rating function dont work. Because of performance issues im willing to set of mootools. Are there any options to run k2 well without mootools ?
Thx Fred
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
K2 is not the only extension that uses the Mootools FrameWork for some visual effects or Ajax calls. Joomla! uses it on backend & frontend...
So i think disabling Mootools is not a good idea. If you really need to, some features like K2 comments & K2 rating will stop to work, no other way to make them work.
Maybe your performance issues come from another extension that uses Mootools.
Olivier
Please Log in or Create an account to join the conversation.
- SDKiller
-
- Offline
- Junior Member
- Posts: 35
Russian K2 support on joomlaforum.ru
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
Thanks for the precision...
So to be clear :
K2 2.4.x = Mootools
K2 2.5.x = JQuery
I think Fred uses K2 2.4.x regarding his problem...and i think K2 version used should now be written for each submission, and may be the Joomla! version to avoid confusion.
Olivier
Please Log in or Create an account to join the conversation.
- L. Arnold
-
- Offline
- New Member
- Posts: 14
Please Log in or Create an account to join the conversation.
- SDKiller
-
- Offline
- Junior Member
- Posts: 35
Landis Arnold wrote: Is there a way for K2 to not make the call to "ajax.googleapis.com ?
You can disable loading of jQuery in K2 params
Russian K2 support on joomlaforum.ru
Please Log in or Create an account to join the conversation.
- James Royal
-
- Offline
- Junior Member
- Posts: 24
BTW that's not my bad spelling that's what is reads
Please Log in or Create an account to join the conversation.
- dido76bg
-
- Offline
- New Member
- Posts: 9
If you are using J1.5.x and any version of K2 or if you don't want to have any problems with loading mootools and jquery in frontens you should put this piece of code in your template right after the head tag
<head>
<?php
$document =& JFactory::getDocument();
$regexp = '/mootools.js/';
foreach ($document->_scripts as $key => $value) {
if (preg_match($regexp, $key))
unset($document->_scripts[$key]);
}
?>
<script type="text/javascript" src="<?php echo JURI::base(); ?>media/system/js/mootools.js"></script>
<?php
$regexp = '/jquery/';
$jquery = null;
foreach ($document->_scripts as $key => $value) {
if (preg_match($regexp, $key)) {
$jquery[] = $key;
unset($document->_scripts[$key]);
}
}
foreach ($jquery as $jq_path) { ?>
<script type="text/javascript" src="<?php echo $jq_path; ?>"></script>
<?php } ?>
<script type="text/javascript">
if (typeof jQuery !== 'undefined') jQuery.noConflict();
</script>
<jdoc:include type="head" />
You can download joomla system jquery plugin from extensions.joomla.org (lets say jqueryeasy or scjquery) and intall it setting it to load jquery and jqueryui in both frond and backend.
If you plan to use mootool upgrade plugin (J1.5.x and K2 v2.5.1), make sure it is the first one of system plugins and jquery is second. Disable K2 jquery loading from parameters.
If you have problems with K2 v2.5.1 in rendering or operating in backend, than you should check the scripts in element folder. (I will discribe that in another topic - here )
Please Log in or Create an account to join the conversation.
- L. Arnold
-
- Offline
- New Member
- Posts: 14
It seems a call that is in Front Page Slide Show does not cause the breakage, but I am commenting out the line there as well as noted on this joomlaworks forum entry:
forum.joomlaworks.gr/frontpage-slideshow-(for-joomla!)/disable-jquery-in-fpss-3-0/
Please Log in or Create an account to join the conversation.
- SDKiller
-
- Offline
- Junior Member
- Posts: 35
James wrote: My sites Kunena forum has a 'MooTools domready event was never fired' error every time it loads a forum page
You could simply change the order of plugins, setting System - K2 plugin AFTER System - Mootools Upgrade
Russian K2 support on joomlaforum.ru
Please Log in or Create an account to join the conversation.
- James Royal
-
- Offline
- Junior Member
- Posts: 24
My site has so many plugins,
System - Mootools Upgrade - system mtupgrade - System - K2 - System - Mootools Control - System - JCH_Optimize plus others which I have NO IDEA what they do
One Idea =
If you plan to use mootool upgrade plugin (J1.5.x and K2 v2.5.1), make sure it is the first one of system plugins and jquery is second.
Second idea =
Moving and switching these on & off just messed up my Kunena menus and most font sizesYou could simply change the order of plugins, setting System - K2 plugin AFTER System - Mootools Upgrade
The simple option was just =Disable K2 jquery loading from parameters.
Cheers
Please Log in or Create an account to join the conversation.
- SDKiller
-
- Offline
- Junior Member
- Posts: 35
James wrote: Hi
My site has so many plugins,
... which I have NO IDEA what they do
Not a good idea to install something you even don't know what is it intended for.
Russian K2 support on joomlaforum.ru
Please Log in or Create an account to join the conversation.
- James Royal
-
- Offline
- Junior Member
- Posts: 24
I have now found out that the KIDE Shout box component does not work then a "item" is viewed, but it works in "category" view, the K2 is blocking/stopping a Ajex script.
Disabling the K2 jquery made the Kunena forum work but what now
Everything was working fine before the upgrade, so what other scripts did it add/change ??
Please Log in or Create an account to join the conversation.
- James Royal
-
- Offline
- Junior Member
- Posts: 24
You state that the Dashboard has been remove in this version so why is it still on my sites ??
Please Log in or Create an account to join the conversation.