You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by lh...@apache.org on 2010/10/08 23:17:58 UTC

svn commit: r1006026 [5/5] - in /shiro/site-template: ./ src/ src/main/ src/main/webapp/ src/main/webapp/WEB-INF/ src/main/webapp/static/ src/main/webapp/static/assets/ src/main/webapp/static/assets/css/ src/main/webapp/static/assets/images/ src/main/w...

Added: shiro/site-template/src/main/webapp/static/assets/js/superfish-1.4.8/js/supersubs.js
URL: http://svn.apache.org/viewvc/shiro/site-template/src/main/webapp/static/assets/js/superfish-1.4.8/js/supersubs.js?rev=1006026&view=auto
==============================================================================
--- shiro/site-template/src/main/webapp/static/assets/js/superfish-1.4.8/js/supersubs.js (added)
+++ shiro/site-template/src/main/webapp/static/assets/js/superfish-1.4.8/js/supersubs.js Fri Oct  8 21:17:55 2010
@@ -0,0 +1,90 @@
+
+/*
+ * Supersubs v0.2b - jQuery plugin
+ * Copyright (c) 2008 Joel Birch
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * 	http://www.opensource.org/licenses/mit-license.php
+ * 	http://www.gnu.org/licenses/gpl.html
+ *
+ *
+ * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
+ * their longest list item children. If you use this, please expect bugs and report them
+ * to the jQuery Google Group with the word 'Superfish' in the subject line.
+ *
+ */
+
+;(function($){ // $ will refer to jQuery within this closure
+
+	$.fn.supersubs = function(options){
+		var opts = $.extend({}, $.fn.supersubs.defaults, options);
+		// return original object to support chaining
+		return this.each(function() {
+			// cache selections
+			var $$ = $(this);
+			// support metadata
+			var o = $.meta ? $.extend({}, opts, $$.data()) : opts;
+			// get the font size of menu.
+			// .css('fontSize') returns various results cross-browser, so measure an em dash instead
+			var fontsize = $('<li id="menu-fontsize">&#8212;</li>').css({
+				'padding' : 0,
+				'position' : 'absolute',
+				'top' : '-999em',
+				'width' : 'auto'
+			}).appendTo($$).width(); //clientWidth is faster, but was incorrect here
+			// remove em dash
+			$('#menu-fontsize').remove();
+			// cache all ul elements
+			$ULs = $$.find('ul');
+			// loop through each ul in menu
+			$ULs.each(function(i) {	
+				// cache this ul
+				var $ul = $ULs.eq(i);
+				// get all (li) children of this ul
+				var $LIs = $ul.children();
+				// get all anchor grand-children
+				var $As = $LIs.children('a');
+				// force content to one line and save current float property
+				var liFloat = $LIs.css('white-space','nowrap').css('float');
+				// remove width restrictions and floats so elements remain vertically stacked
+				var emWidth = $ul.add($LIs).add($As).css({
+					'float' : 'none',
+					'width'	: 'auto'
+				})
+				// this ul will now be shrink-wrapped to longest li due to position:absolute
+				// so save its width as ems. Clientwidth is 2 times faster than .width() - thanks Dan Switzer
+				.end().end()[0].clientWidth / fontsize;
+				// add more width to ensure lines don't turn over at certain sizes in various browsers
+				emWidth += o.extraWidth;
+				// restrict to at least minWidth and at most maxWidth
+				if (emWidth > o.maxWidth)		{ emWidth = o.maxWidth; }
+				else if (emWidth < o.minWidth)	{ emWidth = o.minWidth; }
+				emWidth += 'em';
+				// set ul to width in ems
+				$ul.css('width',emWidth);
+				// restore li floats to avoid IE bugs
+				// set li width to full width of this ul
+				// revert white-space to normal
+				$LIs.css({
+					'float' : liFloat,
+					'width' : '100%',
+					'white-space' : 'normal'
+				})
+				// update offset position of descendant ul to reflect new width of parent
+				.each(function(){
+					var $childUl = $('>ul',this);
+					var offsetDirection = $childUl.css('left')!==undefined ? 'left' : 'right';
+					$childUl.css(offsetDirection,emWidth);
+				});
+			});
+			
+		});
+	};
+	// expose defaults
+	$.fn.supersubs.defaults = {
+		minWidth		: 9,		// requires em unit.
+		maxWidth		: 25,		// requires em unit.
+		extraWidth		: 0			// extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
+	};
+	
+})(jQuery); // plugin code ends

Added: shiro/site-template/src/main/webapp/template.html
URL: http://svn.apache.org/viewvc/shiro/site-template/src/main/webapp/template.html?rev=1006026&view=auto
==============================================================================
--- shiro/site-template/src/main/webapp/template.html (added)
+++ shiro/site-template/src/main/webapp/template.html Fri Oct  8 21:17:55 2010
@@ -0,0 +1,109 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+##
+#set ($siteroot = "http://shiro.apache.org/")
+#set ($assets = "$siteroot/static/assets")
+#set ($pageContentHeaderEnabled = false)
+#set ($globalHelper = $action.getHelper())
+#set ($renderer = $globalHelper.getWikiStyleRenderer())
+##
+#if ( $page.title.equals("Index") )
+    #set ($title = "Application Security Framework")
+#else
+    #set ($title = $page.title)
+#end
+##
+<html>
+<head>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8">
+    <title>Apache Shiro - Welcome to Apache Shiro</title>
+
+    <link rel="stylesheet" type="text/css"
+          href="http://yui.yahooapis.com/2.8.1/build/reset-fonts-grids/reset-fonts-grids.css">
+    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.1/build/base/base-min.css">
+    <link rel="stylesheet" type="text/css" href="/static/assets/js/superfish-1.4.8/css/superfish.css" media="screen">
+    <link rel="stylesheet" type="text/css" href="/static/assets/css/confluence.css" media="screen">
+    <link rel="stylesheet" type="text/css" href="/static/assets/css/style.css"/>
+    <link rel="icon" type="image/vnd.microsoft.icon" href="/static/assets/images/favicon.ico">
+
+    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
+    <script type="text/javascript" src="/static/assets/js/jquery_gradient/jquery.dimensions.js"></script>
+    <script type="text/javascript" src="/static/assets/js/jquery_gradient/jquery.gradient.js"></script>
+    <script type="text/javascript" src="/static/assets/js/superfish-1.4.8/js/hoverIntent.js"></script>
+    <script type="text/javascript" src="/static/assets/js/superfish-1.4.8/js/superfish.js"></script>
+    <script type="text/javascript" src="/static/assets/js/superfish-1.4.8/js/supersubs.js"></script>
+    <script type="text/javascript" src="/static/assets/js/jquery_googleanalytics/jquery.google-analytics.js"></script>
+    <script type="text/javascript">
+        // initialise plugins
+
+        //note that we can't use the simplified dollar-sign based jquery notation as it messes with
+        //velocity's variable reference syntax.  Since the dollar sign is just an alias for the 'jQuery' global
+        //object, we use 'jQuery' explicitly below instead to avoid this conflict:
+        jQuery(function() {
+
+            //Nav bar gradient shading:
+            $('#navlist').gradient({
+                from:      '4273ca',
+                to:        '03148f',
+                direction: 'horizontal'
+            });
+            $('#navlist li').gradient({
+                from:      '4273ca',
+                to:        '03148f',
+                direction: 'horizontal'
+            });
+            $('#navlist ul').gradient({
+                from:      '4273ca',
+                to:        '03148f',
+                direction: 'horizontal'
+            });
+
+            //Nav bar: Supersubs dropdown menus
+            $('ul.sf-menu').supersubs({extraWidth: 1}).superfish({animation:{opacity:'show',height:'show'}});
+
+            //Google Analytics
+            $.trackPage('UA-11551827-1');
+        });
+    </script>
+</head>
+<body>
+
+    <div id="page">
+
+        <div id="header">
+            <img src="/static/assets/images/shiro_logo_484x170.png" alt="Apache Shiro"/>
+            <div id="navbar">
+                #set($child = $pageManager.getPage($page.space.key,"Navigation"))
+                #set($content = $renderer.convertWikiToXHtml($child.toPageContext(), $child.content).trim())
+                #set($content = $content.replaceAll("^<[pP]>|</[pP]>$", "") )
+                $content
+            </div>
+        </div>
+
+        <div id="center">
+            $body
+        </div> <!-- end #center -->
+
+        <div id="footer">
+            Copyright &copy; 2008-2010 The Apache Software Foundation
+        </div>
+
+    </div> <!-- end #page -->
+
+</body>
+</html>
\ No newline at end of file