1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-28 17:31:00 +01:00
This commit is contained in:
8chan 2014-10-08 20:11:36 +00:00
commit 3928a3212a
4 changed files with 56 additions and 1 deletions

View File

@ -109,6 +109,8 @@
$config['additional_javascript'][] = 'js/webm-settings.js';
$config['additional_javascript'][] = 'js/expand-video.js';
$config['additional_javascript'][] = 'js/treeview.js';
$config['additional_javascript'][] = 'js/download-all.js';
$config['additional_javascript'][] = 'js/jszip.min.js';
$config['additional_javascript'][] = 'js/quick-post-controls.js';
$config['additional_javascript'][] = 'js/expand-too-long.js';
$config['additional_javascript'][] = 'js/settings.js';

29
js/download-all.js Normal file
View File

@ -0,0 +1,29 @@
if(active_page=='thread')
$(function (){
$('hr:first').before('<div id="download-all" style="text-align:right"><a class="unimportant" href="javascript:void(0)"></a></div>');
$('div#download-all a')
.text(_('Download All'))
.click(function() {
var zip = new JSZip();
var files = document.getElementsByClassName("fileinfo");
for(var i = 0; i < files.length; i++)
{
for(var j = 0; j < files.length; j++)
{
var x = files[i].getElementsByTagName('a')[j].src;
zip.file(x);
}
}
var content = zip.generate({type:"blob"});
var fns = document.URL.split('/');
var fn = fns[2] + '/' + fns[4].substring(0, fns[4].length-5);
saveAs(content, fn);
})})

14
js/jszip.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -76,7 +76,8 @@ form table tr th{
color: #fff !important;
background: #222 !important;
}
#download-all,
#expand-all-images,
#shrink-all-images,
#treeview{
@ -96,6 +97,10 @@ form table tr th{
margin-top: 6em !important;
}
#download-all{
margin-top: 7em !important;
}
#expand-all-images + hr,
#shrink-all-images + hr{
opacity: 0 !important;
@ -107,6 +112,11 @@ form table tr th{
clear: both !important;
}
#download-all + hr{
opacity: 0 !important;
clear: both !important;
}
#options_handler{
margin-top: 3em !important;
}