Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#7309 closed enhancement (fixed)

SageNB -- Restructure /javascript/ to have /javascript/sage/

Reported by: timdumol Owned by: boothby
Priority: minor Milestone: sage-4.2.1
Component: notebook Keywords:
Cc: was, mpatel Merged in:
Authors: Tim Dumol, Mitesh Patel Reviewers: Mitesh Patel
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

The url layout serves main.js and keyboard/ under /javascript/, yet serves everything else under its own directory -- /javascript/jquery/, /javascript/sage3d, etc. This patch moves main.js and keyboard/ under /javascript/sage/.

Attachments (2)

trac_7309-javascript-sage.patch (7.0 KB) - added by timdumol 11 years ago.
Adds /javascript/sage/ and updates notebook_lib.js and the html templates to use it.
trac_7309-javascript-sage_v2.patch (8.9 KB) - added by mpatel 11 years ago.
Fix TinyMCE init URL. See comment. Apply only this patch. Apply to sagenb repository.

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by timdumol

Adds /javascript/sage/ and updates notebook_lib.js and the html templates to use it.

comment:1 Changed 11 years ago by timdumol

  • Cc was mpatel added

comment:2 Changed 11 years ago by timdumol

  • Status changed from new to needs_review

Changed 11 years ago by mpatel

Fix TinyMCE init URL. See comment. Apply only this patch. Apply to sagenb repository.

comment:3 Changed 11 years ago by mpatel

Version 2

  • Updates tinymce.js's URL in head.tmpl.
  • Deletes notebook.list_window.javascript().
  • Maps sagenb/data/sage/js to /javascript/sage.

Note: All of sagenb/data/sage is still accessible via /java/sage.

My original motivation for the admittedly unorthodox /data/package URLs for package in [jsmath, jquery, sage, ...] was that most non-trivial packages are a mix of HTML, CSS, images, JS, and/or Java, so it's better to group by package than by JS and Java, say. But I did not realize the importance of the static-dynamic distinction, as you emphasized. Two possibilities:

  • Serve sagenb/data/package as /static/package, since most of the files are static.
  • Serve a package's dynamic files under /javascript/package, /images/package, /css/package, etc.
  • That is, serve
    • main.js from /javascript/sage/main.js and similarly for keyboard.
    • main.css from /css/sage/main.css.

Or:

  • Serve sagenb/data/package as /something/package, where something could be a better name than data.
  • Serve the dynamic files from the same structure but overlaid virtually in twist.
  • That is, serve
    • main.js from /something/sage/js/main.js and similarly for keyboard.
    • main.css from /something/sage/css/main.css.

In either case, we could, I think, still use a fast separate server (e.g., nginx) for the static files. Or we could be explicit, e.g.,

<script type="text/javascript" src="{% if static_server_url %}{{ static_server_url }}{% endif %}/[...]/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="{% if dynamic_server_url %}{{ dynamic_server_url }}{% endif %}/[...]/main.js"></script>

But I'm sure there are other options. What do you think?

comment:4 Changed 11 years ago by mpatel

  • Authors changed from Tim Dumol to Tim Dumol, Mitesh Patel
  • Reviewers set to Mitesh Patel

To the extent that it counts, my review is positive.

comment:5 Changed 11 years ago by was

  • Resolution set to fixed
  • Status changed from needs_review to closed

merged into sagenb-0.4.2 (sage-4.2.1)

comment:6 Changed 11 years ago by was

(by the way mpatel gave it a positive-ish review, and I give it a positive review).

comment:7 Changed 11 years ago by was

  • Milestone set to sage-4.2.1
Note: See TracTickets for help on using tickets.