[slf4j-dev] [GIT] SLF4J: Simple Logging Facade for Java branch master updated. v_1.6.6-10-g2e49281

Gitbot git-noreply at pixie.qos.ch
Thu Jul 12 00:27:19 CEST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SLF4J: Simple Logging Facade for Java".

The branch, master has been updated
       via  2e4928103e219e4deaf4576e105e70fd9945e9d8 (commit)
      from  d8eb296c9cefde451647fb5e7a6a409943b98b85 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=slf4j.git;a=commit;h=2e4928103e219e4deaf4576e105e70fd9945e9d8
http://github.com/ceki/slf4j/commit/2e4928103e219e4deaf4576e105e70fd9945e9d8

commit 2e4928103e219e4deaf4576e105e70fd9945e9d8
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Thu Jul 12 00:25:15 2012 +0200

    without scrolling anchors are useless

diff --git a/slf4j-site/src/site/pages/js/decorator.js b/slf4j-site/src/site/pages/js/decorator.js
index 7fe202e..6c4b806 100644
--- a/slf4j-site/src/site/pages/js/decorator.js
+++ b/slf4j-site/src/site/pages/js/decorator.js
@@ -4,12 +4,26 @@
 //    class="anchor"/></a>Logger context</h3>
 
 function decorate() {
-  decoratePropertiesInTables();
-  decorateDoAnchor();
+  var anchor = findAnchorInURL(document.URL);
+  decoratePropertiesInTables(anchor);
+  decorateDoAnchor(anchor);
   decorateConversionWordInTables();
 }
 
-function decoratePropertiesInTables() {
+// ----------------------------------------------
+function findAnchorInURL(url) {
+
+ if(url == null) return null
+  var index = url.lastIndexOf("#");
+  if(index != -1 && (index+1) < url.length) 
+    return url.substr(index+1);
+  else 
+    return null;
+}
+
+// ----------------------------------------------
+function decoratePropertiesInTables(anchor) {
+
  //if(1==1) return;
  var elems = $('tr td:first-child span.prop');
 
@@ -21,7 +35,7 @@ function decoratePropertiesInTables() {
    var tmpHTML = p.innerHTML;
    var propName = e.innerHTML;
    var nameAttr = $(e).attr('name')
-   
+    
    if(nameAttr == null) {
      var containerAttr = $(e).attr('container')
      if(containerAttr != null) 
@@ -29,9 +43,10 @@ function decoratePropertiesInTables() {
      else 
        nameAttr = propName;
    }
-  
+   
    p.innerHTML = "<a name='" + nameAttr + "' href='#" + nameAttr +
                 "'><span class='anchor'/></a><b>" +tmpHTML +"</b>";
+   scrollIfMatch(p, nameAttr, anchor);
  } // for 
 }
 
@@ -45,11 +60,12 @@ function decorateConversionWordInTables() {
      continue;
    e.innerHTML = "<a name='" + nameAttr + "' href='#" + nameAttr +
                 "'><span class='anchor'/></a>" +tmpHTML;
+   scrollIfMatch(e, nameAttr, anchor);
  }
 }
 
 
-function decorateDoAnchor() {
+function decorateDoAnchor(anchor) {
    var elems = $('.doAnchor');
    for(var i = 0; i < elems.length; i++) {
      var e = elems[i];
@@ -60,9 +76,17 @@ function decorateDoAnchor() {
      }
      e.innerHTML = "<a name='" + nameAttr + "' href='#" + nameAttr +
                 "'><span class='anchor'/></a>" +tmpHTML;
+     scrollIfMatch(e, nameAttr, anchor);
    }
 } 
 
+function scrollIfMatch(element, nameAttr, anchor) {
+  if(anchor != null && nameAttr.toString() == anchor)
+     element.scrollIntoView(true);
+
+
+}
+
 function capitaliseFirstLetter(str) {
   return str.charAt(0).toUpperCase() + str.slice(1);
 }

-----------------------------------------------------------------------

Summary of changes:
 slf4j-site/src/site/pages/js/decorator.js |   36 ++++++++++++++++++++++++-----
 1 files changed, 30 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
SLF4J: Simple Logging Facade for Java


More information about the slf4j-dev mailing list