使用者:AristippusSer/common.js

文出維基大典

註:重取頁面,文方新焉。

  • Firefox / Safari:Shift 並點 重新載入,或合鍵 Ctrl-F5Ctrl-R(Mac 為 ⌘-R)。
  • Google Chrome:Ctrl-Shift-R(Mac為 ⌘-Shift-R)。
  • Internet Explorer:Ctrl 並點 重新整理,或合鍵 Ctrl-F5
  • Opera:須至 Tools → Preferences 清謄本(Mac 為 Opera → Preferences)。
/* Replace image 經史子集 with text */

const dict = {
  "Ging.png": "經",
  "Chinese_Character_%22%E5%8F%B2%22_%28Si%29.png": "史",
  "Chinese_Radical_39_%22%E5%AD%90%22.png": "子",
  "Zaap.png": "集"
};

$("img.mw-file-element").each(function() {
  for (const key in dict) {
    if (this.src.endsWith(key)) {
      var newElem = document.createElement("span");
   	  newElem.innerText = dict[key];
      newElem.className = "mw-jszj-aristippusser";
   	  this.replaceWith(newElem);
    }
  }
});