[New Plugin] jQuery4CMSimple

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: [New Plugin] jQuery4CMSimple

Post by Holger » Tue Jun 28, 2011 12:17 pm

Hi jerry,
jerry wrote:For my part it seems that I can just replace $ with jQuery to avoid conflicts with lightbox and anything else I know.
It's possible to replace $ with jQuery without no.Conflict() -
BUT only when jQuery is loaded as the first framework!
jquery.com wrote: If you include jQuery before other libraries, you may use "jQuery" when you do some work with jQuery, and the "$" is also the shortcut for the other library. There is no need for overriding the $-function by calling "jQuery.noConflict()".

Code: Select all

<html>
 <head>
   <script src="jquery.js"></script>
   <script src="prototype.js"></script>
   <script>
     // Use jQuery via jQuery(...)
     jQuery(document).ready(function(){
       jQuery("div").hide();
     });
     
     // Use Prototype with $(...), etc.
     $('someid').hide();
   </script>
 </head>
 <body></body>
 </html>
See example "Including jQuery before Other Libraries " at http://docs.jquery.com/Using_jQuery_wit ... _Libraries

So your solution might not be really save...

Holger

BTW: can't we do that discussion at this thread: http://www.cmsimpleforum.com/viewtopic.php?f=29&t=3209 :?:

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: [New Plugin] jQuery4CMSimple

Post by cmb » Tue Jun 28, 2011 1:42 pm

Hello Holger, hello Jerry,

I will switch to the mentioned thread for this topic to answer your given posts.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

jerry
Posts: 177
Joined: Fri Jul 25, 2008 8:54 pm
Location: Denmark
Contact:

Re: [New Plugin] jQuery4CMSimple

Post by jerry » Tue Jun 28, 2011 6:47 pm

It's possible to replace $ with jQuery without no.Conflict() -
BUT only when jQuery is loaded as the first framework!
You're right Holger. noConflict is included again and it works with jQuery loaded after prototype.
jerry
jerry/simplesolutions

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: [New Plugin] jQuery4CMSimple

Post by cmb » Thu Jun 30, 2011 12:13 am

Hello Holger,

I've checked possible problems with my Pagemanger, by having simulated old plugins including jQuery 1.0. But I found that the jQuery4Simple plugin includes it's jQuery always last! I surfed the code, but didn't find it. :(

How did you manage this? Or is it a secret? ;)

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: [New Plugin] jQuery4CMSimple

Post by Holger » Thu Jun 30, 2011 5:14 pm

cmb wrote:How did you manage this? Or is it a secret? ;)
No secret, hehe. It's so easy: I've managed nothing :mrgreen: .
Because that's the part of the Pluginloader.
IMO there isn't some sorting to the list of plugins to include available (and if so - I had no look - it may fail).
It seems the order of the plugin-loading depends on the order how php reads the script from the filesystem.
And that may depend on the servers operating-system.
But, as I said, I've not looked on the code...

Holger

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: [New Plugin] jQuery4CMSimple

Post by cmb » Thu Jun 30, 2011 6:43 pm

Hi Holger,

thanks for your reply.

I still wonder, because the HTML output of all sites I've seen (not too much), output the plugins css files in alphebeticall order. I thought the plugin loader uses sortdir().

I'd take a look at this because of possible problems with my Pagemanger on sites using old jquery stuff. Because you wrote:
Holger wrote: .... and the user knows one minute after the installation why / what causes the trouble and removes the incompatible stuff again
And I know, that there will be problems when an old jquery version (say v1.0) is loaded after the newer one. So I tried to simulate this, but I couldn't, cause jQuery4CMSimple was always loaded last. But I will double check, so users wont remove Pagemanager as incompatible stuff ;)

Christoph

PS: Just checked; seems it uses readdir() :( As jQuery4CMSimple is distributed with the core, as is the pluginloader, could/should the pluginloader be adjusted?
Christoph M. Becker – Plugins for CMSimple_XH

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: [New Plugin] jQuery4CMSimple

Post by Holger » Tue Jul 26, 2011 11:54 pm

Hi community,

I've updated jQuery4CMSimple to version 1.3 today.

The only small change is in jquery.inc.php, to load the jQuery.js always as the first library.
For discussion on that change see here: http://cmsimpleforum.com/viewtopic.php? ... =20#p18077

Beside this, an updated help-file is included.

Downloads from http://cmsimple-xh.com/wiki/doku.php/pl ... y4cmsimple are always up to date.

Updating existing installations is not necessary if everything is working.

KR
Holger

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: [New Plugin] jQuery4CMSimple

Post by cmb » Wed Jul 27, 2011 12:33 am

Hi Holger,

thank you for being so busy lately :)

IMO loading jquery first is a very good solution, because I see now, that all jquery using plugin developers will comply to the suggested coding conventions. :D

I hope that the new version will be distributed with CMSimpe_XH as soon as possible.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: [New Plugin] jQuery4CMSimple

Post by cmb » Fri Aug 26, 2011 11:57 pm

Hello Holger,

I've just wanted to try out the theming support for jQueryUI. I've downloaded a theme from the themeroller site, and included it to the template as you've explained in the help file under "Desingers View". But that didn't work as expected :( The theme basically was working, but the dialog was "distorted". I've tried another theme with the same result. After some further trial, I've found out, what I'd done wrong! Just to save some download size, I'd "deselected all components" before downloading the theme! After selecting all of them, the download took a little bit longer, but the theme was working fine afterwards. :)

Thanks again for the great work of bringing jQuery, jQueryUI and theming support for individual templates to CMSimple. :D

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: [New Plugin] jQuery4CMSimple

Post by cmb » Wed Aug 31, 2011 3:45 pm

Hello Holger,
Holger wrote:more and more new plugins are using jQuery
As I've just found out, templates too! So, is there any way to make template designers aware of the jQuery4CMSimple plugin?

For the record: the template (BTW a very nice one!) used the jQuery-Plugin "superfish" and included it's own jquery-1.3.2 for this reason. There were no problems between the two jQuery versions, but jQueryUI was not working properly!

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply