In LMS, load OVA JS only in four OVA templates with requireJS. [TNL-693]

To avoid having OVA JS files loaded in every page of the LMS and therefore clash with edXNotes, remove their entries from ```PIPELINE_JS``` in ```common.py``` and load them instead, via requireJS, in the 4 OVA templates: ```imageannotation.html```, ```notes.html```, ```text annotation.html```, and ```videoannotation.html```.

@jimabramson, @explorerleslie Please review.

Alternatively, we can also load the OVA JS in the 4 templates by using ```PIPELINE_JS``` and defining a new group called ```ova_js```:
https://github.com/edx/edx-platform/compare/jmclaus/load_ova_js_from_templates

This runs into a problem though. The following line for example will always be executed:
https://github.com/edx/edx-platform/blob/5cc0e023103475850c6ad1d77fa0a31605f69bb9/lms/templates/videoannotation.html#L203
But in Studio, we'd like to use requireJS:
https://github.com/edx/edx-platform/blob/5cc0e023103475850c6ad1d77fa0a31605f69bb9/lms/templates/videoannotation.html#L206
Good point, OK thanks.

So if I understand correctly, under the present setup, performance/behavior
improves a little for most pages since ova is not loaded all the time
anymore, otherwise it's unchanged.

On the few pages using ova:
a) first load performance will degrade somewhat due to adding a number of
new individual files to download
b) a user behind a proxy that refuses to cache urls with query strings will
be downloading all these files on all loads, not just the first.

I'm concerned about the impact of this on low-bandwidth users, but if I've
misunderstood or I'm missing how the solution addresses this issue, then
I'll withdraw that concern.


On Fri, Nov 7, 2014 at 7:21 AM, Anton Stupak <notifications@github.com>
wrote:

> In lms/templates/main.html:
>
> > @@ -70,6 +71,23 @@
> >      <%static:js group='main_vendor'/>
> >    % endif
> >
> > +  <script>
> > +    window.baseUrl = "${settings.STATIC_URL}";
> > +    (function (require) {
> > +    % if settings.DEBUG is True:
> > +        ## Using what amounts to a random number in the Development environment for cache-busting
> > +        var urlArgs = "bust=" + (new Date()).getTime();
> > +    % else:
> > +        var urlArgs = "v=${git.revision}";
>
>  there are some warnings against using this technique discussed in this
> SO topic, and an alternate suggestion to revision the filenames by
> directory instead of query string. Would that be a feasible alternative in
> this case?
>
> @andy-armstrong <https://github.com/andy-armstrong> I think, no. We
> should change STATIC_URL for LMS to use directory instead of query string.
> In this case, performance degradation occurs for all static (not only for
> loaded via requirejs).
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/edx/edx-platform/pull/5829/files#r20007423>.
>