MediaWiki:MoveArticleStates.js

来自维基导游

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:Ctrl-F5
function moveArticleStates() {
 var spacing = 10, coordPadding = 0, tagCoord, tagDoM;

 if (document.getElementById) {
  tagCoord = document.getElementById("geoCoord");
  tagDoM = document.getElementById("DoM");
  if (tagDoM != null) {
   coordPadding = ( /* tagDoM.getElementsByTagName("img").length */ + 2) * 28 + spacing;
   /* The styles of template:Title-icon and template:Title-icons must be rewritten to count the images */
   tagDoM.style.zIndex = 2;
  }
  if (tagCoord != null) tagCoord.style.paddingRight = coordPadding + 'px';
 }
}

$( document ).ready( moveArticleStates() );