Question: Custom JavaScript file in Galaxy
0
gravatar for ebiokit
2.4 years ago by
ebiokit10
ebiokit10 wrote:

Hi all!

I want to add some custom features to my own Galaxy instance and I need to load a new JavaScript file when Galaxy starts. Now I'm loading the JS file in /usr/local/galaxy/templates/js-app.mako as follows:

<!DOCTYPE HTML>
<html>
    <!--js-app.mako-->
    <head>
        <title>Galaxy</title>
         ...
    </head>
    <body scroll="no" class="full-content">
        ## js libraries and bundled js app (line ~43)
        ${ h.js(
            'bundled/libs.bundled',
            'bundled/' + js_app_name + '.bundled',
            'MY_JAVASCRIPT_FILE.js'
        )}
        ...
    </body>
</html>
...

However, I'm pretty sure that there is an easier and more correct way to do it.

Any ideas?

Many thanks!!

​—

Rafa

javascript development galaxy • 692 views
ADD COMMENTlink modified 2.3 years ago by carlfeberhard390 • written 2.4 years ago by ebiokit10
0
gravatar for carlfeberhard
2.3 years ago by
carlfeberhard390
United States
carlfeberhard390 wrote:

That way will load via a script tag with a cache buster. It'll have access to all the globals we currently use (requirejs, jquery, backbone, etc.) and most of the app is decorated onto the global object Galaxy.

Although not entirely ideal, that spot is as good a place as any currently. Is there something missing that could be added to help your goals?

ADD COMMENTlink written 2.3 years ago by carlfeberhard390
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 167 users visited in the last hour