# HG changeset patch # User Gregory Szorc # Date 1525313761 25200 # Node ID 2ead51dcde71729079750ca17f8da5f0695e6e8b # Parent 3e3acf5d6a0740a6c321fec0e56fef6422be7f2c paper: don't register click handlers with inline javascript (issue5812) The use of inline href="javascript:" undermines CSP policies that don't allow inline javascript. This commit changes the registering of the diffstat and line wrapping toggle handlers to the the global DOMContentLoaded handler, thus eliminating all inline javascript from the paper template. Differential Revision: https://phab.mercurial-scm.org/D3437 diff -r 3e3acf5d6a07 -r 2ead51dcde71 mercurial/templates/paper/changeset.tmpl --- a/mercurial/templates/paper/changeset.tmpl Mon Apr 30 17:28:59 2018 -0700 +++ b/mercurial/templates/paper/changeset.tmpl Wed May 02 19:16:01 2018 -0700 @@ -73,9 +73,9 @@ diffstat {diffsummary} - [+] + [+] @@ -83,7 +83,7 @@
-
line wrap: on
+
line wrap: on
line diff
{diff} diff -r 3e3acf5d6a07 -r 2ead51dcde71 mercurial/templates/paper/filediff.tmpl --- a/mercurial/templates/paper/filediff.tmpl Mon Apr 30 17:28:59 2018 -0700 +++ b/mercurial/templates/paper/filediff.tmpl Wed May 02 19:16:01 2018 -0700 @@ -65,7 +65,7 @@
-
line wrap: on
+
line wrap: on
line diff
{diff} diff -r 3e3acf5d6a07 -r 2ead51dcde71 mercurial/templates/paper/filerevision.tmpl --- a/mercurial/templates/paper/filerevision.tmpl Mon Apr 30 17:28:59 2018 -0700 +++ b/mercurial/templates/paper/filerevision.tmpl Wed May 02 19:16:01 2018 -0700 @@ -65,7 +65,7 @@
-
line wrap: on
+
line wrap: on
line source
        2 files changed, 2 insertions(+), 0 deletions(-)
   
-      [+]
+      [+]