mozilla

Revision 235338 of Template:spec

  • Revision slug: Template:spec
  • Revision title: Template:spec
  • Revision id: 235338
  • Created:
  • Creator: lmorchard
  • Is current revision? No
  • Comment

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 lang = env.locale; 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 'PR': color = "#fff"; bgcolor = "#72ac35"; title = "Proposed Recommendation"; break; case 'REC': color = "#fff"; bgcolor = "#309c40"; title = "Recommendation"; break; } if(lang == "zh-cn"){ switch(status) {   case 'ED':     color = "#fff";     bgcolor = "#e61919";     title = "编辑草案(非官方)";     break;   case 'WD':     color = "#fff";     bgcolor = "#e66e33";     title = "工作草案";     break;   case 'LC':     color = "#333";     bgcolor = "#e2a669";     title = "Last Call";     break;   case 'CR':     color = "#333";     bgcolor = "#cfd510";     title = "候选标准";     break;   case 'PR':     color = "#fff";     bgcolor = "#72ac35";     title = "推荐标准";     break;   case 'REC':     color = "#fff";     bgcolor = "#309c40";     title = "正式标准";     break; } } if(lang == "ja"){ switch(status) { case 'ED': color = "#fff"; bgcolor = "#e61919"; title = "草案(非公式)"; break; case 'WD': color = "#fff"; bgcolor = "#e66e33"; title = "草案"; break; case 'LC': color = "#333"; bgcolor = "#e2a669"; title = "最終草案"; break; case 'CR': color = "#333"; bgcolor = "#cfd510"; title = "勧告候補"; break; case 'PR': color = "#fff"; bgcolor = "#72ac35"; title = "勧告案"; break; case 'REC': color = "#fff"; bgcolor = "#309c40"; title = "W3C 勧告"; 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 lang = env.locale;

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 'PR':
    color = "#fff";
    bgcolor = "#72ac35";
    title = "Proposed Recommendation";
    break;
  case 'REC':
    color = "#fff";
    bgcolor = "#309c40";
    title = "Recommendation";
    break;
}

if(lang == "zh-cn"){
switch(status) {
  case 'ED':
    color = "#fff";
    bgcolor = "#e61919";
    title = "编辑草案(非官方)";
    break;
  case 'WD':
    color = "#fff";
    bgcolor = "#e66e33";
    title = "工作草案";
    break;
  case 'LC':
    color = "#333";
    bgcolor = "#e2a669";
    title = "Last Call";
    break;
  case 'CR':
    color = "#333";
    bgcolor = "#cfd510";
    title = "候选标准";
    break;
  case 'PR':
    color = "#fff";
    bgcolor = "#72ac35";
    title = "推荐标准";
    break;
  case 'REC':
    color = "#fff";
    bgcolor = "#309c40";
    title = "正式标准";
    break;
}
}

if(lang == "ja"){
  switch(status) {
    case 'ED':
      color = "#fff";
      bgcolor = "#e61919";
      title = "草案(非公式)";
      break;
    case 'WD':
      color = "#fff";
      bgcolor = "#e66e33";
      title = "草案";
      break;
    case 'LC':
      color = "#333";
      bgcolor = "#e2a669";
      title = "最終草案";
      break;
    case 'CR':
      color = "#333";
      bgcolor = "#cfd510";
      title = "勧告候補";
      break;
    case 'PR':
      color = "#fff";
      bgcolor = "#72ac35";
      title = "勧告案";
      break;
    case 'REC':
      color = "#fff";
      bgcolor = "#309c40";
      title = "W3C 勧告";
      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>
<% } %>