diff -r 318533413200 -r a1707c607eec src/pyams_skin/resources/js/myams-browser.js --- a/src/pyams_skin/resources/js/myams-browser.js Sun Jul 19 02:02:20 2020 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/** - * MyAMS browser related features - */ -(function($, globals) { - - var ams = globals.MyAMS; - - ams.browser = { - - /** - * Get IE version - */ - getInternetExplorerVersion: function() { - var rv = -1; - if (navigator.appName === "Microsoft Internet Explorer") { - var ua = navigator.userAgent; - var re = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"); - if (re.exec(ua) !== null) { - rv = parseFloat(RegExp.$1); - } - } - return rv; - }, - - /** - * Display alert for old IE version - */ - checkVersion: function() { - var msg = "You're not using Windows Internet Explorer."; - var ver = this.getInternetExplorerVersion(); - if (ver > -1) { - if (ver >= 8) { - msg = "You're using a recent copy of Windows Internet Explorer."; - } else { - msg = "You should upgrade your copy of Windows Internet Explorer."; - } - } - if (globals.alert) { - globals.alert(msg); - } - }, - - /** - * Check if IE is in version 8 or lower - */ - isIE8orlower: function() { - var msg = "0"; - var ver = this.getInternetExplorerVersion(); - if (ver > -1) { - if (ver >= 9) { - msg = 0; - } else { - msg = 1; - } - } - return msg; - }, - - - /** - * Copy selection to clipboard - * - * If 'text' argument is provided, given text is copied to clipboard. - * Otherwise, text ou event's source is copied. - * Several methods are tested to do clipboard copy (based on browser features); il copy can't be done, - * a prompt is displayed to allow user to make a manual copy. - */ - copyToClipboard: function(text) { - - function doCopy(text) { - var copied = false; - if (window.clipboardData && window.clipboardData.setData) { - // IE specific code - copied = clipboardData.setData("Text", text); - } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { - var textarea = $("