• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: jQuery Control Options

jQuery Control Options 11 years 9 months ago #18096

As of release 2, there's an option to disable completely the inclusion of RS Media Gallery's jQuery, which is great, except that it doesn't work at all. Upon reviewing the jQuery helper located in the administrator folder, in fact, the system is hard coded to force the 'smart' function, which completely removes and replaces any loaded jQuery with RS Media Gallery's local assets version.

This is absolutely unacceptable behavior.
  • Because of the manner in which this is performed - a regex match against the term jQuery which auto-matches any version - I can't use a more up to date version of jQuery than what is included in RS Media Gallery.
  • For the same reason, I also can't specify the loading of an externally hosted copy of jQuery, such as at Google API.
  • The method of replacement also forces RS Media Gallery's jQuery to be the very first line in the head section of the document - potentially causing MooTools conflict issues (despite the presence of a noconflict command immediately after the jQuery include.)
  • The method of replacement goes out of processing sequence, waiting to do its work until after the full document has been rendered, making standard JHtml::script and JDocument->addScript() useless, and making the source of this issue annoyingly difficult to track down.

In order to prevent this behavior, I basically had to completely short-circuit the entire helpers\jquery.php file by forcing immediate returns for each function. This is not the quality I've come to expect from RS Joomla products, and I strongly hope that the jQuery loading control is properly rewritten for the next release update. RS Media Gallery has the potential to be a great product with a few more releases to get the new product kinks out, but the jQuery controls as they are currently 'supported' here should never have been released. Very, very sloppy.
The administrator has disabled public write access.

Re: jQuery Control Options 11 years 9 months ago #18104

  • octavian
  • octavian's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
I guess you never took the time to set "jQuery" to "No" and notice that it won't be loaded at all.
PS: What you saw hard-coded as loading the "smart" mode is following a logic where that function is called only on "auto" or "smart".
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
The following user(s) said Thank You: aquaricat

Re: jQuery Control Options 11 years 9 months ago #18147

Ah, actually, the reason I started looking into the problem was because, after explicitly setting it to 'No', I saw that it was still being loaded by Media - and loaded in such a way that I could not overwrite it. In fact, that's the first thing I checked. As stated in the very first sentence of the post, the option doesn't work.

Now, did I have time to go digging through the rest of the code? No, you're right, I found a work-around and moved on. Does that change the fact that I set the option to "No" and it didn't work? Especially when there's a comment stating that 'Smart' is the only mode that actually works in the file? Sorry, but that sounds like an 'incomplete implementation', not an 'implemented elsewhere'.

Could I have made my first post more objectively? Absolutely, and I'll apologize for the irritation left over from trying to track down a very subtle bug when I had half a dozen other things to get done. Problem still remains: With jQuery set explicitly to not load, it was loading and overriding any other jQuery include, and doing so in such a way that it could not be prevented within the normal processing sequence. What got me angry - what I still believe is unacceptable - is the method of the 'Smart' implementation.

Thank you for your time.
The administrator has disabled public write access.

Re: jQuery Control Options 11 years 9 months ago #18152

  • octavian
  • octavian's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
I can safely say that the option works - because we have developed it ourselves and we've tested it extensively and we would have noticed if such an obvious option didn't work. The fact remains that if I set "jQuery" to "No" it's not loaded at all and I made a test 1 minute ago just to be sure.
Why did we develop the "Smart" mode like this? It's very simple. There are plenty of extensions who load their own jQuery version, since Joomla! does not have a built-in method of loading jQuery. I do not blame them for the way they are loading jQuery (they have no alternative), but the first support requests we've had about RSMediaGallery! were related to the fact that other extensions were loading and overwriting jQuery. And what's left to do if an extension loads jQuery AFTER RSMediaGallery! ? You can't stop it unless you remove its jQuery instance and place your own on top. I can also safely say that there are exactly 0 reports of our own jQuery and MooTools conflicting this way. And there's no way the two would conflict since jQuery gets loaded first, sets the noConflict() mode and leaves the $ variable free for MooTools. Even without jQuery.noConflict() it wouldn't break MooTools since MooTools would basically overwrite jQuery.
We've also never received reports of jQuery conflicting since we've added this option so we're pretty sure it does its job.
Especially when there's a comment stating that 'Smart' is the only mode that actually works in the file? Sorry, but that sounds like an 'incomplete implementation', not an 'implemented elsewhere'.

I think you're misreading comments:
// force our own mode since the only one available now is the smart load
$jqueryHelper->mode = 'smart';
"The only one available now" doesn't mean that "we haven't implemented anything else", it means that, because that function runs on Joomla!'s "onAfterRender()" it's the only option that would work THERE (content has finished rendering).
$mainframe->registerEvent('onAfterRender', '_iniRSMediaGalleryjQuery');
... the other options are of course implemented in their respective areas of the same file.

Regards!
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
Last Edit: 11 years 9 months ago by octavian.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!