mozilla

Revision 29015 of Template:VersionTimeline

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

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 currentBlob = template.xverblob(currentGecko);
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 = currentBlob - template.xverblob($0);

// Compute length of initial green block var start = 0; var end = 0; var v = template.xverblob($1); end = 100*(v/availLength); var st = "height:20px; background:#00dd00; width:" + end + "%";
(web.html("availLength: " + availLength + ", end: " + 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 currentBlob = template.xverblob(currentGecko);
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 = currentBlob - template.xverblob($0);

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

// Compute length of initial green block

var start = 0;
var end = 0;

var v = template.xverblob($1);
end = 100*(v/availLength);
var st = "height:20px; background:#00dd00; width:" + end + "%";
<div style=(st)></div>
(web.html("availLength: " + availLength + ", end: " + end));
</div> 
</pre>