Repository: shiro-site
Updated Branches:
  refs/heads/master 7df034f5a -> c4731cd49


Add link to footer to edit current page on GitHub if 'ghEditPage' is present


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

Branch: refs/heads/master
Commit: a4a596289a1774ba62647f019ded3219e4c71382
Parents: 7df034f
Author: Brian Demers <[email protected]>
Authored: Mon Oct 24 12:08:11 2016 -0400
Committer: Brian Demers <[email protected]>
Committed: Mon Oct 24 12:08:11 2016 -0400

----------------------------------------------------------------------
 assets/css/style.css    |  5 +++++
 assets/js/shiro-site.js | 16 ++++++++++++++++
 templates/default.vtl   |  9 +++++++++
 3 files changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/shiro-site/blob/a4a59628/assets/css/style.css
----------------------------------------------------------------------
diff --git a/assets/css/style.css b/assets/css/style.css
index e320b79..63ef54f 100644
--- a/assets/css/style.css
+++ b/assets/css/style.css
@@ -357,4 +357,9 @@ ul.navigation a {
 .warning {
        color: #9F6000;
        background-color: #FEEFB3;
+}
+
+.editThisPage {
+       position:absolute; bottom:2%; right:2%;
+       font-size:16px;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/shiro-site/blob/a4a59628/assets/js/shiro-site.js
----------------------------------------------------------------------
diff --git a/assets/js/shiro-site.js b/assets/js/shiro-site.js
new file mode 100644
index 0000000..9a74c76
--- /dev/null
+++ b/assets/js/shiro-site.js
@@ -0,0 +1,16 @@
+
+function addPageEditLink() {
+
+    var ghRepo = "apache/shiro-site";
+    var ghRelHref = "https://github.com/"; + ghRepo + "/edit/master/";
+
+    var ghEditPageElement = $( "#ghEditPage" );
+    var editThisPageElement = $(".editThisPage");
+
+        if (ghEditPageElement && ghEditPageElement.val() && 
editThisPageElement) {
+            var relGHPage = ghEditPageElement.val();
+
+            var ghEditHref = ghRelHref + relGHPage;
+            editThisPageElement.append("<a href='" + ghEditHref + "'>Edit this 
Page on Github</a>");
+        }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/shiro-site/blob/a4a59628/templates/default.vtl
----------------------------------------------------------------------
diff --git a/templates/default.vtl b/templates/default.vtl
index 407c4cb..bcec194 100644
--- a/templates/default.vtl
+++ b/templates/default.vtl
@@ -56,6 +56,7 @@
     <link rel="stylesheet" 
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/styles/default.min.css";
 integrity="sha256-Zd1icfZ72UBmsId/mUcagrmN7IN5Qkrvh75ICHIQVTk=" 
crossorigin="anonymous" />
     <script type="text/javascript" 
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/highlight.min.js";
 integrity="sha256-s63qpgPYoQk+wv3U6WZqioVJrwFNBTgD4dkeegLuwvo=" 
crossorigin="anonymous"></script>
 
+    <script type="text/javascript" 
src="$root/assets/js/shiro-site.js"></script>
     <script type="text/javascript" 
src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js";></script>
     <script type="text/javascript" 
src="$root/assets/js/jquery_googleanalytics/jquery.google-analytics.js"></script>
     <script>hljs.initHighlightingOnLoad();</script>
@@ -65,6 +66,10 @@
             //Google Analytics
             jQuery.trackPage('UA-11551827-1');
         });
+
+        $( document ).ready(function() {
+            addPageEditLink();
+        });
     </script>
 </head>
 
@@ -102,6 +107,10 @@
             <a 
href="http://www.apache.org/foundation/contributing.html";>Donate to the ASF</a> 
|
             <a 
href="http://www.apache.org/licenses/LICENSE-2.0.html";>License</a>
             <p>Copyright &copy; 2008-$year The Apache Software Foundation</p>
+
+            <div class="editThisPage">
+            </div>
+
             <div class="footer-shield"></div>
 
         </div> <!--END FOOTER WRAPPER-->

Reply via email to