From e8eb804d3cb042735bf7ccd2ac7080255280403f Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Wed, 8 Jun 2016 21:47:44 +0200 Subject: [PATCH] Add files extension to gallery URL This allows to have extensions in the zip package. Plus do not add to the gallery URL if file is an xcf (gimp) in order to prevent zip generation fail. --- templates/partial/lutim.js.ep | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/partial/lutim.js.ep b/templates/partial/lutim.js.ep index a9f3eac..ce3da32 100644 --- a/templates/partial/lutim.js.ep +++ b/templates/partial/lutim.js.ep @@ -199,7 +199,9 @@ $('.messages').append(buildMessage(data.success, data.msg)); $('#del-'+data.msg.real_short).on('click', delImage); if (data.success) { - addToShortHash(data.msg.short); + if (data.msg.ext !== 'xcf') { + addToShortHash(data.msg.short+'.'+data.msg.ext); + } $('.close').unbind('click', evaluateCopyAll); $('.close').on('click', evaluateCopyAll); $('input[type=\'text\']').unbind("click", selectInput); @@ -238,7 +240,9 @@ $('.messages').prepend('
<%= l('Copy all view links to clipboard') %>
'); } $('#lutim-file-url').val(''); - addToShortHash(data.msg.short); + if (data.msg.ext !== 'xcf') { + addToShortHash(data.msg.short+'.'+data.msg.ext); + } $('.close').unbind('click', evaluateCopyAll); $('.close').on('click', evaluateCopyAll); addItem(data.msg);