Custom Interwiki Middle

</script>
</head>
<body>
<div class="iw"><div class="head"><input type="text" id="que" spellcheck="false" autocomplete="off" /></div><div id="wrap"></div></div>
<script>
var wrap = document.querySelector('#wrap'), que = document.querySelector('#que');
search();

que.value = Interwiki.default;
que.onkeyup = function(e) {
e.key=='Enter' && search(e.target.value);
}
function search(q=null) {
que.disabled = 1;
Interwiki.query = q;
Interwiki.init(function(ary) {
wrap.innerHTML = '';
ary.filter(function(v) {return v.res}).forEach(function(a) {
var l = document.createElement('a'),
s1 = document.createElement('span'),
s2 = document.createElement('span');
l.appendChild(s1), l.appendChild(s2), wrap.appendChild(l);
l.title = a.info.title;
s1.classList.add('lang'), s2.classList.add('title');
l.href = a.info.url + a.res.unix_name;
l.target = '_parent';
s1.innerHTML = a.info.name;
s2.innerHTML = a.res.title;
})
que.disabled = 0;
})
}

</script>
<style>

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License