From 363d814f01c0c57875b2124860a6a9e1365129b2 Mon Sep 17 00:00:00 2001 From: spirit Date: Wed, 5 Jun 2019 19:26:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E4=B8=8D=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E5=89=AA=E8=B4=B4=E6=9D=BF=E7=89=88=E6=9D=83=E6=A0=87?= =?UTF-8?q?=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/swicher.php | 3 ++- js/sakura-app.js | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/inc/swicher.php b/inc/swicher.php index 0dcc63d..1175845 100644 --- a/inc/swicher.php +++ b/inc/swicher.php @@ -15,6 +15,7 @@ mashiro_option.template_url = ""; mashiro_option.site_url = ""; mashiro_option.qq_api_url = "https://api.2heng.xin/qqinfo/"; mashiro_option.qq_avatar_api_url = "https://api.2heng.xin/qqinfo/"; +mashiro_option.is_admin = ; mashiro_option.land_at_home = true; @@ -60,4 +61,4 @@ mashiro_option.cover_api = ""; /*End of Initial Variables*/ " + "# For commercial use, please contact the author for authorization. For non-commercial use, please indicate the source.
" + "# 协议(License):署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)
" + "# 作者(Author):" + mashiro_option.author_name + "
" + "# 链接(URL):" + window.location.href + "
" + "# 来源(Source):" + mashiro_option.site_name + "

" + window.getSelection().toString().replace(/\r\n/g, "
");; - var textData = "# 商业转载请联系作者获得授权,非商业转载请注明出处。\n" + "# For commercial use, please contact the author for authorization. For non-commercial use, please indicate the source.\n" + "# 协议(License):署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)\n" + "# 作者(Author):" + mashiro_option.author_name + "\n" + "# 链接(URL):" + window.location.href + "\n" + "# 来源(Source):" + mashiro_option.site_name + "\n\n" + window.getSelection().toString().replace(/\r\n/g, "\n"); - if (event.clipboardData) { - event.clipboardData.setData("text/html", htmlData); - event.clipboardData.setData("text/plain", textData); - } else if (window.clipboardData) { - return window.clipboardData.setData("text", textData); + if (mashiro_option.is_admin == false){ + event.preventDefault(); + var htmlData = "# 商业转载请联系作者获得授权,非商业转载请注明出处。
" + "# For commercial use, please contact the author for authorization. For non-commercial use, please indicate the source.
" + "# 协议(License):署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)
" + "# 作者(Author):" + mashiro_option.author_name + "
" + "# 链接(URL):" + window.location.href + "
" + "# 来源(Source):" + mashiro_option.site_name + "

" + window.getSelection().toString().replace(/\r\n/g, "
");; + var textData = "# 商业转载请联系作者获得授权,非商业转载请注明出处。\n" + "# For commercial use, please contact the author for authorization. For non-commercial use, please indicate the source.\n" + "# 协议(License):署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)\n" + "# 作者(Author):" + mashiro_option.author_name + "\n" + "# 链接(URL):" + window.location.href + "\n" + "# 来源(Source):" + mashiro_option.site_name + "\n\n" + window.getSelection().toString().replace(/\r\n/g, "\n"); + if (event.clipboardData) { + event.clipboardData.setData("text/html", htmlData); + event.clipboardData.setData("text/plain", textData); + } else if (window.clipboardData) { + return window.clipboardData.setData("text", textData); + } } } } @@ -1811,4 +1813,4 @@ if ((isWebkit || isOpera || isIe) && document.getElementById && window.addEventL element.focus(); } }, false); -} \ No newline at end of file +}