Difference between revisions of "MediaWiki:Common.js"

From Armagetron
(all browsers but opera seem to hate me :()
(/me smacks self)
Line 1: Line 1:
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
  
document.onload = function() {
+
window.onload = function() {
 
     alert('hi');
 
     alert('hi');
 
     var links = document.getElementsByTagName('a');
 
     var links = document.getElementsByTagName('a');

Revision as of 18:29, 15 March 2007

/* Any JavaScript here will be loaded for all users on every page load. */

window.onload = function() {
    alert('hi');
    var links = document.getElementsByTagName('a');
    for(var i = 0; i < links.length; ++i) {
		var link = links[i];
		if(link.getAttribute('href') == "http://www.google.com/calendar/embed?src=davefancella.com_vlfi4psoqnf7ff07vlpdl6dmdk%40group.calendar.google.com") {
			var iframe = document.createElement('iframe');
			iframe.setAttribute('src', "http://www.google.com/calendar/embed?src=davefancella.com_vlfi4psoqnf7ff07vlpdl6dmdk%40group.calendar.google.com");
			iframe.setAttribute('style', 'width:100%; height:40em;');
			link.parentNode.replaceChild(iframe, link);
			break;
		}
    }
}