5
\$\begingroup\$

I'm doing my first major jQuery development. It's a Widget for recurring events, and is as such a fairly complex beast. The full code is available at https://github.com/collective/jquery.recurrenceinput.js for those who want to check it out. I appreciate any kind of feedback about any part of the code, so anyone who wants to take a look at it, that would be awesome.

I have a couple of specific questions, and it seems best to put them as separate posts, so here is the first one:

Does my directory layout fit with what a jQuery developer would expect? Is it "best practice"?

The directory structure is this (somewhat simplified):

demo // Files to run the demo/tests:
    delete.png
    jquery.recurrenceinput.css
    overlays.css
    undelete.png
    input.html
    jquery.tools.dateinput.css
    pb_close.png

lib // jQuery files:
    jquery-1.4.2.js
    jquery.tmpl-beta1.js
    jquery.tools.dateinput-1.2.5.js
    jquery.tools.overlay-1.2.5.js
    jquery.utils.i18n-0.8.5.js

src // Actual code
    jquery.recurrenceinput.display.js
    jquery.recurrenceinput.form.js
    jquery.recurrenceinput.js

tests // Tests and supporting files

    jslint.js
    qunit.css
    qunit.js
    test.html
    tests.js

README.rst
\$\endgroup\$
2
+50
\$\begingroup\$

lib is not really lib, but your project's dependencies. Normally you'd call it vendor

tests -> test. This one is just a convention.

I took a quick look at your code and the first thing I saw was snake_case. JS/jQuery convention is to use CamelCase.

\$\endgroup\$
0
\$\begingroup\$

It's close enough. I don't recall noticing a convention for something like a jQuery widget or plugin - maybe because I didn't notice or maybe because there isn't one. As long as you're clearly communicating the separation of the project, which I think the included structure does perfectly well, people will figure it out.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.