🎨 🐛 Rename file & path & remove unused file.
This commit is contained in:
53
assets/js/3rd/comments/waline.js
Normal file
53
assets/js/3rd/comments/waline.js
Normal file
@@ -0,0 +1,53 @@
|
||||
/* Waline comment plugin */
|
||||
NexT.plugins.comments.waline = function() {
|
||||
const element = '.waline-container';
|
||||
if (!NexT.CONFIG.waline
|
||||
|| !NexT.utils.checkDOMExist(element)) return;
|
||||
|
||||
const {
|
||||
emoji,
|
||||
imguploader,
|
||||
placeholder,
|
||||
sofa,
|
||||
requiredmeta,
|
||||
serverurl,
|
||||
wordlimit,
|
||||
reaction,
|
||||
reactiontext,
|
||||
reactiontitle
|
||||
} = NexT.CONFIG.waline.cfg;
|
||||
|
||||
const waline_js = NexT.utils.getCDNResource(NexT.CONFIG.waline.js);
|
||||
|
||||
let locale = {
|
||||
placeholder : placeholder,
|
||||
sofa : sofa,
|
||||
reactionTitle : reactiontitle
|
||||
};
|
||||
|
||||
reactiontext.forEach(function(value, index){
|
||||
locale['reaction'+index] = value;
|
||||
});
|
||||
|
||||
NexT.utils.lazyLoadComponent(element, function () {
|
||||
NexT.utils.getScript(waline_js, function(){
|
||||
const waline_css = NexT.utils.getCDNResource(NexT.CONFIG.waline.css);
|
||||
NexT.utils.getStyle(waline_css, 'before');
|
||||
|
||||
Waline.init({
|
||||
locale,
|
||||
el : element,
|
||||
emoji : emoji,
|
||||
imageUploader : imguploader,
|
||||
wordLimit : wordlimit,
|
||||
requiredMeta : requiredmeta,
|
||||
reaction : reaction,
|
||||
serverURL : serverurl,
|
||||
lang : NexT.CONFIG.lang,
|
||||
dark : 'html[data-theme="dark"]'
|
||||
});
|
||||
|
||||
NexT.utils.hiddeLodingCmp(element);
|
||||
})
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user