💄 Update common creative post link setting.

This commit is contained in:
凡梦星尘
2022-06-20 18:54:43 +08:00
parent 26f36810c9
commit c116aa31ad
3 changed files with 20 additions and 6 deletions

View File

@@ -23,6 +23,19 @@ HTMLElement.prototype.wrap = function(wrapper) {
NexT.utils = {
replacePostCRLink: function() {
if (CONFIG.hostname.startsWith('http')) return;
// Try to support mutli domain without base URL sets.
let href = window.location.href;
if (href.indexOf('#')>-1){
href = href.split('#')[0];
}
let postLink = document.getElementById('post-cr-link');
if (!postLink) return;
postLink.text = href;
postLink.href = href;
},
/**
* One-click copy code support.
*/