diff --git a/HISTORY.md b/HISTORY.md index 7a8f3bb5..6408713a 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -8,6 +8,7 @@ * **Notable Changes:** * made "i" upvar inside FOR loop's C-Shape slot mutable by user script * prevent switching to another sprite if a block editor is open (so local blocks of different sprites don't mix) + * display a permanent warning when using IE * **Notable Fixes:** * typing strings into the search-field again shows relevant blocks (regression from IME) * fixed project dialog's search-field behevior (regression from IME) @@ -26,6 +27,7 @@ * gui: prevent switching to another sprite if a block editor is open (so local blocks of different sprites don't mix) * updated German translation * gui: simplified asset loading scheduler +* gui: display a permenent warning when using IE ### 2019-10-14 * morphic: new "reactToInput" text-editing event diff --git a/src/gui.js b/src/gui.js index 8da3480b..5131cef5 100644 --- a/src/gui.js +++ b/src/gui.js @@ -550,6 +550,8 @@ IDE_Morph.prototype.openIn = function (world) { } else { interpretUrlAnchors.call(this); } + + this.warnAboutIE(); }; // IDE_Morph construction @@ -6002,6 +6004,42 @@ IDE_Morph.prototype.prompt = function (message, callback, choices, key) { ); }; +// IDE_Morph bracing against IE + +IDE_Morph.prototype.warnAboutIE = function () { + var dlg, txt; + if (this.isIE()) { + dlg = new DialogBoxMorph(); + txt = new TextMorph( + 'Please do not use Internet Explorer.\n' + + 'Snap! runs best in a web-standards\n' + + 'compliant browser', + dlg.fontSize, + dlg.fontStyle, + true, + false, + 'center', + null, + null, + MorphicPreferences.isFlat ? null : new Point(1, 1), + new Color(255, 255, 255) + ); + + dlg.key = 'IE-Warning'; + dlg.labelString = "Internet Explorer"; + dlg.createLabel(); + dlg.addBody(txt); + dlg.drawNew(); + dlg.fixLayout(); + dlg.popUp(this.world()); + } +}; + +IDE_Morph.prototype.isIE = function () { + var ua = navigator.userAgent; + return ua.indexOf("MSIE ") > -1 || ua.indexOf("Trident/") > -1; +}; + // ProjectDialogMorph //////////////////////////////////////////////////// // ProjectDialogMorph inherits from DialogBoxMorph: