Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

NOJIRA: Enhance Microsoft IE and Edge browser compatibility check. #299

Open
wants to merge 2 commits into
base: v4.5-branch
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/webapp/defaults/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@
<div class="csc-footer-container" id="footer"></div>
</div> <!-- END main content -->
</div> <!-- END body content -->
<script type="text/javascript">
// Check browser compatability
// Defined in Login.js
browserCompatibilityCheck();
</script>
<script type="text/javascript">
cspace.globalSetup("cspace.login");
</script>
Expand Down
19 changes: 14 additions & 5 deletions src/main/webapp/defaults/js/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,20 @@ cspace = cspace || {};
(function ($, fluid) {
fluid.log("Login.js loaded");

// Notify user of IE browser incompatibility if IE is being used.
var browser = navigator.userAgent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if(/trident/i.test(browser[1])){
window.alert('Notice: CollectionSpace is not optimized to use Internet Explorer. For an optimal experience please use the latest versions of Chrome or Firefox.');
}
// Alert users if they happen to be using an incompatible browser aka. Microsoft.
var browserCompatibilityCheck = function () {

// User strings may change with time,
// please see: https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx
// to stay up to date.
if (/MSIE 10/i.test(navigator.userAgent) ||
/MSIE 9/i.test(navigator.userAgent) ||
/rv:11.0/i.test(navigator.userAgent) ||
/Edge\/\d./i.test(navigator.userAgent))
{
window.alert('Hey there CollectionSpace user! Unfortunately, CollectionSpace is not optimized for use with your current browser. For an optimal experience, please use the latest version of Chrome or Firefox. - The CollectionSpace Team');
}
};

// Show sign in UI and make sure everything else is hidden.
var showSignIn = function (domBinder) {
Expand Down