toggle: Fix incompatability between javascript and webkit.
authorJoey Hess <joey@kodama.kitenet.net>
Fri, 25 Jul 2008 05:24:20 +0000 (01:24 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Fri, 25 Jul 2008 05:24:20 +0000 (01:24 -0400)
IkiWiki/Plugin/toggle.pm
debian/changelog
doc/bugs/toggle_fails_on_Safari.mdwn

index 284eb8249df031e77f2e1ff1796d19624bbae1cf..ef30fe6b6ddce2349820da08401c2ccf376845a8 100644 (file)
@@ -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) ) {
index ea5845778ff7d10ad24d99978501011a86a17ff3..f6137d72f61c37b9ee71837e13ac25876af894bc 100644 (file)
@@ -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 <joeyh@debian.org>  Mon, 21 Jul 2008 11:35:46 -0400
 
index 12fca7084ac7d351a6766f49f607009444dc2426..a756ce81574d76c6256df1e7cf4c9c3625a4f93a 100644 (file)
@@ -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]]