Opened 12 years ago

Closed 12 years ago

#6307 closed enhancement (fixed)

[with patch, positive review] Move javascript out of python-land

Reported by: boothby Owned by: boothby
Priority: minor Milestone: sage-4.1.1
Component: notebook Keywords:
Cc: Merged in: sage-4.1.1.alpha1
Authors: Mike Hansen, Tom Boothby, Robert Miller Reviewers: Tom Boothby, Minh Van Nguyen, John Palmieri
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

As Mike Hansen noted in #5564, the javascript shouldn't be in a python file in triple-quoted strings. Unfortunately, the patch he submitted to do this bitrotted.

Attachments (3)

6307bis.patch (387.7 KB) - added by boothby 12 years ago.
trac_6307-reviewer.patch (66.9 KB) - added by mvngu 12 years ago.
reviewer patch; fixes typos
trac_6307-manifest.in.patch (743 bytes) - added by rlm 12 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 Changed 12 years ago by boothby

  • Summary changed from Move javascript out of python-land to [with patch, needs review] Move javascript out of python-land

comment:2 Changed 12 years ago by boothby

  • Component changed from algebra to notebook
  • Owner changed from tbd to boothby

comment:3 Changed 12 years ago by rlm

  • Summary changed from [with patch, needs review] Move javascript out of python-land to [with patch, positive review] Move javascript out of python-land

comment:4 Changed 12 years ago by ddrake

In #5564, mhansen mentioned that this patch breaks history; if anyone really cares about preserving history, it's easy enough with hg cp. I made a version of this patch which does exactly the same thing with respect to file contents, but also tells Mercurial about the history: http://sage.math.washington.edu/home/drake/6307bis.patch

(It's rather bigger than the patch on this ticket because it's diffing the new .js files against js.py, instead of /dev/null.)

Changed 12 years ago by boothby

comment:5 Changed 12 years ago by boothby

Very nice, I didn't know that functionality existed.

comment:6 Changed 12 years ago by boothby

  • Summary changed from [with patch, positive review] Move javascript out of python-land to [with patch, needs work] Move javascript out of python-land

doctest failure in psage.py

comment:7 Changed 12 years ago by rlm

  • Milestone changed from sage-4.1.1 to sage-4.1

comment:8 Changed 12 years ago by rlm

  • Milestone changed from sage-4.1 to sage-4.1.1

comment:9 Changed 12 years ago by boothby

  • Summary changed from [with patch, needs work] Move javascript out of python-land to [with patch, positive review] Move javascript out of python-land

I can't reproduce the error in psage.py... I'm re-marking this as a positive review.

Changed 12 years ago by mvngu

reviewer patch; fixes typos

comment:10 Changed 12 years ago by mvngu

  • Authors changed from boothby, mhansen to Mike Hansen
  • Reviewers set to Tom Boothby, Minh Van Nguyen

comment:11 Changed 12 years ago by mvngu

Once this ticket is closed, ticket #5564 should also be closed as a consequence of the patches on this ticket. Just to let people know, this has been merged in sage-4.1.1-alpha0. I can't close this ticket because I don't have the privilege to do so. Sorry, folks :-(

comment:12 Changed 12 years ago by mvngu

  • Merged in set to sage-4.1.1.alpha0
  • Resolution set to fixed
  • Status changed from new to closed

comment:13 Changed 12 years ago by mvngu

  • Summary changed from [with patch, positive review] Move javascript out of python-land to [with patch, needs work] Move javascript out of python-land

This ticket results in a corrupt repository. After merging this ticket in Sage 4.1.1.alpha0, I created a source distribution with sage -sdist 4.1.1.alpha0. Now compile that source distribution, then cd to SAGE_ROOT/devel/sage-main and do:

[mvngu@sage sage-main]$ hg st
! sage/server/notebook/templates/async_lib.js
! sage/server/notebook/templates/jmol_lib.js
! sage/server/notebook/templates/notebook_lib.js

I'm marking this ticket as "needs work" and reverting it in my merge tree.

comment:14 Changed 12 years ago by mvngu

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:15 Changed 12 years ago by rlm

Working on a fix for this right now...

comment:16 Changed 12 years ago by rlm

Rather, I have a fix, but the sdist command is taking a long time. Once that is done I can confirm that it worked.

Changed 12 years ago by rlm

comment:17 Changed 12 years ago by rlm

  • Summary changed from [with patch, needs work] Move javascript out of python-land to [with patch, needs review] Move javascript out of python-land

It works!

[rlm-book templates]$ pwd
/Users/rlmill/sage-4.1.1.alpha0.6307/dist/sage-4.1.1.alpha0.fix.test/spkg/standard/sage-4.1.1.alpha0.fix.test/sage/server/notebook/templates
[rlm-book templates]$ ls
total 208K
-rw-r--r-- 1 rlmill  786 2009-07-22 10:23 account_recovery.html
-rw-r--r-- 1 rlmill 1.5K 2009-07-22 10:23 account_settings.html
-rw-r--r-- 1 rlmill  729 2009-07-22 10:23 async_lib.js
-rw-r--r-- 1 rlmill  448 2009-07-22 10:23 banner.html
-rw-r--r-- 1 rlmill  467 2009-07-22 10:23 base.html
-rw-r--r-- 1 rlmill  440 2009-07-22 10:23 base_authenticated.html
-rw-r--r-- 1 rlmill 2.8K 2009-07-22 10:23 docs.html
-rw-r--r-- 1 rlmill  324 2009-07-22 10:23 error_message.html
-rw-r--r-- 1 rlmill  534 2009-07-22 10:23 history.html
-rw-r--r-- 1 rlmill 1.2K 2009-07-22 10:23 jmol_lib.js
-rw-r--r-- 1 rlmill  385 2009-07-22 10:23 list_top.html
-rw-r--r-- 1 rlmill 2.8K 2009-07-22 10:23 login.html
-rw-r--r-- 1 rlmill 117K 2009-07-22 10:23 notebook_lib.js
-rw-r--r-- 1 rlmill 2.3K 2009-07-22 10:23 registration.html
-rw-r--r-- 1 rlmill  284 2009-07-22 10:23 search.html
-rw-r--r-- 1 rlmill  780 2009-07-22 10:23 source_code.html
-rw-r--r-- 1 rlmill  220 2009-07-22 10:23 template_error.html
-rw-r--r-- 1 rlmill 1.3K 2009-07-22 10:23 top_bar.html
-rw-r--r-- 1 rlmill 1.2K 2009-07-22 10:23 upload.html
-rw-r--r-- 1 rlmill  324 2009-07-22 10:23 user_management.html
-rw-r--r-- 1 rlmill 6.7K 2009-07-22 10:23 worksheet_listing.html
-rw-r--r-- 1 rlmill  280 2009-07-22 10:23 yes_no.html

comment:18 Changed 12 years ago by jhpalmieri

  • Authors changed from Mike Hansen to Mike Hansen, Tom Boothby, Robert Miller
  • Reviewers changed from Tom Boothby, Minh Van Nguyen to Tom Boothby, Minh Van Nguyen, John Palmieri
  • Summary changed from [with patch, needs review] Move javascript out of python-land to [with patch, positive review] Move javascript out of python-land

The new patch should fix the repository issues.

comment:19 Changed 12 years ago by mvngu

  • Merged in changed from sage-4.1.1.alpha0 to sage-4.1.1.alpha1
  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.