Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-ka-97 committed Aug 20, 2021
2 parents a2d1760 + 5ea0e1a commit 1ad90c0
Show file tree
Hide file tree
Showing 46 changed files with 3,247 additions and 597 deletions.
65 changes: 34 additions & 31 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,53 @@

const allowedModules = require("./allowedModules");
const allowedModules = require('./allowedModules.js');

module.exports = {
"env": {
"browser": true,
"commonjs": true
env: {
browser: true,
commonjs: true
},
"settings": {
"import/resolver": {
"node": {
"moduleDirectory": ["node_modules", "./"]
settings: {
'import/resolver': {
node: {
moduleDirectory: ['node_modules', './']
}
}
},
"extends": "standard",
"plugins": [
"prebid",
"import"
extends: 'standard',
plugins: [
'prebid',
'import'
],
"globals": {
"$$PREBID_GLOBAL$$": false
globals: {
'$$PREBID_GLOBAL$$': false,
'BROWSERSTACK_USERNAME': false,
'BROWSERSTACK_KEY': false
},
"parserOptions": {
"sourceType": "module"
parserOptions: {
sourceType: 'module',
ecmaVersion: 2018,
},
"rules": {
"comma-dangle": "off",
"semi": "off",
"space-before-function-paren": "off",
"import/extensions": ["error", "ignorePackages"],
rules: {
'comma-dangle': 'off',
semi: 'off',
'space-before-function-paren': 'off',
'import/extensions': ['error', 'ignorePackages'],

// Exceptions below this line are temporary, so that eslint can be added into the CI process.
// Violations of these styles should be fixed, and the exceptions removed over time.
//
// See Issue #1111.
"eqeqeq": "off",
"no-return-assign": "off",
"no-throw-literal": "off",
"no-undef": 2,
"no-useless-escape": "off",
"no-console": "error"
eqeqeq: 'off',
'no-return-assign': 'off',
'no-throw-literal': 'off',
'no-undef': 2,
'no-useless-escape': 'off',
'no-console': 'error'
},
"overrides": Object.keys(allowedModules).map((key) => ({
"files": key + "/**/*.js",
"rules": {
"prebid/validate-imports": ["error", allowedModules[key]]
overrides: Object.keys(allowedModules).map((key) => ({
files: key + '/**/*.js',
rules: {
'prebid/validate-imports': ['error', allowedModules[key]]
}
}))
};
1 change: 0 additions & 1 deletion gulpHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ module.exports = {
},

jsonifyHTML: function (str) {
console.log(arguments);
return str.replace(/\n/g, '')
.replace(/<\//g, '<\\/')
.replace(/\/>/g, '\\/>');
Expand Down
14 changes: 10 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ var webpackStream = require('webpack-stream');
var terser = require('gulp-terser');
var gulpClean = require('gulp-clean');
var KarmaServer = require('karma').Server;
var karmaConfMaker = require('./karma.conf.maker');
var karmaConfMaker = require('./karma.conf.maker.js');
var opens = require('opn');
var webpackConfig = require('./webpack.conf');
var helpers = require('./gulpHelpers');
var webpackConfig = require('./webpack.conf.js');
var helpers = require('./gulpHelpers.js');
var concat = require('gulp-concat');
var header = require('gulp-header');
var footer = require('gulp-footer');
Expand Down Expand Up @@ -71,7 +71,13 @@ function lint(done) {
const isFixed = function (file) {
return file.eslint != null && file.eslint.fixed;
}
return gulp.src(['src/**/*.js', 'modules/**/*.js', 'test/**/*.js'], { base: './' })
return gulp.src([
'src/**/*.js',
'modules/**/*.js',
'test/**/*.js',
'plugins/**/*.js',
'./*.js'
], { base: './' })
.pipe(gulpif(argv.nolintfix, eslint(), eslint({ fix: true })))
.pipe(eslint.format('stylish'))
.pipe(eslint.failAfterError())
Expand Down
8 changes: 7 additions & 1 deletion integrationExamples/gpt/adloox.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@

var videoBids = bids[videoAdUnit.code];
if (videoBids) {
// DEMO NOTES: your environment likely will use the commented section ////
var videoUrl = videoBids.bids[0].vastUrl;
// var videoUrl = pbjs.adServers.dfp.buildVideoUrl({
// adUnit: videoAdUnit,
Expand All @@ -124,7 +125,12 @@
// output: 'vast'
// }
// });
invokeVideoPlayer(videoUrl);
//////////////////////////////////////////////////////////////////////////
var ret = pbjs.adServers.adloox.buildVideoUrl({
adUnit: videoAdUnit,
url: videoUrl
}, invokeVideoPlayer);
if (!ret) console.log('Error building Adloox video URL');
}
}

Expand Down
2 changes: 1 addition & 1 deletion karma.conf.maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// For more information, see http://karma-runner.github.io/1.0/config/configuration-file.html

var _ = require('lodash');
var webpackConf = require('./webpack.conf');
var webpackConf = require('./webpack.conf.js');
var karmaConstants = require('karma').constants;

function newWebpackConfig(codeCoverage) {
Expand Down
22 changes: 17 additions & 5 deletions modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,16 @@ function isNewSession(adagioStorage) {
)
}

function setPlayerName(bidRequest) {
const playerName = (internal.isRendererPreferredFromPublisher(bidRequest)) ? 'other' : 'adagio';

if (playerName === 'other') {
utils.logWarn(`${LOG_PREFIX} renderer.backupOnly has not been set. Adagio recommends to use its own player to get expected behavior.`);
}

return playerName;
}

export const internal = {
enqueue,
getPageviewId,
Expand Down Expand Up @@ -414,11 +424,7 @@ function _buildVideoBidRequest(bidRequest) {
};

if (videoParams.context && videoParams.context === OUTSTREAM) {
bidRequest.mediaTypes.video.playerName = (internal.isRendererPreferredFromPublisher(bidRequest)) ? 'other' : 'adagio';

if (bidRequest.mediaTypes.video.playerName === 'other') {
utils.logWarn(`${LOG_PREFIX} renderer.backupOnly has not been set. Adagio recommends to use its own player to get expected behavior.`);
}
bidRequest.mediaTypes.video.playerName = setPlayerName(bidRequest);
}

// Only whitelisted OpenRTB options need to be validated.
Expand Down Expand Up @@ -1071,6 +1077,8 @@ export const spec = {
if (isOrtb) {
autoFillParams(adagioBid);

adagioBid.params.auctionId = utils.deepAccess(adagioBidderRequest, 'auctionId');

const globalFeatures = GlobalExchange.getOrSetGlobalFeatures();
adagioBid.params.features = {
...globalFeatures,
Expand All @@ -1082,6 +1090,10 @@ export const spec = {
adagioBid.params.prebidVersion = '$prebid.version$';
adagioBid.params.data = GlobalExchange.getExchangeData();

if (utils.deepAccess(adagioBid, 'mediaTypes.video.context') === OUTSTREAM) {
adagioBid.params.playerName = setPlayerName(adagioBid);
}

storeRequestInAdagioNS(adagioBid);
}

Expand Down
Loading

0 comments on commit 1ad90c0

Please sign in to comment.