Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Halloween's over - let's stamp out these ZOMBIE merchandising components #11055

Merged
merged 2 commits into from
Nov 5, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ define([
};
}

function getLenientRules() {
var lenientRules = _.cloneDeep(getRules());
// more lenient rules, closer to the top start of the article
lenientRules.minAbove = 300;
lenientRules.selectors[' > h2'].minAbove = 20;
return lenientRules;
function getInlineMerchRules() {
var newRules = _.cloneDeep(getRules());
newRules.minAbove = 300;
newRules.selectors[' > h2'].minAbove = 20;
return newRules;
}

function getLongArticleRules() {
Expand Down Expand Up @@ -85,19 +84,19 @@ define([
}
},
init = function () {
var rules, lenientRules, inlineMercPromise;
var rules, inlineMercPromise;

if (!commercialFeatures.articleBodyAdverts) {
return false;
}

rules = getRules();
lenientRules = getLenientRules();

if (config.page.hasInlineMerchandise) {
adNames.unshift(['im', 'im']);

inlineMercPromise = spacefinder.getParaWithSpace(lenientRules).then(function (space) {
inlineMercPromise = spacefinder.getParaWithSpace(getInlineMerchRules()).then(function (space) {
if (space) {
adNames.unshift(['im', 'im']);
}
return insertAdAtP(space);
});
} else {
Expand Down Expand Up @@ -137,7 +136,7 @@ define([
init: init,
// rules exposed for spacefinder debugging
getRules: getRules,
getLenientRules: getLenientRules,
getLenientRules: getInlineMerchRules,

reset: function () {
ads = [];
Expand Down