https://bugzilla.wikimedia.org/show_bug.cgi?id=58478

       Web browser: ---
            Bug ID: 58478
           Summary: Better interface for MediaHandler's to add javascript
           Product: MediaWiki
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: File management
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: bawolff...@gmail.com
                CC: aarcos.w...@gmail.com, bawolff...@gmail.com,
                    bryan.tongm...@gmail.com, fflo...@wikimedia.org,
                    gti...@wikimedia.org, mtrac...@member.fsf.org
            Blocks: 700
    Classification: Unclassified
   Mobile Platform: ---

Currently MediaHandlers add JS using the method parserTransformHook, which one
could either directly add modules to the $parser object, or add an OuputHook,
to mess with $wgOut later on.

This is not that good an interface. Besides being rather indirect way to add
resource loader modules, its (almost) impossible to trigger this from a special
page where we call transform directly, and don't have a $parser object that is
parsing something.

I'm not sure what a better interface would be. My first thought would be that
responsibility for this should not be in MediaHandler, but instead be in the
MediaTransformObject. The mto could at least have a method getModules() which
special pages could call, or perhaps something like $mto->addModulesToOutput(
$this->getOutput() ); Still less then ideal since people will be bound to
forget to call it as most media types don't need js, but still would be much
better than current situation.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to