From 2d9cc8bf4d21c9759ea7d8fc7d869c6ce635c5d1 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Fri, 30 Sep 2011 00:07:53 -0500 Subject: [PATCH] Fix tombstone bug and an SVG-Edit regression Bug reported by Andrew Stacey --- public/javascripts/page_helper.js | 10 ++++++++-- public/stylesheets/instiki.css | 1 + public/svg-edit/editor/svg-editor.js | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/public/javascripts/page_helper.js b/public/javascripts/page_helper.js index eb510045..d5ca56f5 100644 --- a/public/javascripts/page_helper.js +++ b/public/javascripts/page_helper.js @@ -42,9 +42,15 @@ function fixRunIn() { }); // add tombstone to proof, since gecko doesn't support :last-child properly $$('div.proof').each(function(element) { - var l = element.childElements().length -1; + var el = element.childElements()[element.childElements().length-1]; var span = new Element('span').update('\u00a0\u00a0\u25ae'); - element.childElements()[l].insert(span); + if (el.match('p')) { + el.insert(span); + } else { + var par = new Element('p').update(span); + par.addClassName('tombstone'); + element.appendChild(par); + } }); } diff --git a/public/stylesheets/instiki.css b/public/stylesheets/instiki.css index 709fd3ce..1a6f72b4 100644 --- a/public/stylesheets/instiki.css +++ b/public/stylesheets/instiki.css @@ -476,6 +476,7 @@ span.theorem_label {font-style:normal; font-weight:bold;} content: " " counter(remark); counter-increment: remark;} .num_note .theorem_label:after { content: " " counter(note); counter-increment: note;} +.tombstone {text-align:right;} /* Hack for Mozilla bug 449396 */ [mathvariant="bold"] * { diff --git a/public/svg-edit/editor/svg-editor.js b/public/svg-edit/editor/svg-editor.js index 03e7d244..f4fd7f59 100644 --- a/public/svg-edit/editor/svg-editor.js +++ b/public/svg-edit/editor/svg-editor.js @@ -42,7 +42,7 @@ opacity: 1 }, initStroke: { - width: 5, + width: 2, color: '000000', // solid black opacity: 1 },