MCPcopy
hub / github.com/mongodb/node-mongodb-native / initializeJS

Function initializeJS

etc/docs/template/static/s/js/frontpage.js:1–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1function 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
31var toggleDownload = function() {
32 downloadLink = 'https://oss.sonatype.org/content/repositories/releases/org/mongodb/';

Callers 1

frontpage.jsFile · 0.70

Calls 5

onMethod · 0.80
$Function · 0.70
jQueryFunction · 0.50
addClassMethod · 0.45
removeClassMethod · 0.45

Tested by

no test coverage detected