:sparkles::fire:💄 Remove sharethis & add others.

This commit is contained in:
elkan1788
2024-08-05 20:38:20 +08:00
parent 85c3eb9d3b
commit e6ee562996
13 changed files with 150 additions and 37 deletions

View File

@@ -91,3 +91,21 @@
}
}
}
@if $post_share_enable {
.post-share-tools {
display: flex;
justify-content: center;
a {
border: 0px;
}
}
@if $post_sharethis_set {
.st-cmp-settings {
display: none;
}
}
}

View File

@@ -85,6 +85,8 @@ $post_edit_enable : {{ $P.postEdit.enable }};
$post_meta_item_text : {{ $P.postMeta.itemText }};
$reward_settings_animation : {{ $P.rewardSets.animation }};
$post_end_tag_icon : {{ $P.postFooter.tagIcon }};
$post_share_enable : {{ $P.share.enable }};
$post_sharethis_set : {{ isset $P.share "sharethis" }};
// TODO find the paramters
$text_align_desktop : {{ $P.textAlign.desktop }};

View File

@@ -1,16 +0,0 @@
/* AddThis share plugin */
NexT.plugins.share.addthis = function() {
const element = '.addthis_inline_share_toolbox';
if (!NexT.CONFIG.addthis || !NexT.utils.checkDOMExist(element)) return;
const addthis_js = NexT.CONFIG.addthis.js + '?pubid=' + NexT.CONFIG.addthis.cfg.pubid;
NexT.utils.lazyLoadComponent(element, function() {
NexT.utils.getScript(addthis_js, {
attributes: {
async: false
},
parentNode: document.querySelector(element)
});
});
}

24
assets/js/third-party/share/addtoany.js vendored Normal file
View File

@@ -0,0 +1,24 @@
/* Addtoany share plugin */
NexT.plugins.share.addtoany = function() {
const element = '.a2a_kit';
if (!NexT.CONFIG.share.enable || !NexT.utils.checkDOMExist(element)) return;
const addtoany = NexT.CONFIG.share.addtoany;
if (!addtoany) return;
NexT.utils.lazyLoadComponent(element, function() {
let addtoany_cfg = `
var a2a_config = a2a_config || {};
a2a_config.onclick = 1;
a2a_config.locale = "${addtoany.locale}";
a2a_config.num_services = ${addtoany.num};
`;
NexT.utils.getScript(null, {
textContent: addtoany_cfg
});
NexT.utils.getScript(addtoany.js, () => { NexT.utils.hiddeLodingCmp(element); });
});
}

View File

@@ -0,0 +1,21 @@
/* Sharethis share plugin */
NexT.plugins.share.sharethis = function() {
const element = '.sharethis-inline-share-buttons';
if (!NexT.CONFIG.share.enable || !NexT.utils.checkDOMExist(element)) return;
const sharethis = NexT.CONFIG.share.sharethis;
if (!sharethis) return;
const sharethis_js = sharethis.js.replace(/id/, sharethis.id);
NexT.utils.lazyLoadComponent(element, function() {
NexT.utils.getScript(sharethis_js, {
attributes: {
async: 'async'
}
});
NexT.utils.hiddeLodingCmp(element);
});
}