User:Msh210/h1.js

// This currently hangs, and I don't know why. $(function { if (wgNamespaceNumber) return; ////////////////////////////////////////// function scr(c) {//return a .class name (doesn't necessarily match template name!) var script="";//default  if (c>0x40 && c<0x5b) script="Latn";  if (c>0x60 && c<0x7b) script="Latn";  if (c>0xff && c<0x250) script="Latn";  if (c>0x249 && c<0x2b0) script="IPA";  if (c>0x36f && c<0x400) script="polytonic";  if (c>0x3ff && c<0x530) script=Cyrl;  if (c>0x52f && c<0x588) script="Armn";//no 588  if (c==0x58a) script="Armn";//589 can be Geor too I think  if (c>0x58f && c<0x600) script="Hebr";  if (c>0x5ff && c<0x700) script="Arab";  if (c>0x6ff && c<0x750) script="Syrc";  if (c>0x74f && c<0x780) script="Arab";  if (c>0x77f && c<0x7c0) script="Thaa";  if (c>0x7bf && c<0x800) script="Nkoo";  //etc. (Summary of Unicode character assignments)  //don't set (set as "") for punctuation etc.  return script; }//function scr ////////////////////////////////////////// var s=document.getElementById("firstHeading").innerHTML; var t=new Array; for (var i=0;i<s.length;i+1) {t[i]=s.charCodeAt(i);}; for (var i=0;i<s.length;i+1) { if (0xD800 <= s.charCodeAt(i) && s.charCodeAt(i) <= 0xDBFF) { t[i]=((s.charCodeAt(i) - 0xD800) * 0x400) + (s.charCodeAt(i+1) - 0xDC00) + 0x10000;//copied, hope it's right t[i+1]=0; };//if };//for for (var i=1;i<t.length-1;i+1) {if (t[i]==0) t=t.slice(0,i-1).concat(t.slice(i+1));}; if (t[t.length-1]==0) {t.pop;}; ////////////////////////////////////////// var consistent=1; var base=scr(t[0]); for (var i=1;i<t.length;i=1) { if (scr(t[i])!=base && scr(t[i])!="") { consistent=0; break;//for };//if };//for if (consistent) document.getElementById("firstHeading").className+=(scr(t[0])?" "+scr(t[0]):" Unicode") });//addOnloadHook