Page 1 of 1

[2.0] AddLoadEvent

Posted: Wed Mar 05, 2014 11:56 am
by garvinhicking
Hi!

In 2.0, the "addLoadEvent" method of the JS has been renamed to "serendipity.addLoadEvent". This imposes a problem for some plugins, which utilize this function:

- spamblockbayes
- freetag
- autosave
- adminnotes

I would opt to put this central addLoadEvent outside the serendipity main object, to ensure operation of the mentioned plugins. I don't think moving the function is worth the additional version switch inside the plugins and making the plugins throw JS error messages and not work if not upgraded.

Opinions?

Re: [2.0] AddLoadEvent

Posted: Wed Mar 05, 2014 5:51 pm
by yellowled
I'd be fine with that, but I assume onli is going to have a more informed opinion. :)

YL

Re: [2.0] AddLoadEvent

Posted: Wed Mar 05, 2014 7:38 pm
by onli
Ok, but I think we should regard it as a legacy call and let new code use $(document).ready instead - the function is not necessary anymore, is it? Maybe we should remove serendipity.addLoadEvent, if we keep addLoadEvent for bc.

Re: [2.0] AddLoadEvent

Posted: Thu Mar 06, 2014 4:00 pm
by garvinhicking
onli wrote:Ok, but I think we should regard it as a legacy call and let new code use $(document).ready instead - the function is not necessary anymore, is it? Maybe we should remove serendipity.addLoadEvent, if we keep addLoadEvent for bc.
I agree, we should use $(document) on new plugins and core code. I also prefer the global function then.

I just committed it.

Regards,
Garvin