diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /browser/base/content/aboutSocialError.xhtml | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'browser/base/content/aboutSocialError.xhtml')
-rw-r--r-- | browser/base/content/aboutSocialError.xhtml | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/browser/base/content/aboutSocialError.xhtml b/browser/base/content/aboutSocialError.xhtml new file mode 100644 index 000000000..94a4e3dbd --- /dev/null +++ b/browser/base/content/aboutSocialError.xhtml @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> + +<!DOCTYPE html [ + <!ENTITY % htmlDTD + PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "DTD/xhtml1-strict.dtd"> + %htmlDTD; + <!ENTITY % netErrorDTD SYSTEM "chrome://global/locale/netError.dtd"> + %netErrorDTD; +]> + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>&loadError.label;</title> + <link rel="stylesheet" href="chrome://browser/skin/aboutNetError.css" type="text/css" media="all" /> + <link rel="stylesheet" type="text/css" media="all" href="chrome://browser/skin/aboutSocialError.css"/> + <link rel="icon" type="image/png" id="favicon" href="chrome://global/skin/icons/warning-16.png"/> + </head> + + <body> + <div id="errorPageContainer"> + + <!-- Error Title --> + <div id="errorTitle"> + <p id="errorShortDescText" >foo</p> + </div> + + <div id="button-box"> + <button id="btnTryAgain" onclick="tryAgainButton()"/> + </div> + </div> + </body> + + <script type="text/javascript;version=1.8"><![CDATA[ + const Cu = Components.utils; + + Cu.import("resource://gre/modules/Services.jsm"); + Cu.import("resource:///modules/Social.jsm"); + + let config = { + tryAgainCallback: reloadProvider + } + + function parseQueryString() { + let searchParams = new URLSearchParams(document.documentURI.split("?")[1]); + let mode = searchParams.get("mode"); + config.origin = searchParams.get("origin"); + let encodedURL = searchParams.get("url"); + let url = decodeURIComponent(encodedURL); + // directory does not have origin set, in that case use the url origin for + // the error message. + if (!config.origin) { + let URI = Services.io.newURI(url, null, null); + config.origin = + Services.scriptSecurityManager.createCodebasePrincipal(URI, {}).origin; + } + + switch (mode) { + case "compactInfo": + document.getElementById("btnTryAgain").style.display = 'none'; + break; + case "tryAgainOnly": + //intentional fall-through + case "tryAgain": + config.tryAgainCallback = loadQueryURL; + config.queryURL = url; + break; + default: + break; + } + } + + function setUpStrings() { + let brandBundle = Services.strings.createBundle("chrome://branding/locale/brand.properties"); + let browserBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties"); + + let productName = brandBundle.GetStringFromName("brandShortName"); + let provider = Social._getProviderFromOrigin(config.origin); + let providerName = provider ? provider.name : config.origin; + + // Sets up the error message + let msg = browserBundle.formatStringFromName("social.error.message", [productName, providerName], 2); + document.getElementById("errorShortDescText").textContent = msg; + + // Sets up the buttons' labels and accesskeys + let btnTryAgain = document.getElementById("btnTryAgain"); + btnTryAgain.textContent = browserBundle.GetStringFromName("social.error.tryAgain.label"); + btnTryAgain.accessKey = browserBundle.GetStringFromName("social.error.tryAgain.accesskey"); + } + + function tryAgainButton() { + config.tryAgainCallback(); + } + + function loadQueryURL() { + window.location.href = config.queryURL; + } + + function reloadProvider() { + let provider = Social._getProviderFromOrigin(config.origin); + provider.reload(); + } + + parseQueryString(); + setUpStrings(); + ]]></script> +</html> |