🎨 🐛 Rename file & path & remove unused file.
This commit is contained in:
24
assets/js/3rd/share/addtoany.js
Normal file
24
assets/js/3rd/share/addtoany.js
Normal 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); });
|
||||
});
|
||||
}
|
||||
21
assets/js/3rd/share/sharethis.js
Normal file
21
assets/js/3rd/share/sharethis.js
Normal 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);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user