Add-ons
Official Add-ons
None have been added yet.
Unofficial Add-ons
Rollback
Rollback is an unsupported and unofficial add-on derived from the previous rollback function in sIFR 2 official add-ons 1.2. This version is designed to work with sIFR 3.
Rollback removes the sIFR elements from the page. This can be useful if you want to provide a styleswitcher: first rollback the sIFR elements, and then replace them again based on the preference of the visitor. You can invoke Rollback via sIFR.rollback().
You can optionally use selectors when rolling back: sIFR.rollback("h1")
/* sIFR Unofficial Rollback addon for sIFR 3
Modified by Paul Hassinger - hassinger.paul@ipaul.com - http://www.ipaul.com
(modified from sIFR 2.0.1 Official Add-ons 1.2)
Copyright 2005 Mark Wubben
This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/
if(typeof sIFR == "object"){
sIFR.rollback = function(){
function rollback(sSelector){
if(sSelector == null){
sSelector = "";
} else {
sSelector += ">";
};
sIFR.removeFlashClass();
if(doRollback(sSelector+"embed") == false){
doRollback(sSelector+"object");
};
};
function doRollback(sSelector){
var node, nodeParent, nodeAlternate, nodeAlternateChild, nodeAlternateNextChild, indexNodeToRemove;
var listNodes = parseSelector(sSelector);
var i = listNodes.length - 1;
var bHasRun = false;
while(i >= 0){
node = listNodes[i];
listNodes.length--;
nodeParent = node.parentNode;
if(node.className == 'sIFR-flash'){
/* Flash blockers may add other nodes as siblings to the Flash element.
Thus, we remove all children of nodeParent, and look for nodeAlternate at the same time */
indexNodeToRemove = 0;
while(indexNodeToRemove < nodeParent.childNodes.length){
node = nodeParent.childNodes[indexNodeToRemove];
if(node.className == "sIFR-alternate"){
nodeAlternate = node;
indexNodeToRemove++;
continue;
};
nodeParent.removeChild(node);
};
if(nodeAlternate != null){
nodeAlternateChild = nodeAlternate.firstChild;
while(nodeAlternateChild != null){
nodeAlternateNextChild = nodeAlternateChild.nextSibling;
nodeParent.appendChild(nodeAlternate.removeChild(nodeAlternateChild));
nodeAlternateChild = nodeAlternateNextChild;
};
nodeParent.removeChild(nodeAlternate);
};
nodeParent.className = nodeParent.className.replace(/\bsIFR\-replaced\b/, "");
bHasRun = true;
};
i--;
};
return bHasRun;
};
return rollback;
}();
};
"Rollforward"
To implement a rollforward option you have to wrap the replacement statements in a function. To do the replacement you call this function, this means you have to call it once, right after you have created it, and when you want to roll forward.
For example:
function do_sIFR(){
// replacement statements go here
};
do_sIFR(); // execute immediately, so the headlines will get replaced
And a link to the rollforward option:
<a href="javascript:do_sIFR();">Show sIFR headlines</a>
Remove Flash Class
You can use this method to remove the sIFR-hasFlash class from the html and body element. Invoke it using sIFR.removeFlashClass().

