Skip to content

Commit

Permalink
Merge pull request #26 from EkstraBladetUdvikling/bannerPreview
Browse files Browse the repository at this point in the history
banner preview in xandr
  • Loading branch information
tegner authored Sep 2, 2020
2 parents 2c13edd + f68ea7f commit 540568a
Show file tree
Hide file tree
Showing 8 changed files with 1,052 additions and 948 deletions.
45 changes: 0 additions & 45 deletions WallpaperTAG

This file was deleted.

55 changes: 0 additions & 55 deletions WallpaperUPLOAD

This file was deleted.

2 changes: 1 addition & 1 deletion epaper/output/epaper-template.min.js

Large diffs are not rendered by default.

97 changes: 49 additions & 48 deletions interscroller/interscroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ function handleReceiver(bodyId, parEl) {
'position:absolute;top:0;left:0;width:100%;height:100vh;clip:rect(auto, auto, auto, auto);z-index:1;cursor:pointer;'
);

receiver.addEventListener('click', function() {
receiver.addEventListener('click', function () {
clickUrl.length ? window.top.open(clickUrl, '_blank') : null;
});



var iframe = receiver.getElementsByTagName('iframe');
iframe
? iframe[0].setAttribute(
Expand All @@ -35,55 +33,58 @@ function handleReceiver(bodyId, parEl) {
: null;
}
}
try {
// create styles and divs
var par = window.parent;
var topper = window.top;
var maxtests = 4;
var index = 0;
var bodyId = document.body.id;

// create styles and divs
var par = window.parent;
var topper = window.top;
var maxtests = 4;
var index = 0;
var bodyId = document.body.id;

if (bodyId !== '' || par === topper) {
handleReceiver(bodyId, topper);
} else {
while (bodyId === '' && index < maxtests) {
bodyId = par.document.body.id;
if (bodyId !== '' || par === topper) {
handleReceiver(bodyId, topper);
} else {
while (bodyId === '' && index < maxtests) {
bodyId = par.document.body.id;

handleReceiver(bodyId, par);
var mediatedIframe = par.document.querySelector('iframe');
if (mediatedIframe) {
mediatedIframe.setAttribute('style', fixedElStyle);
handleReceiver(bodyId, par);
var mediatedIframe = par.document.querySelector('iframe');
if (mediatedIframe) {
mediatedIframe.setAttribute('style', fixedElStyle);
}
par = par.parent;
index++;
}
par = par.parent;
index++;
}
}

var imageDiv = document.createElement('div');
imageDiv.setAttribute(
'style',
'position:fixed;width:100%;height:100vh;top:0;left:0;vertical-align:initial;background-image:url("' +
mediaUrl +
'");background-size:cover;background-repeat:no-repeat;background-position:center center;transform:translateZ(0px);'
);
document.body.appendChild(imageDiv);
var imageDiv = document.createElement('div');
imageDiv.setAttribute(
'style',
'position:fixed;width:100%;height:100vh;top:0;left:0;vertical-align:initial;background-image:url("' +
mediaUrl +
'");background-size:cover;background-repeat:no-repeat;background-position:center center;transform:translateZ(0px);'
);
document.body.appendChild(imageDiv);

// append tracking pixels
if (pixelUrl1.length) {
var pixel1 = document.createElement('img');
pixel1.src = pixelUrl1;
pixel1.style.display = 'none';
document.body.appendChild(pixel1);
}
if (pixelUrl2.length) {
var pixel2 = document.createElement('img');
pixel2.src = pixelUrl2;
pixel2.style.display = 'none';
document.body.appendChild(pixel2);
}
if (pixelUrl3.length) {
var pixel3 = document.createElement('img');
pixel3.src = pixelUrl3;
pixel3.style.display = 'none';
document.body.appendChild(pixel3);
// append tracking pixels
if (pixelUrl1.length) {
var pixel1 = document.createElement('img');
pixel1.src = pixelUrl1;
pixel1.style.display = 'none';
document.body.appendChild(pixel1);
}
if (pixelUrl2.length) {
var pixel2 = document.createElement('img');
pixel2.src = pixelUrl2;
pixel2.style.display = 'none';
document.body.appendChild(pixel2);
}
if (pixelUrl3.length) {
var pixel3 = document.createElement('img');
pixel3.src = pixelUrl3;
pixel3.style.display = 'none';
document.body.appendChild(pixel3);
}
} catch (error) {
document.write('<img src="' + mediaUrl + '" style="width: 100%;" />');
}
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jppol-apn-templates",
"version": "1.0.2",
"version": "1.0.3",
"main": "index.js",
"repository": "https://github.com/EkstraBladetUdvikling/jppol-apn-templates.git",
"author": "Tegner <[email protected]>",
Expand All @@ -11,11 +11,11 @@
"takeover"
],
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/plugin-external-helpers": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"rollup": "^1.31.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-typescript2": "^0.25.3"
"@babel/core": "^7.11.5",
"@babel/plugin-external-helpers": "^7.10.4",
"@babel/preset-env": "^7.11.5",
"rollup": "^2.26.9",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-typescript2": "^0.27.2"
}
}
Loading

0 comments on commit 540568a

Please sign in to comment.