Permalink
Browse files

Initial revision

  • Loading branch information...
Jason Johnston
Jason Johnston committed Mar 8, 2004
0 parents commit f67e76c8fbeb7224784b067edb8645e31122000b
@@ -0,0 +1,23 @@
+<html>
+<head>
+ <title>AccessKey underlining</title>
+
+ <script type="text/javascript" src="../XBL.js"></script>
+
+ <link rel="stylesheet" type="text/css" href="AccessKey.css" />
+
+</head>
+
+<body>
+
+ <h1>Test Visible Accesskeys:</h1>
+
+ <p>
+ Here is a <a href="" accesskey="l">link</a> and here is <a href="" accesskey="a">another</a>.
+ Here's one where the <a href="" accesskey="n">accesskey is not the first letter</a>.
+ The first occurrence of the accesskey should be <a href="" accesskey="e">the only one modified</a>, even on links with <a href="" accesskey="c"><span><em>multiple</em> child</span> nodes</a>.
+ </p>
+
+
+</body>
+</html>
@@ -0,0 +1,2 @@
+*[accesskey] {-moz-binding:url(AccessKey.xml#element);}
+em.accesskey {border-bottom:1px solid; font-style:inherit;}
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<!-- XXX - doesn't work in Mozilla. Draws a blank page. -->
+
+<bindings xmlns="http://www.mozilla.org/xbl" xmlns:h="http://www.w3.org/1999/xhtml">
+ <binding id="element">
+ <implementation>
+ <constructor><![CDATA[
+ // Recursive function to find first instance of key in node and wrap it:
+ function wrapFirstChar(node,key) {
+ if(node.nodeType==1) {
+ if(node.firstChild && wrapFirstChar(node.firstChild,key)) return true;
+ if(node.nextSibling && wrapFirstChar(node.nextSibling,key)) return true;
+ } else if(node.nodeType==3) {
+ var txt = node.nodeValue;
+ var idx = txt.toLowerCase().indexOf(key.toLowerCase());
+ if(idx >= 0) { //modify the node
+ var modKey = (navigator.userAgent.indexOf("Mac")>=0) ? "Control" : "Alt";
+ var bef = txt.substring(0,idx);
+ var aft = txt.substring(idx+1);
+ var par = node.parentNode;
+ var em = document.createElement("em");
+ em.className="accesskey";
+ em.setAttribute("title","Shortcut key: " + modKey + "+" + key.toUpperCase());
+ em.appendChild(document.createTextNode(txt.charAt(idx)));
+ par.insertBefore(document.createTextNode(bef),node);
+ par.insertBefore(em,node);
+ par.insertBefore(document.createTextNode(aft),node);
+ par.removeChild(node);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // clone it and modify the clone:
+ wrapFirstChar(this, this.getAttribute("accesskey"));
+ ]]></constructor>
+ </implementation>
+ </binding>
+</bindings>
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+ <title>Test Content Centering</title>
+ <script type="text/javascript" src="XBL.js"></script>
+ <style type="text/css">
+ body {-moz-binding:url(CenteredContent.xml#body);}
+ #anon-body-container {border:1px solid blue; width:700px;} /* set the width and other styles of the new container */
+ </style>
+</head>
+<body>
+
+ <p>This is the content. Blah.</p>
+ <p>This is the content. Blah.</p>
+ <p>This is the content. Blah.</p>
+ <p>This is the content. Blah.</p>
+ <p>This is the content. Blah.</p>
+ <p>This is the content. Blah.</p>
+ <p>This is the content. Blah.</p>
+ <p>This is the content. Blah.</p>
+ <p>This is the content. Blah.</p>
+ <p>This is the content. Blah.</p>
+ <p>This is the content. Blah.</p>
+ <p>This is the content. Blah.</p>
+ <p>This is the content. Blah.</p>
+ <p>This is the content. Blah.</p>
+
+</body>
+</html>
+
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+
+<xbl:bindings xmlns:xbl="http://www.mozilla.org/xbl">
+ <xbl:binding id="body">
+ <xbl:content>
+ <table xmlns="http://www.w3.org/1999/xhtml" width="100%" height="100%">
+ <tbody><tr><td align="center" valign="middle">
+ <div id="anon-body-container" style="position:relative; text-align:left;">
+ <xbl:children />
+ </div>
+ </td></tr></tbody>
+ </table>
+ </xbl:content>
+ </xbl:binding>
+</xbl:bindings>
@@ -0,0 +1,15 @@
+<html>
+<head>
+ <style type="text/css">
+ .electronic-mail {-moz-binding:url(EmailLink.xml#email-address);}
+ </style>
+
+ <script type="text/javascript" src="XBL.js"></script>
+
+</head>
+<body>
+
+ <p>Please email me at <span class="electronic-mail">jj[at]lojjic|period|net</span>.</p>
+ <p>Or you can email me at <span class="electronic-mail" title="another email address">jason/at/lojjic\point\net</span>.</p>
+
+</body>
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<bindings xmlns="http://www.mozilla.org/xbl" xmlns:h="http://www.w3.org/1999/xhtml">
+ <binding id="email-address">
+ <implementation>
+ <field name="email">
+ var txt = this.firstChild;
+ if(txt.nodeType!=3) txt=txt.firstChild; //if anon. content not supported
+ txt.nodeValue.replace(/[ \[\{\(\|\/\\]at[ \]\}\)\|\/\\]/i, "@")
+ .replace(/[ \[\{\(\|\/\\](dot|period|point)[ \]\}\)\|\/\\]/gi, ".");
+ </field>
+ <constructor>
+ var lnk = document.getAnonymousNodes(this)[1];
+ lnk.setAttribute("href", "mailto:"+this.email);
+ lnk.firstChild.nodeValue = this.getAttribute("title") || this.email;
+ </constructor>
+ </implementation>
+ <content>
+ <h:span style="display:none"><children /></h:span>
+ <h:a href="">-</h:a>
+ </content>
+ </binding>
+</bindings>
@@ -0,0 +1,70 @@
+<html>
+<head>
+ <title>Fisheye Menu test</title>
+
+ <script type="text/javascript" src="XBL.js"></script>
+
+ <style type="text/css">
+ @import url(FisheyeMenu.css);
+
+ * {font-size:12px; font-family:Arial,sans-serif;}
+
+ #no-image {list-style-image:none !important;} /*test what happens when no icon*/
+
+
+ /* hook up the control panel: */
+ #controller {margin:10em; -moz-binding:url(FisheyeMenu.xml#controller);}
+ #controller th {text-align:right;}
+
+ </style>
+
+
+</head>
+<body>
+
+ <h1>Test OSX Bar</h1>
+
+ <ul class="fisheye-menu" id="menu">
+ <li><a href="http://lojjic.net">Label 1</a></li><!-- linked label -->
+ <li>Label 2 <!-- text label with child menu -->
+ <ul>
+ <li><a href="">Submenu</a></li>
+ <li><a href="">Submenu</a></li>
+ <li><a href="">Submenu</a></li>
+ </ul>
+ </li>
+ <li><span></span>Label 3<!-- empty element before text label -->
+ <ul>
+ <li><a href="">Submenu</a></li>
+ <li><a href="">Submenu</a></li>
+ <li><a href="">Submenu</a></li>
+ </ul>
+ </li>
+ <li><span></span><a href="TitleTips-test.html">Label 4</a></li><!-- empty element before linked label -->
+ <li id="no-image"><a href="#">Label 5</a></li>
+ <li><a href="#">Label 6</a></li>
+ <li>Label 7
+ <ul>
+ <li><a href="">Submenu</a></li>
+ <li><a href="">Submenu</a></li>
+ <li><a href="">Submenu</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Label 8</a></li>
+ <li><a href="#">Label 9</a></li>
+ <li><a href="#">Label 10</a></li>
+
+ </ul>
+
+
+
+ <style type="text/css">
+ </style>
+ <div id="controller" title="menu"></div>
+
+ <p style="margin-top:200em; margin-left:200em; text-align:right; font-size:.8em;">Making the page scroll...</p>
+
+
+
+</body>
+</html>
@@ -0,0 +1,17 @@
+/*=== Styles for Fisheye Menu ===*/
+
+.fisheye-menu {-moz-binding:url(FisheyeMenu.xml#menu); margin:0; padding:0; position:absolute;}
+ .fisheye-menu li {-moz-binding:url(FisheyeMenu.xml#icon); list-style-image:url(assets/folder-64x64.png); list-style-type:none; margin:0; padding:0; display:inline;}
+ .fisheye-menu li li {-moz-binding:none; list-style-image:none;}
+ .fisheye-menu ul {background:#FEFEFE; margin:3px 0 0; padding:0; border-top:1px solid #999; margin:3px -6px -3px;}
+ .fisheye-menu ul li {display:block; margin:0; padding:3px 0 3px 6px; border-bottom:1px solid #EEE; font-weight:normal;}
+ .fisheye-menu ul li li {border-left:4px solid #CCC;}
+ .fisheye-menu :link, .fisheye-menu :visited {display:block; color:#000; text-decoration:none;}
+ .fisheye-menu ul :link, .fisheye-menu ul :visited {display:block; margin:-3px 0 -3px -6px; padding:3px 1em 3px 6px; color:#000; text-decoration:none;}
+ .fisheye-menu ul :link:hover, .fisheye-menu ul :visited:hover {background:#EEE;}
+
+.fisheye-menu-background {background:#F0F0F0; border:1px solid #9F9F9F;}
+.fisheye-menu-icon {} /*the container for the icon image or alt*/
+.fisheye-menu-icon-img {} /*the icon image itself*/
+.fisheye-menu-icon-alt {border:1px solid #999;} /*text shown when no image*/
+.fisheye-menu-popup {width:120px; background:#EEE; border:1px solid #999; margin:0; padding:3px 6px; font-weight:bold;}
Oops, something went wrong.

0 comments on commit f67e76c

Please sign in to comment.