This commit is contained in:
Luc Didry
2016-06-08 18:14:36 +02:00
parent c450b27c0d
commit 453bc5d2c5
10 changed files with 12063 additions and 34 deletions
+3 -1
View File
@@ -61,4 +61,6 @@ It uses:
* [Moment.js](http://momentjs.com/) for displaying real dates instead of unix timestamps.
* [Fontello](http://fontello.com/) and the [markdown font](https://github.com/dcurtis/markdown-mark/) for the icons, licenses for the fontello icons fonts are in `public/font/LICENSE.txt`
* [Henny Penny](https://www.google.com/fonts/specimen/Henny+Penny) font designed by Olga Umpeleva for [Brownfox](http://brownfox.org)
* [Unite gallery](http://unitegallery.net/) for the gallery
* [JSZip](https://stuk.github.io/jszip/) for generating a zip containing all the images in the gallery
* [FileSaver.js](https://github.com/eligrey/FileSaver.js/) for saving the zip
+16 -7
View File
@@ -103,6 +103,11 @@ msgstr "Nach erstem Aufruf löschen?"
msgid "Deletion link"
msgstr "Link zum Löschen"
#: templates/gallery.html.ep:6
#: templates/gallery.html.ep:63
msgid "Download all images"
msgstr "Laden Sie alle Bilder"
#: templates/index.html.ep:63
#: templates/index.html.ep:65
#: templates/partial/lutim.js.ep:131
@@ -266,6 +271,10 @@ msgstr "Nur der Hochladende (natürlich nur, wenn er vorher auch Rechteinhaber d
msgid "Please contact the administrator: %1"
msgstr "Kontaktiere den Administrator: %1"
#: templates/gallery.html.ep:51
msgid "Please wait"
msgstr "Warten Sie mal"
#: templates/index.html.ep:140
msgid "Send an image"
msgstr "Sende ein Bild"
@@ -301,7 +310,7 @@ msgid "The delete token is invalid."
msgstr "Das Token zum Löschen ist ungültig."
#. ($upload->filename)
#: lib/Lutim/Controller.pm:427
#: lib/Lutim/Controller.pm:432
msgid "The file %1 is not an image."
msgstr "Die Datei %1 ist kein Bild."
@@ -342,7 +351,7 @@ msgid "The images you post on Lutim can be stored indefinitely or be deleted at
msgstr "Die Bilder, die du auf Lutim hochlädst, können entweder nie, nach dem ersten Aufruf oder nach einer bestimmten Zeit gelöscht werden."
#. ($c->config->{contact})
#: lib/Lutim/Controller.pm:422
#: lib/Lutim/Controller.pm:427
msgid "There is no more available URL. Retry or contact the administrator. %1"
msgstr "Es sind keine URLs mehr verfügbar. Versuche es erneut oder kontaktiere den Administrator. %1"
@@ -357,10 +366,10 @@ msgstr "Twittere es!"
msgid "Unable to find the image %1."
msgstr "Konnte das Bild %1 nicht finden."
#: lib/Lutim.pm:54
#: lib/Lutim/Controller.pm:511
#: lib/Lutim/Controller.pm:557
#: lib/Lutim/Controller.pm:601
#: lib/Lutim.pm:66
#: lib/Lutim/Controller.pm:517
#: lib/Lutim/Controller.pm:563
#: lib/Lutim/Controller.pm:607
msgid "Unable to find the image: it has been deleted."
msgstr "Dieses Bild wurde gelöscht."
@@ -386,7 +395,7 @@ msgid "Uploaded files by days"
msgstr "Hochgeladene Bilder pro Tag"
#. ($config->{contact})
#: lib/Lutim.pm:146
#: lib/Lutim.pm:170
msgid "Uploading is currently disabled, please try later or contact the administrator (%1)."
msgstr "Hochladen ist momentan deaktiviert. Versuche es später erneut oder kontaktiere den Administrator (%1)."
+16 -7
View File
@@ -101,6 +101,11 @@ msgstr "Delete at first view?"
msgid "Deletion link"
msgstr "Deletion link"
#: templates/gallery.html.ep:6
#: templates/gallery.html.ep:63
msgid "Download all images"
msgstr ""
#: templates/index.html.ep:63
#: templates/index.html.ep:65
#: templates/partial/lutim.js.ep:131
@@ -262,6 +267,10 @@ msgstr "Only the uploader! (well, only if he's the only owner of the images' rig
msgid "Please contact the administrator: %1"
msgstr "Please contact the administrator: %1"
#: templates/gallery.html.ep:51
msgid "Please wait"
msgstr ""
#: templates/index.html.ep:140
msgid "Send an image"
msgstr "Send an image"
@@ -297,7 +306,7 @@ msgid "The delete token is invalid."
msgstr "The delete token is invalid."
#. ($upload->filename)
#: lib/Lutim/Controller.pm:427
#: lib/Lutim/Controller.pm:432
msgid "The file %1 is not an image."
msgstr "The file %1 is not an image."
@@ -338,7 +347,7 @@ msgid "The images you post on Lutim can be stored indefinitely or be deleted at
msgstr "The images you post on Lutim can be stored indefinitely or be deleted at first view or after a delay selected from those proposed."
#. ($c->config->{contact})
#: lib/Lutim/Controller.pm:422
#: lib/Lutim/Controller.pm:427
msgid "There is no more available URL. Retry or contact the administrator. %1"
msgstr "There is no more available URL. Retry or contact the administrator. %1"
@@ -353,10 +362,10 @@ msgstr "Tweet it!"
msgid "Unable to find the image %1."
msgstr "Unable to find the image %1."
#: lib/Lutim.pm:54
#: lib/Lutim/Controller.pm:511
#: lib/Lutim/Controller.pm:557
#: lib/Lutim/Controller.pm:601
#: lib/Lutim.pm:66
#: lib/Lutim/Controller.pm:517
#: lib/Lutim/Controller.pm:563
#: lib/Lutim/Controller.pm:607
msgid "Unable to find the image: it has been deleted."
msgstr "Unable to find the image: it has been deleted."
@@ -382,7 +391,7 @@ msgid "Uploaded files by days"
msgstr "Uploaded files by days"
#. ($config->{contact})
#: lib/Lutim.pm:146
#: lib/Lutim.pm:170
msgid "Uploading is currently disabled, please try later or contact the administrator (%1)."
msgstr "Uploading is currently disabled, please try later or contact the administrator (%1)."
+16 -7
View File
@@ -103,6 +103,11 @@ msgstr "¿Borrar en la primera vista?"
msgid "Deletion link"
msgstr "Enlace para borrar"
#: templates/gallery.html.ep:6
#: templates/gallery.html.ep:63
msgid "Download all images"
msgstr "Descargar todas las imágenes"
#: templates/index.html.ep:63
#: templates/index.html.ep:65
#: templates/partial/lutim.js.ep:131
@@ -264,6 +269,10 @@ msgstr "¡Sólo el usuario! (bueno, sólo si él/ela es el único titular de los
msgid "Please contact the administrator: %1"
msgstr "Por favor, contacte con el administrador: %1"
#: templates/gallery.html.ep:51
msgid "Please wait"
msgstr "Por favor espera"
#: templates/index.html.ep:140
msgid "Send an image"
msgstr "Enviar una imagen"
@@ -299,7 +308,7 @@ msgid "The delete token is invalid."
msgstr "El código de borrado no es válido."
#. ($upload->filename)
#: lib/Lutim/Controller.pm:427
#: lib/Lutim/Controller.pm:432
msgid "The file %1 is not an image."
msgstr "El archivo %1 no es una imagen."
@@ -340,7 +349,7 @@ msgid "The images you post on Lutim can be stored indefinitely or be deleted at
msgstr "Puede, opcionalmente, solicitar que la imagen publicada en Lutim se elimine con la primera vista (o descarga) o tras un tiempo seleccionado de entre varios propuestos."
#. ($c->config->{contact})
#: lib/Lutim/Controller.pm:422
#: lib/Lutim/Controller.pm:427
msgid "There is no more available URL. Retry or contact the administrator. %1"
msgstr "No más URL disponibles. Inténtelo de nuevo o contacte con el administrador. %1"
@@ -355,10 +364,10 @@ msgstr "¡Tuitéalo!"
msgid "Unable to find the image %1."
msgstr "No se ha podido encontrar la imagen %1."
#: lib/Lutim.pm:54
#: lib/Lutim/Controller.pm:511
#: lib/Lutim/Controller.pm:557
#: lib/Lutim/Controller.pm:601
#: lib/Lutim.pm:66
#: lib/Lutim/Controller.pm:517
#: lib/Lutim/Controller.pm:563
#: lib/Lutim/Controller.pm:607
msgid "Unable to find the image: it has been deleted."
msgstr "No se ha podido encontrar la imagen: ha sido borrada."
@@ -384,7 +393,7 @@ msgid "Uploaded files by days"
msgstr "Archivos enviados por día"
#. ($config->{contact})
#: lib/Lutim.pm:146
#: lib/Lutim.pm:170
msgid "Uploading is currently disabled, please try later or contact the administrator (%1)."
msgstr "La carga está deshabilitada en estos momentos, por favor inténtelo más tarde o contacte con el administrador (%1)."
+16 -7
View File
@@ -103,6 +103,11 @@ msgstr "Supprimer au premier accès ?"
msgid "Deletion link"
msgstr "Lien de suppression"
#: templates/gallery.html.ep:6
#: templates/gallery.html.ep:63
msgid "Download all images"
msgstr "Télécharger toutes les images"
#: templates/index.html.ep:63
#: templates/index.html.ep:65
#: templates/partial/lutim.js.ep:131
@@ -264,6 +269,10 @@ msgstr "Seulement l'envoyeur ! (enfin, seulement s'il possède des droits exclus
msgid "Please contact the administrator: %1"
msgstr "Veuillez contacter ladministrateur : %1"
#: templates/gallery.html.ep:51
msgid "Please wait"
msgstr "Veuillez patienter"
#: templates/index.html.ep:140
msgid "Send an image"
msgstr "Envoyer une image"
@@ -301,7 +310,7 @@ msgid "The delete token is invalid."
msgstr "Le jeton de suppression est invalide."
#. ($upload->filename)
#: lib/Lutim/Controller.pm:427
#: lib/Lutim/Controller.pm:432
msgid "The file %1 is not an image."
msgstr "Le fichier %1 n'est pas une image."
@@ -342,7 +351,7 @@ msgid "The images you post on Lutim can be stored indefinitely or be deleted at
msgstr "Les images déposées sur Lutim peuvent être stockées indéfiniment, ou seffacer dès le premier affichage ou au bout du délai choisi parmi ceux proposés."
#. ($c->config->{contact})
#: lib/Lutim/Controller.pm:422
#: lib/Lutim/Controller.pm:427
msgid "There is no more available URL. Retry or contact the administrator. %1"
msgstr "Il n'y a plus d'URL disponible. Veuillez réessayer ou contacter l'administrateur. %1."
@@ -357,10 +366,10 @@ msgstr "Tweetez !"
msgid "Unable to find the image %1."
msgstr "Impossible de trouver l'image %1."
#: lib/Lutim.pm:54
#: lib/Lutim/Controller.pm:511
#: lib/Lutim/Controller.pm:557
#: lib/Lutim/Controller.pm:601
#: lib/Lutim.pm:66
#: lib/Lutim/Controller.pm:517
#: lib/Lutim/Controller.pm:563
#: lib/Lutim/Controller.pm:607
msgid "Unable to find the image: it has been deleted."
msgstr "Impossible de trouver l'image : elle a été supprimée."
@@ -386,7 +395,7 @@ msgid "Uploaded files by days"
msgstr "Fichiers envoyés, par jour"
#. ($config->{contact})
#: lib/Lutim.pm:146
#: lib/Lutim.pm:170
msgid "Uploading is currently disabled, please try later or contact the administrator (%1)."
msgstr "L'envoi d'images est actuellement désactivé, veuillez réessayer plus tard ou contacter l'administrateur (%1)."
+2
View File
@@ -0,0 +1,2 @@
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,i=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/constructor/i.test(e.HTMLElement),f=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},u="application/octet-stream",s=1e3*40,d=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,s)},c=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(i){f(i)}}}},l=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},p=function(t,f,s){if(!s){t=l(t)}var p=this,v=t.type,w=v===u,m,y=function(){c(p,"writestart progress write writeend".split(" "))},h=function(){if(w&&a&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=r.result;e.location.href="data:attachment/file"+t.slice(t.search(/[,;]/));p.readyState=p.DONE;y()};r.readAsDataURL(t);p.readyState=p.INIT;return}if(!m){m=n().createObjectURL(t)}if(w){e.location.href=m}else{var o=e.open(m,"_blank");if(!o){e.location.href=m}}p.readyState=p.DONE;y();d(m)};p.readyState=p.INIT;if(o){m=n().createObjectURL(t);setTimeout(function(){r.href=m;r.download=f;i(r);y();d(m);p.readyState=p.DONE});return}h()},v=p.prototype,w=function(e,t,n){return new p(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=l(e)}return navigator.msSaveOrOpenBlob(e,t)}}v.abort=function(){};v.readyState=v.INIT=0;v.WRITING=1;v.DONE=2;v.error=v.onwritestart=v.onprogress=v.onwrite=v.onabort=v.onerror=v.onwriteend=null;return w}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define([],function(){return saveAs})}
+11925
View File
File diff suppressed because it is too large Load Diff
+15
View File
File diff suppressed because one or more lines are too long
+53 -5
View File
@@ -1,14 +1,27 @@
% # vim:set sw=4 ts=4 sts=4 ft=html.epl expandtab:
<div class="container">
<div>
<p>
<button id="download-all" class="btn btn-info col-sm-12">
<%= l('Download all images') %>
</button>
</p>
</div>
</div>
<div class="container">
<div id="gallery" style="display:none;">
</div>
</div>
%= stylesheet 'gallery/css/unite-gallery.css'
%= stylesheet 'gallery/themes/default/ug-theme-default.css'
%= javascript 'gallery/js/unitegallery.js'
%= javascript 'gallery/themes/tiles/ug-theme-tiles.js'
%= stylesheet '/gallery/css/unite-gallery.css'
%= stylesheet '/gallery/themes/default/ug-theme-default.css'
%= javascript '/gallery/js/unitegallery.js'
%= javascript '/gallery/themes/tiles/ug-theme-tiles.js'
%= javascript '/js/jszip.min.js'
%= javascript '/js/FileSaver.min.js'
%= javascript begin
$(document).ready(function() {
$('#download-all').click(downloadAll);
var absUrl = '<%= url_for('/') %>';
var key = window.location.hash.substring(1); // Get key
@@ -30,7 +43,42 @@ $(document).ready(function() {
var api = $("#gallery").unitegallery({
gallery_theme: "tiles",
tiles_max_columns: 4,
lightbox_overlay_color: "#444"
lightbox_overlay_color: "#DDD"
});
});
function downloadAll() {
$('#download-all').attr('disabled', 'disabled');
$('#download-all').text('<%= l('Please wait') %>');
var zip = new JSZip();
$('.ug-thumb-wrapper img.ug-thumb-image').each(function(index) {
var url = $(this).prop('src');
var name = url.replace(/.*\/([^\/]+)$/, '$1');
zip.file(name, getBase64Image(this), {base64: true});
});
zip.generateAsync({type:"blob"})
.then(function(content) {
// see FileSaver.js
saveAs(content, "images.zip");
$('#download-all').text('<%= l('Download all images') %>');
$('#download-all').removeAttr('disabled');
});
}
function getBase64Image(img) {
// Create an empty canvas element
var canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
// Copy the image contents to the canvas
var ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0);
// Get the data-URL formatted image
// Firefox supports PNG and JPEG. You could check img.src to
// guess the original format, but be aware the using "image/jpg"
// will re-encode the image.
var dataURL = canvas.toDataURL("image/png");
return dataURL.replace(/^data:image\/(png|jpg);base64,/, "");
}
% end
+1
View File
@@ -2,6 +2,7 @@ templates/about.html.ep
templates/index.html.ep
templates/stats.html.ep
templates/myfiles.html.ep
templates/gallery.html.ep
templates/layouts/default.html.ep
templates/partial/common.js.ep
templates/partial/lutim.js.ep