[closed] New plugin: Pagemanager_XH

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

Moderator: Tata

Gert
Posts: 3054
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: New plugin: Pagemanager_XH

Post by Gert » Sat Jun 25, 2011 10:57 am

Hi Christoph, jQuery4CMSimple 1.0 will not be the last version - the first release always is the endurance test ;)

For Details: Holger is the author and responsible for the Plugin, I'm sure, he will read this post and answer your questions.
Gert Ebersbach | CMSimple | Templates - Plugins - Services

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

Re: New plugin: Pagemanager_XH

Post by Holger » Sat Jun 25, 2011 1:31 pm

Gert wrote:For Details: Holger is the author and responsible for the Plugin, I'm sure, he will read this post and answer your questions.
Ok, I'll try ;) .
cmb wrote:But what if the plugin loader includes a plugin which uses a really old jQuery version, and after that, the loader includes jQuery4CMSimple.
We can't do somthing against that. An old plugin should be updated or it remain incompatible.

jQuery for CMSimple takes care that jQuery, jQueryUI and other jQuery-Plugins are propper and only once loaded.
Developers must use the provided functions for this jobs and then most of all that problems in the past should be gone.
By default the libraries are only integrated by a request of a plugin and, with some small own php-code, a developer can find out which jQuery / UI version is running.
But there's also an option to integrate the libraries by default to any page.

The plugin-code was written much easy as possible, so it should not be a problem for a developer to understand how it works.
Beside this the help-file contains ready to run code-examples for copy'n paste.
cmb wrote:And I want to know if jQuery4CMSimple will use the jQuery.noConflict() call.
Hmm, the no.Conflict() call is part of your own plugin code ;) .
And from my point of view it's not a good solution to use two different js-frameworks with the no.Conflict() solution on the same installation.
And, as you wrote, if jQuery4CMSimple relies on no.Conflict(), every plugin becomes incompatible. So the compatible way is to use no.Conflict() in the plugin code.
So can you point me to an example where all this should be necessary?
Almost every interesting effect or plugin - like lightboxes - is available in jQuery ore cloned with jQuery. And if not, it's not that problem to convert it...

Holger

cmb
Posts: 13273
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: New plugin: Pagemanager_XH

Post by cmb » Sat Jun 25, 2011 1:45 pm

Hello Holger,

thanks for your reply.
Holger wrote: We can't do somthing against that. An old plugin should be updated or it remain incompatible.
You might want to see my new post in "Open Development". Maybe you'll take a look at my suggestion, and it's possible to use the function.

The description of jQuery4CMSimple's functioning sounds very good to me. I'm looking forward to test it. :)
Holger wrote: Hmm, the no.Conflict() call is part of your own plugin code
As I've written this, I was not aware that noConflict() has a return value. So the problem is solved for me.
Holger wrote: So can you point me to an example where all this should be necessary?
No, not really. It was a general thought about possible problems and stimulated from jerry's first post above. I for myself am glad, if I hadn't to mess around with other js frameworks, and there is a standard for CMSimple.

Thanks for your time,
Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 13273
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: New plugin: Pagemanager_XH

Post by cmb » Sat Jun 25, 2011 1:54 pm

Hello Holger,

an afterthought:
cmb wrote: As I've written this, I was not aware that noConflict() has a return value. So the problem is solved for me.
As I understand noConflict() causes $ to be removed! What happens, if one plugin author uses noConflict(), and another author relies on $. Wouldn't this be a problem? If I find time, I'll check for myself.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: New plugin: Pagemanager_XH

Post by Holger » Sat Jun 25, 2011 1:59 pm

cmb wrote:Hello Holger,

an afterthought:
cmb wrote: As I've written this, I was not aware that noConflict() has a return value. So the problem is solved for me.
As I understand noConflict() causes $ to be removed! What happens, if one plugin author uses noConflict(), and another author relies on $. Wouldn't this be a problem? If I find time, I'll check for myself.

Christoph
No, that's not a problem.

Holger

cmb
Posts: 13273
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: New plugin: Pagemanager_XH

Post by cmb » Sat Jun 25, 2011 2:12 pm

Hello Holger,
Holger wrote: No, that's not a problem.
I think it is. Just tested the following code:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <title><!-- Insert your title here --></title>
</head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script>
var jq = jQuery.noConflict();
$(document).ready(function(){alert("Hello");});
</script>
<body>
    <!-- Insert your content here -->
</body>
</html>
Without the line

Code: Select all

var jq = jQuery.noConflict();
I'm welcomed by my browser ;) With the noConflict() line: no response. My JS error console says:

Code: Select all

$ is not a function
    $(document).ready(function(){alert("foo");}); 
Christoph
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: New plugin: Pagemanager_XH

Post by Holger » Sat Jun 25, 2011 2:25 pm

cmb wrote:I think it is.
Ahh, sorry, now I understand what you mean, I've not read your post carefully.
Of course it'll be a problem if you run another jQuery based plugin which is using $.
That's the intention behind no.Conflict(), making $ available for other frameworks.
So no one should use no.Conflict() in his plugin, that's true.

BTW: have a look here:
http://www.cmsimple-xh.com/wiki/doku.ph ... d_cmsimple

Holger

cmb
Posts: 13273
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: New plugin: Pagemanager_XH

Post by cmb » Sat Jun 25, 2011 2:39 pm

Hello Holger,
Holger wrote: So no one should use no.Conflict() in his plugin, that's true.
That would solve my problems with Pagemanager_XH. :) As it relies on jsTree, and jsTree doesn't work with noConflict().
Holger wrote: BTW: have a look here:
http://www.cmsimple-xh.com/wiki/doku.ph ... d_cmsimple
It is released?! :D Shouldn't there be an announcement in "Addons and Plugins"?

I'll look at it ASAP.

Thanks,
Christoph
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: New plugin: Pagemanager_XH

Post by Holger » Sat Jun 25, 2011 3:04 pm

cmb wrote:It is released?! :D Shouldn't there be an announcement in "Addons and Plugins"?
Be patient. It's in progress....

Martin
Posts: 346
Joined: Thu Oct 23, 2008 11:57 am
Contact:

Re: New plugin: Pagemanager_XH

Post by Martin » Sat Jun 25, 2011 3:22 pm

Hi Christoph,

jsTree works with noConflict() ... you just would have to encapsulate your init code like this:

Code: Select all

<!-- initialize jstree -->
<script type="text/javascript">
/* <![CDATA[ */
(function($){
// insert your init code from admin.php l. 58pp.
})(jQuery);
/* ]]> */
</script>
 
Although I am really convinced that there is absolutely no need to use more than one js-framework in one CMSimple installation, you can't rely on other plugin authors or users with a faible for all kind of plugins - but as there are only a few jQuery-based plugins and Holger's integration is fresh and new, we could take the opportunity to establish this closure thing as "best practice"?

KR
Martin

Post Reply