MediaWiki:Common.js

From open-support.info

(Difference between revisions)
Jump to: navigation, search
m
m
Line 1: Line 1:
/* ここにあるすべてのJavaScriptは、すべてのページ読み込みですべての利用者に対して読み込まれます */
/* ここにあるすべてのJavaScriptは、すべてのページ読み込みですべての利用者に対して読み込まれます */
-
function createBookNavLink() {
+
function resizeWidthMax() {
 +
  if(
 +
      document.getElementsByClassName &&
 +
      document.getElementsByClassName('resizeWidthMax') &&
 +
      document.getElementsByClassName('resizeWidthMax').parentNode &&
 +
      document.getElementsByClassName('resizeWidthMax').parentNode.parentNode
 +
  ) {
 +
    alert(document.getElementsByClassName('resizeWidthMax').width);
 +
  }
 +
}
 +
addOnloadHook( resizeWidthMax );
 +
function createBookNavLink() {
if (
if (
document.getElementById &&
document.getElementById &&
Line 13: Line 24:
}
}
  }
  }
-
 
if (
if (
document.getElementById &&
document.getElementById &&
Line 30: Line 40:
}
}
-
 
if (
if (
document.getElementById &&
document.getElementById &&
Line 49: Line 58:
curNode.parentNode.insertBefore(newNode,curNode);
curNode.parentNode.insertBefore(newNode,curNode);
}
}
-
 
}
}
addOnloadHook( createBookNavLink );
addOnloadHook( createBookNavLink );

Revision as of 06:32, 19 April 2011

/* ここにあるすべてのJavaScriptは、すべてのページ読み込みですべての利用者に対して読み込まれます */
function resizeWidthMax() {
  if(
      document.getElementsByClassName &&
      document.getElementsByClassName('resizeWidthMax') &&
      document.getElementsByClassName('resizeWidthMax').parentNode &&
      document.getElementsByClassName('resizeWidthMax').parentNode.parentNode
  ) {
    alert(document.getElementsByClassName('resizeWidthMax').width);
  }
}
addOnloadHook( resizeWidthMax );

function createBookNavLink() {
	if (
		document.getElementById &&
		document.getElementById('bodyContent') &&
		document.getElementById('bookFooterMargin')
	) {
		var bct = document.getElementById('bodyContent');
		var bfm = document.getElementById('bookFooterMargin');
		if ( bct.clientHeight < 350 ) {
			bfm.style.height = ( 350 + bfm.clientHeight - bct.clientHeight ) + "px";
		}
 	}
	if (
		document.getElementById &&
		document.getElementById('bookHeaderNavSrc') &&
		document.getElementById('bookHeaderNavSrc').innerHTML &&
		document.getElementById('contentSub') &&
		document.getElementById('contentSub').innerHTML
	) {

		var curNode = document.getElementById('contentSub');
		var newNode = document.getElementById('bookHeaderNavSrc');
		if( ! curNode.innerHTML ) {
			curNode.innerHTML = '&nbsp;';
		}
		curNode.innerHTML = newNode.innerHTML + curNode.innerHTML;

	}
	if (
		document.getElementById &&
		document.getElementById('bookFooterNavSrc') &&
		document.getElementById('bookFooterNavSrc').innerHTML &&
		document.getElementById('catlinks') &&
		document.getElementById('catlinks').innerHTML &&
		document.createElement &&
		document.insertBefore
	) {
		var curNode = document.getElementById('catlinks');
		var newNode = document.createElement('div');
		newNode.id = 'bookFooter';
		newNode.innerHTML = document.getElementById('bookFooterNavSrc').innerHTML;
		newNode.style.margin        = '0px';
		newNode.style.padding       = '0px';
		newNode.style.verticalAlign = 'bottom';
		curNode.parentNode.insertBefore(newNode,curNode);
	}
}
addOnloadHook( createBookNavLink );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox