diff --git a/levgal_tpl/LevGal-Album.template.php b/levgal_tpl/LevGal-Album.template.php index 996194d..1ba422c 100644 --- a/levgal_tpl/LevGal-Album.template.php +++ b/levgal_tpl/LevGal-Album.template.php @@ -454,7 +454,7 @@ function template_main_album_display() function template_main_album_sidebar() { - global $context, $txt, $modSettings, $memberContext, $scripturl; + global $context, $txt, $modSettings, $memberContext, $scripturl, $settings; // Start the sidebar container. echo ' @@ -553,12 +553,61 @@ function template_main_album_sidebar() template_sidebar_action_list($txt['lgal_album_actions'], $context['album_actions']); } + // Sidebar Sharing. + template_main_item_sidebar_share(); + // Sorting albums. template_main_item_sidebar_sorting(); // And end the sidebar container. echo ' '; + + // Now we need the JavaScript for our copy to clipboard buttons. + echo ' + + '; +} + +function template_main_item_sidebar_share() +{ + global $context, $txt, $scripturl; + + echo ' +

+ ', $txt['lgal_share'], ' +

+
+
+
', $txt['lgal_share_simple_bbc'], ' + ', $txt['help'], ' +
+
+ + +
+
+
'; } function template_main_item_sidebar_sorting() @@ -832,6 +881,7 @@ function transLitSlug() lgal_quota: ' . (empty($context['quota_data']) ? '{}' : json_encode($context['quota_data'])) . ', lgal_enable_resize: ' . (empty($context['lgal_enable_resize']) ? 'false' : 'true') . ', maxFiles: 1, + maxThumbnailFilesize: defaults.maxThumbnailFilesize, paramName: defaults.paramName, chunking: defaults.chunking, retryChunks: defaults.retryChunks, @@ -899,7 +949,7 @@ function transLitSlug() }, accept: function(file, done) { // We do not have the width / height until thumbnail completes - this.on("thumbnail", function(file) { + this.on("thumbnail", function(file, dataURL) { let result = addFileFilter(file, this.options.lgal_quota, this.options.lgal_enable_resize); if (result !== true) { @@ -909,6 +959,13 @@ function transLitSlug() } else { + // This is for tiff files, maybe others, which fail on creating a client side thumbnail + if (typeof dataURL === "object" && dataURL instanceof Event) + { + let dataURL = get_upload_generic_thumbnail(file, this.options.lgal_quota); + file.previewElement.querySelector("img[data-dz-thumbnail]").src = dataURL; + } + done(); } }); @@ -1074,6 +1131,7 @@ function template_add_bulk_items() lgal_quota: ' . (empty($context['quota_data']) ? '{}' : json_encode($context['quota_data'])) . ', lgal_enable_resize: ' . (empty($context['lgal_enable_resize']) ? 'false' : 'true') . ', maxFiles: 250, + maxThumbnailFilesize: defaults.maxThumbnailFilesize, paramName: defaults.paramName, chunking: defaults.chunking, retryChunks: defaults.retryChunks, @@ -1180,7 +1238,7 @@ function template_add_bulk_items() uploader.disable(); } }); - this.on("thumbnail", function(file) { + this.on("thumbnail", function(file, dataURL) { let result = addFileFilter(file, this.options.lgal_quota, this.options.lgal_enable_resize); if (result !== true) { @@ -1189,6 +1247,12 @@ function template_add_bulk_items() } else { + // This is for tiff files, maybe others, which fail on creating a client side thumbnail + if (typeof dataURL === "object" && dataURL instanceof Event) + { + let dataURL = get_upload_generic_thumbnail(file, this.options.lgal_quota); + file.previewElement.querySelector("img[data-dz-thumbnail]").src = dataURL; + } sessionStorage.setItem(file.upload.uuid, file.name); file.acceptDimensions(); }