# HG changeset patch # User Thierry Florac # Date 1527522307 -7200 # Node ID fa838ff79f03d95bb3c71d6146ff47c0ddcc8a9c # Parent 277aea3b91ec6a4b05fdd31a20ab1fd4e1a24040 Updated JQuery "scrollTo" plug-in to release 2.1.2 diff -r 277aea3b91ec -r fa838ff79f03 src/pyams_skin/resources/js/ext/jquery-scrollTo.js --- a/src/pyams_skin/resources/js/ext/jquery-scrollTo.js Mon May 28 14:06:21 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -(function($) { - var j = $.scrollTo = function(a, b, c) { - return $(window).scrollTo(a, b, c) - }; - j.defaults = { - axis: 'xy', - duration: parseFloat($.fn.jquery) >= 1.3 ? 0 : 1, - limit: true - }; - j.window = function(a) { - return $(window)._scrollable() - }; - $.fn._scrollable = function() { - return this.map(function() { - var a = this, - isWin = !a.nodeName || $.inArray(a.nodeName.toLowerCase(), ['iframe', '#document', 'html', 'body']) != -1; - if (!isWin) return a; - var b = (a.contentWindow || a).document || a.ownerDocument || a; - return /webkit/i.test(navigator.userAgent) || b.compatMode == 'BackCompat' ? b.body : b.documentElement - }) - }; - $.fn.scrollTo = function(f, g, h) { - if (typeof g == 'object') { - h = g; - g = 0 - } - if (typeof h == 'function') h = { - onAfter: h - }; - if (f == 'max') f = 9e9; - h = $.extend({}, j.defaults, h); - g = g || h.duration; - h.queue = h.queue && h.axis.length > 1; - if (h.queue) g /= 2; - h.offset = both(h.offset); - h.over = both(h.over); - return this._scrollable().each(function() { - if (f == null) return; - var d = this, - $elem = $(d), - targ = f, - toff, attr = {}, - win = $elem.is('html,body'); - switch (typeof targ) { - case 'number': - case 'string': - if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) { - targ = both(targ); - break - } - targ = $(targ, this); - if (!targ.length) return; - case 'object': - if (targ.is || targ.style) toff = (targ = $(targ)).offset() - } - var e = $.isFunction(h.offset) && h.offset(d, targ) || h.offset; - $.each(h.axis.split(''), function(i, a) { - var b = a == 'x' ? 'Left' : 'Top', - pos = b.toLowerCase(), - key = 'scroll' + b, - old = d[key], - max = j.max(d, a); - if (toff) { - attr[key] = toff[pos] + (win ? 0 : old - $elem.offset()[pos]); - if (h.margin) { - attr[key] -= parseInt(targ.css('margin' + b)) || 0; - attr[key] -= parseInt(targ.css('border' + b + 'Width')) || 0 - } - attr[key] += e[pos] || 0; - if (h.over[pos]) attr[key] += targ[a == 'x' ? 'width' : 'height']() * h.over[pos] - } else { - var c = targ[pos]; - attr[key] = c.slice && c.slice(-1) == '%' ? parseFloat(c) / 100 * max : c - } - if (h.limit && /^\d+$/.test(attr[key])) attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max); - if (!i && h.queue) { - if (old != attr[key]) animate(h.onAfterFirst); - delete attr[key] - } - }); - animate(h.onAfter); - - function animate(a) { - $elem.animate(attr, g, h.easing, a && - function() { - a.call(this, targ, h) - }) - } - }).end() - }; - j.max = function(a, b) { - var c = b == 'x' ? 'Width' : 'Height', - scroll = 'scroll' + c; - if (!$(a).is('html,body')) return a[scroll] - $(a)[c.toLowerCase()](); - var d = 'client' + c, - html = a.ownerDocument.documentElement, - body = a.ownerDocument.body; - return Math.max(html[scroll], body[scroll]) - Math.min(html[d], body[d]) - }; - - function both(a) { - return $.isFunction(a) || typeof a == 'object' ? a : { - top: a, - left: a - } - }; - return j -})(jQuery); \ No newline at end of file diff -r 277aea3b91ec -r fa838ff79f03 src/pyams_skin/resources/js/ext/jquery-scrollTo.min.js --- a/src/pyams_skin/resources/js/ext/jquery-scrollTo.min.js Mon May 28 14:06:21 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -(function(c){var a=c.scrollTo=function(e,d,f){return c(window).scrollTo(e,d,f)};a.defaults={axis:"xy",duration:parseFloat(c.fn.jquery)>=1.3?0:1,limit:true};a.window=function(d){return c(window)._scrollable()};c.fn._scrollable=function(){return this.map(function(){var e=this,f=!e.nodeName||c.inArray(e.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!f){return e}var d=(e.contentWindow||e).document||e.ownerDocument||e;return/webkit/i.test(navigator.userAgent)||d.compatMode=="BackCompat"?d.body:d.documentElement})};c.fn.scrollTo=function(i,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function"){d={onAfter:d}}if(i=="max"){i=9000000000}d=c.extend({},a.defaults,d);e=e||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=b(d.offset);d.over=b(d.over);return this._scrollable().each(function(){if(i==null){return}var n=this,j=c(n),k=i,h,f={},m=j.is("html,body");switch(typeof k){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(k)){k=b(k);break}k=c(k,this);if(!k.length){return}case"object":if(k.is||k.style){h=(k=c(k)).offset()}}var l=c.isFunction(d.offset)&&d.offset(n,k)||d.offset;c.each(d.axis.split(""),function(t,r){var p=r=="x"?"Left":"Top",v=p.toLowerCase(),s="scroll"+p,q=n[s],o=a.max(n,r);if(h){f[s]=h[v]+(m?0:q-j.offset()[v]);if(d.margin){f[s]-=parseInt(k.css("margin"+p))||0;f[s]-=parseInt(k.css("border"+p+"Width"))||0}f[s]+=l[v]||0;if(d.over[v]){f[s]+=k[r=="x"?"width":"height"]()*d.over[v]}}else{var u=k[v];f[s]=u.slice&&u.slice(-1)=="%"?parseFloat(u)/100*o:u}if(d.limit&&/^\d+$/.test(f[s])){f[s]=f[s]<=0?0:Math.min(f[s],o)}if(!t&&d.queue){if(q!=f[s]){g(d.onAfterFirst)}delete f[s]}});g(d.onAfter);function g(o){j.animate(f,e,d.easing,o&&function(){o.call(this,k,d)})}}).end()};a.max=function(h,g){var k=g=="x"?"Width":"Height",f="scroll"+k;if(!c(h).is("html,body")){return h[f]-c(h)[k.toLowerCase()]()}var j="client"+k,i=h.ownerDocument.documentElement,e=h.ownerDocument.body;return Math.max(i[f],e[f])-Math.min(i[j],e[j])};function b(d){return c.isFunction(d)||typeof d=="object"?d:{top:d,left:d}}return a})(jQuery); \ No newline at end of file diff -r 277aea3b91ec -r fa838ff79f03 src/pyams_skin/resources/js/ext/jquery-scrollto-2.1.2.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_skin/resources/js/ext/jquery-scrollto-2.1.2.js Mon May 28 17:45:07 2018 +0200 @@ -0,0 +1,210 @@ +/*! + * jQuery.scrollTo + * Copyright (c) 2007 Ariel Flesler - aflesler ○ gmail • com | https://github.com/flesler + * Licensed under MIT + * https://github.com/flesler/jquery.scrollTo + * @projectDescription Lightweight, cross-browser and highly customizable animated scrolling with jQuery + * @author Ariel Flesler + * @version 2.1.2 + */ +;(function(factory) { + 'use strict'; + if (typeof define === 'function' && define.amd) { + // AMD + define(['jquery'], factory); + } else if (typeof module !== 'undefined' && module.exports) { + // CommonJS + module.exports = factory(require('jquery')); + } else { + // Global + factory(jQuery); + } +})(function($) { + 'use strict'; + + var $scrollTo = $.scrollTo = function(target, duration, settings) { + return $(window).scrollTo(target, duration, settings); + }; + + $scrollTo.defaults = { + axis:'xy', + duration: 0, + limit:true + }; + + function isWin(elem) { + return !elem.nodeName || + $.inArray(elem.nodeName.toLowerCase(), ['iframe','#document','html','body']) !== -1; + } + + $.fn.scrollTo = function(target, duration, settings) { + if (typeof duration === 'object') { + settings = duration; + duration = 0; + } + if (typeof settings === 'function') { + settings = { onAfter:settings }; + } + if (target === 'max') { + target = 9e9; + } + + settings = $.extend({}, $scrollTo.defaults, settings); + // Speed is still recognized for backwards compatibility + duration = duration || settings.duration; + // Make sure the settings are given right + var queue = settings.queue && settings.axis.length > 1; + if (queue) { + // Let's keep the overall duration + duration /= 2; + } + settings.offset = both(settings.offset); + settings.over = both(settings.over); + + return this.each(function() { + // Null target yields nothing, just like jQuery does + if (target === null) return; + + var win = isWin(this), + elem = win ? this.contentWindow || window : this, + $elem = $(elem), + targ = target, + attr = {}, + toff; + + switch (typeof targ) { + // A number will pass the regex + case 'number': + case 'string': + if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) { + targ = both(targ); + // We are done + break; + } + // Relative/Absolute selector + targ = win ? $(targ) : $(targ, elem); + /* falls through */ + case 'object': + if (targ.length === 0) return; + // DOMElement / jQuery + if (targ.is || targ.style) { + // Get the real position of the target + toff = (targ = $(targ)).offset(); + } + } + + var offset = $.isFunction(settings.offset) && settings.offset(elem, targ) || settings.offset; + + $.each(settings.axis.split(''), function(i, axis) { + var Pos = axis === 'x' ? 'Left' : 'Top', + pos = Pos.toLowerCase(), + key = 'scroll' + Pos, + prev = $elem[key](), + max = $scrollTo.max(elem, axis); + + if (toff) {// jQuery / DOMElement + attr[key] = toff[pos] + (win ? 0 : prev - $elem.offset()[pos]); + + // If it's a dom element, reduce the margin + if (settings.margin) { + attr[key] -= parseInt(targ.css('margin'+Pos), 10) || 0; + attr[key] -= parseInt(targ.css('border'+Pos+'Width'), 10) || 0; + } + + attr[key] += offset[pos] || 0; + + if (settings.over[pos]) { + // Scroll to a fraction of its width/height + attr[key] += targ[axis === 'x'?'width':'height']() * settings.over[pos]; + } + } else { + var val = targ[pos]; + // Handle percentage values + attr[key] = val.slice && val.slice(-1) === '%' ? + parseFloat(val) / 100 * max + : val; + } + + // Number or 'number' + if (settings.limit && /^\d+$/.test(attr[key])) { + // Check the limits + attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max); + } + + // Don't waste time animating, if there's no need. + if (!i && settings.axis.length > 1) { + if (prev === attr[key]) { + // No animation needed + attr = {}; + } else if (queue) { + // Intermediate animation + animate(settings.onAfterFirst); + // Don't animate this axis again in the next iteration. + attr = {}; + } + } + }); + + animate(settings.onAfter); + + function animate(callback) { + var opts = $.extend({}, settings, { + // The queue setting conflicts with animate() + // Force it to always be true + queue: true, + duration: duration, + complete: callback && function() { + callback.call(elem, targ, settings); + } + }); + $elem.animate(attr, opts); + } + }); + }; + + // Max scrolling position, works on quirks mode + // It only fails (not too badly) on IE, quirks mode. + $scrollTo.max = function(elem, axis) { + var Dim = axis === 'x' ? 'Width' : 'Height', + scroll = 'scroll'+Dim; + + if (!isWin(elem)) + return elem[scroll] - $(elem)[Dim.toLowerCase()](); + + var size = 'client' + Dim, + doc = elem.ownerDocument || elem.document, + html = doc.documentElement, + body = doc.body; + + return Math.max(html[scroll], body[scroll]) - Math.min(html[size], body[size]); + }; + + function both(val) { + return $.isFunction(val) || $.isPlainObject(val) ? val : { top:val, left:val }; + } + + // Add special hooks so that window scroll properties can be animated + $.Tween.propHooks.scrollLeft = + $.Tween.propHooks.scrollTop = { + get: function(t) { + return $(t.elem)[t.prop](); + }, + set: function(t) { + var curr = this.get(t); + // If interrupt is true and user scrolled, stop animating + if (t.options.interrupt && t._last && t._last !== curr) { + return $(t.elem).stop(); + } + var next = Math.round(t.now); + // Don't waste CPU + // Browsers don't render floating point scroll + if (curr !== next) { + $(t.elem)[t.prop](next); + t._last = this.get(t); + } + } + }; + + // AMD requirement + return $scrollTo; +}); diff -r 277aea3b91ec -r fa838ff79f03 src/pyams_skin/resources/js/ext/jquery-scrollto-2.1.2.min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_skin/resources/js/ext/jquery-scrollto-2.1.2.min.js Mon May 28 17:45:07 2018 +0200 @@ -0,0 +1,1 @@ +!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){"use strict";function t(t){return!t.nodeName||-1!==e.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])}function o(t){return e.isFunction(t)||e.isPlainObject(t)?t:{top:t,left:t}}var n=e.scrollTo=function(t,o,n){return e(window).scrollTo(t,o,n)};return n.defaults={axis:"xy",duration:0,limit:!0},e.fn.scrollTo=function(r,i,s){"object"==typeof i&&(s=i,i=0),"function"==typeof s&&(s={onAfter:s}),"max"===r&&(r=9e9),s=e.extend({},n.defaults,s),i=i||s.duration;var a=s.queue&&s.axis.length>1;return a&&(i/=2),s.offset=o(s.offset),s.over=o(s.over),this.each(function(){function f(t){var o=e.extend({},s,{queue:!0,duration:i,complete:t&&function(){t.call(l,m,s)}});d.animate(p,o)}if(null!==r){var u,c=t(this),l=c?this.contentWindow||window:this,d=e(l),m=r,p={};switch(typeof m){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(m)){m=o(m);break}m=c?e(m):e(m,l);case"object":if(0===m.length)return;(m.is||m.style)&&(u=(m=e(m)).offset())}var h=e.isFunction(s.offset)&&s.offset(l,m)||s.offset;e.each(s.axis.split(""),function(e,t){var o="x"===t?"Left":"Top",r=o.toLowerCase(),i="scroll"+o,x=d[i](),v=n.max(l,t);if(u)p[i]=u[r]+(c?0:x-d.offset()[r]),s.margin&&(p[i]-=parseInt(m.css("margin"+o),10)||0,p[i]-=parseInt(m.css("border"+o+"Width"),10)||0),p[i]+=h[r]||0,s.over[r]&&(p[i]+=m["x"===t?"width":"height"]()*s.over[r]);else{var w=m[r];p[i]=w.slice&&"%"===w.slice(-1)?parseFloat(w)/100*v:w}s.limit&&/^\d+$/.test(p[i])&&(p[i]=p[i]<=0?0:Math.min(p[i],v)),!e&&s.axis.length>1&&(x===p[i]?p={}:a&&(f(s.onAfterFirst),p={}))}),f(s.onAfter)}})},n.max=function(o,n){var r="x"===n?"Width":"Height",i="scroll"+r;if(!t(o))return o[i]-e(o)[r.toLowerCase()]();var s="client"+r,a=o.ownerDocument||o.document,f=a.documentElement,u=a.body;return Math.max(f[i],u[i])-Math.min(f[s],u[s])},e.Tween.propHooks.scrollLeft=e.Tween.propHooks.scrollTop={get:function(t){return e(t.elem)[t.prop]()},set:function(t){var o=this.get(t);if(t.options.interrupt&&t._last&&t._last!==o)return e(t.elem).stop();var n=Math.round(t.now);o!==n&&(e(t.elem)[t.prop](n),t._last=this.get(t))}},n}); diff -r 277aea3b91ec -r fa838ff79f03 src/pyams_skin/resources/js/myams.js --- a/src/pyams_skin/resources/js/myams.js Mon May 28 14:06:21 2018 +0200 +++ b/src/pyams_skin/resources/js/myams.js Mon May 28 17:45:07 2018 +0200 @@ -5345,13 +5345,9 @@ content += ''; } content += ''; - var alert = $(content).insertBefore(parent); + $(content).insertBefore(parent); if (parent.exists) { - ams.ajax.check($.scrollTo, - ams.baseURL + 'ext/jquery-scrollTo.min.js', - function() { - $.scrollTo(parent, {offset: {top: -50}}); - }); + ams.skin.scrollTo(parent, {offset: {top: -50}}); } }, @@ -5429,6 +5425,29 @@ }, /** + * Scroll to given element + * + * @param element: the element to which to scroll + * @param options: scroll options + */ + scrollTo: function(element, options) { + ams.ajax.check($.scrollTo, + ams.baseURL + 'ext/jquery-scrollto-2.1.2' + ams.devext + '.js', + function() { + var body = $('body'); + var offset = options.offset || 0; + if (body.hasClass('fixed-header')) { + offset -= $('#header').height(); + } + if (body.hasClass('fixed-ribbon')) { + offset -= $('#ribbon').height(); + } + options = $.extend({}, options, {offset: offset}); + $.scrollTo(element, options); + }); + }, + + /** * Initialize breadcrumbs based on active menu position */ _drawBreadCrumb: function() { diff -r 277aea3b91ec -r fa838ff79f03 src/pyams_skin/resources/js/myams.min.js --- a/src/pyams_skin/resources/js/myams.min.js Mon May 28 14:06:21 2018 +0200 +++ b/src/pyams_skin/resources/js/myams.min.js Mon May 28 17:45:07 2018 +0200 @@ -1,1 +1,1 @@ -"use strict";!function(e,a){var t=a.console;String.prototype.startsWith=function(e){var a=this.length,t=e.length;return!(a0},void 0===e.scrollbarWidth&&(e.scrollbarWidth=function(){var a=e('
').appendTo("body"),t=a.children(),n=t.innerWidth()-t.height(99).innerWidth();return a.remove(),n}),e.fn.extend({exists:function(){return e(this).length>0},objectOrParentWithClass:function(e){return this.hasClass(e)?this:this.parents("."+e)},listattr:function(a){var t=[];return this.each(function(){t.push(e(this).attr(a))}),t},style:function(e,a,t){if(void 0!==this.get(0)){var n=this.get(0).style;return void 0!==e?void 0!==a?(t=void 0!==t?t:"",n.setProperty(e,a,t),this):n.getPropertyValue(e):n}},removeClassPrefix:function(a){return this.each(function(t,n){var s=n.className.split(" ").map(function(e){return e.startsWith(a)?"":e});n.className=e.trim(s.join(" "))}),this},contextMenu:function(a){function t(t,n,s){var i=e(window)[n](),r=e(a.menuSelector)[n](),o=t;return t+r>i&&r',openedSign:''},a),n=e(this);n.find("LI").each(function(){var a=e(this);if(a.find("UL").size()>0){a.find("A:first").append(""+t.closedSign+"");var n=a.find("A:first");"#"===n.attr("href")&&n.click(function(){return!1})}}),n.find("LI.active").each(function(){var a=e(this).parents("UL"),n=a.parent("LI");a.slideDown(t.speed),n.find("b:first").html(t.openedSign),n.addClass("open")}),n.find("LI A").on("click",function(){var a=e(this);if(!a.hasClass("active")){var s=a.attr("href").replace(/^#/,""),i=a.parent().find("UL");if(t.accordion){var r=a.parent().parents("UL"),o=n.find("UL:visible");o.each(function(a){var n=!0;if(r.each(function(e){if(r[e]===o[a])return n=!1,!1}),n&&i!==o[a]){var c=e(o[a]);!s&&c.hasClass("active")||c.slideUp(t.speed,function(){e(this).parent("LI").removeClass("open").find("B:first").delay(t.speed).html(t.closedSign)})}})}var c=a.parent().find("UL:first");s||!c.is(":visible")||c.hasClass("active")?c.slideDown(t.speed,function(){a.parent("LI").addClass("open").find("B:first").delay(t.speed).html(t.openedSign)}):c.slideUp(t.speed,function(){a.parent("LI").removeClass("open").find("B:first").delay(t.speed).html(t.closedSign)})}})}}),e.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");for(var a="",t=0;t127&&n<2048?(a+=String.fromCharCode(n>>6|192),a+=String.fromCharCode(63&n|128)):(a+=String.fromCharCode(n>>12|224),a+=String.fromCharCode(n>>6&63|128),a+=String.fromCharCode(63&n|128))}return a},decode:function(e){for(var a="",t=0,n=0,s=0,i=0;t191&&n<224?(s=e.charCodeAt(t+1),a+=String.fromCharCode((31&n)<<6|63&s),t+=2):(s=e.charCodeAt(t+1),i=e.charCodeAt(t+2),a+=String.fromCharCode((15&n)<<12|(63&s)<<6|63&i),t+=3);return a}},void 0===a.MyAMS&&(a.MyAMS={devmode:!0,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:!0,safeMethods:["GET","HEAD","OPTIONS","TRACE"],csrfCookieName:"csrf_token",csrfHeaderName:"X-CSRF-Token",enableWidgets:!0,enableMobile:!1,enableFastclick:!1,warnOnFormChange:!1,ismobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())});var n=a.MyAMS,s=n;n.baseURL=function(){var a=e('script[src*="/myams.js"], script[src*="/myams.min.js"]').attr("src");return s.devmode=a.indexOf(".min.js")<0,s.devext=s.devmode?"":".min",a.substring(0,a.lastIndexOf("/")+1)}(),n.log=function(){t&&t.debug&&t.debug(this,arguments)},n.getQueryVar=function(e,a){if(e.indexOf("?")<0)return!1;e.endsWith("&")||(e+="&");var t=new RegExp(".*?[&\\?]"+a+"=(.*?)&.*"),n=e.replace(t,"$1");return n!==e&&n},n.rgb2hex=function(a){return"#"+e.map(a.match(/\b(\d+)\b/g),function(e){return("0"+parseInt(e).toString(16)).slice(-2)}).join("")},n.generateId=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()},n.generateUUID=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===a?t:3&t|8).toString(16)})},n.getObject=function(e,a){if(e){if("string"!=typeof e)return e;var t=e.split(".");a=void 0===a||null===a?window:a;for(var n=0;n").attr("data-ams-id",t).text('@import "'+s.getSource(a)+'";'),n)var c=setInterval(function(){try{o[0].sheet.cssRules;n.call(window,!0,i),clearInterval(c)}catch(e){}},10);o.appendTo(r)}else n&&n.call(window,!1,i)},n.event={stop:function(e){e||(e=window.event),e&&"string"!=typeof e&&(e.stopPropagation?(e.stopPropagation(),e.preventDefault()):(e.cancelBubble=!0,e.returnValue=!1))}},n.browser={getInternetExplorerVersion:function(){var e=-1;if("Microsoft Internet Explorer"===navigator.appName){var a=navigator.userAgent;null!==new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(a)&&(e=parseFloat(RegExp.$1))}return e},checkVersion:function(){var e="You're not using Windows Internet Explorer.",t=this.getInternetExplorerVersion();t>-1&&(e=t>=8?"You're using a recent copy of Windows Internet Explorer.":"You should upgrade your copy of Windows Internet Explorer."),a.alert&&a.alert(e)},isIE8orlower:function(){var e="0",a=this.getInternetExplorerVersion();return a>-1&&(e=a>=9?0:1),e},copyToClipboard:function(i){function r(i){var r=!1;if(window.clipboardData&&window.clipboardData.setData)r=clipboardData.setData("Text",i);else if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var o=e("