Support

Admin Tools

#10090 gCalendar Display Issues

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Tuesday, 08 November 2011 08:25 CST

timbreese
Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? Yes
Have I searched the forum before posting? Yes
Have I read the documentation before posting (which pages?)? Yes
Joomla! version: 1.5.24
PHP version: 5.2.17
MySQL version: 5.1.56
Host: CompuGeeks
Admin Tools version: 2.1.11


Description of my issue:
I moved to a new host to solve the problems I was having with gCalendar. Now the calendar is not loading at all. I tried removing the .htaccess file but then I came up with an error page when I tried to access the calendar. I tried putting components/com_gcalendar/ in AdminTools as an exception but that also didn't work. I think it probably has to do with AdminTools but I can't figure out how.

http://fusw.org/calendar.html

The errors that I am getting with Firebug are:
this.element.getStyles is not a function mootools.js (line 65)
jQuery("gcalendar_component").fullCalendar is not a function calendar.html# (line 134)

Thanks again for your help!!

Tim

nicholas
Akeeba Staff
Manager
That's a conflict between mooTools (the JS framework used by Joomla! itself) and jQuery (the JS framework used by GCalendar). I have used GCalendar myself on a test site and all I can say is that its developer is worse in his JavaScript skills even to yours truly (and I'm no JS hotshot, quite the contrary). What he SHOULD have done is to place jQuery in "noConflict" mode. He didn't, so on any page where you have GCalendar and mooTools is loading as well (pretty much EVERY page on your site) it causes a JS error. Oops! ;)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

timbreese
I have posted your reply in the gCalendar forum! He asked if I could turn off JQuery in JomSocial but I can't find any preference in that app to do so. Do I need MooTools? Can I turn off JQuery? I'm not sure why this is a problem now when it was working before.

How can I fix the problem?

I turned on Debug System if you want to check the page: http://fusw.org/calendar.html

Thanks!!

nicholas
Akeeba Staff
Manager
Pardon my French, but this is a completely BS reply gCalendar's developer gave you :( He should fix his own Javascript. What he asked you to do is impossible and even if you could do that, another software would have a conflict with it and so on and so on. All he needs to do is get off his buttocks, run jQuery in noConflict mode (ideally, confined in a private object) and get done with it. I've been doing that for almost two years and, guess what, I never had any compatibility issues with properly written software.

Well, if you ask me, the best way to integrate a Google calendar on your site is to actually use the IFrame code provided by Google calendar itself. The only downside of this method is that it doesn't support HTTPS, but your site doesn't use HTTPS anyway :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

timbreese
Would the iFrame code work with multiple calendars?

I like the other aspects of gCalendar (module, upcoming events, etc) it would be great if I could get it to work.

I passed along your comments to the gCalendar forum. Let's see what he says- maybe it will get him to get off his butt!! :)

nicholas
Akeeba Staff
Manager
No, the IFrame method will only work with one calendar, albeit you can place it either in a component or a module position (tip: use the Wrapper component and module). Upcoming events, no it doesn't do that, unless Google itself offers such a feature and I have missed it :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

timbreese
Wow- this is now the battle of the forums!

Here is his response:
"Forget what this guy told you. I'm pretty aware how to handle jQuery in no conflict mode and I'm doing it!!. As I posted before, the problem is with the Jomsocial component. It loads jQuery after GCalendar is loading it and overwrites some calendar related stuff because of that. Does Jomsocial have some options not to load jQuery?

I feel really sorry for users like you when you get information like in the AdminTools forum. He absolutely didn't understand how GCalendar loads jQuery. So please don't count too much on his information. Post him this code snippet and if he will find a bug in it, I will include it into the next release."


static $jQueryloaded;
if($jQueryloaded == null){
$param = GCalendarUtil::getComponentParameter('loadJQuery');
$document =& JFactory::getDocument();
if(!JFactory::getApplication()->get('jquery', false) && ($param == 'yes' || empty($param))){
$document->addScript(JURI::base().'components/com_gcalendar/libraries/jquery/jquery.min.js');
JFactory::getApplication()->set('jquery', true);
}
$document->addScriptDeclaration("jQuery.noConflict();");
$jQueryloaded = 'loaded';
}

slaes
im no js developer myself but i can tell you this guy aint giving you the full picture. has he actually seen your site?

anyway, do yourself a favour and try this, works everytime.

http://extensions.joomla.org/extensions/core-enhancements/scripts/7230

nicholas
Akeeba Staff
Manager
Jesus Christ, it's one thing not understanding what I said and another thing pretending that you have the absolute truth :s OK, let's try again, with instructions for idiots. If you don't mind copying and pasting between forums, Tim :)

As per the jQuery.noConflict() documentation there are two ways to use jQuery.noConflict:
1. Without passing a parameter, or passing the parameter false, i.e. jQuery.noConflict(false); This is required in order to workaround conflicts with other JavaScript libraries which are also using the $ object, e.g. mooTools. HOWEVER!!! Two BIG "buts":
a. This will ONLY work if the call to noConflict follows the loading of jQuery and BEFORE mooTools is loaded. In any other case, hell may break loose (at least that's what was going on with mooTools 1.11 and 1.2 - I don't know if it's fixed with 1.3).
b. This will work ONLY if NO OTHER copy of jQuery is being loaded on the page.

2. By passing the optional parameter, you can "trap" jQuery in an object for your liking. For example: var myjQ = jQuery.noConflict(true); From that point, all calls to jQuery have to use that object, e.g. instead of jQuery('#foobar') use myjQ('#foobar'). Why do that? Because your own copy of jQuery (this one specific version nonetheless!) is now fully private and isolated not only from other JavaScript frameworks, but also from other copies of jQuery on the same page.

The big catch is, again, that this has to be called BEFORE any other JS framework or another copy of jQuery is loaded. Obviously, using the Joomla! API to link to jQuery's minified file and then use the API to insert a script can not guarantee that, ergo is bound to cause a problem. That's why he's having a problem.

Now, if you're wondering what's the safest way to load jQuery in noConflict mode and, in fact, use a private object, the solution is simple. Always use your local copy of the jQuery minified source file with the noConflict line at its bottom. Otherwise, he can create an in-place replacement of the page source as I was doing in Akeeba Backup 3.0 and 3.1, registering on-the fly a plugin handler for the onAfterRender event. It worked perfectly with both a local copy of jQuery and fetching a copy off Google. If you want the code and can't find an old copy of Akeeba Backup, please let me know and I'll be more than happy to share.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!