src/Tools/WWW_Find/www/find_theorems.js
author blanchet
Mon, 26 Nov 2012 13:35:05 +0100
changeset 50222 40e3c3be6bca
parent 48670 206144b13849
child 50233 eef21a0726f1
permissions -rw-r--r--
added file headers

/*
 * Author: Timothy Bourke, NICTA
 */
var utf8 = new Object();
utf8['\\<supseteq>'] = 'โŠ‡';
utf8['\\<KK>'] = '๐”Ž';
utf8['\\<up>'] = 'โ†‘';
utf8['\\<otimes>'] = 'โŠ—';
utf8['\\<aa>'] = '๐”ž';
utf8['\\<dagger>'] = 'โ€ ';
utf8['\\<frown>'] = 'โŒข';
utf8['\\<guillemotleft>'] = 'ยซ';
utf8['\\<qq>'] = '๐”ฎ';
utf8['\\<X>'] = '๐’ณ';
utf8['\\<triangleright>'] = 'โ–น';
utf8['\\<guillemotright>'] = 'ยป';
utf8['\\<nu>'] = 'ฮฝ';
utf8['\\<sim>'] = 'โˆผ';
utf8['\\<rightharpoondown>'] = 'โ‡';
utf8['\\<p>'] = '๐—‰';
utf8['\\<Up>'] = 'โ‡‘';
utf8['\\<triangleq>'] = 'โ‰œ';
utf8['\\<nine>'] = '๐Ÿต';
utf8['\\<preceq>'] = 'โ‰ผ';
utf8['\\<nabla>'] = 'โˆ‡';
utf8['\\<FF>'] = '๐”‰';
utf8['\\<II>'] = 'โ„‘';
utf8['\\<VV>'] = '๐”™';
utf8['\\<spacespace>'] = 'โฃ';
utf8['\\<and>'] = 'โˆง';
utf8['\\<mapsto>'] = 'โ†ฆ';
utf8['\\<ll>'] = '๐”ฉ';
utf8['\\<F>'] = 'โ„ฑ';
utf8['\\<degree>'] = 'ยฐ';
utf8['\\<beta>'] = 'ฮฒ';
utf8['\\<Colon>'] = 'โˆท';
utf8['\\<bool>'] = '๐”น';
utf8['\\<e>'] = '๐–พ';
utf8['\\<lozenge>'] = 'โ—Š';
utf8['\\<u>'] = '๐—Ž';
utf8['\\<sharp>'] = 'โ™ฏ';
utf8['\\<Longleftrightarrow>'] = 'โŸบ';
utf8['\\<Otimes>'] = 'โจ‚';
utf8['\\<EE>'] = '๐”ˆ';
utf8['\\<I>'] = 'โ„';
utf8['\\<UU>'] = '๐”˜';
utf8['\\<exclamdown>'] = 'ยก';
utf8['\\<dots>'] = 'โ€ฆ';
utf8['\\<N>'] = '๐’ฉ';
utf8['\\<kk>'] = '๐”จ';
utf8['\\<plusminus>'] = 'ยฑ';
utf8['\\<E>'] = 'โ„ฐ';
utf8['\\<triangle>'] = 'โ–ณ';
utf8['\\<eta>'] = 'ฮท';
utf8['\\<triangleleft>'] = 'โ—ƒ';
utf8['\\<chi>'] = 'ฯ‡';
utf8['\\<z>'] = '๐—“';
utf8['\\<hungarumlaut>'] = 'ห';
utf8['\\<partial>'] = 'โˆ‚';
utf8['\\<three>'] = '๐Ÿฏ';
utf8['\\<lesssim>'] = 'โ‰ฒ';
utf8['\\<subset>'] = 'โŠ‚';
utf8['\\<H>'] = 'โ„‹';
utf8['\\<leftarrow>'] = 'โ†';
utf8['\\<PP>'] = '๐”“';
utf8['\\<sqsupseteq>'] = 'โŠ’';
utf8['\\<R>'] = 'โ„›';
utf8['\\<bowtie>'] = 'โจ';
utf8['\\<C>'] = '๐’ž';
utf8['\\<ddagger>'] = 'โ€ก';
utf8['\\<ff>'] = '๐”ฃ';
utf8['\\<turnstile>'] = 'โŠข';
utf8['\\<bar>'] = 'ยฆ';
utf8['\\<propto>'] = 'โˆ';
utf8['\\<S>'] = '๐’ฎ';
utf8['\\<vv>'] = '๐”ณ';
utf8['\\<lhd>'] = 'โŠฒ';
utf8['\\<paragraph>'] = 'ยถ';
utf8['\\<mu>'] = 'ฮผ';
utf8['\\<rightharpoonup>'] = 'โ‡€';
utf8['\\<Inter>'] = 'โ‹‚';
utf8['\\<o>'] = '๐—ˆ';
utf8['\\<asymp>'] = 'โ‰';
utf8['\\<Leftarrow>'] = 'โ‡';
utf8['\\<Sqinter>'] = 'โจ…';
utf8['\\<eight>'] = '๐Ÿด';
utf8['\\<succeq>'] = 'โ‰ฝ';
utf8['\\<forall>'] = 'โˆ€';
utf8['\\<complex>'] = 'โ„‚';
utf8['\\<GG>'] = '๐”Š';
utf8['\\<Coprod>'] = 'โˆ';
utf8['\\<L>'] = 'โ„’';
utf8['\\<WW>'] = '๐”š';
utf8['\\<leadsto>'] = 'โ†';
utf8['\\<D>'] = '๐’Ÿ';
utf8['\\<angle>'] = 'โˆ ';
utf8['\\<section>'] = 'ยง';
utf8['\\<TTurnstile>'] = 'โŠซ';
utf8['\\<mm>'] = '๐”ช';
utf8['\\<T>'] = '๐’ฏ';
utf8['\\<alpha>'] = 'ฮฑ';
utf8['\\<leftharpoondown>'] = 'โ†ฝ';
utf8['\\<rho>'] = 'ฯ';
utf8['\\<wrong>'] = 'โ‰€';
utf8['\\<l>'] = '๐—…';
utf8['\\<doteq>'] = 'โ‰';
utf8['\\<times>'] = 'ร—';
utf8['\\<noteq>'] = 'โ‰ ';
utf8['\\<rangle>'] = 'โŸฉ';
utf8['\\<div>'] = 'รท';
utf8['\\<Longrightarrow>'] = 'โŸน';
utf8['\\<BB>'] = '๐”…';
utf8['\\<sqsupset>'] = 'โŠ';
utf8['\\<rightarrow>'] = 'โ†’';
utf8['\\<real>'] = 'โ„';
utf8['\\<hh>'] = '๐”ฅ';
utf8['\\<Phi>'] = 'ฮฆ';
utf8['\\<integral>'] = 'โˆซ';
utf8['\\<CC>'] = 'โ„ญ';
utf8['\\<euro>'] = 'โ‚ฌ';
utf8['\\<xx>'] = '๐”ต';
utf8['\\<Y>'] = '๐’ด';
utf8['\\<zeta>'] = 'ฮถ';
utf8['\\<longleftarrow>'] = 'โŸต';
utf8['\\<a>'] = '๐–บ';
utf8['\\<onequarter>'] = 'ยผ';
utf8['\\<And>'] = 'โ‹€';
utf8['\\<downharpoonright>'] = 'โ‡‚';
utf8['\\<phi>'] = 'ฯ†';
utf8['\\<q>'] = '๐—Š';
utf8['\\<Rightarrow>'] = 'โ‡’';
utf8['\\<clubsuit>'] = 'โ™ฃ';
utf8['\\<ggreater>'] = 'โ‰ซ';
utf8['\\<two>'] = '๐Ÿฎ';
utf8['\\<succ>'] = 'โ‰ป';
utf8['\\<AA>'] = '๐”„';
utf8['\\<lparr>'] = 'โฆ‡';
utf8['\\<Squnion>'] = 'โจ†';
utf8['\\<HH>'] = 'โ„Œ';
utf8['\\<sqsubseteq>'] = 'โŠ‘';
utf8['\\<QQ>'] = '๐””';
utf8['\\<setminus>'] = 'โˆ–';
utf8['\\<Lambda>'] = 'ฮ›';
utf8['\\<RR>'] = 'โ„œ';
utf8['\\<J>'] = '๐’ฅ';
utf8['\\<gg>'] = '๐”ค';
utf8['\\<hyphen>'] = 'ยญ';
utf8['\\<B>'] = 'โ„ฌ';
utf8['\\<Z>'] = '๐’ต';
utf8['\\<ww>'] = '๐”ด';
utf8['\\<lambda>'] = 'ฮป';
utf8['\\<onehalf>'] = 'ยฝ';
utf8['\\<f>'] = '๐–ฟ';
utf8['\\<Or>'] = 'โ‹';
utf8['\\<v>'] = '๐—';
utf8['\\<natural>'] = 'โ™ฎ';
utf8['\\<seven>'] = '๐Ÿณ';
utf8['\\<Oplus>'] = 'โจ';
utf8['\\<subseteq>'] = 'โŠ†';
utf8['\\<rfloor>'] = 'โŒ‹';
utf8['\\<LL>'] = '๐”';
utf8['\\<Sum>'] = 'โˆ‘';
utf8['\\<ominus>'] = 'โŠ–';
utf8['\\<bb>'] = '๐”Ÿ';
utf8['\\<Pi>'] = 'ฮ ';
utf8['\\<cent>'] = 'ยข';
utf8['\\<diamond>'] = 'โ—‡';
utf8['\\<mho>'] = 'โ„ง';
utf8['\\<O>'] = '๐’ช';
utf8['\\<rr>'] = '๐”ฏ';
utf8['\\<twosuperior>'] = 'ยฒ';
utf8['\\<leftharpoonup>'] = 'โ†ผ';
utf8['\\<pi>'] = 'ฯ€';
utf8['\\<k>'] = '๐—„';
utf8['\\<star>'] = 'โ‹†';
utf8['\\<rightleftharpoons>'] = 'โ‡Œ';
utf8['\\<equiv>'] = 'โ‰ก';
utf8['\\<langle>'] = 'โŸจ';
utf8['\\<Longleftarrow>'] = 'โŸธ';
utf8['\\<nexists>'] = 'โˆ„';
utf8['\\<Odot>'] = 'โจ€';
utf8['\\<lfloor>'] = 'โŒŠ';
utf8['\\<sqsubset>'] = 'โŠ';
utf8['\\<SS>'] = '๐”–';
utf8['\\<box>'] = 'โ–ก';
utf8['\\<index>'] = 'ฤฑ';
utf8['\\<pounds>'] = 'ยฃ';
utf8['\\<Upsilon>'] = 'ฮฅ';
utf8['\\<ii>'] = '๐”ฆ';
utf8['\\<hookleftarrow>'] = 'โ†ฉ';
utf8['\\<P>'] = '๐’ซ';
utf8['\\<threesuperior>'] = 'ยณ';
utf8['\\<epsilon>'] = 'ฮต';
utf8['\\<yy>'] = '๐”ถ';
utf8['\\<h>'] = '๐—';
utf8['\\<upsilon>'] = 'ฯ…';
utf8['\\<x>'] = '๐—‘';
utf8['\\<not>'] = 'ยฌ';
utf8['\\<le>'] = 'โ‰ค';
utf8['\\<one>'] = '๐Ÿญ';
utf8['\\<cdots>'] = 'โ‹ฏ';
utf8['\\<some>'] = 'ฯต';
utf8['\\<Prod>'] = 'โˆ';
utf8['\\<NN>'] = '๐”‘';
utf8['\\<squnion>'] = 'โŠ”';
utf8['\\<dd>'] = '๐”ก';
utf8['\\<top>'] = 'โŠค';
utf8['\\<dieresis>'] = 'ยจ';
utf8['\\<tt>'] = '๐”ฑ';
utf8['\\<U>'] = '๐’ฐ';
utf8['\\<unlhd>'] = 'โŠด';
utf8['\\<cedilla>'] = 'ยธ';
utf8['\\<kappa>'] = 'ฮบ';
utf8['\\<amalg>'] = 'โจฟ';
utf8['\\<restriction>'] = 'โ†พ';
utf8['\\<struct>'] = 'โ‹„';
utf8['\\<m>'] = '๐—†';
utf8['\\<six>'] = '๐Ÿฒ';
utf8['\\<midarrow>'] = 'โ”€';
utf8['\\<lbrace>'] = 'โฆƒ';
utf8['\\<lessapprox>'] = 'โช…';
utf8['\\<MM>'] = '๐”';
utf8['\\<down>'] = 'โ†“';
utf8['\\<oplus>'] = 'โŠ•';
utf8['\\<wp>'] = 'โ„˜';
utf8['\\<surd>'] = 'โˆš';
utf8['\\<cc>'] = '๐” ';
utf8['\\<bottom>'] = 'โŠฅ';
utf8['\\<copyright>'] = 'ยฉ';
utf8['\\<ZZ>'] = 'โ„จ';
utf8['\\<union>'] = 'โˆช';
utf8['\\<V>'] = '๐’ฑ';
utf8['\\<ss>'] = '๐”ฐ';
utf8['\\<unrhd>'] = 'โŠต';
utf8['\\<onesuperior>'] = 'ยน';
utf8['\\<b>'] = '๐–ป';
utf8['\\<downharpoonleft>'] = 'โ‡ƒ';
utf8['\\<cdot>'] = 'โ‹…';
utf8['\\<r>'] = '๐—‹';
utf8['\\<Midarrow>'] = 'โ•';
utf8['\\<Down>'] = 'โ‡“';
utf8['\\<diamondsuit>'] = 'โ™ข';
utf8['\\<rbrakk>'] = 'โŸง';
utf8['\\<lless>'] = 'โ‰ช';
utf8['\\<longleftrightarrow>'] = 'โŸท';
utf8['\\<prec>'] = 'โ‰บ';
utf8['\\<emptyset>'] = 'โˆ…';
utf8['\\<rparr>'] = 'โฆˆ';
utf8['\\<Delta>'] = 'ฮ”';
utf8['\\<XX>'] = '๐”›';
utf8['\\<parallel>'] = 'โˆฅ';
utf8['\\<K>'] = '๐’ฆ';
utf8['\\<nn>'] = '๐”ซ';
utf8['\\<registered>'] = 'ยฎ';
utf8['\\<M>'] = 'โ„ณ';
utf8['\\<delta>'] = 'ฮด';
utf8['\\<threequarters>'] = 'ยพ';
utf8['\\<g>'] = '๐—€';
utf8['\\<cong>'] = 'โ‰…';
utf8['\\<tau>'] = 'ฯ„';
utf8['\\<w>'] = '๐—';
utf8['\\<ge>'] = 'โ‰ฅ';
utf8['\\<flat>'] = 'โ™ญ';
utf8['\\<zero>'] = '๐Ÿฌ';
utf8['\\<Uplus>'] = 'โจ„';
utf8['\\<longmapsto>'] = 'โŸผ';
utf8['\\<supset>'] = 'โŠƒ';
utf8['\\<in>'] = 'โˆˆ';
utf8['\\<sqinter>'] = 'โŠ“';
utf8['\\<OO>'] = '๐”’';
utf8['\\<updown>'] = 'โ†•';
utf8['\\<circ>'] = 'โˆ˜';
utf8['\\<rat>'] = 'โ„š';
utf8['\\<stileturn>'] = 'โŠฃ';
utf8['\\<ee>'] = '๐”ข';
utf8['\\<Omega>'] = 'ฮฉ';
utf8['\\<or>'] = 'โˆจ';
utf8['\\<inverse>'] = 'ยฏ';
utf8['\\<rhd>'] = 'โŠณ';
utf8['\\<uu>'] = '๐”ฒ';
utf8['\\<iota>'] = 'ฮน';
utf8['\\<d>'] = '๐–ฝ';
utf8['\\<questiondown>'] = 'ยฟ';
utf8['\\<Union>'] = 'โ‹ƒ';
utf8['\\<omega>'] = 'ฯ‰';
utf8['\\<approx>'] = 'โ‰ˆ';
utf8['\\<t>'] = '๐—';
utf8['\\<Updown>'] = 'โ‡•';
utf8['\\<spadesuit>'] = 'โ™ ';
utf8['\\<five>'] = '๐Ÿฑ';
utf8['\\<exists>'] = 'โˆƒ';
utf8['\\<rceil>'] = 'โŒ‰';
utf8['\\<JJ>'] = '๐”';
utf8['\\<minusplus>'] = 'โˆ“';
utf8['\\<nat>'] = 'โ„•';
utf8['\\<oslash>'] = 'โŠ˜';
utf8['\\<A>'] = '๐’œ';
utf8['\\<Xi>'] = 'ฮž';
utf8['\\<currency>'] = 'ยค';
utf8['\\<Turnstile>'] = 'โŠจ';
utf8['\\<hookrightarrow>'] = 'โ†ช';
utf8['\\<pp>'] = '๐”ญ';
utf8['\\<Q>'] = '๐’ฌ';
utf8['\\<aleph>'] = 'โ„ต';
utf8['\\<acute>'] = 'ยด';
utf8['\\<xi>'] = 'ฮพ';
utf8['\\<simeq>'] = 'โ‰ƒ';
utf8['\\<i>'] = '๐—‚';
utf8['\\<Join>'] = 'โ‹ˆ';
utf8['\\<y>'] = '๐—’';
utf8['\\<lbrakk>'] = 'โŸฆ';
utf8['\\<greatersim>'] = 'โ‰ณ';
utf8['\\<greaterapprox>'] = 'โช†';
utf8['\\<longrightarrow>'] = 'โŸถ';
utf8['\\<lceil>'] = 'โŒˆ';
utf8['\\<Gamma>'] = 'ฮ“';
utf8['\\<odot>'] = 'โŠ™';
utf8['\\<YY>'] = '๐”œ';
utf8['\\<infinity>'] = 'โˆž';
utf8['\\<Sigma>'] = 'ฮฃ';
utf8['\\<yen>'] = 'ยฅ';
utf8['\\<int>'] = 'โ„ค';
utf8['\\<tturnstile>'] = 'โŠฉ';
utf8['\\<oo>'] = '๐”ฌ';
utf8['\\<ointegral>'] = 'โˆฎ';
utf8['\\<gamma>'] = 'ฮณ';
utf8['\\<upharpoonleft>'] = 'โ†ฟ';
utf8['\\<sigma>'] = 'ฯƒ';
utf8['\\<n>'] = '๐—‡';
utf8['\\<rbrace>'] = 'โฆ„';
utf8['\\<DD>'] = '๐”‡';
utf8['\\<notin>'] = 'โˆ‰';
utf8['\\<j>'] = '๐—ƒ';
utf8['\\<uplus>'] = 'โŠŽ';
utf8['\\<leftrightarrow>'] = 'โ†”';
utf8['\\<TT>'] = '๐”—';
utf8['\\<bullet>'] = 'โˆ™';
utf8['\\<Theta>'] = 'ฮ˜';
utf8['\\<smile>'] = 'โŒฃ';
utf8['\\<G>'] = '๐’ข';
utf8['\\<jj>'] = '๐”ง';
utf8['\\<inter>'] = 'โˆฉ';
utf8['\\<Psi>'] = 'ฮจ';
utf8['\\<ordfeminine>'] = 'ยช';
utf8['\\<W>'] = '๐’ฒ';
utf8['\\<zz>'] = '๐”ท';
utf8['\\<theta>'] = 'ฮธ';
utf8['\\<ordmasculine>'] = 'ยบ';
utf8['\\<c>'] = '๐–ผ';
utf8['\\<psi>'] = 'ฯˆ';
utf8['\\<s>'] = '๐—Œ';
utf8['\\<Leftrightarrow>'] = 'โ‡”';
utf8['\\<heartsuit>'] = 'โ™ก';
utf8['\\<four>'] = '๐Ÿฐ';

var re_xsymbol = /\\<.*?>/g;

function encodequery(ele) {
  var text = ele.value;
  var otext = text;
  var pos = getCaret(ele);

  xsymbols = text.match(re_xsymbol);
  for (i in xsymbols) {
    var repl = utf8[xsymbols[i]];
    if (repl) {
	text = text.replace(xsymbols[i], repl, "g");
    }
  }

  if (text != otext) {
    ele.value = text;

    if (pos != -1) {
      pos = pos - (otext.length - text.length);
      setCaret(ele, pos);
    }
  }
}

/* from: http://www.webdeveloper.com/forum/showthread.php?t=74982 */
function getCaret(obj) {
  var pos = -1;

  if (document.selection) { // IE
    obj.focus ();
    var sel = document.selection.createRange();
    var sellen = document.selection.createRange().text.length;
    sel.moveStart ('character', -obj.value.length);
    pos = sel.text.length - sellen;

  } else if (obj.selectionStart || obj.selectionStart == '0') { // Gecko
    pos = obj.selectionStart;
  }
  
  return pos;
}

/* from: http://parentnode.org/javascript/working-with-the-cursor-position/ */
function setCaret(obj, pos) {
  if (obj.createTextRange) {
      var range = obj.createTextRange();
      range.move("character", pos);
      range.select();
  } else if (obj.selectionStart) {
      obj.focus();
      obj.setSelectionRange(pos, pos);
  }
}