added doc Anchors

Project: http://git-wip-us.apache.org/repos/asf/celix-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix-site/commit/3214a1d0
Tree: http://git-wip-us.apache.org/repos/asf/celix-site/tree/3214a1d0
Diff: http://git-wip-us.apache.org/repos/asf/celix-site/diff/3214a1d0

Branch: refs/heads/asf-site
Commit: 3214a1d0272cb8c5d36690f026e1d3af3253cc26
Parents: ece5efd
Author: ESmink <[email protected]>
Authored: Thu Dec 7 11:38:01 2017 +0100
Committer: ESmink <[email protected]>
Committed: Thu Dec 7 11:38:01 2017 +0100

----------------------------------------------------------------------
 build.py                           |  1 -
 src/noprocess/import/javascript.js | 13 +++++++++++--
 src/noprocess/import/style.css     | 12 ++++++++++++
 3 files changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix-site/blob/3214a1d0/build.py
----------------------------------------------------------------------
diff --git a/build.py b/build.py
index 00d4097..7928cce 100755
--- a/build.py
+++ b/build.py
@@ -92,7 +92,6 @@ for title in root:
                        if(i2 > i3 or i3 > file.find('\n', i + 3)):
                                i += 3
                                continue
-                       print(file[i:i3] + "|" + file[i2 + 1:i3])
                        # copy images here
                        with 
open(fl.find('path').text[:fl.find('path').text.rfind('/') + 1] + file[i2 + 
1:i3]) as src:
                                with 
open(fl.find('dest').text[:fl.find('dest').text.rfind('/') + 1] + file[i2 + 
1:i3], 'w') as dest:dest.write(src.read())

http://git-wip-us.apache.org/repos/asf/celix-site/blob/3214a1d0/src/noprocess/import/javascript.js
----------------------------------------------------------------------
diff --git a/src/noprocess/import/javascript.js 
b/src/noprocess/import/javascript.js
index 400e09d..3464e37 100755
--- a/src/noprocess/import/javascript.js
+++ b/src/noprocess/import/javascript.js
@@ -1,7 +1,16 @@
 //make links to the same page unclickable
 links = document.getElementsByTagName('a')
+url = location.origin + location.pathname
 for(i = 0;i < links.length;i++){       
-       if(links[i].href == window.location.href){
-               links[i].style = 'font-weight: bold;pointer-events: 
none;cursor: default;-webkit-user-select: none;-moz-user-select: 
none;-ms-user-select: none;user-select: none'      
+       if(links[i].href == url){
+               links[i].style = 'font-weight: bold;pointer-events: 
none;cursor: default;-webkit-user-select: none;-moz-user-select: 
none;-ms-user-select: none;user-select: none'
+               //add doc anchors
+               if(links[i].parentElement.tagName == 'TD'){
+                       titles = document.getElementsByTagName('h2')
+                       for(o = 0;o < titles.length;o++){
+                               titles[o].id = titles[o].innerHTML.replace(/ 
/g, '_')
+                               links[i].parentElement.innerHTML += '<br><a 
style="font-family: timesnewroman;" href="#' + titles[o].id + '">' + 
titles[o].innerHTML + '</a>'
+                       }
+               }
        }
 }

http://git-wip-us.apache.org/repos/asf/celix-site/blob/3214a1d0/src/noprocess/import/style.css
----------------------------------------------------------------------
diff --git a/src/noprocess/import/style.css b/src/noprocess/import/style.css
index 849fa52..461bbf9 100755
--- a/src/noprocess/import/style.css
+++ b/src/noprocess/import/style.css
@@ -239,6 +239,18 @@ a {
        padding: 5px;
 }
 
+#docContent h2{
+       padding-top: 80px;
+       margin-top: -80px;
+}
+
+#footText {
+       color: white;
+       font-size: 12px;
+       background: #2CB9EC;
+       padding: 4px;
+}
+
 @media screen and (max-width: 1140px) {
        #APbig{display:none}
        #APsmall{display:block}

Reply via email to