Skip to content

Commit

Permalink
feat: support zoom for lightgallery images (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
guqing authored Mar 13, 2024
1 parent 876cd46 commit d91e481
Show file tree
Hide file tree
Showing 8 changed files with 818 additions and 45 deletions.
1 change: 1 addition & 0 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"vite-plugin-static-copy": "^0.9.0"
},
"dependencies": {
"lg-zoom.js": "^1.3.0",
"lightgallery.js": "^1.4.0"
}
}
7 changes: 7 additions & 0 deletions assets/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions assets/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export default defineConfig({
src: `./node_modules/lightgallery.js/dist/*`,
dest: "",
},
{
src: `./node_modules/lg-zoom.js/dist/*`,
dest: "js/plugins/zoom/",
},
],
}),
],
Expand Down
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "com.github.node-gradle.node" version "5.0.0"
id "run.halo.plugin.devtools" version "0.0.4"
id "run.halo.plugin.devtools" version "0.0.7"
id "io.freefair.lombok" version "8.0.1"
id 'java'
}
Expand Down Expand Up @@ -39,3 +39,7 @@ build {
// build frontend before build
tasks.getByName('compileJava').dependsOn('buildFrontend')
}

halo {
version = '2.13'
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
import static org.apache.commons.lang3.StringUtils.defaultIfBlank;

import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.stream.Collectors;

import io.micrometer.common.util.StringUtils;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Component;
import org.springframework.util.PropertyPlaceholderHelper;
import org.springframework.util.RouteMatcher;
import org.springframework.web.util.pattern.PathPatternRouteMatcher;
import org.springframework.web.util.pattern.PatternParseException;
Expand Down Expand Up @@ -67,6 +64,8 @@ static String lightGalleryScript(Set<String> domSelectors) {
<!-- PluginLightGallery start -->
<link href="/plugins/PluginLightGallery/assets/static/css/lightgallery.min.css" rel="stylesheet" />
<script defer src="/plugins/PluginLightGallery/assets/static/js/lightgallery.min.js"></script>
<!-- PluginLightGallery zoom plugin -->
<script defer src="/plugins/PluginLightGallery/assets/static/js/plugins/zoom/lg-zoom.min.js"></script>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
%s
Expand Down
Loading

0 comments on commit d91e481

Please sign in to comment.