[dokuwiki] Re: JavaScript/JQuery cleanup Weekend?

  • From: "Matthias Schulte" <mailinglist@xxxxxxxxx>
  • To: <dokuwiki@xxxxxxxxxxxxx>
  • Date: Fri, 3 Jun 2011 20:51:07 +0200

Hi,

would this cause some problems for the plugin authors? When they would like
to serve their plugin for DW versions with old Javascript stuff and also for 
DW's 
with the jQuery-Port?

Regards
Matthias

> -----Original Message-----
> From: dokuwiki-bounce@xxxxxxxxxxxxx [mailto:dokuwiki-
> bounce@xxxxxxxxxxxxx] On Behalf Of Andreas Gohr
> Sent: Friday, June 03, 2011 2:26 PM
> To: DokuWiki Mailinglist
> Subject: [dokuwiki] JavaScript/JQuery cleanup Weekend?
> 
> 
> Hi *,
> 
> Let me start with a somewhat longer introduction first...
> 
> I just pushed two patches. The first fixes the AJAX quick search for
> page names which was completely broken since the JQuery branch was
> merged. Looked like this was never tested, there were several parts
> that could never have worked.
> 
> Apart from the bugs I noticed that the whole thing was wrapped in an
> anonymous function that passed the noConflict jQuery() function as $()
> to its inside. I believe this i also the case at a few other places.
> This is problematic because of two things:
> 
> 1. It makes the code harder to understand because you always need to
> think if it is our old $() function that is currently still there for
> compatibility reasons or if the $ was overwritten by a wrapper
> somewhere.
> 2. The wrapper hides the global named Object we had before. This makes
> it impossible for plugins to attach themselves to it or to overwrite
> or extend parts of the implementation.
> 
> So please, don't do this. Type the few more letters and always use jQuery().
> 
> My second patch added a DEPRECATED() function to mark deprecated
> JavaScript functions. The first one I marked this way is our good old
> $() function. If you browse a current checkout in Chrome or Firefox
> with Firebug enabled, you will see a bunch of warnings in your
> JavaScript console. These are all cases where our old $() is still
> used.
> 
> My goal for October is to ship a version were none of these messages
> will show up in a clean, 3rd party plugin free DokuWiki will show up.
> 
> This means we have to go through our current JavaScript and clean it
> up. We probably should also refactor the whole script directory a
> little bit. Eg. renaming files to be more sensible (like ajax.js to
> quicksearch.js) or moving deprecated functions away from the other
> functions...
> 
> ... now this was the introduction ;-)
> 
> Because all of this is quite some work, I was wondering if we should
> do it together like we do on our bug hunting weekends. Participants
> should have at least some basic knowledge of JavaScript and JQuery.
> 
> Who would be up for it? Any date suggestions?
> 
> Andi
> 
> PS: Kate and Piyush, this would be a good opportunity for you to learn
> about our existing JavaScript and the JQuery integration
> 
> --
> splitbrain.org
> --
> DokuWiki mailing list - more info at
> http://www.dokuwiki.org/mailinglist

--
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: