Skip to content

Commit 2af65df

Browse files
committed
use pluginkit from gh
Signed-off-by: George Lemon <georgelemon@protonmail.com>
1 parent 5a7a6cf commit 2af65df

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

booyaka.nimble

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ requires "semver"
2222
requires "iconim"
2323

2424
requires "htmlparser#head"
25-
requires "https://github.com/openpeeps/pluginkit"
25+
# requires "https://github.com/openpeeps/pluginkit"
26+
requires "pluginkit"
2627

2728
# Supra is not really a dependency but we want to ensure
2829
# it's available when building the release version of Booyaka

src/storage/assets/app.css

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/storage/assets/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/storage/client/app.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ export default {
4747
this.initSmoothAnchors();
4848
this.initExternalLinksDecorator();
4949

50+
const fetchSwapCallback = function() {
51+
opts.enableAnimatedAlerts && this.initAnimatedAlerts();
52+
opts.fetchAndSwapCallback && opts.fetchAndSwapCallback();
53+
}.bind(this) // bind 'this' to ensure the correct context inside the callback
54+
5055
// Intercept clicks on internal links to enable SPA-like navigation without full page reloads.
5156
let sidebarNavigation = document.querySelector('.sidebar-navigation')
5257
document.addEventListener('click', (e) => {
@@ -60,7 +65,7 @@ export default {
6065
sidebarNavigation.querySelectorAll('a').forEach(link => link.classList.remove('active', 'bg-dark'));
6166
a.classList.add('active', 'bg-dark');
6267
}
63-
this.fetchAndSwap(a.pathname + a.search, true, opts.fetchAndSwapCallback);
68+
this.fetchAndSwap(a.pathname + a.search, true, fetchSwapCallback);
6469
}
6570
});
6671

@@ -264,6 +269,7 @@ document.addEventListener('DOMContentLoaded', () => {
264269
UI.init({
265270
enableStickySidebar: true,
266271
enableTimeAgo: true,
272+
enableAnimatedAlerts: true,
267273
fetchAndSwapCallback: (url, html) => {
268274
hljs.highlightAll();
269275
}

0 commit comments

Comments
 (0)