Skip to content

Commit 57be545

Browse files
committed
Updated un-supported browser overlays.
1 parent fea32af commit 57be545

File tree

4 files changed

+78
-15
lines changed

4 files changed

+78
-15
lines changed

index.html

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<meta name="description" content="Regular expression tester with syntax highlighting, contextual help, video tutorial, reference, and searchable community patterns." />
1111

1212
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
13+
<meta name="viewport" content="user-scalable=yes">
1314

1415
<!-- Windows8 Pin to home. -->
1516
<meta name="application-name" content="RegExr"/>
@@ -359,13 +360,23 @@ <h1 class="substitution-title">Substitution</h1>
359360
<!-- White spinner used in the community search. -->
360361
<img class="hidden spinner white" src="data:image/gif;base64,R0lGODlhEAAQAPYkAN7e3ufn6HZ2eK6ur2ZmaB8fIlNTVRgYGz09QBYWGScnKhQUFx4eICwsLz8/QYCAgURER5CQkomJinh4erm5uoWFh0ZGSV1dXzIyNSMjJmRkZru7vDs7PhoaHRwcH1VVVyUlKDAwM9jY2VlZWxMTFmhoaiEhJDQ0NqOjpKGhoi4uMcTExTg4OkNDRfLy80xMTpiYmX5+f4ODhVBQUvj4+Hx8fre3uDk5PGBgYo2NjszMzJSUlb+/v0hISsbGx9HR0nNzdGtrbe/v75ubnWJiZLOztNPT09ra229vcVFRVNzc3aWlpm1tb3p6fJ+foIKCg46OkM/P0F5eYOLi4vb29ltbXSkpK8DAwbKys05OUKqqq+3t7XV1dkFBQ8rKyqioqUpKTL29vrW1tisrLevr65KSlJ2dn/T09DY2OPHx8YuLjKenqGlpa9XV1dfX1+np6eTk5M3Nzqysrfr6+ldXWeDg4JaWl4eHibCwsZqam8LCw8jIyQAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQECgD/ACwAAAAAEAAQAEAHjIAkgoOEhYI8OiaGggsOHII3PHA1hgkZGQuDSWtfTAgeHRgvJRcqhSV7aWc0ggkHmYNLIkmLJB0hY4IlPDG1HDO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saJAvXs0wrKCeqS1UgIAZQUVcjqkZULlsBU0dFF7MOTxRKIgMCLIwCAQAh+QQFCgADACwBAAEADgAOAAAHgIAkggsFYywcLA0egowHICoYNw4WLz0NjAkmCiYdJAsmLB90IYIeBQeMjCc4IyYLHaipjD1BDgsJsqkqQBe5sh01Ar6pHRU1PDS9vjdQTDJnKcNsMEkIOlsxuRcod5dsAAF2BhkmYE14KS+MJVd1R0Y6Kxt5M7I3AmsrPDAlGIyBACH5BAUKAAAALAEAAQAOAA4AAAd/gCSCJAsHDCYmDAmDjAkdDBlWKioFg0yMggcZaCwZJA4/NJiCIA4cHU9nKKOCGGAqNmlVrCQZMy1KWyC0CSMGIgG7rAc4VQNTH7QqbEkCSmW0SUAONzZtSKNgMSW7Uj5eMj0FDA4aajEIg1VfVxtYWikwNV2YJyVQa04xH2ODgQA7" />
361362

362-
<div id="notSupported" class="not-supported hidden">
363+
<div class="not-supported-mobile hidden">
363364
<div class="top">
364365
<h1 class="icon regexr-logo">&#xE600;</h1><h1 class="regexr-text">RegExr</h1><span class="version regexr-text">v2.0</span>
365366
</div>
366367
<div class="content">
367-
<p>Uh-oh, it looks like your browser is not supported.</p>
368-
<p>RegExr only supports modern desktop browsers.</p>
368+
<p>RegExr isn't optimized for mobile devices yet. You can still take a look, but it might be a bit quirky.</p>
369+
<a id="closeOverlay">Let me in!</a>
370+
</div>
371+
</div>
372+
373+
<div class="not-supported hidden">
374+
<div class="top">
375+
<h1 class="icon regexr-logo">&#xE600;</h1><h1 class="regexr-text">RegExr</h1><span class="version regexr-text">v2.0</span>
376+
</div>
377+
<div class="content">
378+
<p>RegExr requires a modern browser</p>
379+
<p>Please update your browser to the latest version and try again.</p>
369380
<p class="flash hidden">If you have Flash support you can still visit <a href="v1/">RegExr version 1</a></p>
370381
</div>
371382
</div>
@@ -375,13 +386,19 @@ <h1 class="icon regexr-logo">&#xE600;</h1><h1 class="regexr-text">RegExr</h1><sp
375386
Since our initial load can cause errors, we just catch them and show the overlay if they happen.
376387
-->
377388
<script>
378-
if (!Utils.isSupported()) {
379-
var el = document.getElementById("notSupported");
380-
el.className = "not-supported";
389+
if (!$.isSupported()) {
390+
var el = document.querySelector(".not-supported");
391+
$.removeClass(el, "hidden");
381392
if (ZeroClipboard.detectFlashSupport()) {
382393
var flash = document.getElementsByClassName('flash')[0];
383394
flash.className = "";
384395
}
396+
} else if($.partialSupport()) {
397+
var el = document.querySelector(".not-supported-mobile");
398+
$.removeClass(el, "hidden");
399+
$.el("#closeOverlay").addEventListener("click", function() {
400+
$.addClass(el, "hidden");
401+
});
385402
}
386403
</script>
387404
<!-- <% if (build) { %> -->

js/utils/Utils.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,24 @@ Utils.populateSelector = function (selector, items) {
182182
};
183183

184184
Utils.isSupported = function() {
185-
// No iPhone (iPad works ok);
186-
var iosType = $.iosType();
187-
if (iosType != null && iosType != "ipad") {
185+
// This should catch all the not supported browsers.
186+
return $.isCanvasSupported() && $.isCalcSupported() && store.enabled;
187+
};
188+
189+
Utils.partialSupport = function() {
190+
// If we're not all supported just say no.
191+
if (!Utils.isSupported()) {
188192
return false;
189193
}
190194

191-
// No android.
192-
if ($.isAndroid()) {
193-
return false;
195+
// iOS and Android both kind of work.
196+
if ($.iosType() != null || $.isAndroid()) {
197+
return true;
194198
}
195199

196-
// This should catch the majority of other not supported browsers.
197-
return $.isCanvasSupported() && $.isCalcSupported() && store.enabled;
198-
};
200+
// Should never actually get here.
201+
return false;
202+
}
199203

200204
Utils.isCalcSupported = function () {
201205
return this.checkCalc("-webkit-") || this.checkCalc("-moz-") || this.checkCalc();

scss/site.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@
4040
top: 50%;
4141
@include vendor-prefix(transform, translate(-50%, -50%));
4242
}
43+
44+
font-size: 1.2rem;
45+
@include bpPixelDensity(1.5) {
46+
font-size: 2.5rem;
47+
}
48+
}
49+
50+
.not-supported-mobile {
51+
@extend .not-supported;
52+
53+
background: rgba(30,30,30,.95);
54+
font-size: 2.5rem;
4355
}
4456

4557
.beta-banner {

scss/utilities.scss

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,33 @@
3636
font-weight: normal;
3737
font-style: normal;
3838
}
39+
40+
41+
@mixin bpPixelDensity ($pd: 2, $width: null) {
42+
// 1.25
43+
@if $pd == 1.25 {
44+
@media (-webkit-min-device-pixel-ratio: $pd),
45+
(min-resolution: 120dpi) { @content; }
46+
}
47+
// 1.3
48+
@if $pd == 1.3 {
49+
@media (-webkit-min-device-pixel-ratio: $pd),
50+
(min-resolution: 124.8dpi) { @content; }
51+
}
52+
// 1.5
53+
@if $pd == 1.5 {
54+
@media (-webkit-min-device-pixel-ratio: $pd),
55+
(min-resolution: 144dpi) { @content; }
56+
}
57+
// 2
58+
@if $pd == 2 {
59+
@if $width != null {
60+
@media (-webkit-min-device-pixel-ratio: $pd) and (min-width: $width),
61+
(min-resolution: 192dpi) and (min-width: $width) { @content; }
62+
} @else {
63+
@media (-webkit-min-device-pixel-ratio: $pd),
64+
(min-resolution: 192dpi) { @content; }
65+
}
66+
}
67+
68+
}

0 commit comments

Comments
 (0)