-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,14 +16,17 @@ function initTwikoo () { | |
} | ||
function initLightGallery () { | ||
// This function is compiled to ES5 | ||
var commentContents = document.getElementsByClassName('tk-content'); | ||
var commentContents = [ | ||
...document.getElementsByClassName('vp-doc'), | ||
...document.getElementsByClassName('tk-content') | ||
]; | ||
for (var i = 0; i < commentContents.length; i++) { | ||
var commentItem = commentContents[i]; | ||
var imgEls = commentItem.getElementsByTagName('img'); | ||
if (imgEls.length > 0) { | ||
for (var j = 0; j < imgEls.length; j++) { | ||
var imgEl = imgEls[j]; | ||
if (imgEl.parentElement.tagName === 'A') continue; | ||
var aEl = document.createElement('a'); | ||
aEl.setAttribute('class', 'tk-lg-link'); | ||
aEl.setAttribute('href', imgEl.getAttribute('src')); | ||
|
@@ -65,11 +68,11 @@ onMounted(() => { | |
<component :is="'script'" defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous"></component> | ||
|
||
<!-- lightGallery --> | ||
<link rel="stylesheet" href="https://cdn.staticfile.org/lightgallery/2.1.8/css/lightgallery.css"> | ||
<component :is="'script'" src="https://cdn.staticfile.org/lightgallery/2.1.8/lightgallery.min.js"></component> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery@2.1.8/css/lightgallery.css"> | ||
<component :is="'script'" src="https://cdn.jsdelivr.net/npm/lightgallery@2.1.8/lightgallery.min.js"></component> | ||
|
||
<!-- Twikoo --> | ||
<div id="twikoo"></div> | ||
<component :is="'script'" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/twikoo.all.min.js" ref="twikooJs"></component> | ||
<component :is="'script'" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/twikoo.min.js" ref="twikooJs"></component> | ||
</div> | ||
</template> |