Joomla's 1.5.23 and template's Mootools version conflict!!!

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
mihalisp
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Sep 18, 2007 11:35 am

Joomla's 1.5.23 and template's Mootools version conflict!!!

Post by mihalisp » Mon Oct 24, 2011 2:12 am

I use Valee template from Mightytemplate which uses its own mootools 1.2 libraries instead of Joomla's 1.5 native mootools libraries.But this creates some conflicts because i have both Frontpage slideshow and Lof k2 article scroller.I cant get them both to work at the same time.It has to do with mootools .

Can you help me please?


Lof k2 article scroller uses script11 or script12.js if it finds the following :

$app = JFactory::getApplication();

if( (float)$app->get ('MooToolsVersion')>='1.2' ) {
JHTML::script( 'script_12.js','modules/'.$module->module.'/assets/');
} else {
JHTML::script( 'script_11.js','modules/'.$module->module.'/assets/');
}


script11.js line 60

this.fxItems[index] = new Fx.Styles( item, fx );

Also,lof k2 scroller has script12.js
In the same line it has:

var fx = $extend({waiting:false, onComplete:function(){ this.onClick=false}.bind(this) }, this.setting.fxObject );
this.slides.each( function(item, index) {
item.setStyles( eval('({"'+this.styleMode[0]+'": index * this.maxSize,"'+this.styleMode[1]+'":Math.abs(this.maxSize),"display" : "block"})') );
this.fxItems[index] = new Fx.Morph( item, fx );
}.bind(this) );

In IE7 the error is in the following lines:

the error is :the object does not support this property or method....


Μήνυμα: Αναμένεται αντικείμενο
Γραμμή: 60
Χαρακτήρας: 6
Κώδικας: 0
URI: http://localhost/kaz/modules/mod_lofk2s ... ript_11.js


Μήνυμα: Το αντικείμενο δεν υποστηρίζει αυτή την ιδιότητα ή μέθοδο
Γραμμή: 114
Χαρακτήρας: 3
Κώδικας: 0
URI: http://localhost/kaz/media/system/js/modal.js


Μήνυμα: Το αντικείμενο δεν υποστηρίζει αυτή την ιδιότητα ή μέθοδο
Γραμμή: 262
Χαρακτήρας: 1
Κώδικας: 0
URI: http://localhost/kaz/templates/valee/js/mootools-1.2.js

The Valee template uses its own mootools which is:
Valee mootools-1.2.js line 262

window.fireEvent("domready");document.fireEvent("domready");};window.addEvent("load",b);if(Browser.Engine.trident){var a=document.createElement("div");



modal.js in joomla system line 114

this.fx = {
overlay: this.overlay.effect('opacity', {
duration: this.options.fxOverlayDuration,
wait: false}).set(0),
window: this.window.effects({
duration: this.options.fxResizeDuration,
wait: false}),
content: this.content.effect('opacity', {
duration: this.options.fxContentDuration,
wait: false}).set(0)



Please help me.I have tried everything.

I figured out that Lof k2 scroller identifies if there is mootools version 1.2 or 1.2 and acts accordingly(script11.js or script12.js).But i realised that it always finds out that mootools in my system is 1.1 since it cant understand the template's mootools-1.2.js



Thank you in advance

mihalisp
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Sep 18, 2007 11:35 am

Re: Joomla's 1.5.23 and template's Mootools version conflict

Post by mihalisp » Mon Oct 24, 2011 9:33 pm

After a lot of effort i figured out that the problem might occur when the following 2 pieces of code come together from different .php files in the same script.
I assume that somehow i have to use the noConflict mode to make it work properly.

My head tag is as follows :

<link type="text/css" href="/kaz/templates/valee/css/template_css.css" rel="stylesheet">
</link>
<link id="mightyCSS" type="text/css" href="/kaz/templates/valee/css/style1.css" rel="stylesheet">
</link>
<link type="text/css" href="/kaz/templates/valee/css/mightymenu.css" rel="stylesheet">
</link>
<link type="text/css" href="/kaz/templates/valee/css/typography.css" rel="stylesheet">
</link>
<link type="text/css" href="/kaz/templates/system/css/general.css" rel="stylesheet">
</link>
<link type="text/css" href="/kaz/templates/system/css/system.css" rel="stylesheet">
</link>
<style type="text/css">
</style>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<meta content="index, follow" name="robots">
<meta content="........" name="keywords">
<meta content="........" name="description">
<meta content="Joomla! 1.5 - Open Source Content Management" name="generator">
<title>Front page</title>
<link title="Frontpage Slideshow (by JoomlaWorks) RSS Feed" type="application/rss+xml" rel="alternate" href="/kaz/index.php?option=com_fpss&task=module&id=54&format=feed&type=rss">
<link title="Frontpage Slideshow (by JoomlaWorks) Atom Feed" type="application/atom+xml" rel="alternate" href="/kaz/index.php?option=com_fpss&task=module&id=54&format=feed&type=atom">
<link type="text/css" href="/kaz/media/system/css/modal.css" rel="stylesheet">
</link>
<link type="text/css" href="http://localhost/kaz/components/com_k2/css/k2.css" rel="stylesheet">
</link>
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jq ... ery-ui.css" rel="stylesheet">
</link>
<link type="text/css" href="/kaz/plugins/content/jw_sigpro/includes/js/jquery_slimbox/css/slimbox2.css" rel="stylesheet">
</link>
<link media="screen" type="text/css" href="/kaz/plugins/content/jw_sigpro/tmpl/Classic/css/template.css" rel="stylesheet">
</link>
<link media="print" type="text/css" href="/kaz/plugins/content/jw_sigpro/includes/css/print.css" rel="stylesheet">
</link>
<link type="text/css" href="/kaz/modules/mod_lofk2scroller/assets/style.css" rel="stylesheet">
</link>
<link type="text/css" href="/kaz/modules/mod_fpss/tmpl/Movies/css/template.css.php?width=510&height=313&sidebarWidth=382&timer=1&thumbnailViewportWidth=72&thumbnailViewportHeight=45&mid=54" rel="stylesheet">
</link>
<script src="/kaz/media/system/js/mootools.js" type="text/javascript">
</script>
<script src="/kaz/media/system/js/modal.js" type="text/javascript">
</script>
<script src="http://localhost/kaz/components/com_k2/js/k2.js" type="text/javascript">
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jq ... ery.min.js" type="text/javascript">
</script>
<script src="http://localhost/kaz/plugins/system/scj ... onflict.js" type="text/javascript">
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jq ... -ui.min.js" type="text/javascript">
</script>
<script src="/kaz/media/system/js/caption.js" type="text/javascript">
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jq ... ery.min.js" type="text/javascript">
</script>
<script src="/kaz/plugins/content/jw_sigpro/includes/js/jquery_slimbox/js/slimbox2.js" type="text/javascript">
</script>
<script src="/kaz/plugins/content/jw_sigpro/includes/js/behaviour.js" type="text/javascript">
</script>
<script src="/kaz/modules/mod_lofk2scroller/assets/script_11.js" type="text/javascript">
</script>
<script src="/kaz/modules/mod_fpss/includes/js/jquery.fpss.js" type="text/javascript">

<script type="text/javascript">
1
2
3 window.addEvent('domready', function() {
4
5 SqueezeBox.initialize({});
6
7 $$('a.modal').each(function(el) {
8 el.addEvent('click', function(e) {
9 new Event(e).stop();
10 SqueezeBox.fromElement(el);
11 });
12 });
13 });
14var K2RatingURL = 'http://localhost/kaz/';
15 /* Frontpage Slideshow v3.0.2 */
16
17 $FPSS.noConflict();
18 $FPSS(document).ready(function(){
19 $FPSS('#fpssContainer54').fpss( {
20 autoStart: 1,
21 transitionTime: 1000,
22 interval: 7000,
23 timer: 1,
24 effect: 'crossfade',
25 event: 'click',
26 textEffect: 1,
27 lavalamp: 1,
28 playLabel: 'Play',
29 pauseLabel: 'Pause'
30 });
31 });
32
33
</script>


I believe that the first piece of code uses mootools 1.1(probably Lof k2 scroller is not compatible with mootools 1.2 ) and the fpss uses jquery and these conflict.
How can i make it work???

Thank you in advance!


Locked

Return to “Joomla! 1.5 Coding”