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 +}