Closed Bug 995319 Opened 10 years ago Closed 9 years ago

update the uproot-dialog.html file to use require for as much as possible

Categories

(Webmaker Graveyard :: X-Ray Goggles, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: michiel, Assigned: michiel)

References

Details

In order to make it easier to extend functionality, we should update the script loading in uproot-dialog.html to use require() as much as possible. Ideally for everything.
Assignee: nobody → admix.snurnikov
Blocks: 968291
Status: NEW → ASSIGNED
I updated uproot-dialog.html to use requireJS. Commits are here: https://github.com/admix/goggles.webmaker.org/commits/bug995319
The only error I have now is that here: https://github.com/admix/goggles.webmaker.org/blob/bug995319/views/uproot-dialog.html#L123-L129 publication.js runs before all the dependencies from main.js will be loaded and " require(['jquery'], ... " is looking for jquery inside the js/ instead of bower/jquery/jquery.js.

To test: click "Activate X-Ray", click on "Publish" - browser console will give an error that /js/jquery.js not found (404).

I tried to put jquery.js inside the js/ and it works perfectly fine. So the solution should be here, somehow load dependencies for publication.js before it loaded. Need help.

PS: I will be off from Tuesday 22 to Saturday 26. Will come back and work more on that.
Will appreciate to any help. Thanks.
Flags: needinfo?(pomax)
what if we change it from a direct loading of publication.js to:

<script>
require(["jquery", "publication.js"], function() { /* don't really do much */ });
</script>

would that solve the jQuery availability issue?
Flags: needinfo?(pomax)
Assignee: admix.snurnikov → nobody
Assignee: nobody → pomax
Closing as part of maintenance due to inactivity
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.