mozilla

Revision 114835 of Template:Fx minversion section

  • Revision slug: Template:Fx_minversion_section
  • Revision title: Template:Fx minversion section
  • Revision id: 114835
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment remove use of mediawiki template; 241 words added, 200 words removed
Tags: 

Revision Content

/* one parameter: Firefox version */

/* get the page language */
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);
}
/* fall back to page.language on a user page */
else if (string.StartsWith(lang, "user:")) {
 lang = page.language;
}

var articleUrl = "Firefox " + $0 + " for developers";
var IntroducedIn = "Introduced in Firefox " + $0;

switch(lang) {
  case 'de':
    articleUrl = "Firefox " + $0 + " für Entwickler";
    IntroducedIn = "Eingeführt in Firefox " + $0;
    break;
}

if ( wiki.pageexists(lang + '/' + articleUrl) ) { web.link(wiki.uri(lang + '/'+ articleUrl), IntroducedIn); } else { IntroducedIn; }


One of the Version information templates. For example:

{{Fx_minversion_section(3)}}

This template should be used when the content of a section applies to Firefox version N or higher. For individual items in a list or a table use Template:fx minversion inline, and for entire articles, use Template:fx minversion header.

Revision Source

<pre class="script">
/* one parameter: Firefox version */

/* get the page language */
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);
}
/* fall back to page.language on a user page */
else if (string.StartsWith(lang, "user:")) {
 lang = page.language;
}

var articleUrl = "Firefox " + $0 + " for developers";
var IntroducedIn = "Introduced in Firefox " + $0;

switch(lang) {
  case 'de':
    articleUrl = "Firefox " + $0 + " für Entwickler";
    IntroducedIn = "Eingeführt in Firefox " + $0;
    break;
}

<div style="border: 0pt none ; margin: 10px 0px; padding: 0px 10px; background-color: rgb(255, 255, 225); font-weight: normal; text-align: center;">
  <p style="margin: 4px 0px;">
   if ( wiki.pageexists(lang + '/' + articleUrl) ) {
    web.link(wiki.uri(lang + '/'+ articleUrl), IntroducedIn); }
   else { IntroducedIn; }
  </p>
</div>
</pre>
<div class="noinclude"><hr />
<p>One of the <a title="Project:en/Custom_Templates#Version_information_templates" href="/Project:en/Custom_Templates#Version_information_templates">Version information templates</a>. For example:</p>
<pre class="eval"><span class="nowiki">{{Fx_minversion_section(3)}}</span>
</pre>
<p>This template should be used when the content of a section applies to Firefox version N or higher. For individual items in a list or a table use <a title="Template:fx_minversion_inline" href="/Template:fx_minversion_inline">Template:fx minversion inline</a>, and for entire articles, use <a title="Template:fx_minversion_header" href="/Template:fx_minversion_header">Template:fx minversion header</a>.</p>
</div>