Template:VersionTimeline

  • Revision slug: Template:VersionTimeline
  • Revision title: Template:VersionTimeline
  • Revision id: 29011
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 4 words added, 4 words removed

Revision Content

/* parameters: version created, version last changed, version deprecated (optional), version obsoleted (optional) */
/* get page language first */

var currentGecko = 2.0;  // Update this to current Gecko version
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 availLength = currentGecko - $0;

// Compute length of initial green block var start = 0; var end = 0; end = 100*($1/availLength); var st = "height:20px; background:#00dd00; width:" + end + "%";

Revision Source

<pre class="script">
/* parameters: version created, version last changed, version deprecated (optional), version obsoleted (optional) */
/* get page language first */

var currentGecko = 2.0;  // Update this to current Gecko version
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 availLength = currentGecko - $0;

<div style="height:24px; background:#222222; padding:2px; padding-right:262px;">

// Compute length of initial green block

var start = 0;
var end = 0;

end = 100*($1/availLength);
var st = "height:20px; background:#00dd00; width:" + end + "%";
<div style=(st)></div>

</div> 
</pre>
Revert to this revision