mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
upLG
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
export interface CommentStrings {
|
||||
toggleComments: string;
|
||||
}
|
||||
export interface CommentSettings {
|
||||
/**
|
||||
* Enable comment box
|
||||
*/
|
||||
commentBox: boolean;
|
||||
/**
|
||||
* Enable facebook comment box
|
||||
*/
|
||||
fbComments: boolean;
|
||||
/**
|
||||
* Enable disqus comment box
|
||||
*/
|
||||
disqusComments: boolean;
|
||||
/**
|
||||
* Disqus comment config
|
||||
*/
|
||||
disqusConfig: {
|
||||
title?: string;
|
||||
language: string;
|
||||
};
|
||||
/**
|
||||
* Facebook comments default markup
|
||||
*/
|
||||
commentsMarkup: string;
|
||||
/**
|
||||
* Custom translation strings for aria-labels
|
||||
*/
|
||||
commentPluginStrings: CommentStrings;
|
||||
}
|
||||
export declare const commentSettings: CommentSettings;
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* lightGallery comments module
|
||||
* Supports facebook and disqus comments
|
||||
*
|
||||
* @ref - https://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables
|
||||
* @ref - https://github.com/disqus/DISQUS-API-Recipes/blob/master/snippets/js/disqus-reset/disqus_reset.html
|
||||
* @ref - https://css-tricks.com/lazy-loading-disqus-comments/
|
||||
* @ref - https://developers.facebook.com/docs/plugins/comments/#comments-plugin
|
||||
*
|
||||
*/
|
||||
import { LgQuery } from '../../lgQuery';
|
||||
import { LightGallery } from '../../lightgallery';
|
||||
import { CommentSettings } from './lg-comment-settings';
|
||||
export default class CommentBox {
|
||||
core: LightGallery;
|
||||
settings: CommentSettings;
|
||||
private $LG;
|
||||
constructor(instance: LightGallery, $LG: LgQuery);
|
||||
init(): void;
|
||||
private setMarkup;
|
||||
toggleCommentBox(): void;
|
||||
addFbComments(): void;
|
||||
addDisqusComments(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
/*!
|
||||
* lightgallery | 2.9.0 | October 1st 2025
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
|
||||
/**
|
||||
* List of lightGallery events
|
||||
* All events should be documented here
|
||||
* Below interfaces are used to build the website documentations
|
||||
* */
|
||||
var lGEvents = {
|
||||
afterAppendSlide: 'lgAfterAppendSlide',
|
||||
init: 'lgInit',
|
||||
hasVideo: 'lgHasVideo',
|
||||
containerResize: 'lgContainerResize',
|
||||
updateSlides: 'lgUpdateSlides',
|
||||
afterAppendSubHtml: 'lgAfterAppendSubHtml',
|
||||
beforeOpen: 'lgBeforeOpen',
|
||||
afterOpen: 'lgAfterOpen',
|
||||
slideItemLoad: 'lgSlideItemLoad',
|
||||
beforeSlide: 'lgBeforeSlide',
|
||||
afterSlide: 'lgAfterSlide',
|
||||
posterClick: 'lgPosterClick',
|
||||
dragStart: 'lgDragStart',
|
||||
dragMove: 'lgDragMove',
|
||||
dragEnd: 'lgDragEnd',
|
||||
beforeNextSlide: 'lgBeforeNextSlide',
|
||||
beforePrevSlide: 'lgBeforePrevSlide',
|
||||
beforeClose: 'lgBeforeClose',
|
||||
afterClose: 'lgAfterClose',
|
||||
rotateLeft: 'lgRotateLeft',
|
||||
rotateRight: 'lgRotateRight',
|
||||
flipHorizontal: 'lgFlipHorizontal',
|
||||
flipVertical: 'lgFlipVertical',
|
||||
autoplay: 'lgAutoplay',
|
||||
autoplayStart: 'lgAutoplayStart',
|
||||
autoplayStop: 'lgAutoplayStop',
|
||||
};
|
||||
|
||||
var commentSettings = {
|
||||
commentBox: false,
|
||||
fbComments: false,
|
||||
disqusComments: false,
|
||||
disqusConfig: {
|
||||
title: undefined,
|
||||
language: 'en',
|
||||
},
|
||||
commentsMarkup: '<div id="lg-comment-box" class="lg-comment-box lg-fb-comment-box"><div class="lg-comment-header"><h3 class="lg-comment-title">Leave a comment.</h3><span class="lg-comment-close lg-icon"></span></div><div class="lg-comment-body"></div></div>',
|
||||
commentPluginStrings: {
|
||||
toggleComments: 'Toggle Comments',
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* lightGallery comments module
|
||||
* Supports facebook and disqus comments
|
||||
*
|
||||
* @ref - https://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables
|
||||
* @ref - https://github.com/disqus/DISQUS-API-Recipes/blob/master/snippets/js/disqus-reset/disqus_reset.html
|
||||
* @ref - https://css-tricks.com/lazy-loading-disqus-comments/
|
||||
* @ref - https://developers.facebook.com/docs/plugins/comments/#comments-plugin
|
||||
*
|
||||
*/
|
||||
var CommentBox = /** @class */ (function () {
|
||||
function CommentBox(instance, $LG) {
|
||||
// get lightGallery core plugin instance
|
||||
this.core = instance;
|
||||
this.$LG = $LG;
|
||||
// extend module default settings with lightGallery core settings
|
||||
this.settings = __assign(__assign({}, commentSettings), this.core.settings);
|
||||
return this;
|
||||
}
|
||||
CommentBox.prototype.init = function () {
|
||||
if (!this.settings.commentBox) {
|
||||
return;
|
||||
}
|
||||
this.setMarkup();
|
||||
this.toggleCommentBox();
|
||||
if (this.settings.fbComments) {
|
||||
this.addFbComments();
|
||||
}
|
||||
else if (this.settings.disqusComments) {
|
||||
this.addDisqusComments();
|
||||
}
|
||||
};
|
||||
CommentBox.prototype.setMarkup = function () {
|
||||
this.core.outer.append(this.settings.commentsMarkup +
|
||||
'<div class="lg-comment-overlay"></div>');
|
||||
var commentToggleBtn = "<button type=\"button\" aria-label=\"" + this.settings.commentPluginStrings['toggleComments'] + "\" class=\"lg-comment-toggle lg-icon\"></button>";
|
||||
this.core.$toolbar.append(commentToggleBtn);
|
||||
};
|
||||
CommentBox.prototype.toggleCommentBox = function () {
|
||||
var _this_1 = this;
|
||||
this.core.outer
|
||||
.find('.lg-comment-toggle')
|
||||
.first()
|
||||
.on('click.lg.comment', function () {
|
||||
_this_1.core.outer.toggleClass('lg-comment-active');
|
||||
});
|
||||
this.core.outer
|
||||
.find('.lg-comment-overlay')
|
||||
.first()
|
||||
.on('click.lg.comment', function () {
|
||||
_this_1.core.outer.removeClass('lg-comment-active');
|
||||
});
|
||||
this.core.outer
|
||||
.find('.lg-comment-close')
|
||||
.first()
|
||||
.on('click.lg.comment', function () {
|
||||
_this_1.core.outer.removeClass('lg-comment-active');
|
||||
});
|
||||
};
|
||||
CommentBox.prototype.addFbComments = function () {
|
||||
var _this_1 = this;
|
||||
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
||||
var _this = this;
|
||||
this.core.LGel.on(lGEvents.beforeSlide + ".comment", function (event) {
|
||||
var html = _this_1.core.galleryItems[event.detail.index].fbHtml;
|
||||
_this_1.core.outer.find('.lg-comment-body').html(html);
|
||||
});
|
||||
this.core.LGel.on(lGEvents.afterSlide + ".comment", function () {
|
||||
try {
|
||||
FB.XFBML.parse();
|
||||
}
|
||||
catch (err) {
|
||||
_this.$LG(window).on('fbAsyncInit', function () {
|
||||
FB.XFBML.parse();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
CommentBox.prototype.addDisqusComments = function () {
|
||||
var _this_1 = this;
|
||||
var $disqusThread = this.$LG('#disqus_thread');
|
||||
$disqusThread.remove();
|
||||
this.core.outer
|
||||
.find('.lg-comment-body')
|
||||
.append('<div id="disqus_thread"></div>');
|
||||
this.core.LGel.on(lGEvents.beforeSlide + ".comment", function () {
|
||||
$disqusThread.html('');
|
||||
});
|
||||
this.core.LGel.on(lGEvents.afterSlide + ".comment", function (event) {
|
||||
var index = event.detail.index;
|
||||
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
||||
var _this = _this_1;
|
||||
// DISQUS needs sometime to intialize when lightGallery is opened from direct url(hash plugin).
|
||||
setTimeout(function () {
|
||||
try {
|
||||
DISQUS.reset({
|
||||
reload: true,
|
||||
config: function () {
|
||||
this.page.identifier =
|
||||
_this.core.galleryItems[index].disqusIdentifier;
|
||||
this.page.url =
|
||||
_this.core.galleryItems[index].disqusURL;
|
||||
this.page.title =
|
||||
_this.settings.disqusConfig.title;
|
||||
this.language =
|
||||
_this.settings.disqusConfig.language;
|
||||
},
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
console.error('Make sure you have included disqus JavaScript code in your document. Ex - https://lg-disqus.disqus.com/admin/install/platforms/universalcode/');
|
||||
}
|
||||
}, _this.core.lGalleryOn ? 0 : 1000);
|
||||
});
|
||||
};
|
||||
CommentBox.prototype.destroy = function () {
|
||||
this.core.LGel.off('.lg.comment');
|
||||
this.core.LGel.off('.comment');
|
||||
};
|
||||
return CommentBox;
|
||||
}());
|
||||
|
||||
export default CommentBox;
|
||||
//# sourceMappingURL=lg-comment.es5.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* lightgallery | 2.9.0 | October 1st 2025
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgComment=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},e="lgBeforeSlide",o="lgAfterSlide",n={commentBox:!1,fbComments:!1,disqusComments:!1,disqusConfig:{title:void 0,language:"en"},commentsMarkup:'<div id="lg-comment-box" class="lg-comment-box lg-fb-comment-box"><div class="lg-comment-header"><h3 class="lg-comment-title">Leave a comment.</h3><span class="lg-comment-close lg-icon"></span></div><div class="lg-comment-body"></div></div>',commentPluginStrings:{toggleComments:"Toggle Comments"}};return function(){function i(e,o){return this.core=e,this.$LG=o,this.settings=t(t({},n),this.core.settings),this}return i.prototype.init=function(){this.settings.commentBox&&(this.setMarkup(),this.toggleCommentBox(),this.settings.fbComments?this.addFbComments():this.settings.disqusComments&&this.addDisqusComments())},i.prototype.setMarkup=function(){this.core.outer.append(this.settings.commentsMarkup+'<div class="lg-comment-overlay"></div>');var t='<button type="button" aria-label="'+this.settings.commentPluginStrings.toggleComments+'" class="lg-comment-toggle lg-icon"></button>';this.core.$toolbar.append(t)},i.prototype.toggleCommentBox=function(){var t=this;this.core.outer.find(".lg-comment-toggle").first().on("click.lg.comment",(function(){t.core.outer.toggleClass("lg-comment-active")})),this.core.outer.find(".lg-comment-overlay").first().on("click.lg.comment",(function(){t.core.outer.removeClass("lg-comment-active")})),this.core.outer.find(".lg-comment-close").first().on("click.lg.comment",(function(){t.core.outer.removeClass("lg-comment-active")}))},i.prototype.addFbComments=function(){var t=this,n=this;this.core.LGel.on(e+".comment",(function(e){var o=t.core.galleryItems[e.detail.index].fbHtml;t.core.outer.find(".lg-comment-body").html(o)})),this.core.LGel.on(o+".comment",(function(){try{FB.XFBML.parse()}catch(t){n.$LG(window).on("fbAsyncInit",(function(){FB.XFBML.parse()}))}}))},i.prototype.addDisqusComments=function(){var t=this,n=this.$LG("#disqus_thread");n.remove(),this.core.outer.find(".lg-comment-body").append('<div id="disqus_thread"></div>'),this.core.LGel.on(e+".comment",(function(){n.html("")})),this.core.LGel.on(o+".comment",(function(e){var o=e.detail.index,n=t;setTimeout((function(){try{DISQUS.reset({reload:!0,config:function(){this.page.identifier=n.core.galleryItems[o].disqusIdentifier,this.page.url=n.core.galleryItems[o].disqusURL,this.page.title=n.settings.disqusConfig.title,this.language=n.settings.disqusConfig.language}})}catch(t){console.error("Make sure you have included disqus JavaScript code in your document. Ex - https://lg-disqus.disqus.com/admin/install/platforms/universalcode/")}}),n.core.lGalleryOn?0:1e3)}))},i.prototype.destroy=function(){this.core.LGel.off(".lg.comment"),this.core.LGel.off(".comment")},i}()}));
|
||||
@@ -0,0 +1,213 @@
|
||||
/*!
|
||||
* lightgallery | 2.9.0 | October 1st 2025
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgComment = factory());
|
||||
}(this, (function () { 'use strict';
|
||||
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
|
||||
/**
|
||||
* List of lightGallery events
|
||||
* All events should be documented here
|
||||
* Below interfaces are used to build the website documentations
|
||||
* */
|
||||
var lGEvents = {
|
||||
afterAppendSlide: 'lgAfterAppendSlide',
|
||||
init: 'lgInit',
|
||||
hasVideo: 'lgHasVideo',
|
||||
containerResize: 'lgContainerResize',
|
||||
updateSlides: 'lgUpdateSlides',
|
||||
afterAppendSubHtml: 'lgAfterAppendSubHtml',
|
||||
beforeOpen: 'lgBeforeOpen',
|
||||
afterOpen: 'lgAfterOpen',
|
||||
slideItemLoad: 'lgSlideItemLoad',
|
||||
beforeSlide: 'lgBeforeSlide',
|
||||
afterSlide: 'lgAfterSlide',
|
||||
posterClick: 'lgPosterClick',
|
||||
dragStart: 'lgDragStart',
|
||||
dragMove: 'lgDragMove',
|
||||
dragEnd: 'lgDragEnd',
|
||||
beforeNextSlide: 'lgBeforeNextSlide',
|
||||
beforePrevSlide: 'lgBeforePrevSlide',
|
||||
beforeClose: 'lgBeforeClose',
|
||||
afterClose: 'lgAfterClose',
|
||||
rotateLeft: 'lgRotateLeft',
|
||||
rotateRight: 'lgRotateRight',
|
||||
flipHorizontal: 'lgFlipHorizontal',
|
||||
flipVertical: 'lgFlipVertical',
|
||||
autoplay: 'lgAutoplay',
|
||||
autoplayStart: 'lgAutoplayStart',
|
||||
autoplayStop: 'lgAutoplayStop',
|
||||
};
|
||||
|
||||
var commentSettings = {
|
||||
commentBox: false,
|
||||
fbComments: false,
|
||||
disqusComments: false,
|
||||
disqusConfig: {
|
||||
title: undefined,
|
||||
language: 'en',
|
||||
},
|
||||
commentsMarkup: '<div id="lg-comment-box" class="lg-comment-box lg-fb-comment-box"><div class="lg-comment-header"><h3 class="lg-comment-title">Leave a comment.</h3><span class="lg-comment-close lg-icon"></span></div><div class="lg-comment-body"></div></div>',
|
||||
commentPluginStrings: {
|
||||
toggleComments: 'Toggle Comments',
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* lightGallery comments module
|
||||
* Supports facebook and disqus comments
|
||||
*
|
||||
* @ref - https://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables
|
||||
* @ref - https://github.com/disqus/DISQUS-API-Recipes/blob/master/snippets/js/disqus-reset/disqus_reset.html
|
||||
* @ref - https://css-tricks.com/lazy-loading-disqus-comments/
|
||||
* @ref - https://developers.facebook.com/docs/plugins/comments/#comments-plugin
|
||||
*
|
||||
*/
|
||||
var CommentBox = /** @class */ (function () {
|
||||
function CommentBox(instance, $LG) {
|
||||
// get lightGallery core plugin instance
|
||||
this.core = instance;
|
||||
this.$LG = $LG;
|
||||
// extend module default settings with lightGallery core settings
|
||||
this.settings = __assign(__assign({}, commentSettings), this.core.settings);
|
||||
return this;
|
||||
}
|
||||
CommentBox.prototype.init = function () {
|
||||
if (!this.settings.commentBox) {
|
||||
return;
|
||||
}
|
||||
this.setMarkup();
|
||||
this.toggleCommentBox();
|
||||
if (this.settings.fbComments) {
|
||||
this.addFbComments();
|
||||
}
|
||||
else if (this.settings.disqusComments) {
|
||||
this.addDisqusComments();
|
||||
}
|
||||
};
|
||||
CommentBox.prototype.setMarkup = function () {
|
||||
this.core.outer.append(this.settings.commentsMarkup +
|
||||
'<div class="lg-comment-overlay"></div>');
|
||||
var commentToggleBtn = "<button type=\"button\" aria-label=\"" + this.settings.commentPluginStrings['toggleComments'] + "\" class=\"lg-comment-toggle lg-icon\"></button>";
|
||||
this.core.$toolbar.append(commentToggleBtn);
|
||||
};
|
||||
CommentBox.prototype.toggleCommentBox = function () {
|
||||
var _this_1 = this;
|
||||
this.core.outer
|
||||
.find('.lg-comment-toggle')
|
||||
.first()
|
||||
.on('click.lg.comment', function () {
|
||||
_this_1.core.outer.toggleClass('lg-comment-active');
|
||||
});
|
||||
this.core.outer
|
||||
.find('.lg-comment-overlay')
|
||||
.first()
|
||||
.on('click.lg.comment', function () {
|
||||
_this_1.core.outer.removeClass('lg-comment-active');
|
||||
});
|
||||
this.core.outer
|
||||
.find('.lg-comment-close')
|
||||
.first()
|
||||
.on('click.lg.comment', function () {
|
||||
_this_1.core.outer.removeClass('lg-comment-active');
|
||||
});
|
||||
};
|
||||
CommentBox.prototype.addFbComments = function () {
|
||||
var _this_1 = this;
|
||||
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
||||
var _this = this;
|
||||
this.core.LGel.on(lGEvents.beforeSlide + ".comment", function (event) {
|
||||
var html = _this_1.core.galleryItems[event.detail.index].fbHtml;
|
||||
_this_1.core.outer.find('.lg-comment-body').html(html);
|
||||
});
|
||||
this.core.LGel.on(lGEvents.afterSlide + ".comment", function () {
|
||||
try {
|
||||
FB.XFBML.parse();
|
||||
}
|
||||
catch (err) {
|
||||
_this.$LG(window).on('fbAsyncInit', function () {
|
||||
FB.XFBML.parse();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
CommentBox.prototype.addDisqusComments = function () {
|
||||
var _this_1 = this;
|
||||
var $disqusThread = this.$LG('#disqus_thread');
|
||||
$disqusThread.remove();
|
||||
this.core.outer
|
||||
.find('.lg-comment-body')
|
||||
.append('<div id="disqus_thread"></div>');
|
||||
this.core.LGel.on(lGEvents.beforeSlide + ".comment", function () {
|
||||
$disqusThread.html('');
|
||||
});
|
||||
this.core.LGel.on(lGEvents.afterSlide + ".comment", function (event) {
|
||||
var index = event.detail.index;
|
||||
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
||||
var _this = _this_1;
|
||||
// DISQUS needs sometime to intialize when lightGallery is opened from direct url(hash plugin).
|
||||
setTimeout(function () {
|
||||
try {
|
||||
DISQUS.reset({
|
||||
reload: true,
|
||||
config: function () {
|
||||
this.page.identifier =
|
||||
_this.core.galleryItems[index].disqusIdentifier;
|
||||
this.page.url =
|
||||
_this.core.galleryItems[index].disqusURL;
|
||||
this.page.title =
|
||||
_this.settings.disqusConfig.title;
|
||||
this.language =
|
||||
_this.settings.disqusConfig.language;
|
||||
},
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
console.error('Make sure you have included disqus JavaScript code in your document. Ex - https://lg-disqus.disqus.com/admin/install/platforms/universalcode/');
|
||||
}
|
||||
}, _this.core.lGalleryOn ? 0 : 1000);
|
||||
});
|
||||
};
|
||||
CommentBox.prototype.destroy = function () {
|
||||
this.core.LGel.off('.lg.comment');
|
||||
this.core.LGel.off('.comment');
|
||||
};
|
||||
return CommentBox;
|
||||
}());
|
||||
|
||||
return CommentBox;
|
||||
|
||||
})));
|
||||
//# sourceMappingURL=lg-comment.umd.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "lightgallery/plugins/comment",
|
||||
"private": true,
|
||||
"main": "lg-comment.umd.js",
|
||||
"module": "lg-comment.es5.js",
|
||||
"typings": "lg-comment.d.ts"
|
||||
}
|
||||
Reference in New Issue
Block a user