Template:spec

  • Revision slug: Template:spec
  • Revision title: Template:spec
  • Revision id: 10400
  • Created:
  • Creator: ziyunfei
  • Is current revision? No
  • Comment 2 words added, 2 words removed

Revision Content

<% /* parameters: */ /* $0 = link to specification */ /* $1 = link text (optional) */ /* $2 = status of specification (optional). Possible values: ED, WD, LC, CR, PR, REC. */ var status = $2; var title = ""; var color = ""; var bgcolor = ""; switch(status) { case 'ED': color = "#fff"; bgcolor = "#e61919"; title = "Editor's Draft (unofficial)"; break; case 'WD': color = "#fff"; bgcolor = "#e66e33"; title = "Working Draft"; break; case 'LC': color = "#333"; bgcolor = "#e2a669"; title = "Last Call"; break; case 'CR': color = "#333"; bgcolor = "#cfd510"; title = "Candidate Recommendation"; break;  case 'ZH-CN':     color = "#333";     bgcolor = "#cfd510";     title = "工作草案";     break; case 'PR': color = "#fff"; bgcolor = "#72ac35"; title = "Proposed Recommendation"; break; case 'REC': color = "#fff"; bgcolor = "#309c40"; title = "Recommendation"; break; } web.link( $0, ($1 || $0) ); if ($2) { (status) }

Revision Source

<%

/* parameters: */
/* $0 = link to specification */
/* $1 = link text (optional) */
/* $2 = status of specification (optional). Possible values: ED, WD, LC, CR, PR, REC. */

var status = $2;
var title = "";
var color = "";
var bgcolor = "";

switch(status) {
  case 'ED':
    color = "#fff";
    bgcolor = "#e61919";
    title = "Editor's Draft (unofficial)";
    break;
  case 'WD':
    color = "#fff";
    bgcolor = "#e66e33";
    title = "Working Draft";
    break;
  case 'LC':
    color = "#333";
    bgcolor = "#e2a669";
    title = "Last Call";
    break;
  case 'CR':
    color = "#333";
    bgcolor = "#cfd510";
    title = "Candidate Recommendation";
    break;
  case 'ZH-CN':
    color = "#333";
    bgcolor = "#cfd510";
    title = "工作草案";
    break;
  case 'PR':
    color = "#fff";
    bgcolor = "#72ac35";
    title = "Proposed Recommendation";
    break;
  case 'REC':
    color = "#fff";
    bgcolor = "#309c40";
    title = "Recommendation";
    break;
}

web.link( $0, ($1 || $0) );

if ($2) {
   <span title=(title) style=('color:' + color + '; background-color:' + bgcolor+ '; display: inline-block; font-size: x-small; margin-left: 6px; white-space: nowrap; padding: 2px 5px;')>(status)</span>
}
</pre>
Revert to this revision