()
| 1 | function initializeJS() { |
| 2 | jQuery('.driverPicker').selectpicker(); |
| 3 | jQuery('.driverPicker').change(toggleDownload); |
| 4 | jQuery('.releasePicker').selectpicker(); |
| 5 | jQuery('.releasePicker').change(toggleDownload); |
| 6 | jQuery('.distroPicker').bootstrapToggle(); |
| 7 | jQuery('.distroPicker').change(toggleDownload); |
| 8 | |
| 9 | var clipboard = new ZeroClipboard(jQuery(".clipboard button")); |
| 10 | var clipBridge = $('#global-zeroclipboard-html-bridge'); |
| 11 | clipBridge.tooltip({title: "copy to clipboard", placement: 'bottom'}); |
| 12 | clipboard.on( 'copy', function(event) { |
| 13 | clipBridge.attr('title', 'copied').tooltip('fixTitle').tooltip('show'); |
| 14 | $('#global-zeroclipboard-html-bridge').tooltip({title: "copied", placement: 'bottom'}); |
| 15 | var button = jQuery(".clipboard button"); |
| 16 | button.addClass('btn-success'); |
| 17 | clipboard.clearData(); |
| 18 | prefix = $('.distroPicker').prop('checked') ? "#maven" : "#gradle" |
| 19 | driverVersion = $('.driverPicker').selectpicker().val(); |
| 20 | releaseVersion = $('.releasePicker').selectpicker().val(); |
| 21 | activeSample = prefix + "-" + releaseVersion + "-" + driverVersion; |
| 22 | clipboard.setText($(activeSample).text()); |
| 23 | |
| 24 | button.animate({ opacity: 1 }, 400, function() { |
| 25 | button.removeClass('btn-success'); |
| 26 | clipBridge.attr('title', 'copy to clipboard').tooltip('hide').tooltip('fixTitle'); |
| 27 | }); |
| 28 | }); |
| 29 | }; |
| 30 | |
| 31 | var toggleDownload = function() { |
| 32 | downloadLink = 'https://oss.sonatype.org/content/repositories/releases/org/mongodb/'; |
no test coverage detected