<%
// General macro for inserting a secure context notice, i.e. to mark a
// feature as only available on secure contexts. See the following page:
// https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
//
// Parameters:
//  $0  The type of warning indicator: inline/header

var lang = env.locale;

var str_title = mdn.localString({
  "en-US": "Secure context",
  "fr"   : "Contexte sécurisé",
  "ja"   : "安全なコンテキスト用"
});

var str_tooltip = mdn.localString({
  "en-US": "This feature is available only in secure contexts (HTTPS)",
  "fr"   : "Cette fonctionnalité est uniquement disponible dans des contextes sécurisés (HTTPS)",
  "ja"   : "この機能は安全なコンテキスト (HTTPS) でのみ利用できます"
});

var str_desc = mdn.localString({
  "en-US": "This feature is available only in <a href='/" + lang + "/docs/Web/Security/Secure_Contexts'>secure contexts</a> (HTTPS), in some or all <a href='#Browser_compatibility'>supporting browsers</a>.",
  "fr"   : "Cette fonctionnalité est uniquement disponible dans des <a href='/" + lang + "/docs/Web/Security/Secure_Contexts'>contextes sécurisés</a> (HTTPS), pour certains <a href='#Compatibilité_des_navigateurs'>navigateurs qui la prennent en charge</a>.",
  "ja"   : "この機能は一部またはすべての<a href='#Browser_compatibility'>対応しているブラウザー</a>において、<a href='/" + lang + "/docs/Web/Security/Secure_Contexts'>安全なコンテキスト</a> (HTTPS) でのみ利用できます。"
});

if($0 === 'inline') {
  result = "<span class='inlineIndicator secureContexts' title='" + str_tooltip + "'>" + str_title + "</span>";
} else if($0 === 'header') {
  result = "<div class='blockIndicator secureContexts'><p><strong>" + str_title + "</strong><br/>" + str_desc + "</p></div>";
}
%>

<%- result %>
