[2.0] AddLoadEvent

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

[2.0] AddLoadEvent

Post by garvinhicking » Wed Mar 05, 2014 12:56 pm

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/

User avatar
yellowled
Regular
Posts: 7074
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: [2.0] AddLoadEvent

Post by yellowled » Wed Mar 05, 2014 6:51 pm

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

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
onli
Regular
Posts: 2254
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: [2.0] AddLoadEvent

Post by onli » Wed Mar 05, 2014 8:38 pm

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.

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] AddLoadEvent

Post by garvinhicking » Thu Mar 06, 2014 5:00 pm

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