Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixes a bug attaching beacon URL parameters #37

Merged
merged 3 commits into from

3 participants

@edgarklein

When attaching beacon URL parameters boomerang always starts attaching the parameters with "?". This is incorrect if the beacon URL already contains URL parameters. This fix checks whether the URL contains a "?" and if it does, it will attach the parameters prefixed with "&".

Edgar Klein and others added some commits
@bluesmoon

agreed, this should be merged in.

@bluesmoon bluesmoon commented on the diff
boomerang.js
@@ -373,8 +373,15 @@ boomr = {
return this;
}
+ // if there are already url parameters in the beacon url,
+ // change the first parameter prefix for the boomerang url parameters to &
+ var paramPrefix = '?';

Based on boomerang's coding convention, variables should be declared at the start of the function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@bluesmoon bluesmoon commented on the diff
boomerang.js
@@ -373,8 +373,15 @@ boomr = {
return this;
}
+ // if there are already url parameters in the beacon url,
+ // change the first parameter prefix for the boomerang url parameters to &
+ var paramPrefix = '?';
+ if(impl.beacon_url.indexOf('?') > -1)

Also, preferred braces around all block statements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@bluesmoon

merged into bluesmoon/master with a few mods, and have requested an upstream pull.

@edgarklein

I hope you merged all 3 pull requests because they are all related.

@bluesmoon
@marcelduran marcelduran merged commit 8dc71c5 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 23, 2012
  1. if there are already url parameters in the beacon url, change the fir…

    Edgar Klein authored
    …st parameter prefix for the boomerang url parameters to &
  2. replaced spaces with tabs

    Edgar Klein authored
Commits on Mar 26, 2012
  1. @edgarklein
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 1 deletion.
  1. +8 −1 boomerang.js
View
9 boomerang.js
@@ -373,8 +373,15 @@ boomr = {
return this;
}
+ // if there are already url parameters in the beacon url,
+ // change the first parameter prefix for the boomerang url parameters to &
+ var paramPrefix = '?';

Based on boomerang's coding convention, variables should be declared at the start of the function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ if(impl.beacon_url.indexOf('?') > -1)

Also, preferred braces around all block statements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ paramPrefix = '&';
+
+
// use document.URL instead of location.href because of a safari bug
- url = impl.beacon_url + '?v=' + encodeURIComponent(BOOMR.version) +
+ url = impl.beacon_url + paramPrefix + 'v=' + encodeURIComponent(BOOMR.version) +
'&u=' + encodeURIComponent(d.URL.replace(/#.*/, ''));
for(k in impl.vars) {
Something went wrong with that request. Please try again.