[theme-reviewers] Heavily Commented Javascript Files.
Dion Hulse (dd32)
wordpress at dd32.id.au
Tue Jul 5 03:28:37 UTC 2011
Just remember to use best practices in doing so.
* If you minify the file rather than just strippings comments, don't munge
it. To keep people happy, mentioning in the dev version what compressor and
settings were used would probably be appreciated.
* Default to the minified/commentless file, but enqueue the dev version
when the SCRIPT_DEBUG constant is set, this is what core uses to use the
non-minified files, makes it easier to debug that way IMO.
(Those apply to plugins as equally as to Themes)
On 5 July 2011 13:24, Chip Bennett <chip at chipbennett.net> wrote:
> All else being equal and being implemented properly, I don't see any
> reason why that should cause a problem.
>
> Given that you're not actually required to provide a version of the JS
> file with inline documentation (i.e. the condensed version would be
> perfectly valid on its own), providing a second, documented version is
> an example of going above and beyond. IMHO anything that adds
> documentation to a Theme should be encouraged.
>
> Chip
>
> On 7/4/11, Michael Fields <michael at mfields.org> wrote:
> > I've been working on integrating some javascript functionality into my
> next
> > public theme. Thing is, I've grown quite accustomed to documenting my
> code
> > over the past year and this applies to javascript as well. The file in
> > question is almost 200 lines long and I only see it grown. Fully
> documented,
> > it could easily become 3-400 lines. I'm projecting about 50% of the code
> > will be documentation when all is said and done.
> >
> > I would like to include it into the theme much the same way that
> WordPress
> > included js. Having a "dev" version and a "live" version. The live
> version
> > would contain the same functional code minus excess whitespace and
> comments.
> > I would not use any compression or package application to obfuscate the
> > code.
> >
> > Just wondering if this is something that would pass theme review. I know
> > questions like this have been asked before, but I honestly can not
> remember
> > the outcome.
> >
> > Here's the script:
> > https://github.com/mfields/nighthawk/blob/master/dropdowns.js
> >
> > Best wishes,
> > -Mike
> > _______________________________________________
> > theme-reviewers mailing list
> > theme-reviewers at lists.wordpress.org
> > http://lists.wordpress.org/mailman/listinfo/theme-reviewers
> >
>
> --
> Sent from my mobile device
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110705/0542fefc/attachment.htm>
More information about the theme-reviewers
mailing list