From 99b59f2d62a8e431d84a469ab31a8da101333b26 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 25 Jul 2008 01:24:20 -0400 Subject: [PATCH] toggle: Fix incompatability between javascript and webkit. --- IkiWiki/Plugin/toggle.pm | 4 ++-- debian/changelog | 1 + doc/bugs/toggle_fails_on_Safari.mdwn | 10 ++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/toggle.pm b/IkiWiki/Plugin/toggle.pm index 284eb8249..ef30fe6b6 100644 --- a/IkiWiki/Plugin/toggle.pm +++ b/IkiWiki/Plugin/toggle.pm @@ -39,9 +39,9 @@ function toggle(s) { style.display = "none"; } -function getElementsByClass(class) { +function getElementsByClass(c) { var ret = new Array(); - var pattern = new RegExp("(^|\\s)"+class+"(\\s|$)"); + var pattern = new RegExp("(^|\\s)"+c+"(\\s|$)"); var els = document.getElementsByTagName('*'); for (i = 0, j = 0; i < els.length; i++) { if ( pattern.test(els[i].className) ) { diff --git a/debian/changelog b/debian/changelog index ea5845778..f6137d72f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,7 @@ ikiwiki (2.55) UNRELEASED; urgency=low * attachment: Do not escape _ when determining attachment filenames. * Rebuild pages that change their type. (Gabriel McManus) * monotone: Add support for rename, delete, and also diff. (William Uther) + * toggle: Fix incompatability between javascript and webkit. -- Joey Hess Mon, 21 Jul 2008 11:35:46 -0400 diff --git a/doc/bugs/toggle_fails_on_Safari.mdwn b/doc/bugs/toggle_fails_on_Safari.mdwn index 12fca7084..a756ce815 100644 --- a/doc/bugs/toggle_fails_on_Safari.mdwn +++ b/doc/bugs/toggle_fails_on_Safari.mdwn @@ -14,3 +14,13 @@ Looking at the Safari Web Inspector, it believes there is a parse error on line 47 function getElementsByClass(class) { SyntaxError: Parse error 48 var ret = new Array(); + +> Reproduced in epiphany-webkit on debian. +> +> Also noticed something interesting when I opened the page in vim. It +> highlighted the "class" like a type definition, not a variable. Sure +> enough, replacing with "c" fixed it. +> +> I wonder if webkit is actually in the right here, and using a reseved +> word like, presumably, "class" as a variable name is not legal. As I try +> to ignore javascript as much as possible, I can't say. [[done]] --[[Joey]] -- 2.26.2