function com_stewartspeak_replacement() {
/*
Dynamic Heading Generator
By Stewart Rosenberger
http://www.stewartspeak.com/headings/
This script searches through a web page for specific or general elements
and replaces them with dynamically generated images, in conjunction with
a server-side script.
*/
// ##################################################################
// CONFIG
// ##################################################################
// --------------------------------------------
// on definit les chemins
// --------------------------------------------
// --------------------------------------------
// Ici, on spécifie quels elements du DOM on transforme en image.
// --------------------------------------------
// Parametres :
/*
selector => on s'adresse à la (ou les) balise comme pour les styles
(exemple : '#divTitre h1' signifie toutes les balises
contenu dans l'element du DOM ayant pour id='divTitre')
url => on situe le fichier 'dynatext.php' avec pour parametre en GET :
- fontname => le nom de la police utilisée
- fontsize => la taille de la police
- fontcolor => la couleur de la police
- backgroundcolor => la couleur du font de l'image
- transparentbg => 1 : le fond de l'image est transparent
wordwrap => true : découpe en autant d'images qu'il y a de mots
*/
/* home */
replaceSelector("h1","http://cocoledico.com/include/js/dynatext/dynatext.php?fontname=TERRI___.TTF&fontsize=30&fontcolor=277007&backgroundcolor=ffffff&transparentbg=1",true);
replaceSelector("#h1ListeAlphabet","http://cocoledico.com/include/js/dynatext/dynatext.php?fontname=TERRI___.TTF&fontsize=20&fontcolor=277007&backgroundcolor=ffffff&transparentbg=1",true);
//replaceSelector("#divColonneCentre h2","http://cocoledico.com/include/js/dynatext/dynatext.php?fontname=TERRI___.TTF&fontsize=23&fontcolor=277007&backgroundcolor=ffffff&transparentbg=1",true);
// --------------------------------------------
// chemin de l'image qui permet de créer des images transparentes
// --------------------------------------------
var testURL = "http://cocoledico.com/include/js/dynatext/shim.png" ;
// --------------------------------------------
// permet de na pas imprimer les images, mais juste le texte d'origine
// il faut donc creer le fichier "dynatext-replacement-print.css"
// --------------------------------------------
var doNotPrintImages = true;
var printerCSS = "http://cocoledico.comdynatext-replacement-print.css";
// --------------------------------------------
// ????
// --------------------------------------------
var hideFlicker = false;
var hideFlickerCSS = "http://cocoledico.comdynatext-replacement-antiflicker.css";
var hideFlickerTimeout = 10;
// ##################################################################
// fin => CONFIG
// ##################################################################
/* ---------------------------------------------------------------------------
For basic usage, you should not need to edit anything below this comment.
If you need to further customize this script's abilities, make sure
you're familiar with Javascript. And grab a soda or something.
*/
var items;
var imageLoaded = false;
var documentLoaded = false;
function replaceSelector(selector,url,wordwrap)
{
if(typeof items == "undefined")
items = new Array();
items[items.length] = {selector: selector, url: url, wordwrap: wordwrap};
}
if(hideFlicker)
{
document.write('');
window.flickerCheck = function()
{
if(!imageLoaded)
setStyleSheetState('hide-flicker',false);
};
setTimeout('window.flickerCheck();',hideFlickerTimeout)
}
if(doNotPrintImages)
document.write('');
var test = new Image();
test.onload = function() { imageLoaded = true; if(documentLoaded) replacement(); };
test.src = testURL + "?date=" + (new Date()).getTime();
addLoadHandler(function(){ documentLoaded = true; if(imageLoaded) replacement(); });
function documentLoad()
{
documentLoaded = true;
if(imageLoaded)
replacement();
}
function replacement()
{
for(var i=0;i 0) for(var j=0;j -1)
{
var bits = token.split('#');
var tagName = bits[0];
var id = bits[1];
var element = document.getElementById(id);
if(!element || (tagName && element.nodeName.toLowerCase() != tagName) )
return new Array();
currentContext = new Array(element);
continue;
}
if(token.indexOf('.') > -1)
{
var bits = token.split('.');
var tagName = bits[0];
var className = bits[1];
if(!tagName)
tagName = '*';
var found = new Array;
var foundCount = 0;
for(var h=0;h -1); };
break;
default :
checkFunction = function(e) { return e.getAttribute(attrName); };
}
currentContext = new Array;
var currentContextIndex = 0;
for(var k=0;k