@@ -1669,50 +1669,38 @@ require([
16691669 filtObj = new Object ( ) ;
16701670 for ( ckey in window . filterObj ) {
16711671 if ( ckey === 'Program' ) {
1672-
16731672 for ( ind = 0 ; ind < window . filterObj [ ckey ] . length ; ind ++ ) {
16741673 program = window . filterObj [ ckey ] [ ind ] ;
16751674 if ( program in window . projSets ) {
16761675 if ( ! ( 'Program.' + program in window . filterObj ) ) {
16771676 collObj = collObj . concat ( window . projSets [ program ] ) ;
16781677 }
1679- }
1680- else {
1678+ } else {
16811679 collObj . push ( program ) ;
16821680 }
16831681 }
1684- }
1685- else if ( ckey . startsWith ( 'Program.' ) ) {
1682+ } else if ( ckey . startsWith ( 'Program.' ) ) {
16861683 for ( ind = 0 ; ind < window . filterObj [ ckey ] . length ; ind ++ ) {
16871684 collObj . push ( window . filterObj [ ckey ] [ ind ] ) ;
16881685 }
1689- }
1690- else {
1686+ } else {
16911687 nmA = ckey . split ( '.' ) ;
16921688 nm = nmA [ nmA . length - 1 ] ;
16931689 if ( nm . endsWith ( '_rng' ) ) {
16941690 if ( window . filterObj [ ckey ] . type === 'none' ) {
16951691 nm = nm . replace ( '_rng' , '' ) ;
1696- }
1697- else {
1692+ } else {
16981693 nm = nm . replace ( '_rng' , '_' + window . filterObj [ ckey ] . type ) ;
16991694 }
17001695 if ( ( 'rng' in window . filterObj [ ckey ] ) && ( 'none' in window . filterObj [ ckey ] ) ) {
17011696 filtObj [ nm ] = [ window . filterObj [ ckey ] [ 'rng' ] , 'None' ]
1702- }
1703-
1704- else if ( 'rng' in window . filterObj [ ckey ] ) {
1697+ } else if ( 'rng' in window . filterObj [ ckey ] ) {
17051698 filtObj [ nm ] = window . filterObj [ ckey ] [ 'rng' ]
1706- }
1707- else if ( 'none' in window . filterObj [ ckey ] ) {
1699+ } else if ( 'none' in window . filterObj [ ckey ] ) {
17081700 noneKey = nm . replace ( '_rng' , '' ) ;
17091701 filtObj [ noneKey ] = [ 'None' ] ;
17101702 }
1711-
1712-
1713-
1714- }
1715- else {
1703+ } else {
17161704 filtObj [ nm ] = window . filterObj [ ckey ] ;
17171705 }
17181706 }
@@ -1749,11 +1737,13 @@ require([
17491737 $ ( '#file-export-option' ) . prop ( 'title' , 'Your cohort exceeds the maximum for download.' ) ;
17501738 $ ( '#file-export-option input' ) . prop ( 'disabled' , 'disabled' ) ;
17511739 $ ( '#file-export-option input' ) . prop ( 'checked' , false ) ;
1752-
1753- $ ( '#bq-export-option input' ) . prop ( 'checked' , true ) . trigger ( "click" ) ;
1754-
1755- $ ( '#file-manifest-max-exceeded' ) . show ( ) ;
17561740 $ ( '#file-manifest' ) . hide ( ) ;
1741+ if ( ! user_is_social ) {
1742+ $ ( '#need-social-account' ) . show ( ) ;
1743+ } else {
1744+ $ ( '#file-manifest-max-exceeded' ) . show ( ) ;
1745+ $ ( '#bq-export-option input' ) . prop ( 'checked' , true ) . trigger ( "click" ) ;
1746+ }
17571747 } else {
17581748 $ ( '#file-manifest-max-exceeded' ) . hide ( ) ;
17591749 $ ( '#file-manifest' ) . show ( ) ;
@@ -2533,12 +2523,8 @@ require([
25332523 filtnm = checkBox . value ;
25342524 hasCheckBox = true ;
25352525 numCheckBoxes ++ ;
2536- }
2537- else
2538- {
2539-
2526+ } else {
25402527 filtnm = $ ( filterCat ) . children ( '.list-group-sub-item__body, .list-group-item__body, .collection-list' ) [ 0 ] . id ;
2541-
25422528 if ( $ ( filterCat ) . children ( '.list-group-item__heading' ) . children ( 'input:checkbox' ) . length > 0 ) {
25432529 hasCheckBox = true ;
25442530 numCheckBoxes ++ ;
@@ -2668,35 +2654,26 @@ require([
26682654
26692655 if ( item1 === item2 ) {
26702656 if ( isSeries && ( curInd === 0 ) ) {
2671-
26722657 var seriesNuma = parseInt ( $ ( a ) . children ( ) [ 1 ] . innerText ) ;
26732658 var seriesNumb = parseInt ( $ ( b ) . children ( ) [ 1 ] . innerText ) ;
2674-
26752659 if ( seriesNuma === seriesNumb ) {
26762660 return 0 ;
2677- }
2678- else if ( ( ( seriesNuma > seriesNumb ) ) ) {
2661+ } else if ( ( ( seriesNuma > seriesNumb ) ) ) {
26792662 return 1 ;
2680- }
2681- else {
2663+ } else {
26822664 return - 1 ;
26832665 }
2684- }
2685- else {
2666+ } else {
26862667 return 0 ;
26872668 }
2688- }
2689-
2690- else if ( ( ( item1 > item2 ) && asc ) || ( ( item2 > item1 ) && ! asc ) ) {
2669+ } else if ( ( ( item1 > item2 ) && asc ) || ( ( item2 > item1 ) && ! asc ) ) {
26912670 return 1 ;
2692- }
2693- else {
2671+ } else {
26942672 return - 1
26952673 }
26962674 } ) ;
26972675 $ ( tbl ) . find ( 'tbody' ) . append ( rowSet ) ;
2698- }
2699-
2676+ } ;
27002677
27012678 var filterItemBindings = function ( filterId ) {
27022679 $ ( '#' + filterId ) . find ( 'input:checkbox' ) . on ( 'click' , function ( ) {
@@ -2809,16 +2786,16 @@ require([
28092786
28102787 }
28112788
2812- }
2789+ } ;
28132790
28142791 var addFilterBindings = function ( id ) {
28152792 var filterCats = findFilterCats ( id , false ) ;
28162793 for ( var i = 0 ; i < filterCats . length ; i ++ ) {
28172794 filterItemBindings ( filterCats [ i ] ) ;
28182795 }
2819- }
2796+ } ;
28202797
2821- var addSliders = function ( id , initialized , hideZeros , parStr ) {
2798+ var addSliders = function ( id , initialized , hideZeros , parStr ) {
28222799 $ ( '#' + id ) . find ( '.list-group-item__body.isQuant' ) . each ( function ( ) {
28232800 $ ( this ) . find ( '.more-checks' ) . addClass ( 'hide' ) ;
28242801 $ ( this ) . find ( '.less-checks' ) . addClass ( 'hide' ) ;
@@ -2834,7 +2811,6 @@ require([
28342811 var wNone = $ ( this ) . hasClass ( 'wNone' ) ;
28352812 var checked = ( $ ( this ) . find ( '.noneBut' ) . length > 0 ) ? $ ( this ) . find ( '.noneBut' ) . find ( ':input' ) [ 0 ] . checked : false ;
28362813
2837-
28382814 if ( ! initialized ) {
28392815 var slideDivId = $ ( this ) . prop ( 'id' ) + '_slide' ;
28402816 curmin = $ ( this ) . attr ( 'data-curmin' ) ;
@@ -2852,51 +2828,39 @@ require([
28522828 addSlider = false ;
28532829 $ ( this ) . removeClass ( 'hasSlider' ) ;
28542830 //$(this).removeClass('isActive');
2855- }
2856- else if ( isActive ) {
2831+ } else if ( isActive ) {
28572832 if ( curmin === 'NA' ) {
28582833 min = lower ;
2859- }
2860- else {
2834+ } else {
28612835 min = Math . min ( lower , Math . floor ( curmin ) ) ;
28622836 }
28632837 if ( curmax === 'NA' ) {
28642838 max = upper ;
2865- }
2866- else {
2839+ } else {
28672840 max = Math . max ( upper , Math . ceil ( curmax ) ) ;
28682841 }
2869-
2870- }
2871- else {
2842+ } else {
28722843 min = Math . floor ( curmin ) ;
28732844 max = Math . ceil ( curmax ) ;
28742845 lower = min ;
28752846 upper = max ;
28762847 //$(this).attr('data-curminrng', lower);
28772848 //$(this).attr('data-curmaxrng', upper);
2878- }
28792849 }
2880-
2881- else if ( ! isActive ) {
2850+ } else if ( ! isActive ) {
28822851 lower = min ;
28832852 upper = max ;
28842853 //$(this).attr('data-curminrng', lower);
28852854 //$(this).attr('data-curmaxrng', upper);
28862855 }
2887-
2888-
28892856 }
28902857
2891-
28922858 if ( addSlider ) {
28932859 $ ( this ) . addClass ( 'hasSlider' ) ;
28942860 mkSlider ( $ ( this ) . prop ( 'id' ) , min , max , 1 , true , wNone , parStr , $ ( this ) . data ( 'filter-attr-id' ) , $ ( this ) . data ( 'filter-display-attr' ) , lower , upper , isActive , checked ) ;
2895- }
2896- else {
2861+ } else {
28972862 $ ( this ) . removeClass ( 'hasSlider' ) ;
28982863 //$(this).removeClass('isActive');
2899-
29002864 }
29012865 } ) ;
29022866 } ;
@@ -2958,10 +2922,8 @@ require([
29582922 // For collection list
29592923 $ ( '.collection-list' ) . each ( function ( ) {
29602924 var $group = $ ( this ) ;
2961-
29622925 var checkboxes = $group . find ( "input:checked" ) ;
2963- if ( checkboxes . length > 0 )
2964- {
2926+ if ( checkboxes . length > 0 ) {
29652927 var values = [ ] ;
29662928 var my_id = "" ;
29672929 checkboxes . each ( function ( ) {
@@ -3046,7 +3008,6 @@ require([
30463008 var cohort_loaded = false ;
30473009 function load_preset_filters ( ) {
30483010 if ( is_cohort && ! cohort_loaded ) {
3049- console . debug ( "Unloaded cohort found, loading..." ) ;
30503011 var loadPending = load_filters ( cohort_filters ) ;
30513012 loadPending . done ( function ( ) {
30523013 console . debug ( "Load pending complete." ) ;
@@ -3066,7 +3027,7 @@ require([
30663027 } else if ( Object . keys ( filters_for_load ) . length > 0 ) {
30673028 var loadPending = load_filters ( filters_for_load ) ;
30683029 loadPending . done ( function ( ) {
3069- console . debug ( "External filter load done." ) ;
3030+ // console.debug("External filter load done.");
30703031 } ) ;
30713032 } else {
30723033 // check for localStorage key of saved filters from a login
@@ -3076,7 +3037,7 @@ require([
30763037 if ( has_sliders ) {
30773038 let loadPending = load_sliders ( ANONYMOUS_SLIDERS , ! has_filters ) ;
30783039 loadPending . done ( function ( ) {
3079- console . debug ( "Sliders loaded from anonymous login." ) ;
3040+ // console.debug("Sliders loaded from anonymous login.");
30803041 } ) ;
30813042 }
30823043 if ( has_filters ) {
0 commit comments