「MediaWiki:Common.js/ParserFunctions.js」の版間の差分
提供: Yourpedia
細 |
細 (miss) |
||
6行目: | 6行目: | ||
var a = eval(Expr[i].innerText); | var a = eval(Expr[i].innerText); | ||
Expr[i].innerText = a; | Expr[i].innerText = a; | ||
− | Expr[i].style.display = ""; | + | Expr[i].style.display = "inline"; |
} | } | ||
25行目: | 25行目: | ||
}else{ | }else{ | ||
Ifempty[i].innerHTML = c[2]; | Ifempty[i].innerHTML = c[2]; | ||
− | Ifempty[i].style.display = ""; | + | Ifempty[i].style.display = "inline"; |
} | } | ||
}else{ | }else{ | ||
Ifempty[i].innerHTML = c[1]; | Ifempty[i].innerHTML = c[1]; | ||
− | Ifempty[i].style.display = ""; | + | Ifempty[i].style.display = "inline"; |
} | } | ||
} | } | ||
45行目: | 45行目: | ||
str = str.replace(/^\s+|\s+$/g,''); | str = str.replace(/^\s+|\s+$/g,''); | ||
if(str != ""){ | if(str != ""){ | ||
− | Iftdempty[i].style.display = ""; | + | Iftdempty[i].style.display = "table-row"; |
} | } | ||
} | } | ||
// END | // END |
2020年4月12日 (日) 18:07時点における版
/* Any JavaScript here will be loaded for all users on every page load. */ /* #expr */ var Expr = document.getElementsByClassName('expr'); for(var i in Expr){ var a = eval(Expr[i].innerText); Expr[i].innerText = a; Expr[i].style.display = "inline"; } /* #if */ var Ifempty = document.getElementsByClassName('ifempty'); for(var i in Ifempty){ var c = new Array(); var i3 = 0; for (var i2 in Ifempty[i].childNodes){ if(Ifempty[i].childNodes[i2].tagName == "SPAN"){ c[i3] = Ifempty[i].childNodes[i2].innerHTML; i3++; } } if(c[0] == ""){ if(c[2] == undefined){ Ifempty[i].innerHTML = ""; }else{ Ifempty[i].innerHTML = c[2]; Ifempty[i].style.display = "inline"; } }else{ Ifempty[i].innerHTML = c[1]; Ifempty[i].style.display = "inline"; } } /* #if table用 */ var Iftdempty = document.getElementsByClassName('iftdempty'); for(var i in Iftdempty){ var str = ""; for (var i2 in Iftdempty[i].childNodes){ if(Iftdempty[i].childNodes[i2].tagName == "TD"){ str = Iftdempty[i].childNodes[i2].innerHTML; break; } } str = str.replace(/^\s+|\s+$/g,''); if(str != ""){ Iftdempty[i].style.display = "table-row"; } } // END