diff --git a/js/legacy.js b/js/legacy.js index e0662e8a..acfb595f 100644 --- a/js/legacy.js +++ b/js/legacy.js @@ -188,6 +188,35 @@ jQuery.Legacy = (function($) { return false; } + /** + * shows an error message + * + * @private + * @name Check.showError + * @param {string} message + * @function + */ + function showError(message) + { + var $error = $('#errormessage'), + $glyphIcon = $error.find(':first'), + $element; + if ($glyphIcon.length) { + // if there is an icon, we need to provide an inner element + // to translate the message into, instead of the parent + $element = $(''); + $error.html(' ').prepend($glyphIcon).append($element); + } else { + $element = $error; + } + if (message.indexOf('switching to HTTPS.', 'https' + window.location.href.slice(4)]); + showError( + 'Your browser may require an HTTPS connection to support the WebCrypto API. Try switching to HTTPS.'.replace( + '%s', + 'https' + window.location.href.slice(4) + ) + ); } $('#oldnotice').removeClass('hidden'); init = true; diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index f1df7437..f0ab0b58 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -71,7 +71,7 @@ if ($MARKDOWN): endif; ?> - +