[2.0] AddLoadEvent

Discussion corner for Developers of Serendipity.
Post Reply
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

[2.0] AddLoadEvent

Post 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?
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: [2.0] AddLoadEvent

Post by yellowled »

I'd be fine with that, but I assume onli is going to have a more informed opinion. :)

YL
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: [2.0] AddLoadEvent

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] AddLoadEvent

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply