Only load 3D JS on file page

Authored by Esanders on Sep 19 2018, 1:50 PM.


Only load 3D JS on file page

The JS exists to put in a placeholder and then update it for newly-
uploaded 3D files to be rendered into a 2D thumbnail. Running this on
every page is a very expensive batch for all readers for a benefit of
only a very few editors for a few seconds after they upload a file, so
instead we'll load this "only" on all File pages; this means that any
content/talk/etc. pages which transclude a non-existing 3D file will
appear slightly broken for a few seconds after it is first uploaded,
but that's a serious edge case.

What we really want is "only load this code on pages with renderings
of 3D files", but MediaWiki doesn't have support for that yet.

Bug: T204621
Change-Id: Ibe60e939d5b4924130aec8bcbe14fdcc3d72bbea