(ads)(WIP) publift

This commit is contained in:
Andrea Vos 2023-09-13 17:28:00 +02:00
parent 319a85680c
commit 4dde0080cd
33 changed files with 133 additions and 112 deletions

View File

@ -133,7 +133,7 @@
</div>
</div>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<Loading :value="profiles">
<template v-slot:header>
@ -146,7 +146,7 @@
</ul>
</Loading>
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
<Loading :value="socialConnections">
<template v-slot:header>
@ -192,7 +192,7 @@
</a>
</section>
<AdPlaceholder phkey="main-2"/>
<AdPlaceholder :phkey="['content-2', 'content-mobile-2']"/>
<div>
<iframe v-for="domain in universalDomains"

View File

@ -1,10 +1,13 @@
<template>
<div v-if="config.ads && config.ads.enabled && active"
:class="[adPlaceholdersVisible ? 'ad-placeholder-preview' : '']">
<template v-if="adPlaceholdersVisible">
<p class="text-center h5">{{phkey}}</p>
:class="[adPlaceholdersVisible ? 'ad-placeholder-preview' : '']"
:style="adConfig?.sticky ? 'height: 100%' : null"
>
<div v-if="adPlaceholdersVisible" :class="[adConfig?.sticky ? 'wrapper-sticky' : '']">
<p class="text-center h5">{{currentKey}}</p>
<Debug :v="adConfig"/>
</template>
</div>
<div v-else-if="adConfig.fuse" :class="['adsbypublift', adConfig?.sticky ? 'wrapper-sticky' : '']" :data-fuse="adConfig.fuse"></div>
<div v-else-if="adConfig.waldo" :class="['adsbynewor', adConfig.video ? 'waldo-video-tag' : '']" :id="'waldo-tag-' + adConfig.slotId"></div>
<ins v-else-if="adConfig.adsense" class="adsbygoogle"
style="display:block;margin-block: 1em;"
@ -31,40 +34,61 @@ import { adsInternalPerPlaceholder } from "../src/adsInternal";
import {mapState} from "vuex";
import {randomItem} from "../src/helpers";
const MOBILE_BREAKPOINT = 992;
export default {
props: {
phkey: {required: true},
},
data() {
if (adsInternalPerPlaceholder[this.phkey]) {
return {
active: true,
adConfig: randomItem(adsInternalPerPlaceholder[this.phkey]),
}
}
if (!adPlaceholders[this.phkey]) {
return { active: false, adConfig: {} }; // FIXME
}
const {slotId, adFormat, adLayout = null, responsive = false, video = false} = adPlaceholders[this.phkey];
return {
active: true,
adConfig: {
waldo: true,
slotId,
adFormat,
adLayout,
responsive,
video,
}
isMobile: undefined,
}
},
mounted() {
if (!process.client) { return; }
(window.adsbygoogle = window.adsbygoogle || []).push({});
this.handleResize();
window.addEventListener('resize', this.handleResize);
},
beforeUnmount() {
window.removeEventListener('resize', this.handleResize);
},
methods: {
handleResize() {
this.isMobile = window.innerWidth < MOBILE_BREAKPOINT;
},
},
computed: {
currentKey() {
if (!Array.isArray(this.phkey)) {
return this.phkey;
}
return this.phkey[this.isMobile ? 1 : 0];
},
active() {
return this.isMobile !== undefined && this.currentKey
&& (adsInternalPerPlaceholder[this.currentKey] || adPlaceholders[this.currentKey]);
},
adConfig() {
if (!this.active) { return {}; }
if (adsInternalPerPlaceholder[this.currentKey]) {
return randomItem(adsInternalPerPlaceholder[this.currentKey]);
}
const {slotId, adFormat, adLayout = null, responsive = false, video = false, sticky = false} = adPlaceholders[this.currentKey];
return {
fuse: true,
slotId,
adFormat,
adLayout,
responsive,
video,
sticky,
}
},
// adPlaceholdersVisible: () => true,
...mapState([
'adPlaceholdersVisible',
]),
@ -80,7 +104,7 @@ export default {
padding: 1em;
}
.adsbygoogle:not(:empty), .adsinternal:not(:empty), .adsbynewor:not(:empty) {
.adsbygoogle:not(:empty), .adsinternal:not(:empty), .adsbynewor:not(:empty), .adsbypublift:not(:empty) {
text-decoration: none;
&:before {
content: attr(data-label);
@ -88,4 +112,9 @@ export default {
font-size: 0.7rem;
}
}
.wrapper-sticky {
position: -webkit-sticky;
position: sticky;
top: 0;
}
</style>

View File

@ -143,7 +143,7 @@
</template>
</Table>
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
<template v-if="config.nouns.submit">
<Separator icon="plus"/>

View File

@ -174,9 +174,9 @@
<Stats/>
</div>
</div>
<AdPlaceholder phkey="footer"/>
<EasterEgg/>
<UkraineBanner class="my-3"/>
<AdPlaceholder phkey="footer"/>
</div>
</footer>
<div v-else>

View File

@ -28,6 +28,7 @@
<Logo flag class="me-2"/><span class="higher"><T>title</T></span>
</h1>
</nuxt-link>
<AdPlaceholder :phkey="[null, 'header']"/>
<VersionDropdown/>
</div>
<div class="btn-group-vertical d-flex nav-custom mb-2">

View File

@ -214,7 +214,7 @@
</template>
</Table>
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
<Separator icon="plus"/>

View File

@ -12,6 +12,6 @@
</nuxt-link>
</p>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
</div>
</template>

View File

@ -1,9 +1,9 @@
<template>
<div>
<div class="main-asides d-flex flex-column flex-xxl-row justify-content-center align-items-center align-items-xxl-start">
<div class="main-asides d-flex flex-column flex-xxl-row justify-content-center align-items-center align-items-xxl-stretch">
<aside v-if="!wide" class="aside-left p-0 p-xxl-3">
<slot name="aside-left">
<AdPlaceholder phkey="aside-left-middle" class="d-none d-xxl-block"/>
<AdPlaceholder :phkey="['aside-left', null]" class="d-none d-xxl-block"/>
</slot>
</aside>
<main :class="[wide ? 'wide' : '']">
@ -11,7 +11,7 @@
</main>
<aside v-if="!wide" class="aside-right">
<slot name="aside-right">
<AdPlaceholder phkey="aside-right-middle"/>
<AdPlaceholder :phkey="['aside-right', null]"/>
</slot>
</aside>
</div>

View File

@ -1,5 +1,5 @@
<template>
<AdPlaceholder phkey="support"/>
<AdPlaceholder phkey="content-footer"/>
<!--
<section>
<h3>

View File

@ -100,7 +100,7 @@
</template>
</Table>
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
<Separator icon="plus"/>

View File

@ -138,7 +138,7 @@
async loadAds() {
if (!this.adsEnabled) { return; }
await this.$loadScript('newor', `https://cdn.thisiswaldo.com/static/js/15234.js`);
await this.$loadScript('newor', `https://cdn.fuseplatform.net/publift/tags/2/3329/fuse.js`);
},
async loadGTM() {
if (!this.adsEnabled) { return; }

View File

@ -1170,6 +1170,12 @@ privacy:
It uses cookies that enable it to serve ads to our users based on previous visits to our site and other sites.
You may opt out of personalised advertising by not giving your consent when prompted
or by clicking on the “Privacy” button in the right bottom corner of the page.
publift: >
In order to fund the project we show ads using third party vendors, including <strong>Publift</strong>,
whose privacy policy is available {https://www.publift.com/privacy-policy=here}.
It uses cookies that enable it to serve ads to our users based on previous visits to our site and other sites.
You may opt out of personalised advertising by not giving your consent when prompted
by using the button below.
logsBackups: >
Logs and backups are stored for no longer than 18 months.
gdpr: >

View File

@ -39,7 +39,7 @@
<PronounGroup v-for="pronounGroup in pronounGroups" :key="pronounGroup.name" :pronounGroup="pronounGroup"/>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<section>
<Share :title="`${$t('pronouns.intro')}: ${$t('pronouns.any.short')}`"/>
@ -54,7 +54,7 @@
<T>home.about</T>
<Homepage align="center"/>
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
</section>
</div>
</Page>

View File

@ -8,11 +8,11 @@
<LinkedText :text="config.pronouns.null.history"/>
</p>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<Avoiding/>
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
</Page>
</template>

View File

@ -5,7 +5,7 @@
<Icon v="pen-nib"/>
<T>links.blog</T>
</h2>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<BlogEntriesList :posts="posts" details/>
<Separator icon="heart"/>
<Support/>

View File

@ -10,11 +10,11 @@
</router-link>
</p>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<Spelling :text="content"/>
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
<div class="d-print-none">
<Separator icon="heart"/>

View File

@ -61,7 +61,7 @@
</template>
<template v-if="!basic">
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
<CalendarExtra :year="year"/>
<Separator icon="heart"/>

View File

@ -39,7 +39,7 @@
</section>
<template v-if="!basic">
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
<CalendarExtra :day="day"/>
<Separator icon="heart"/>

View File

@ -26,7 +26,7 @@
</div>
</details>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<section itemscope itemtype="https://schema.org/FAQPage">
<Answer v-for="question in Object.keys($t('faq.questions'))" :key="question"
@ -39,7 +39,7 @@
/>
</section>
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
<section>
<Share :title="$t('faq.headerLong')"/>

View File

@ -1,7 +1,7 @@
<template>
<Page>
<UkraineBanner class="mb-4"/>
<AdPlaceholder phkey="small-homepage"/>
<AdPlaceholder :phkey="['header', null]"/>
<template v-if="$te('home.welcome')">
<section>
<h2>
@ -26,11 +26,7 @@
</div>
</div>
<AdPlaceholder phkey="main-0"/>
<CalendarBanner link/>
<AdPlaceholder phkey="main-1"/>
</section>
</template>
@ -41,7 +37,7 @@
<T>home.about</T>
<AdPlaceholder phkey="main-2"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<CardsBanner/>
@ -55,7 +51,6 @@
<Separator icon="bookmark"/>
<section>
<AdPlaceholder phkey="main-3"/>
<div class="row">
<div class="col-12 col-md-6">
<LanguageVersions/>
@ -70,6 +65,8 @@
</div>
</section>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
<template v-if="posts.length">
<Separator icon="pen-nib" class="mb-5"/>
<section>

View File

@ -12,7 +12,7 @@
<Share :title="$t('inclusive.headerLong')"/>
</section>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<InclusiveDictionary load ref="inclusivedictionary"/>
</Page>

View File

@ -10,18 +10,15 @@
<BlogEntriesList :posts="posts" details/>
</section>
<Endorsements/>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<Links/>
<AdPlaceholder phkey="main-1"/>
<AcademicLinks v-if="!config.links.split && config.links.academic.length > 0"/>
<AdPlaceholder phkey="main-2"/>
<Media v-if="(config.links.mediaGuests.length + config.links.mediaMentions.length > 0) && (!config.links.split || (config.links.mediaGuests.length + config.links.mediaMentions.length <= 2))"/>
<AdPlaceholder phkey="main-3"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
<Recommended/>
<AdPlaceholder phkey="main-4"/>
<Socials/>
<AdPlaceholder phkey="main-5"/>
<LanguageVersions/>
<AdPlaceholder :phkey="['content-2', 'content-mobile-2']"/>
<section>
<h2 class="mb-3">
<Icon v="home-heart"/>

View File

@ -14,7 +14,7 @@
</li>
</ul>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
</Page>
</template>

View File

@ -13,7 +13,7 @@
<Share :title="$t('nouns.headerLong')"/>
</section>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<NounsExtra>
<details v-if="config.nouns.collapsable" class="border mb-3" ref="dictionarywrapper">

View File

@ -7,8 +7,8 @@
<p class="small"><em>
<T>terms.lastUpdate</T><T>quotation.colon</T>
2023-07-27
(Newor Media)
2023-09-14
(Publift)
</em></p>
<div v-if="$te('terms.translationDisclaimer')" class="alert alert-warning">
@ -28,7 +28,7 @@
<p><T>privacy.content.plausible</T></p>
<p><T>privacy.content.hCaptcha</T></p>
<p v-if="config.ads && config.ads.enabled">
<T>privacy.content.newor</T>
<T>privacy.content.publift</T>
<T>privacy.content.gtm</T>
</p>
<p><T>privacy.content.logsBackups</T></p>
@ -36,12 +36,7 @@
<template v-if="config.ads && config.ads.enabled">
<hr/>
<p>
<a href="#" @click.prevent="revokeCookieConsent">
<Icon v="eraser"/>
<T>privacy.consent.revoke</T>
</a>
</p>
<div data-fuse-privacy-tool></div>
</template>
</Page>
</template>
@ -55,3 +50,9 @@ export default {
},
}
</script>
<style lang="scss">
#fuse-privacy-tool {
font-size: 0.5rem;
}
</style>

View File

@ -11,7 +11,7 @@
</div>
</section>
<AdPlaceholder phkey="small-homepage"/>
<AdPlaceholder :phkey="['header', null]"/>
<div class="position-relative">
<div v-if="profile.sensitive.length && !contentWarningDismissed" class="content-warning text-center">
@ -30,20 +30,18 @@
</div>
</div>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<CardsBanner/>
<template v-slot:aside-left>
<ProfileShare :user="user" class="d-none d-xxl-block" :mainPronoun="mainPronoun"/>
<AdPlaceholder phkey="aside-left-middle" class="d-none d-xxl-block"/>
<AdPlaceholder :phkey="['aside-left', null]" class="d-none d-xxl-block"/>
</template>
<template v-slot:aside-right>
<div class="row">
<div class="my-2 col-12 col-lg-4 col-xxl-12">
<AdPlaceholder phkey="aside-right-top"/>
<div v-if="$user() && $user().username === user.username" class="list-group list-group-flare">
<div class="list-group-item pt-3">
<h5>
@ -117,8 +115,9 @@
</div>
</div>
<AdPlaceholder :phkey="['aside-right', null]"/>
<div class="my-2 col-12 col-lg-4 col-xxl-12">
<AdPlaceholder phkey="aside-right-middle"/>
<div v-if="Object.keys(user.profiles).length > 1" class="list-group list-group-flare">
<div class="list-group-item pt-3">
<h5>
@ -137,7 +136,6 @@
<div class="my-2 col-12 col-lg-4 col-xxl-12">
<ProfileShare :user="user" class="d-xxl-none" :mainPronoun="mainPronoun"/>
<AdPlaceholder phkey="aside-right-bottom"/>
</div>
</div>
</template>

View File

@ -2,7 +2,7 @@
<Page>
<MustLogin v-if="!$user()"/>
<div v-else>
<AdPlaceholder phkey="small-homepage"/>
<AdPlaceholder :phkey="['header', null]"/>
<div class="mb-3 d-flex justify-content-between flex-column flex-md-row">
<h2 class="text-nowrap">
<Avatar :user="$user()"/>
@ -280,7 +280,7 @@
</button>
</section>
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
</form>
</div>
</Page>

View File

@ -67,11 +67,11 @@
</template>
</section>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<GrammarTables :selectedPronoun="selectedPronoun" :counter="counter"/>
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
<PronounGroup :pronounGroup="pronounGroup"/>
@ -85,7 +85,7 @@
<Literature :pronoun="selectedPronoun" :sources="groupedSources"/>
</section>
<AdPlaceholder phkey="main-2"/>
<AdPlaceholder :phkey="['content-2', 'content-mobile-2']"/>
<Separator icon="info"/>
<section class="mb-0">

View File

@ -16,7 +16,7 @@
<CardsBanner/>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<ul class="list-group mt-4">
<li v-for="[group, groupPronouns] in pronounLibrary.split()" class="list-group-item">
@ -220,7 +220,7 @@
</ul>
</section>
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
<Separator icon="fist-raised"/>

View File

@ -13,7 +13,7 @@
<Share :title="$t('sources.headerLonger')"/>
</section>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<SourcesChart :sources="sources" label="all pronouns"/>
@ -140,7 +140,7 @@
</template></Loading>
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
</Page>
</template>

View File

@ -88,7 +88,7 @@
</ul>
</section>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<section>
<h3>
@ -125,7 +125,7 @@
</template>
</section>
<AdPlaceholder phkey="main-1"/>
<AdPlaceholder :phkey="['content-1', 'content-mobile-1']"/>
</Page>
</template>

View File

@ -14,7 +14,7 @@
<ModerationRules type="rulesTerminology" emphasise/>
<AdPlaceholder phkey="main-0"/>
<AdPlaceholder :phkey="['content-0', 'content-mobile-0']"/>
<TermsDictionary load ref="termsdictionary"/>
</Page>

View File

@ -1,23 +1,15 @@
export default {
'support': null, // {slotId: 2557549454, adFormat: 'auto', responsive: true},
'header': {slotId: '22990353741', name: '71161633/PRNNSPG_pronounspage/header'},
'aside-left-top': null,
'aside-left-middle': null, // {slotId: '15311'}, // prev: {slotId: 8917042232, adFormat: 'autorelaxed'}, // prev: {slotId: 4999879969, adFormat: 'auto', responsive: true},
'aside-left-bottom': null,
'content-0': {slotId: '22990470028', name: '71161633/PRNNSPG_pronounspage/incontent_1'},
'content-1': {slotId: '22990353738', name: '71161633/PRNNSPG_pronounspage/incontent_2'},
'content-footer': {slotId: '22990470040', name: '71161633/PRNNSPG_pronounspage/blog_footer'},
'content-mobile-0': {slotId: '22990353744', name: '71161633/PRNNSPG_pronounspage/mrec_1'},
'content-mobile-1': {slotId: '22990470043', name: '71161633/PRNNSPG_pronounspage/mrec_2'},
'content-mobile-2': {slotId: '22990470046', name: '71161633/PRNNSPG_pronounspage/mrec_3'},
'aside-right-top': null,
'aside-right-middle': {slotId: '15312'}, // prev: {slotId: 2369847195, adFormat: 'auto', responsive: true},
'aside-right-bottom': null, // prev: {slotId: 6664353412, adFormat: 'auto', responsive: true},
'aside-left': {slotId: '22990470034', name: '71161633/PRNNSPG_pronounspage/vrec_lhs', sticky: true},
'aside-right': {slotId: '22990470031', name: '71161633/PRNNSPG_pronounspage/vrec_rhs', sticky: true},
'main-0': {slotId: '15597'}, // video: true // prev: {slotId: 3137058361, adFormat: 'auto', adLayout: 'in-article'}, // prev: {slotId: 8172838213, adFormat: 'auto', responsive: true},
'main-1': {slotId: '15306'}, //{slotId: 3299823474, adFormat: 'auto', responsive: true},
'main-2': {slotId: '15309'}, // {slotId: 3108251782, adFormat: 'auto', responsive: true},
'main-3': {slotId: '15310'}, // {slotId: 6716873048, adFormat: 'auto', responsive: true},
'main-4': null,
'main-5': null,
'main-6': null,
'footer': {slotId: '15307'}, // prev: {slotId: 6584462360, adFormat: 'autorelaxed'},
'small-homepage': {slotId: '15306'}, //{slotId: 6146027401, adFormat: 'auto', responsive: true},
'footer': {slotId: '22990470037', name: '71161633/PRNNSPG_pronounspage/footer'},
};