The namespace function in media doesn't follow the Drupal core pattern of declaring objects within Drupal.

Namespaces should be created similarly to Drupal.media = Drupal.media || {};

Comments

james.elliott’s picture

patch attached

james.elliott’s picture

Status: Needs work » Needs review
JacobSingh’s picture

Status: Needs review » Reviewed & tested by the community

RTBC. It works fine. It's a step backwards though in terms of DRY. Pretty much every JS framework seems to have one of these, I think I stole this one from YUI. I suppose being "standard" is more important than being right though :)

Maybe we should try to get a namespace function into core.
This is an interesting thread on the topic (sorta):

http://stackoverflow.com/questions/527089/is-it-possible-to-create-a-nam...

Regardless, I defer to you on pretty much all JS matters, just go for it.

effulgentsia’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

Looks like this has been rolled into #1139514: Overhaul the media browser code to not use an iframe, and be more understandable, maintainable, and extendable. Please re-open this issue if you'd like it committed ahead of the other issue.

gilgabar’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Closed (duplicate) » Needs work

The issue this was to be rolled into has been closed as won't fix, so reopening this as it is still a worthwhile change.

The patch in #1 needs to be updated for the current code base and there is a stray kpr() that should be removed.

chris matthews’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

Closing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team