Template:Interwiki

  • Revision slug: Template:Interwiki
  • Revision title: Template:Interwiki
  • Revision id: 89966
  • Created:
  • Creator: Potappo
  • Is current revision? No
  • Comment fixed typo; 1 words added, 1 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")) {
 lang = string.Substr(lang, 8);
}
if (lang === 'zh_tw' || lang === 'cn') {
    lang = 'zh';
}
switch(prefix) {
case 'wikipedia':
     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")) {
 lang = string.Substr(lang, 8);
}
if (lang === 'zh_tw' || lang === 'cn') {
    lang = 'zh';
}
switch(prefix) {
case 'wikipedia':
    <a class=(prefix) title=(title) href=('http://' + lang + '.wikipedia.org/wiki' & path)> title </a>;
    break;
case 'wikimo':
    <a class=(prefix) title=(title) href=('http://wiki.mozilla.org/' + path)> title </a>;
    break;
default:
    'Unknown prefix: ' + prefix + '.';
}

%>
Revert to this revision