MDN may have intermittent access issues April 18 13:00 - April 19 01:00 UTC. See whistlepig.mozilla.org for all notifications.

mozilla

Revision 65214 of Template:interface

  • Revision slug: Template:interface
  • Revision title: Template:interface
  • Revision id: 65214
  • Created:
  • Creator: Potappo
  • Is current revision? No
  • Comment added detect code for page language and $0 page existing; 65 words added, 192 words removed

Revision Content

 

/* get a page's language (Don't use page.language!) */
var u = Uri.Parts(Page.uri);
var lang = u.path[0];

/* check $0 exists */
if(wiki.pageExists(wiki.uri(lang + '/' + $0))) {
    web.link(wiki.uri(page.language + '/' + $0), $0);
} else {
    <a rel=('internal') href=(wiki.uri(lang + '/' + $0)) class=('new') >$0a>
}
%>
      

Revision Source

<p> </p>
<pre class="script">
/* get a page's language (Don't use page.language!) */
var u = Uri.Parts(Page.uri);
var lang = u.path[0];

/* check $0 exists */
if(wiki.pageExists(wiki.uri(lang + '/' + $0))) {
    web.link(wiki.uri(page.language + '/' + $0), $0);
} else {
    <<span class="start-tag">a</span><span class="attribute-name"> rel</span>=(<span class="attribute-value">'internal') </span><span class="attribute-name">href</span><span>=</span>(<span>wiki.uri(</span>lang + '/' + $0<span>)) </span><span class="attribute-name">class</span>=<span class="attribute-value">('new') </span>>$0</<span class="end-tag">a</span>>
}
%>
Revert to this revision