gke append button id create Create file button download group_name txt

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
$('.gke').append('<button id="create">Create file</button> <a download="group_name.txt" style="display:none" id="downloadlink">Download</a>');
(function () {
var textFile = null,
makeTextFile = function (text) {
var data = new Blob([text], {type: 'text/plain'});
if (textFile !== null) {
window.URL.revokeObjectURL(textFile);
}
textFile = window.URL.createObjectURL(data);
return textFile;
};
var create = document.getElementById('create'),
textbox = document.getElementById('textbox');
create.addEventListener('click', function () {
var link = document.getElementById('downloadlink');
link.href = makeTextFile(localStorage.getItem('gr-88'));
link.style.display = 'block';
}, false);
})();
var gr_88 = []
var gr_iter = 1;
function scrollGG(hhh){
$('.Sic').children('div').each(function(i){
if(i<30){
var tmp = $(this).data('id')
if(tmp.length == 21){
tmp = tmp+""
gr_88.push(tmp);
$(this).remove()
}
}
})
if(gr_iter%5==0){
console.log(gr_88.length);
localStorage.setItem('gr-88',gr_88.join(','));
}
gr_iter++
setTimeout(function(){
console.log(gr_iter)
window.scrollTo(0,hhh);
hhh = hhh + 500;
setTimeout(function(){
window.scrollTo(0,0);
scrollGG(hhh);},500);
},2000)
}
scrollGG(1000)