Permalink
Browse files

Run all this privately.

  • Loading branch information...
lamby committed Mar 7, 2014
1 parent 5a23234 commit 79d294fbdd01cbbf89257d53de0d078b0216338e
Showing with 10 additions and 8 deletions.
  1. +10 −8 js/inject.js
View
@@ -1,9 +1,11 @@
-var url = jQuery("a:contains(My Profile)[href^='/athletes/']").attr('href');
-var target = window._measurement_preference == "meters" ? "feet" : "meters";
-var athlete_id = parseInt(url.split('/')[2], 10);
+(function() {
+ var url = jQuery("a:contains(My Profile)[href^='/athletes/']").attr('href');
+ var target = window._measurement_preference == "meters" ? "feet" : "meters";
+ var athlete_id = parseInt(url.split('/')[2], 10);
-(new Strava.Athletes.Athlete(url, athlete_id)).save(
- "measurement_preference",
- target,
- {"success": function(x) { window.location.reload(); } }
-);
+ (new Strava.Athletes.Athlete(url, athlete_id)).save(
+ "measurement_preference",
+ target,
+ {"success": function(x) { window.location.reload(); } }
+ );
+})();

0 comments on commit 79d294f

Please sign in to comment.