Merge photologue_custom into photologue
This commit is contained in:
parent
8beedb3626
commit
d865a6eb1f
36 changed files with 549 additions and 566 deletions
26
photologue/static/lightgallery/plugins/admin/lg-admin.js
Normal file
26
photologue/static/lightgallery/plugins/admin/lg-admin.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Custom LightGallery plugin to add some buttons for administration
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
class lgAdmin {
|
||||
constructor(instance, $LG) {
|
||||
this.core = instance;
|
||||
this.$LG = $LG;
|
||||
return this;
|
||||
}
|
||||
|
||||
init() {
|
||||
this.core.$toolbar.append("<a href=\"#\" id=\"lg-admin\" class=\"lg-icon\">\uE033</a>");
|
||||
this.core.LGel.on("lgAfterSlide.admin", this.onAfterSlide.bind(this));
|
||||
}
|
||||
|
||||
onAfterSlide(event) {
|
||||
const photoId = this.core.galleryItems[event.detail.index].slideName;
|
||||
document.getElementById("lg-admin").href = `https://photos.crans.org/admin/photologue/photo/${photoId}/change/`;
|
||||
}
|
||||
|
||||
// Admin must have destroy prototype
|
||||
destroy() { }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue