Template:Interwiki

  • Revision slug: Template:Interwiki
  • Revision title: Template:Interwiki
  • Revision id: 89969
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 7 words added, 16 words removed

Revision Content

var prefix = string.ToLower($0 || $prefix || '');
var path = $1 || $path;
var title = $2 || $title || path;
var u = Uri.Parts(Page.uri);
var lang = string.ToLower(u.path[0]);
if(string.Contains(lang, "project") || string.Contains(lang, "Project")) {
 lang = string.Substr(lang, 8);
}
if (lang === 'zh_tw' || lang === 'cn') {
    lang = 'zh';
}
switch(prefix) {
case 'wikipedia':
    web.link('http://' + lang + '.wikipedia.org/wiki' + path)', 'title');
    break;
case 'wikimo':
    title;
    break;
default:
    'Unknown prefix: ' + prefix + '.';
}

Revision Source

<pre class="script">
var prefix = string.ToLower($0 || $prefix || '');
var path = $1 || $path;
var title = $2 || $title || path;
var u = Uri.Parts(Page.uri);
var lang = string.ToLower(u.path[0]);
if(string.Contains(lang, "project") || string.Contains(lang, "Project")) {
 lang = string.Substr(lang, 8);
}
if (lang === 'zh_tw' || lang === 'cn') {
    lang = 'zh';
}
switch(prefix) {
case 'wikipedia':
    web.link('http://' + lang + '.wikipedia.org/wiki' + path)', 'title');
    break;
case 'wikimo':
    <a class=(prefix) title=(title) href=('http://wiki.mozilla.org/' + path)>title</a>;
    break;
default:
    'Unknown prefix: ' + prefix + '.';
}
</pre>
Revert to this revision