From 7471b17f9c5c17e51c360f40e5d525d9e350ede1 Mon Sep 17 00:00:00 2001 From: Comsenz <10433182@qq.com> Date: Mon, 13 Nov 2017 11:53:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E5=88=B0=E5=89=AA=E8=B4=B4=E6=9D=BF=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/static/js/common.js | 42 +++++++++++++++++++++++++++++++- upload/static/js/common_extra.js | 19 --------------- 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/upload/static/js/common.js b/upload/static/js/common.js index 96d89a3..7abeef9 100644 --- a/upload/static/js/common.js +++ b/upload/static/js/common.js @@ -1572,7 +1572,47 @@ function getClipboardData() { } function setCopy(text, msg) { - $F('_setCopy', arguments); + var cp = document.createElement('textarea'); + cp.style.fontSize = '12pt'; + cp.style.border = '0'; + cp.style.padding = '0'; + cp.style.margin = '0'; + cp.style.position = 'absolute'; + cp.style.left = '-9999px'; + var yPosition = window.pageYOffset || document.documentElement.scrollTop; + cp.style.top = yPosition + 'px'; + cp.setAttribute('readonly', ''); + cp.value = text; + $('append_parent').appendChild(cp); + cp.select(); + cp.setSelectionRange(0, cp.value.length); + try { + var success = document.execCommand('copy', false, null); + } catch (e) { + var success = false; + } + $('append_parent').removeChild(cp); + + if(success) { + if(msg) { + showPrompt(null, null, '' + msg + '', 1500); + } + } else if(BROWSER.ie) { + var r = clipboardData.setData('Text', text); + if(r) { + if(msg) { + showPrompt(null, null, '' + msg + '', 1500); + } + } else { + showDialog('