mirror of https://github.com/mashirozx/sakura.git
管理员不开启剪贴板版权标识
parent
919f3812df
commit
363d814f01
|
@ -15,6 +15,7 @@ mashiro_option.template_url = "<?php echo get_template_directory_uri(); ?>";
|
|||
mashiro_option.site_url = "<?php echo 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 = <?php if( current_user_can( 'manage_options' ) ) { echo 'true'; } else { echo 'false'; } ?>;
|
||||
|
||||
<?php if( is_home() ){ ?>
|
||||
mashiro_option.land_at_home = true;
|
||||
|
@ -60,4 +61,4 @@ mashiro_option.cover_api = "<?php echo $imgurl; ?>";
|
|||
/*End of Initial Variables*/
|
||||
</script>
|
||||
<?php }
|
||||
add_action('wp_head', 'font_end_js_control');
|
||||
add_action('wp_head', 'font_end_js_control');
|
||||
|
|
|
@ -783,14 +783,16 @@ function add_copyright() {
|
|||
});
|
||||
|
||||
function setClipboardText(event) {
|
||||
event.preventDefault();
|
||||
var htmlData = "# 商业转载请联系作者获得授权,非商业转载请注明出处。<br>" + "# For commercial use, please contact the author for authorization. For non-commercial use, please indicate the source.<br>" + "# 协议(License):署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)<br>" + "# 作者(Author):" + mashiro_option.author_name + "<br>" + "# 链接(URL):" + window.location.href + "<br>" + "# 来源(Source):" + mashiro_option.site_name + "<br><br>" + window.getSelection().toString().replace(/\r\n/g, "<br>");;
|
||||
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 = "# 商业转载请联系作者获得授权,非商业转载请注明出处。<br>" + "# For commercial use, please contact the author for authorization. For non-commercial use, please indicate the source.<br>" + "# 协议(License):署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)<br>" + "# 作者(Author):" + mashiro_option.author_name + "<br>" + "# 链接(URL):" + window.location.href + "<br>" + "# 来源(Source):" + mashiro_option.site_name + "<br><br>" + window.getSelection().toString().replace(/\r\n/g, "<br>");;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue