Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#7332 closed defect (fixed)

Escape css id's and classes in templates

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

Status badges

Description

Currently, some css id's and classes have illegal values ('admin/0', for example, in worksheet_listing.html). This prevents jQuery and Selenium from accessing those attributes.

This adds a filter to produce legal values from those values.

Attachments (3)

trac_7332-css-escape.patch (3.0 KB) - added by timdumol 12 years ago.
Adds css_escape filter and makes worksheet_listing.html use it.
trac_7332-css-escape.2.patch (3.6 KB) - added by timdumol 12 years ago.
Fixed notebook_lib.js so that the checkboxes work after the patch.
trac_7332-css-escape.3.patch (3.9 KB) - added by mpatel 12 years ago.
Also fix the overall checkbox ("controlbox"). Apply only this patch.

Download all attachments as: .zip

Change History (10)

Changed 12 years ago by timdumol

Adds css_escape filter and makes worksheet_listing.html use it.

comment:1 Changed 12 years ago by timdumol

  • Authors set to Tim Dumol
  • Status changed from new to needs_review

Changed 12 years ago by timdumol

Fixed notebook_lib.js so that the checkboxes work after the patch.

comment:2 Changed 12 years ago by timdumol

Deepends on #7310.

Changed 12 years ago by mpatel

Also fix the overall checkbox ("controlbox"). Apply only this patch.

comment:3 Changed 12 years ago by mpatel

  • Reviewers set to Mitesh Patel

Version 3:

  • Rebased against #7309, #7310. For some reason, I got
    applying trac_7332-css-escape.2.patch
    patching file sagenb/notebook/template.py
    Hunk #1 FAILED at 15
    Hunk #3 FAILED at 75
    2 out of 3 hunks FAILED -- saving rejects to file sagenb/notebook/template.py.rej
    patch failed, unable to continue (try -v)
    patch failed, rejects left in working dir
    
    but the failures were inconsequential.
  • Fixes the overall checkbox in notebook_lib.js.

To the extent it counts, my review is positive.

comment:4 Changed 12 years ago by was

  • Status changed from needs_review to positive_review

Looks good to me.

comment:5 Changed 12 years ago by was

  • Milestone changed from sage-4.3 to sage-4.2.1
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:6 Changed 12 years ago by mpatel

  • Report Upstream set to N/A

On this sage-devel thread: I forgot to account for dots ('.') in login names. A quick fix: In sagenb/data/sage/js/notebook_lib.js's check_worksheet_filenames, replace

        id = worksheet_filenames[i].replace('/', '-');

with

        id = worksheet_filenames[i].replace(/[\/.]/g, '-');

I'll open a new ticket and add a patch, once I'm confident I haven't missed other special characters.

comment:7 Changed 12 years ago by mpatel

See #7811.

Note: See TracTickets for help on using tickets.