2 var WL = 'http://www.wolnelektury.pl';
7 document.addEventListener("deviceready", onDeviceReady, false);
10 function onDeviceReady() {
11 console.log('onDeviceReady');
12 var error = function(err) { alert(err); };
14 FileRepo.init(function() {
15 console.log('after FileRepo.init');
16 Catalogue.init(function() {
17 console.log('after catalogue.init');
18 History.init(function() {
19 console.log('after history.init');
20 View.init(function() {
21 Catalogue.sync(function() {
22 Catalogue.updateLocal();
31 var currentOffset = function() {
32 var scr = document.body.scrollTop;
33 var h = document.getElementById('nothing').offsetTop;
34 return scr/h;document.getElementById('nothing')
37 var setOffset = function(offset) {
38 var h = document.getElementById('nothing').offsetTop;
43 var prettySize = function(size) {
45 var units = ['B', 'KiB', 'MiB', 'GiB'];
47 var unit = units.shift();
48 while (size > 1000 && units.length) {
53 return Math.round(size*10)/10 + ' ' + unit;
55 return Math.round(size) + ' ' + unit;