mirror of
https://github.com/mashirozx/sakura.git
synced 2025-05-29 01:49:21 +08:00
管理员不开启剪贴板版权标识
This commit is contained in:
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.site_url = "<?php echo site_url(); ?>";
|
||||||
mashiro_option.qq_api_url = "https://api.2heng.xin/qqinfo/";
|
mashiro_option.qq_api_url = "https://api.2heng.xin/qqinfo/";
|
||||||
mashiro_option.qq_avatar_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() ){ ?>
|
<?php if( is_home() ){ ?>
|
||||||
mashiro_option.land_at_home = true;
|
mashiro_option.land_at_home = true;
|
||||||
@ -60,4 +61,4 @@ mashiro_option.cover_api = "<?php echo $imgurl; ?>";
|
|||||||
/*End of Initial Variables*/
|
/*End of Initial Variables*/
|
||||||
</script>
|
</script>
|
||||||
<?php }
|
<?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) {
|
function setClipboardText(event) {
|
||||||
event.preventDefault();
|
if (mashiro_option.is_admin == false){
|
||||||
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>");;
|
event.preventDefault();
|
||||||
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");
|
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>");;
|
||||||
if (event.clipboardData) {
|
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");
|
||||||
event.clipboardData.setData("text/html", htmlData);
|
if (event.clipboardData) {
|
||||||
event.clipboardData.setData("text/plain", textData);
|
event.clipboardData.setData("text/html", htmlData);
|
||||||
} else if (window.clipboardData) {
|
event.clipboardData.setData("text/plain", textData);
|
||||||
return window.clipboardData.setData("text", 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();
|
element.focus();
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user