diff --git a/cps/static/js/caliBlur.js b/cps/static/js/caliBlur.js index 997bd270..6162d34d 100644 --- a/cps/static/js/caliBlur.js +++ b/cps/static/js/caliBlur.js @@ -1,6 +1,9 @@ // Move advanced search to side-menu $( 'a[href*="advanced"]' ).parent().insertAfter( '#nav_new' ); $( 'body' ).addClass('blur'); +$( 'body.stat' ).addClass( 'stats' ); +$( 'body.config' ).addClass( 'admin'); +$( 'body.viewconfig' ).addClass( 'admin'); // Back button curHref = window.location.href.split('/'); @@ -34,99 +37,7 @@ $( 'a.navbar-brand' ).clone().appendTo( '.home-btn' ).empty().removeClass('navba // Wrap book description in div container if ( $( 'body.book' ).length > 0 ) { - - /* description = $( 'h3:contains("Description:")' ).nextUntil( '.morestuff' ).slice(0,-1); - bookInfo = $( '.author' ).nextUntil( 'h3:contains("Description:")'); - $( 'h3:contains("Description:")' ).hide(); - $( description ).detach(); - $( bookInfo ).wrapAll( '
' ); - $( 'h3:contains("Description:")' ).after( '' ); - $( '.languages' ).appendTo( '.bookinfo' ); - $('.hr').detach(); - if ( $( '.identifiers ').length > 0 ) { - console.log(".identifiers length " + $( '.identifiers ').length ); - $( '.identifiers' ).before( '' ); - } else { - if ( $( '.bookinfo > p:first-child' ).length > 0 ) { - console.log(".bookinfo > p:first-child length " + $( '.bookinfo > p' ).length ); - $( '.bookinfo > p:first-child' ).first().after( '' ); - } else{ - if ( $( '.bookinfo a[href*="/series/"]' ).length > 0 ) { - console.log( 'series text found; placing hr below series' ); - $( '.bookinfo a[href*="/series/"]' ).parent().after( '' ); - } else { - console.log("prepending hr div to top of .bookinfo"); - $( '.bookinfo' ).prepend( '' ); - } - } - } - $( '.rating' ).insertBefore( '.hr' ); - $( 'div.description' ).hide(); - $( '#remove-from-shelves' ).insertAfter( '.hr' ); - - /* if book description is not in html format, Remove extra line breaks - Remove blank lines/unnecessary spaces, split by line break to array - Push array into .description div. If there is still a wall of text, - find sentences and split wall into groups of three sentence paragraphs. - If the book format is in html format, Keep html, but strip away inline - styles and empty elements */ -/* - // If text is sitting in div as text node - if ( description[0] === undefined ) { - textValue = $( '.book-meta' ) - .contents() - .filter(function() { - return this.nodeType == Node.TEXT_NODE; - }).text(); - description = $.makeArray( - textValue.replace(/(?:(?:\r\n|\r|\n)\s*){2}/gm, "") - ); - $( '.book-meta' ).contents().filter(function() { - return this.nodeType === 3; - }).remove(); - } - if ( description[1] === undefined ) { - newdesc = description.toString() - .replace(/^(?=\n)$|^\s*|\s*$|\n\n+/gm,"").split(/\n/); - $.each(newdesc, function(i, val) { - $( 'div.description' ).append( '' + newdesc[i] + '
' ); - }); - $( '.description' ).fadeIn(100); - //If still a wall of text create 3 sentence paragraphs. - if( $( '.description p' ).length === 1 ) { - if ( description.context != undefined ) { - newdesc = description.text() - .replace(/^(?=\n)$|^\s*|\s*$|\n\n+/gm,"").split(/\n/); - } - else { - newdesc = description.toString(); - } - doc = nlp ( newdesc.toString() ); - sentences = doc.map((m)=> m.out( 'text' )); - $( '.description p' ).remove(); - let size = 3; let sentenceChunks = []; - for (var i=0; i