ElkArte Community

Title: footnotes
Post by: emanuele on November 22, 2013, 08:13:16 am
I was playing again with them:
Code: [Select]
diff --git a/sources/Subs.php b/sources/Subs.php
index 5479fc3..82b0a3b 100644
--- a/sources/Subs.php
+++ b/sources/Subs.php
@@ -2369,8 +2369,8 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
  global $fn_num, $fn_content, $fn_count;
 
  $fn_num++;
- $fn_content[] = "<sup id=\"fn$fn_num" . "_" . "$fn_count\">$fn_num&nbsp;</sup>$m[2]<a class=\"footnote_return\" href=\"#ref$fn_num" . "_" . "$fn_count\">&crarr;</a>";
- return "<a href=\"#fn$fn_num" . "_" . "$fn_count\" id=\"ref$fn_num" . "_" . "$fn_count\">[$fn_num]</a>";'), $message);
+ $fn_content[] = "<div class=\"target\" id=\"fn$fn_num" . "_" . "$fn_count\"><sup>$fn_num&nbsp;</sup>$m[2]<a class=\"footnote_return\" href=\"#ref$fn_num" . "_" . "$fn_count\">&crarr;</a></div>";
+ return "<a class=\"target\" href=\"#fn$fn_num" . "_" . "$fn_count\" id=\"ref$fn_num" . "_" . "$fn_count\">[$fn_num]</a>";'), $message);
 
  $fn_total += $fn_num;
 
diff --git a/themes/default/css/index_light.css b/themes/default/css/index_light.css
index 8d1d288..83f9b73 100644
--- a/themes/default/css/index_light.css
+++ b/themes/default/css/index_light.css
@@ -143,6 +143,9 @@ body {
 div.bbc_footnotes {
  border-top: 1px solid #bfbfbf;
 }
+.bbc_footnotes .target:target {
+ background-color: #d8ffdf;
+}
 sup.bbc_footnotes, sup.bbc_footnotes a {
  color: #50aa3a;
  font-weight: 700;

For the result see the attachments.

Idea borrowed from wikipedia.

Push? O:-)
Title: Re: footnotes
Post by: Xarcell on November 22, 2013, 08:53:54 am
Interesting, I can definitely see that being useful. Must have in my book, but others may feel as though it's bloat.
Title: Re: footnotes
Post by: Spuds on November 22, 2013, 10:37:47 am
Sure ... seems to provide another way to style them which is good, and if folks don't like that its an easy css change for a theme.
Title: Re: footnotes
Post by: emanuele on November 22, 2013, 11:15:29 am
Committed in #1074. O:-)
Title: Re: footnotes
Post by: Nao on November 22, 2013, 11:54:28 am
1074? Is that a rev number..?
Title: Re: footnotes
Post by: emanuele on November 22, 2013, 12:02:48 pm
Nope, just the github pull request number. :D
Title: Re: footnotes
Post by: Nao on November 22, 2013, 06:13:14 pm
So many already..?
Title: Re: footnotes
Post by: emanuele on November 22, 2013, 06:31:25 pm
We were working hard. :P
It's a bit difficult do statistics since PRs are counted with issues, so it's all mixed...
Title: Re: footnotes
Post by: Nao on November 23, 2013, 03:06:21 am
Hmm yeah.

Do you know if the pull request gets updated (marked done) on the site if it's merged or rebased locally then pushed to the repo?
Title: Re: footnotes
Post by: emanuele on November 23, 2013, 05:36:15 am
Yes, they are.
I'm not sure what exactly triggers the closing (if the commit message of the merge or something else), the last I did it, I used the same commit message and after I pushed it the PR was closed.