diff -r 27ed26ca8623 -r 02a40997d8cb src/ztfy/myams/resources/js/myams.js --- a/src/ztfy/myams/resources/js/myams.js Fri May 12 14:03:02 2017 +0200 +++ b/src/ztfy/myams/resources/js/myams.js Thu Oct 26 14:45:34 2017 +0200 @@ -14,6 +14,8 @@ "use strict"; + var console = globals.console; + /** * String prototype extensions */ @@ -100,7 +102,7 @@ */ if ($.scrollbarWidth === undefined) { $.scrollbarWidth = function() { - var parent = $('
').appendTo('body'); + var parent = $('
').appendTo('body'); var child = parent.children(); var width = child.innerWidth() - child.height(99).innerWidth(); parent.remove(); @@ -444,8 +446,8 @@ * Basic logging function which log all arguments to console */ MyAMS.log = function() { - if (globals.console) { - globals.console.log(this, arguments); + if (console) { + console.debug && console.debug(this, arguments); } }; @@ -688,14 +690,55 @@ return msg; }, - copyToClipboard: function() { - return function() { - var source = $(this); - source.parents('.btn-group').removeClass('open'); - if (globals.prompt) { - globals.prompt(MyAMS.i18n.CLIPBOARD_COPY, source.text()); + + 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 = $("