หมายเหตุ: หลังเผยแพร่ คุณอาจต้องล้างแคชเว็บเบราว์เซอร์ของคุณเพื่อดูการเปลี่ยนแปลง

  • ไฟร์ฟอกซ์ / ซาฟารี: กด Shift ค้างขณะคลิก Reload หรือกด Ctrl-F5 หรือ Ctrl-R (⌘-R บนแมค)
  • กูเกิล โครม: กด Ctrl-Shift-R (⌘-Shift-R บนแมค)
  • อินเทอร์เน็ตเอกซ์พลอเรอร์ และ Edge: กด Ctrl ค้างขณะคลิก Refresh หรือกด Ctrl-F5
  • โอเปร่า: กด Ctrl-F5
// {{documentation}}
/** LegacyScripts **/
/*jshint maxerr:1048576, strict:true, undef:true, latedef:true, es5:true */
/*global mw, jQuery, importScript, importScriptURI, $, ObjectStorage */
/* ==importScript== */
/**
 * do NOT use this function
 **/
var importScriptFromWikibits = window.importScript;
window.importScript = function (page, wiki, oldid) {
	if (!wiki && !oldid) return importScriptFromWikibits(page);
	
	mw.log.warn("importScript called with more than one argument. This is deprecated and may be unreliable. Please use mw.loader.load directly");
	var url = (wiki ? encodeURIComponent(wiki) : mw.config.get('wgScript')) + '?title=' +
		mw.util.wikiUrlencode(page) +
		(oldid ? '&oldid=' + encodeURIComponent(oldid) : '') +
		'&action=raw&ctype=text/javascript';
	return mw.loader.load(url);
};

/* ==Cookies== */

window.setCookie = function setCookie(cookieName, cookieValue) {
	/*global escape */
	mw.log.warn("deprecated function setCookie called; use jQuery.cookie instead");
	var today = new Date();
	var expire = new Date();
	var nDays = 30;
	expire.setTime(today.getTime() + (3600000 * 24 * nDays));
	document.cookie = cookieName + "=" + escape(cookieValue) +
		";path=/" +
		";expires=" + expire.toGMTString();
};

window.getCookie = function getCookie(cookieName) {
	/*global unescape */
	mw.log.warn("deprecated function getCookie called; use jQuery.cookie instead");
	
	cookieName = String(cookieName);
	var start = document.cookie.indexOf(cookieName + "=");
	if (start === -1) return "";
	var len = start + cookieName.length + 1;
	if ((!start) && (cookieName !== document.cookie.substring(0, cookieName.length)))
		return "";
	var end = document.cookie.indexOf(";", len);
	if (end === -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len, end));
};

/*  ==[[MediaWiki:Youhavenewmessages]] to display differently for non-newbies with JS than for others= */
/* Suspected unresponsive page culprit: see the GP (Nov. 2010, "Blocking script execution on each page") */
if (mw.config.get('wgUserGroups') && mw.config.get('wgUserGroups').indexOf("autoconfirmed") == -1) {
	mw.util.addCSS(".visible-to-anons { display: inline; }");
}

/*
/* ==Import [[User:Yair rand/newentrywiz.js]]== *
jQuery(document).ready(function () {
	if (document.getElementById('necplaceholder')) {
		importScript('User:Yair rand/newentrywiz.js');
	}
});
*/

$(function() {
	// TH: fixes appearance caused by some fonts
	var $fixingCollection = $(".firstHeading, .mw-body-content a, .headword, .mention b").not(":has(img, b, strong, u, ruby)");
	$fixingCollection.each(function() {
		var txt = $(this).text();
		txt = txt.replace(/([ᦵᦶᦷᦺꪵꪶꪹꪻꪼ])/g, '††$1'); // ZWNJ...
		txt = txt.replace(/([ᨠ-ᩌ][ᩕ-ᩞ]᩻?)([ᩮᩯᩰᩱᩲ])/g, '††$2‡‡$1'); // ZWNJ...ZWJ
		txt = txt.replace(/([ᨠ-ᩌ]᩠[ᨠ-ᩌ]᩻?)([ᩮᩯᩰᩱᩲ])/g, '††$2‡‡$1'); // ZWNJ...ZWJ
		txt = txt.replace(/([ᨠ-ᩌ]᩠[ᨠ-ᩌ])(ᩕ)/g, '††$2‡‡$1'); // ZWNJ...ZWJ
		txt = txt.replace(/††/g, '‌'); // ZWNJ
		txt = txt.replace(/‡‡/g, '‍'); // ZWJ
		$(this).text(txt); 
	});
});