Template:VersionTimeline

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

Revision Content

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

var currentGecko = 2;  // 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;
}

// Compute length of initial red block, if any var start = 0; var end = 0; if ($0 > 1) {   end = $0/currentGecko;  
}

Revision Source

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

var currentGecko = 2;  // 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;
}

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

// Compute length of initial red block, if any

var start = 0;
var end = 0;
if ($0 > 1) {
  end = $0/currentGecko;
  <div style="height:20px; background:#dd0000; width:" + end + "%"></div>
}

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