()
| 29 | }; |
| 30 | |
| 31 | var toggleDownload = function() { |
| 32 | downloadLink = 'https://oss.sonatype.org/content/repositories/releases/org/mongodb/'; |
| 33 | downloadSnapshotLink = 'https://oss.sonatype.org/content/repositories/snapshots/org/mongodb/'; |
| 34 | prefix = $('.distroPicker').prop('checked') ? "#maven" : "#gradle"; |
| 35 | driverVersion = $('.driverPicker').selectpicker().val(); |
| 36 | releaseVersion = $('.releasePicker').selectpicker().val(); |
| 37 | activeDriver = $('.driverPicker option:selected').text(); |
| 38 | activeVersion = $('.releasePicker option:selected').text(); |
| 39 | |
| 40 | driverVersions = $('.driverPicker option:selected').data('versions'); |
| 41 | $('.releasePicker option').each(function(){ |
| 42 | $(this).prop('disabled', driverVersions.indexOf($(this).text()) < 0); |
| 43 | }); |
| 44 | |
| 45 | $('.driverPicker option').each(function(){ |
| 46 | driverVersions = $(this).data('versions'); |
| 47 | $(this).prop('disabled', driverVersions.indexOf(activeVersion) < 0); |
| 48 | }); |
| 49 | |
| 50 | $('.driverPicker').selectpicker('refresh'); |
| 51 | $('.releasePicker').selectpicker('refresh'); |
| 52 | |
| 53 | activeSample = prefix + "-" + releaseVersion + "-" + driverVersion; |
| 54 | activeDescription = "#driver-" + driverVersion; |
| 55 | |
| 56 | if (activeVersion.indexOf("SNAPSHOT") > -1) { |
| 57 | activeLink = downloadSnapshotLink + activeDriver +'/' + activeVersion + '/'; |
| 58 | } else { |
| 59 | activeLink = downloadLink + activeDriver +'/' + activeVersion + '/'; |
| 60 | } |
| 61 | |
| 62 | $('.download').addClass('hidden'); |
| 63 | $(activeSample).removeClass('hidden'); |
| 64 | $(activeDescription).removeClass('hidden'); |
| 65 | $('#downloadLink').attr('href', activeLink); |
| 66 | }; |
| 67 | |
| 68 | jQuery(document).ready(function(){ |
| 69 | initializeJS(); |
nothing calls this directly
no test coverage detected