User:Wyang/common.js

//still experimenting, please help fix any error/clumsiness in the code

//importScript('User:Eirikr/edittools.js'); //importScript('User:Wyang/AddAudio.js'); importScript('User:Dixtosa/AjaxEdit.js'); //importScript('User:suzukaze-c/zhDialMap.js'); //importScript('User:Wyang/autoLoad.js'); importScript('User:V111P/PrefLangs.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_zh = new RegExp("[一-龯㐀-䶵]"); var re_vi = new RegExp("[àằầèềìòồờùừỳáắấéếíóốớúứýảẳẩẻểỉỏổởủửỷãẵẫẽễĩõỗỡũữỹạặậẹệịọộợụựỵđâêô]"); var re_ko = new RegExp("[ᄀ-ᄒ"+"ᅡ-ᅵ"+"ᆨ-ᇂ"+"ㄱ-ㆎ가-힣]"); if (re_new.test(headingText)) { if (document.getElementById("mw-previewheader") === null) { 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_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;