1
1
var sortMethod = "popularity" ;
2
2
var booksUrl = "full_by_popularity.js" ;
3
3
var bookshelves = "bookshelves.js" ;
4
- var inBooksLooadingLoop = false ;
5
4
var booksTable = null ;
6
5
var title_dict = null ;
7
6
var globalShelvesTable = null ;
@@ -13,21 +12,6 @@ var persist_options = {
13
12
debug : true ,
14
13
} ;
15
14
16
-
17
- function queryParams ( key ) {
18
- var qd = { } ;
19
- if ( location . search ) location . search . substr ( 1 ) . split ( "&" ) . forEach ( function ( item ) {
20
- var s = item . split ( "=" ) ,
21
- k = s [ 0 ] ,
22
- v = s [ 1 ] && decodeURIComponent ( s [ 1 ] ) ;
23
- ( qd [ k ] = qd [ k ] || [ ] ) . push ( v )
24
- } )
25
- if ( key == undefined )
26
- return qd ;
27
- else
28
- return qd [ key ] ;
29
- }
30
-
31
15
function getPersistedPage ( ) {
32
16
var pp = $ ( "#page_record" ) . val ( ) ;
33
17
try {
@@ -41,19 +25,6 @@ function getPersistedPage() {
41
25
}
42
26
}
43
27
44
- function getRequestedPage ( ) {
45
- var qp = queryParams ( "page" ) ;
46
- try {
47
- return parseInt ( qp ) - 1 ;
48
- } catch ( e ) {
49
- if ( qp ) {
50
- console . log ( e ) ;
51
- console . warn ( "Unable to work with requested page `" + qp + "`" ) ;
52
- }
53
- return 0 ;
54
- }
55
- }
56
-
57
28
function onTablePageChange ( e , settings , table ) {
58
29
// record global ref to table
59
30
if ( table )
@@ -68,25 +39,13 @@ function goToAuthor(name) {
68
39
showBooks ( ) ;
69
40
}
70
41
71
- function goToTitle ( title ) {
72
- $ ( "#title_filter" ) . val ( title ) ;
73
- }
74
-
75
-
76
42
function minimizeUI ( ) {
77
43
console . log ( "minimizeUI" ) ;
78
44
$ ( "#hide-precontent" ) . val ( "true" ) ;
79
45
$ ( "#hide-precontent" ) . change ( ) ;
80
46
$ ( ".precontent" ) . slideUp ( 300 ) ;
81
47
}
82
48
83
- function maximizeUI ( ) {
84
- console . log ( "maximizeUI" ) ;
85
- $ ( "#hide-precontent" ) . val ( "" ) ;
86
- $ ( "#hide-precontent" ) . change ( ) ;
87
- $ ( ".precontent" ) . slideDown ( 300 ) ;
88
- }
89
-
90
49
function loadScript ( url , nodeId , callback ) {
91
50
console . log ( "requesting script for #" + nodeId + " from " + url ) ;
92
51
if ( document . getElementById ( nodeId ) ) {
@@ -197,10 +156,6 @@ function is_cover_page() {
197
156
return $ ( "body" ) . hasClass ( "cover" ) ;
198
157
}
199
158
200
- function is_bookshelf_page ( ) {
201
- return $ ( "body" ) . hasClass ( "individual_book_shelf" ) ;
202
- }
203
-
204
159
function is_bookshelves_page ( ) {
205
160
return $ ( '#bookshelvesDisplay' ) . length != 0 ;
206
161
}
@@ -234,7 +189,7 @@ function showBooks() {
234
189
235
190
$ ( document ) . ready ( function ( ) {
236
191
booksTable = $ ( "#books_table" ) . dataTable ( {
237
- initComplete : function ( settings , json ) {
192
+ initComplete : function ( ) {
238
193
var requestedPage = getPersistedPage ( ) ;
239
194
if ( requestedPage ) {
240
195
this . api ( )
@@ -269,7 +224,7 @@ function showBooks() {
269
224
} ,
270
225
{
271
226
targets : 0 ,
272
- render : function ( data , type , full , meta ) {
227
+ render : function ( data , type , full ) {
273
228
img = '<img class="pure-u-1-8 book-cover-pre" src= "' + full [ 3 ] + '_cover_image.jpg"' +
274
229
'onerror="this.onerror=null;this.style.height=\'50px\';this.src=\'' + 'favicon.png\'" >' ;
275
230
div = '<div class="list-stripe"></div>' ;
@@ -292,13 +247,13 @@ function showBooks() {
292
247
} ,
293
248
{
294
249
targets : 1 ,
295
- render : function ( data , type , full , meta ) {
250
+ render : function ( ) {
296
251
return "" ;
297
252
}
298
253
} ,
299
254
{
300
255
targets : 2 ,
301
- render : function ( data , type , full , meta ) {
256
+ render : function ( data , type , full ) {
302
257
var html = "" ;
303
258
var urlBase =
304
259
full [ 0 ] . replace ( "/" , "-" ) . substring ( 0 , 230 ) + "." + full [ 3 ] ;
@@ -353,7 +308,6 @@ function showBooks() {
353
308
) ;
354
309
} else if ( event . which == 2 ) {
355
310
/* Middle click */
356
- var href = $ ( this ) . attr ( "data-href" ) ;
357
311
var link = $ (
358
312
"<a href='" +
359
313
encodeURIComponent ( titre . replace ( "/" , "-" ) . substring ( 0 , 230 ) ) +
@@ -428,7 +382,7 @@ function showBookshelf(bookshelfURL) {
428
382
429
383
$ ( document ) . ready ( function ( ) {
430
384
booksTable = $ ( "#books_table" ) . dataTable ( {
431
- initComplete : function ( settings , json ) {
385
+ initComplete : function ( ) {
432
386
var requestedPage = getPersistedPage ( ) ;
433
387
if ( requestedPage ) {
434
388
this . api ( )
@@ -463,7 +417,7 @@ function showBookshelf(bookshelfURL) {
463
417
} ,
464
418
{
465
419
targets : 0 ,
466
- render : function ( data , type , full , meta ) {
420
+ render : function ( data , type , full ) {
467
421
img = '<img class="pure-u-1-8 book-cover-pre" src= "' + full [ 3 ] + '_cover_image.jpg"' +
468
422
'onerror="this.onerror=null;this.style.height=\'50px\';this.src=\'' + 'favicon.png\'" >' ;
469
423
div = '<div class="list-stripe"></div>' ;
@@ -486,13 +440,13 @@ function showBookshelf(bookshelfURL) {
486
440
} ,
487
441
{
488
442
targets : 1 ,
489
- render : function ( data , type , full , meta ) {
443
+ render : function ( ) {
490
444
return "" ;
491
445
}
492
446
} ,
493
447
{
494
448
targets : 2 ,
495
- render : function ( data , type , full , meta ) {
449
+ render : function ( data , type , full ) {
496
450
var html = "" ;
497
451
var urlBase =
498
452
full [ 0 ] . replace ( "/" , "-" ) . substring ( 0 , 230 ) + "." + full [ 3 ] ;
@@ -547,7 +501,6 @@ function showBookshelf(bookshelfURL) {
547
501
) ;
548
502
} else if ( event . which == 2 ) {
549
503
/* Middle click */
550
- var href = $ ( this ) . attr ( "data-href" ) ;
551
504
var link = $ (
552
505
"<a href='" +
553
506
encodeURIComponent ( titre . replace ( "/" , "-" ) . substring ( 0 , 230 ) ) +
@@ -600,7 +553,7 @@ function onLocalized() {
600
553
// console.debug("no persisted lang or equal to browser, updating select");
601
554
l10nselect . val ( detectedLang ) ;
602
555
}
603
- l10nselect . on ( "change" , function ( e ) {
556
+ l10nselect . on ( "change" , function ( ) {
604
557
// console.debug("on change, setting lang " + $(this).val());
605
558
$ . persistValue ( "l10nselect" , $ ( this ) . val ( ) , persist_options ) ;
606
559
l10n . setLanguage ( $ ( this ) . val ( ) ) ;
@@ -654,7 +607,7 @@ function init() {
654
607
create_options ( language_filter , languages_json_data ) ;
655
608
}
656
609
657
- language_filter . on ( "change" , function ( e ) {
610
+ language_filter . on ( "change" , function ( ) {
658
611
minimizeUI ( ) ;
659
612
if ( globalShelvesTable == null ) {
660
613
showBooks ( ) ;
0 commit comments