mozilla

Revision 309123 of Template:IFSummaryStart

  • Revision slug: Template:IFSummaryStart
  • Revision title: Template:IFSummaryStart
  • Revision id: 309123
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment

Revision Content

<% // This is a shortcut for using IFSummaryStart, then summary text, then // IFSummaryEnd. It's used to create the summary box at the top of a page. // // Parameters: // // $0 - Path of IDL file // $1 - The interface's parent class // $2 - "scriptable" or "not scriptable" // $3 - The last Gecko version the interface changed in /* defaults to English */ var scriptableOutput = "Unknown"; var scriptable = "Scriptable"; var notscriptable = "Not scriptable"; var scriptableLink = "en-US/docs/Interfaces/About_Scriptable_Interfaces"; var lastChanged = "Last changed in Gecko "; var inheritsFrom = "Inherits from: "; var outdated = "This page has not been updated recently; the content may be outdated."; switch(env.locale) { case "fr": scriptable = "Scriptable"; notscriptable = "Not scriptable"; scriptableLink = "fr/docs/Interfaces/À_propos_des_interfaces_scriptables"; break; case "ja": scriptable = "Scriptable", scriptableOutput = "Unknown", scriptableLink = "ja/docs/Interfaces/About_Scriptable_Interfaces", notscriptable = "Not scriptable", inheritsFrom = "継承元: ", lastChanged = "最終更新: Gecko ", outdated = "このページには最近の更新はありません。古い版である可能性が有ります。"; break; case "ko": scriptable = "스크립트에서 사용 가능"; notscriptable = "Not scriptable"; scriptableLink = "ko/docs/Interfaces/About_Scriptable_Interfaces"; break; case "pl": scriptable = "skryptowalny"; notscriptable = "Not scriptable"; scriptableLink = "pl/docs/Interfejsy/O_interfejsach_skryptowalnych"; break; case "zh-CN": scriptable = "脚本化"; notscriptable = "不可脚本化"; inheritsFrom = "继承于: "; scriptableLink = "zh-CN/docs/Interfaces/About_Scriptable_Interfaces"; lastChanged = "最后修改于Gecko "; break; } switch($2.toLowerCase()) { case "scriptable": scriptableOutput = '' + scriptable + ''; break; case "not scriptable": scriptableOutput = '' + notscriptable + ''; break; } /* 1000000 * 60 * 60 * 24 * 365 === 31536000000000 */ if (date.now - env.modified < 31536000000000) template("note", [outdated]); %>
<%- template("source", [$0]) %><%- scriptableOutput %>

Revision Source

<%
// This is a shortcut for using IFSummaryStart, then summary text, then
// IFSummaryEnd. It's used to create the summary box at the top of a page.
//
// Parameters:
//
//  $0 - Path of IDL file
//  $1 - The interface's parent class
//  $2 - "scriptable" or "not scriptable"
//  $3 - The last Gecko version the interface changed in

/* defaults to English */
var scriptableOutput = "Unknown";
var scriptable = "Scriptable";
var notscriptable = "Not scriptable";
var scriptableLink = "en-US/docs/Interfaces/About_Scriptable_Interfaces";
var lastChanged = "Last changed in Gecko ";
var inheritsFrom = "Inherits from: ";
var outdated = "This page has not been updated recently; the content may be outdated.";

switch(env.locale) {
  case "fr":
    scriptable = "Scriptable";
    notscriptable = "Not scriptable";
    scriptableLink = "fr/docs/Interfaces/À_propos_des_interfaces_scriptables";
    break;
  case "ja":
    scriptable = "Scriptable",
    scriptableOutput = "Unknown",
    scriptableLink = "ja/docs/Interfaces/About_Scriptable_Interfaces",
    notscriptable = "Not scriptable",
    inheritsFrom = "継承元: ",
    lastChanged = "最終更新: Gecko ",
    outdated = "このページには最近の更新はありません。古い版である可能性が有ります。";
    break;
  case "ko":
    scriptable = "스크립트에서 사용 가능";
    notscriptable = "Not scriptable";
    scriptableLink = "ko/docs/Interfaces/About_Scriptable_Interfaces";
    break;
  case "pl":
    scriptable = "skryptowalny";
    notscriptable = "Not scriptable";
    scriptableLink = "pl/docs/Interfejsy/O_interfejsach_skryptowalnych";
    break;
  case "zh-CN":
    scriptable = "脚本化";
    notscriptable = "不可脚本化";
    inheritsFrom = "继承于: ";
    scriptableLink = "zh-CN/docs/Interfaces/About_Scriptable_Interfaces";
    lastChanged = "最后修改于Gecko ";
    break;
}

switch($2.toLowerCase()) {
  case "scriptable":
    scriptableOutput = '<a style="color:#00cc00; font-weight:700;" href="' + scriptableLink + '">' + scriptable + '</a>';
    break;
  case "not scriptable":
    scriptableOutput = '<span style="color:#cc0000; font-weight:700;">' + notscriptable + '</span>';
    break;
}

/* 1000000 * 60 * 60 * 24 * 365 === 31536000000000 */
if (date.now - env.modified < 31536000000000) template("note", [outdated]);
%>
<div style="border:solid #ddd 2px; margin-right:262px; margin-bottom:12px;">
<div style="background:#eee; padding:2px;"><%- template("source", [$0]) %><span style="text-align:right; float:right;"><%- scriptableOutput %></span></div>
<span style="padding: 4px 2px;">