User:Jens Ingels/common.js/flash.js

/** Embed flash movies ************************************************** * Allows embedding of flash files in a page. Only enabled in userspace currently. * See Template:Flash * By Olipro */ var flashOk; function embedFlashMovie( flashOk ) { mainbody = document.getElementById( 'bodyContent' ); mainbody.innerHTML = contentTempHolder; spancheck = document.getElementsByTagName( 'span' ); for( i = 0; i < spancheck.length; i++ ) { if( spancheck[i].getAttribute( 'id' ) != 'embedFlashDoc' ) { continue; }		obj = spancheck[i].innerHTML.split( '@' ); flwidth = obj[0]; flheight = obj[1]; flfile = obj[2].replace( 'fullurl://', 'http://' ); showFlash = ' '; if( flashOk ) { showFlash = ''; showFlash += ''; showFlash += ''; showFlash += ' '; } else { showFlash = '' + flfile + ' (Click to show)'; }		spancheck[i].innerHTML = showFlash; spancheck[i].style.display = 'inline'; } } var contentTempHolder; function embedFlashCheck { if( !document.getElementById( 'embedFlashDoc' ) ) { return; }	mainbody = document.getElementById( 'bodyContent' ); contentTempHolder = mainbody.innerHTML; if( typeof displayFlashOverride != 'undefined' ) { embedFlashMovie( displayFlashOverride ); return; }	askmessage = ' This page contains '; askmessage += 'Flash; would you '; askmessage += 'like to see it? Yes | No | '; askmessage += 'Don\'t show this again '; mainbody.innerHTML = askmessage; } addOnloadHook( embedFlashCheck );