Skip to content

Commit

Permalink
Export getParameterByName method
Browse files Browse the repository at this point in the history
On Utils.js make getParameterByName method public
  • Loading branch information
hdjvieira committed Jul 28, 2017
1 parent a6000c5 commit 52e1dc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
14 changes: 2 additions & 12 deletions modules/polluxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ import adloader from 'src/adloader';
import adaptermanager from 'src/adaptermanager';
import { STATUS } from 'src/constants';

// get parameters
var getParameterByName = function (name) {
var regexS = '[\\?&]' + name + '=([^&#]*)';
var regex = new RegExp(regexS);
var results = regex.exec(window.location.search);
if (results === null) {
return '';
}
return decodeURIComponent(results[1].replace(/\+/g, ' '));
};
// Prebid adapter for Pollux header bidding client
function polluxBidAdapter() {
function _callBids(params) {
Expand All @@ -25,8 +15,8 @@ function polluxBidAdapter() {
var bid = bids[i];
// check params
if (bid.params.zone) {
var domain = getParameterByName('domain');
var tracker2 = getParameterByName('tracker2');
var domain = utils.getParameterByName('domain');
var tracker2 = utils.getParameterByName('tracker2');
if (domain) {
request_obj.domain = domain;
} else {
Expand Down
1 change: 1 addition & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ var getParameterByName = function (name) {

return decodeURIComponent(results[1].replace(/\+/g, ' '));
};
exports.getParameterByName = getParameterByName;

/**
* This function validates paramaters.
Expand Down

0 comments on commit 52e1dc8

Please sign in to comment.