[dokuwiki] JavaScript/JQuery cleanup Weekend?

  • From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
  • To: DokuWiki Mailinglist <dokuwiki@xxxxxxxxxxxxx>
  • Date: Fri, 3 Jun 2011 14:25:58 +0200

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
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

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

... 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?


PS: Kate and Piyush, this would be a good opportunity for you to learn
about our existing JavaScript and the JQuery integration

DokuWiki mailing list - more info at

Other related posts: