|
3 | 3 | /**
|
4 | 4 | * Provide the summary information for the tracking settings vertical tabs.
|
5 | 5 | */
|
6 |
| -Drupal.behaviors.trackingSettingsSummary = { |
| 6 | +Backdrop.behaviors.trackingSettingsSummary = { |
7 | 7 | attach: function (context) {
|
8 |
| - // Make sure this behavior is processed only if drupalSetSummary is defined. |
9 |
| - if (typeof jQuery.fn.drupalSetSummary == 'undefined') { |
| 8 | + // Make sure this behavior is processed only if backdropSetSummary is defined. |
| 9 | + if (typeof jQuery.fn.backdropSetSummary == 'undefined') { |
10 | 10 | return;
|
11 | 11 | }
|
12 | 12 |
|
13 |
| - $('fieldset#edit-domain-tracking', context).drupalSetSummary(function (context) { |
| 13 | + $('fieldset#edit-domain-tracking', context).backdropSetSummary(function (context) { |
14 | 14 | var $radio = $('input[name="matomo_domain_mode"]:checked', context);
|
15 | 15 | if ($radio.val() == 0) {
|
16 |
| - return Drupal.t('A single domain'); |
| 16 | + return Backdrop.t('A single domain'); |
17 | 17 | }
|
18 | 18 | else if ($radio.val() == 1) {
|
19 |
| - return Drupal.t('One domain with multiple subdomains'); |
| 19 | + return Backdrop.t('One domain with multiple subdomains'); |
20 | 20 | }
|
21 | 21 | });
|
22 | 22 |
|
23 |
| - $('fieldset#edit-page-vis-settings', context).drupalSetSummary(function (context) { |
| 23 | + $('fieldset#edit-page-vis-settings', context).backdropSetSummary(function (context) { |
24 | 24 | var $radio = $('input[name="matomo_visibility_pages"]:checked', context);
|
25 | 25 | if ($radio.val() == 0) {
|
26 | 26 | if (!$('textarea[name="matomo_pages"]', context).val()) {
|
27 |
| - return Drupal.t('Not restricted'); |
| 27 | + return Backdrop.t('Not restricted'); |
28 | 28 | }
|
29 | 29 | else {
|
30 |
| - return Drupal.t('All pages with exceptions'); |
| 30 | + return Backdrop.t('All pages with exceptions'); |
31 | 31 | }
|
32 | 32 | }
|
33 | 33 | else {
|
34 |
| - return Drupal.t('Restricted to certain pages'); |
| 34 | + return Backdrop.t('Restricted to certain pages'); |
35 | 35 | }
|
36 | 36 | });
|
37 | 37 |
|
38 |
| - $('fieldset#edit-role-vis-settings', context).drupalSetSummary(function (context) { |
| 38 | + $('fieldset#edit-role-vis-settings', context).backdropSetSummary(function (context) { |
39 | 39 | var vals = [];
|
40 | 40 | $('input[type="checkbox"]:checked', context).each(function () {
|
41 | 41 | vals.push($.trim($(this).next('label').text()));
|
42 | 42 | });
|
43 | 43 | if (!vals.length) {
|
44 |
| - return Drupal.t('Not restricted'); |
| 44 | + return Backdrop.t('Not restricted'); |
45 | 45 | }
|
46 | 46 | else if ($('input[name="matomo_visibility_roles"]:checked', context).val() == 1) {
|
47 |
| - return Drupal.t('Excepted: @roles', {'@roles' : vals.join(', ')}); |
| 47 | + return Backdrop.t('Excepted: @roles', {'@roles' : vals.join(', ')}); |
48 | 48 | }
|
49 | 49 | else {
|
50 | 50 | return vals.join(', ');
|
51 | 51 | }
|
52 | 52 | });
|
53 | 53 |
|
54 |
| - $('fieldset#edit-user-vis-settings', context).drupalSetSummary(function (context) { |
| 54 | + $('fieldset#edit-user-vis-settings', context).backdropSetSummary(function (context) { |
55 | 55 | var $radio = $('input[name="matomo_custom"]:checked', context);
|
56 | 56 | if ($radio.val() == 0) {
|
57 |
| - return Drupal.t('Not customizable'); |
| 57 | + return Backdrop.t('Not customizable'); |
58 | 58 | }
|
59 | 59 | else if ($radio.val() == 1) {
|
60 |
| - return Drupal.t('On by default with opt out'); |
| 60 | + return Backdrop.t('On by default with opt out'); |
61 | 61 | }
|
62 | 62 | else {
|
63 |
| - return Drupal.t('Off by default with opt in'); |
| 63 | + return Backdrop.t('Off by default with opt in'); |
64 | 64 | }
|
65 | 65 | });
|
66 | 66 |
|
67 |
| - $('fieldset#edit-linktracking', context).drupalSetSummary(function (context) { |
| 67 | + $('fieldset#edit-linktracking', context).backdropSetSummary(function (context) { |
68 | 68 | var vals = [];
|
69 | 69 | if ($('input#edit-matomo-trackmailto', context).is(':checked')) {
|
70 |
| - vals.push(Drupal.t('Mailto links')); |
| 70 | + vals.push(Backdrop.t('Mailto links')); |
71 | 71 | }
|
72 | 72 | if ($('input#edit-matomo-track', context).is(':checked')) {
|
73 |
| - vals.push(Drupal.t('Outbound links')); |
74 |
| - vals.push(Drupal.t('Downloads')); |
| 73 | + vals.push(Backdrop.t('Outbound links')); |
| 74 | + vals.push(Backdrop.t('Downloads')); |
75 | 75 | }
|
76 | 76 | if ($('input#edit-matomo-trackcolorbox', context).is(':checked')) {
|
77 |
| - vals.push(Drupal.t('Colorbox')); |
| 77 | + vals.push(Backdrop.t('Colorbox')); |
78 | 78 | }
|
79 | 79 | if (!vals.length) {
|
80 |
| - return Drupal.t('Not tracked'); |
| 80 | + return Backdrop.t('Not tracked'); |
81 | 81 | }
|
82 |
| - return Drupal.t('@items enabled', {'@items' : vals.join(', ')}); |
| 82 | + return Backdrop.t('@items enabled', {'@items' : vals.join(', ')}); |
83 | 83 | });
|
84 | 84 |
|
85 |
| - $('fieldset#edit-messagetracking', context).drupalSetSummary(function (context) { |
| 85 | + $('fieldset#edit-messagetracking', context).backdropSetSummary(function (context) { |
86 | 86 | var vals = [];
|
87 | 87 | $('input[type="checkbox"]:checked', context).each(function () {
|
88 | 88 | vals.push($.trim($(this).next('label').text()));
|
89 | 89 | });
|
90 | 90 | if (!vals.length) {
|
91 |
| - return Drupal.t('Not tracked'); |
| 91 | + return Backdrop.t('Not tracked'); |
92 | 92 | }
|
93 |
| - return Drupal.t('@items enabled', {'@items' : vals.join(', ')}); |
| 93 | + return Backdrop.t('@items enabled', {'@items' : vals.join(', ')}); |
94 | 94 | });
|
95 | 95 |
|
96 |
| - $('fieldset#edit-search', context).drupalSetSummary(function (context) { |
| 96 | + $('fieldset#edit-search', context).backdropSetSummary(function (context) { |
97 | 97 | var vals = [];
|
98 | 98 | if ($('input#edit-matomo-site-search', context).is(':checked')) {
|
99 |
| - vals.push(Drupal.t('Site search')); |
| 99 | + vals.push(Backdrop.t('Site search')); |
100 | 100 | }
|
101 | 101 | if (!vals.length) {
|
102 |
| - return Drupal.t('Not tracked'); |
| 102 | + return Backdrop.t('Not tracked'); |
103 | 103 | }
|
104 |
| - return Drupal.t('@items enabled', {'@items' : vals.join(', ')}); |
| 104 | + return Backdrop.t('@items enabled', {'@items' : vals.join(', ')}); |
105 | 105 | });
|
106 | 106 |
|
107 |
| - $('fieldset#edit-privacy', context).drupalSetSummary(function (context) { |
| 107 | + $('fieldset#edit-privacy', context).backdropSetSummary(function (context) { |
108 | 108 | var vals = [];
|
109 | 109 | if ($('input#edit-matomo-privacy-donottrack', context).is(':checked')) {
|
110 |
| - vals.push(Drupal.t('Universal web tracking opt-out')); |
| 110 | + vals.push(Backdrop.t('Universal web tracking opt-out')); |
111 | 111 | }
|
112 | 112 | if (!vals.length) {
|
113 |
| - return Drupal.t('No privacy'); |
| 113 | + return Backdrop.t('No privacy'); |
114 | 114 | }
|
115 |
| - return Drupal.t('@items enabled', {'@items' : vals.join(', ')}); |
| 115 | + return Backdrop.t('@items enabled', {'@items' : vals.join(', ')}); |
116 | 116 | });
|
117 | 117 | }
|
118 | 118 | };
|
|
0 commit comments