ANNEAUX
sources code / source data / code page / exemple
--------------------
code
exemple : "http://www.a-nous-la-liberte.org/hhttpp/ring/mwrcode.js"
/*
* Test de Webrings JS pour Francis
* Copyright (c) 2001 - Sébastien
* mailto:seb-web@arcturus.crt1.net
* http://arcturus.crt1.net/
/* Déclarations et définitions globales */function ring(sites)
{
this.sites = sites;
this.printSite = printSite;
this.findOurURLIndex = findOurURLIndex;
this.getRndURL = getRndURL;
this.getRelURL = getRelURL;
this.goRndURL = goRndURL;
this.goRelURL = goRelURL;
this.test = test;
}function printSite(num)
{
document.writeln(this.sites[num]);
}function findOurURLIndex()
{
var index = 0;for (var i = 0; i < this.sites.length; ++i)
if (document.URL.match(this.sites[i]))
index = i;
return index;
}function getRndURL()
{
var idx;while ((idx = Math.floor((this.sites.length-1)*Math.random())) == this.findOurURLIndex())
;return this.sites[idx];
}function getRelURL(delta)
{
var idx = ((this.findOurURLIndex() - delta) % this.sites.length);
return this.sites[(idx < 0) ? idx + this.sites.length : idx];
}function goRndURL()
{
window.open(this.getRndURL(), "ring");
}function goRelURL(delta)
{
window.open(this.getRelURL(delta), "ring");
}
/* Initialisation */
/* Fonctions de test */
function test()
{ document.writeln("<hr>------Ring mwrcode.js : ---------- ");
document.writeln(" <br>This page : "+ document.location.pathname);
document.writeln(" <br>cur site pos 0: " + this.getRelURL(0));
document.writeln(" <br>------ Navigtion <======= ---- ");
document.writeln(" <br>Prev 5: " + this.getRelURL(-5));
document.writeln(" <br>Prev 4: " + this.getRelURL(-4));
document.writeln(" <br>Prev 3: " + this.getRelURL(-3));
document.writeln(" <br>Prev 2: " + this.getRelURL(-2));
document.writeln(" <br>Prev 1: " + this.getRelURL(-1));
document.writeln(" <br>------ Navigtion ======> --- ");
document.writeln(" <br>Next 1: " + this.getRelURL(1));
document.writeln(" <br>Next 2 " + this.getRelURL(2));
document.writeln(" <br>Next 3: " + this.getRelURL(3));
document.writeln(" <br>Next 4: " + this.getRelURL(4));
document.writeln(" <br>Next 5: " + this.getRelURL(5));
document.writeln(" <br>------ Navigtion ? ---------- ");
document.writeln(" <br>Random: " + this.getRndURL() +"<hr>");}
Data
exemple : "http://www.a-nous-la-liberte.org/hhttpp/ring/exemple/handicap.js"Les données sont présentées sous formes d'une matrice;
avec comme donnée l'URL complete du site
/*
* Test de Webrings JS pour Francis
* Copyright (c) 2001 - Sébastien
* mailto:seb-web@arcturus.crt1.net
* http://arcturus.crt1.net/
/* Déclarations et définitions globales */
/*
Declarations et definitions globales
rem : Le nom du newring devra être passer
en argument dans les appels du script
*/handicap = new ring ([
"http://www.a-nous-la-liberte.org/hhttpp/ring/handicap/index.html",
"http://www.a-nous-la-liberte.org/hhttpp/ring/handicap/portal.html",
"http://www.a-nous-la-liberte.org/hhttpp/ring/test/2choixcss.html",
"http://www.a-nous-la-liberte.org/hhttpp/ring/test/1.html",
"http://www.a-nous-la-liberte.org/hhttpp/ring/test/2.html",
"http://www.a-nous-la-liberte.org/hhttpp/ring/test/4.html",
"http://www.a-nous-la-liberte.org/hhttpp/ring/handicap/join.html",
"http://www.a-nous-la-liberte.org/hhttpp/ring/test/6.html",
"http://www.a-nous-la-liberte.org/hhttpp/ring/test/8.html",
"http://www.a-nous-la-liberte.org/hhttpp/ring/test/10.html",
"http://www.a-nous-la-liberte.org/hhttpp/ring/handicap/portal.html"
]);
La page qui utilise l'anneau
elle peut incorporer
- une fonction de test facultative
- des liens absolus,
- des appels à des boutons,
- des images,
- et des zones à cliquer
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Tillemans Francis">
<meta name="GENERATOR" content="Mozilla/4.7 [fr] (Win98; I) [Netscape]">
<title>Webring demo page</title>
<script language="javascript" type="text/javascript" src="http://www.a-nous-la-liberte.org/hhttpp/ring/mwrcode.js"></script>
<script language="javascript" type="text/javascript"
src="http://www.a-nous-la-liberte.org/hhttpp/ring/exemple/handicap.js"></script>
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#804040" alink="#FF0000">
</center>
<center><h3>
test function</h3><pre>
<script language="javascript" type="text/javascript"> handicap.test(); </script>
</pre></center>
.......<br>Activer un anneau avec des liens <br>
<a href="javascript:handicap.goRndURL()">site au hasard</a><br>
<a href="javascript:handicap.goRelURL(1)"> site suivant</a><br>
<a href="javascript:handicap.goRelURL(-1)"> site anterieur</a><br>
et nous continuons la visite car il y a d'autres moyens encore
car moi je prefere les moyens plus visuels tels que des boutons a simple ou doubble click<input type="button" value="mail us"
style="background:mail.gif background-color:yellow;color:blue;font-weight: bold;font-size:14pt" onclick="window.open('mail.html', 'mailring','width=415,height=490,resizable=yes,scrollbars=yes'); return false;"><input type="button" value="join" style="background-color:white;color:red;font-weight:bold;font-size:14pt" onClick="alert('non encore actif!')">
<input type="button" value="random" style="background-color:blue;color:yellow;font-weight: bold;font-size:14pt" onDblClick="javascript:handicap.goRndURL()">
des images sont parfois très interressantes à utiliser
soit de toutes petites images réactives, soit des bandeaux avec des zones à cliquer<img SRC="fondring.gif" alt="welcome handicap web ring" height=20 width=10
align=ABSCENTER NOSAVE BORDER=0 >
<a href="joinwebring.html">
<img SRC="join.gif" ALT="join us"
NOSAVE BORDER=0 height=20 width=20 align=ABSCENTER>
</a>
<img SRC="fondring.gif" alt="join us" height=20 width=10
align=ABSCENTER NOSAVE BORDER=0><a href="javascript:handicap.goRelURL(-5)">
<img SRC="fondring.gif" alt="previous 5" height=20 width=10
align=ABSCENTER NOSAVE BORDER=0>
</a>
<!-- peut aussi être commandé par un bandeau et des images à cliquer -->
<table height="20" width="468" col=1 border=0>
<tdr>
<td>
<center>
<img SRC="bandeauring2.gif" ALT="le petit bandeau qui va pilote l'anneau...."
NOSAVE BORDER=0 USEMAP="#actionable2" height=20 width=468>
</center>
</td>
</tr>
</table></center><center><!------ ACTIVATED THE BUTTONS ON THE DISPLAY ------->
<!------ The ALT="description" explain on line what you should expect ---->
<!------ Both on screens and on ability readers but not on print outs ! ---->
<!----- any question ? horsetherapy@ibelgique.com -------->
<!----- voir l'exemple ---->
<map NAME="actionable2">
<!----- join --->
<area SHAPE=CIRCLE COORDS="10,10,12,12" alt="join the web ring" href="#" onclick="window.open('join.html','prevring','width=800,height=600,resizable=yes,scrollbars=yes'); return false;">
<!-- a ring call -->
<area SHAPE=CIRCLE COORDS="35,10,12,12" alt="site - 1"
href="#" onclick="javascript:handicap.goRelURL(-1)">
<....
</map>
suite de votre texte</body>
</html>