「MediaWiki:Common.js/ParserFunctions.js」の版間の差分

提供: Yourpedia
移動: 案内検索
(一旦差し戻し)
18行目: 18行目:
 
if(numA && numB && numC){
 
if(numA && numB && numC){
 
numC.innerText = Number(numA) + Number(numB);
 
numC.innerText = Number(numA) + Number(numB);
break;
 
}
 
}
 
}
 
 
/* スタイルのバグ修正 */
 
if(location.host == 'ja.yourpedia.org'){
 
var link = document.getElementsByTagName('link');
 
for(var i in link){
 
if(link[i].rel == 'stylesheet' && link[i].href.indexOf('yourpedia.org/mediawiki/load.php') != -1){
 
link[i].href = link[i].href.replace(/https:\/\/(.+).yourpedia.org\//, 'https://ja.yourpedia.org/');
 
 
break;
 
break;
 
}
 
}

2019年6月7日 (金) 02:25時点における版

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

/* 計算スクリプト */
	var Keisans = document.getElementsByClassName('tashizan');
	
	var Childs;
	var numA;
	var numB;
	var numC;
	
	for(var i in Keisans){
		Childs = Keisans[i].childNodes;
		for(var i2 in Childs){
			if(Childs[i2].className == 'numA') numA = Childs[i2].innerText;
			if(Childs[i2].className == 'numB') numB = Childs[i2].innerText;
			if(Childs[i2].className == 'numC') numC = Childs[i2];
			
			if(numA && numB && numC){
				numC.innerText = Number(numA) + Number(numB);
				break;
			}
		}
	}

// END