Skip to content

Commit cb3061d

Browse files
committed
chore: bump version to 1.0.9 and improve console logging
1 parent c103663 commit cb3061d

1 file changed

Lines changed: 8 additions & 15 deletions

File tree

StravaTextAuto-Selector.user.js

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name Strava Text Auto-Selector
33
// @namespace typpi.online
4-
// @version 1.0.8
4+
// @version 1.0.9
55
// @description Automatically selects text in specific Strava elements and displays a notification near the cursor. Also allows right-click to copy text.
66
// @author Nick2bad4u
77
// @license UnLicense
@@ -10,8 +10,8 @@
1010
// @include *://*.strava.com/activities/*
1111
// @include *://*.strava.com/athlete/training
1212
// @icon https://www.google.com/s2/favicons?sz=64&domain=strava.com
13-
// @downloadURL https://update.greasyfork.org/scripts/519370/Strava%20Text%20Auto-Selector.user.js
14-
// @updateURL https://update.greasyfork.org/scripts/519370/Strava%20Text%20Auto-Selector.meta.js
13+
// @downloadURL https://update.greasyfork.org/scripts/519370/Strava%20Text%20Auto-Selector.user.js
14+
// @updateURL https://update.greasyfork.org/scripts/519370/Strava%20Text%20Auto-Selector.meta.js
1515
// ==/UserScript==
1616

1717
(function () {
@@ -37,6 +37,7 @@
3737
'#heading > div > div.row.no-margins.activity-summary-container > div.spans8.activity-summary.mt-md.mb-md > div.details-container > div > h1',
3838
'.ride .segment-effort-detail .effort-details table, .swim .segment-effort-detail .effort-details table',
3939
'.activity-description p:only-child',
40+
'.activity-description p:first-child',
4041
];
4142
const summarySelector = '.summaryGridDataContainer';
4243

@@ -84,18 +85,14 @@
8485
// Query elements and add event listeners initially for the first three selectors
8586
selectors.forEach((selector) => {
8687
const elements = document.querySelectorAll(selector);
87-
console.log(
88-
`Found ${elements.length} elements for selector: ${selector}`,
89-
);
88+
console.log(`Found ${elements.length} elements for selector: ${selector}`);
9089
elements.forEach(addContextMenuListener);
9190
});
9291

9392
// Function to handle the summaryGridDataContainer elements separately
9493
function handleSummaryGridDataContainer() {
9594
const elements = document.querySelectorAll(summarySelector);
96-
console.log(
97-
`Found ${elements.length} elements for selector: ${summarySelector}`,
98-
);
95+
console.log(`Found ${elements.length} elements for selector: ${summarySelector}`);
9996
elements.forEach(addContextMenuListener);
10097
}
10198

@@ -107,9 +104,7 @@
107104
if (node.matches(summarySelector)) {
108105
addContextMenuListener(node);
109106
}
110-
node
111-
.querySelectorAll(summarySelector)
112-
.forEach(addContextMenuListener);
107+
node.querySelectorAll(summarySelector).forEach(addContextMenuListener);
113108
}
114109
});
115110
});
@@ -119,9 +114,7 @@
119114
childList: true,
120115
subtree: true,
121116
});
122-
console.log(
123-
'MutationObserver set up to monitor the DOM for summaryGridDataContainer.',
124-
);
117+
console.log('MutationObserver set up to monitor the DOM for summaryGridDataContainer.');
125118

126119
// Handle existing summaryGridDataContainer elements initially
127120
handleSummaryGridDataContainer();

0 commit comments

Comments
 (0)