User:Wyang/autoLoad.js

function autoLoad { var headingText = document.getElementById("firstHeading").innerHTML; var re_new = new RegExp("^Creating [^\:]+$"); var re_allLatin = new RegExp("^Creating [a-zA-Z]+$"); var re_ja = new RegExp("[ぁ-ゖァ-ヺー]"); var re_zh = new RegExp("[一-龯㐀-䶵]"); var re_vi = new RegExp("[àằầèềìòồờùừỳáắấéếíóốớúứýảẳẩẻểỉỏổởủửỷãẵẫẽễĩõỗỡũữỹạặậẹệịọộợụựỵđ]"); var re_ko = new RegExp("[ᄀ-ᄒ"+"ᅡ-ᅵ"+"ᆨ-ᇂ"+"ㄱ-ㆎ가-힣]"); var re_th = new RegExp("[ก-๛]"); var re_km = new RegExp("[ក-៩]"); var re_my = new RegExp("[က-႟ꩠ-ꩻ]"); var re_hi = new RegExp("[ँंअ-ऊएऐओ-घच-झट-नप-रलवशसहा-ूेैो-◌्।-॰ड़ढ़]"); if (re_new.test(headingText)) { if (document.getElementById("mw-previewheader") === null) { if (re_ja.test(headingText)) { $('textarea')[0].value = ""; } else if (re_zh.test(headingText)) { $('textarea')[0].value = ""; } else if (re_vi.test(headingText)) { $('textarea')[0].value = ""; } else if (re_ko.test(headingText)) { $('textarea')[0].value = ""; } else if (re_th.test(headingText)) { $('textarea')[0].value = ""; } else if (re_km.test(headingText)) { $('textarea')[0].value = ""; } else if (re_my.test(headingText)) { $('textarea')[0].value = ""; } else if (re_hi.test(headingText)) { $('textarea')[0].value = ""; //} else if (re_allLatin.test(headingText)) { //	$('textarea')[0].value = "==English=="; //} else { //	$('textarea')[0].value = ""; }		}	}	$("#wpTextbox1").on('keyup', function{	   var n = $(this).val.replace(/deryy/g,'\n\n====Derived terms====\n');	    $(this).val(n);	}); }

autoLoad;