Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@politico/interactive-style

Package Overview
Dependencies
Maintainers
11
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@politico/interactive-style - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

src/components/Head/styles.scss

2

dist/components/Ad/index.js

@@ -6,3 +6,3 @@ import './index.css';

var styles = {"styles":"politico_style___18KvUvfWYa"};
var styles = {"fill-politico-red":"politico_style___30_exgCxIJ","styles":"politico_style___18KvUvfWYa"};

@@ -9,0 +9,0 @@ var Ad = function Ad(props) {

@@ -92,3 +92,3 @@ import './index.css';

var styles = {"styles":"politico_style___3VGtmWUyEI"};
var styles = {"fill-politico-red":"politico_style___1R_7bQtKvW","styles":"politico_style___3VGtmWUyEI"};

@@ -95,0 +95,0 @@ var Dek =

import './index.css';
import React from 'react';
import { Helmet } from 'react-helmet';
var Head = function Head(props) {
return React.createElement(Helmet, null, !props['no-html'] && React.createElement("html", {
lang: "en",
dir: "ltr"
}), props.title && React.createElement("title", null, props.title), props.title && props.social && [React.createElement("meta", {
key: "description",
name: "description",
content: props.social.twitter.card_description
}), React.createElement("meta", {
key: "twitter:card",
property: "twitter:card",
content: "summary_large_image"
}), React.createElement("meta", {
key: "og:type",
property: "og:type",
content: "article"
}), React.createElement("meta", {
key: "twitter:site",
property: "twitter:site",
content: "@politico"
}), React.createElement("meta", {
key: "twitter:creator",
property: "twitter:creator",
content: "@politico"
}), React.createElement("meta", {
key: "article:author",
property: "article:author",
content: "https://www.facebook.com/politico"
}), React.createElement("meta", {
key: "fb:app_id",
property: "fb:app_id",
content: "114037015331397"
}), React.createElement("meta", {
key: "twitter:title",
property: "twitter:title",
content: props.title
}), React.createElement("meta", {
key: "og:title",
property: "og:title",
content: props.title
}), React.createElement("meta", {
key: "twitter:description",
property: "twitter:description",
content: props.social.twitter.card_description
}), React.createElement("meta", {
key: "og:description",
property: "og:description",
content: props.social.fbook.card_description
}), React.createElement("meta", {
key: "twitter:image",
property: "twitter:image",
content: props.social.image.url
}), React.createElement("meta", {
key: "twitter:image:alt",
property: "twitter:image:alt",
content: props.title
}), React.createElement("meta", {
key: "og:image",
property: "og:image",
content: props.social.image.url
}), React.createElement("meta", {
key: "og:image:type",
property: "og:image:type",
content: props.social.image.type
}), React.createElement("meta", {
key: "og:image:width",
property: "og:image:width",
content: props.social.image.width
}), React.createElement("meta", {
key: "og:image:height",
property: "og:image:height",
content: props.social.image.height
})], props.publishPath && !props['no-meta'] && [React.createElement("meta", {
key: "charSet",
charSet: "utf-8"
}), React.createElement("meta", {
key: "httpEquiv='Content-Type'",
httpEquiv: "Content-Type",
content: "text/html; charset=UTF-8"
}), React.createElement("meta", {
key: "httpEquiv='X-UA-Compatible'",
httpEquiv: "X-UA-Compatible",
content: "IE=edge,chrome=1"
}), React.createElement("meta", {
key: "viewport",
name: "viewport",
content: "width=device-width, initial-scale=1"
}), React.createElement("meta", {
key: "og:url",
property: "og:url",
content: "https://politico.com/".concat(props.publishPath)
}), React.createElement("link", {
key: "canonical",
rel: "canonical",
href: "https://politico.com/".concat(props.publishPath)
})], !props['no-battletoads'] && React.createElement("link", {
rel: "stylesheet",
type: "text/css",
href: "https://www.politico.com/interactives/cdn/fonts/battletoads/icons/politico-battletoads-icons.min.css"
}), !props['no-fontawesome'] && React.createElement("link", {
rel: "stylesheet",
href: "https://use.fontawesome.com/releases/v5.3.1/css/all.css",
integrity: "sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU",
crossOrigin: "anonymous"
}), !props['no-typekit'] && [React.createElement("link", {
rel: "stylesheet",
href: "https://use.typekit.net/dsx2uhv.css"
}), React.createElement("script", null, "try{Typekit.load({ async: true });}catch(e){}")], !props['no-jQuery'] && React.createElement("script", {
src: "https://code.jquery.com/jquery-3.2.1.slim.min.js",
integrity: "sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g=",
crossOrigin: "anonymous"
}), !props['no-adBlockCookie'] && React.createElement("script", null, "\n document.cookie = \"__adblocker=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/\";\n var setNptTechAdblockerCookie = function(adblocker) {\n var d = new Date();\n d.setTime(d.getTime() + 60 * 60 * 24 * 2 * 1000);\n document.cookie = \"__adblocker=\" + (adblocker ? \"true\" : \"false\") + \"; expires=\" + d.toUTCString() + \"; path=/\";\n };\n var script = document.createElement(\"script\");\n script.setAttribute(\"async\", true);\n script.setAttribute(\"src\", \"//www.npttech.com/advertising.js\");\n script.setAttribute(\"onerror\", \"setNptTechAdblockerCookie(true);\");\n document.getElementsByTagName(\"head\")[0].appendChild(script);\n "), !props['no-utag'] && React.createElement("script", null, "// UTag Setup Script\n function get (obj, key, def) {\n if (obj.hasOwnProperty(key)) {\n return obj[key];\n } else {\n return def;\n }\n }\n\n function makeBylines (authors) {\n if (authors.length === 1) {\n return authors[0];\n } else if (authors.length === 0) {\n return null;\n }\n\n var output = authors.slice();\n var lastAuthor = output.pop();\n var secondToLastAuthor = output.pop();\n\n var commaAuthors = output.length > 0 ? output.join(', ') + ', ' : '';\n\n return commaAuthors + secondToLastAuthor + ' and ' + lastAuthor;\n }\n\n function setupUtag () {\n var conf = window.pibOptions;\n\n if (!window.pibOptions) {\n return;\n }\n\n const authors = get(conf, 'authors', []).map(function (a) {\n if (typeof a === 'string') {\n return a;\n } else if (typeof a === 'object' && 'name' in a) {\n return a.name;\n } else {\n return '';\n }\n });\n\n // Set up utag variables from project package.json\n window.utag_data = {\n 'page_level_1': 'interactives',\n 'free_paid_content': get(conf, 'freePaidContent', null),\n 'ad_unit_section': get(conf, 'adUnitSection', null),\n 'site_section': get(conf, 'siteSection', null),\n 'page_type': get(conf, 'pageType', null),\n 'site_domain': 'www.politico.com',\n 'internal_site_id': 'politico',\n 'page_name': get(conf, 'pageName', null),\n 'content_author': authors.join('|'),\n 'content_byline': 'By ' + makeBylines(authors),\n 'enable_prebid': true,\n };\n\n // load the utag script\n (function (a, b, c, d) {\n a = '//tags.tiqcdn.com/utag/politico/main/prod/utag.js';\n b = document; c = 'script'; d = b.createElement(c); d.src = a;\n d.type = 'text/java' + c;\n d.async = true;\n a = b.getElementsByTagName(c)[0]; a.parentNode.insertBefore(d, a);\n })();\n\n // responsive ad script\n !(function (a) { var b = function () { var a = document.createElement('p'); a.style.width = '100%', a.style.height = '200px'; var b = document.createElement('div'); b.style.position = 'absolute', b.style.top = '0px', b.style.left = '0px', b.style.visibility = 'hidden', b.style.width = '200px', b.style.height = '150px', b.style.overflow = 'hidden', b.appendChild(a), document.body.appendChild(b); var c = a.offsetWidth; b.style.overflow = 'scroll'; var d = a.offsetWidth; return c === d && (d = b.clientWidth), document.body.removeChild(b), c - d; }; var c = function () { typeof googletag !== 'undefined' && googletag.cmd.push(function () { googletag.pubads().refresh(); }); }; var d = function () { var a = 'alpha'; return i >= 748 && i < 990 ? a = 'beta' : i >= 990 && i < l ? a = 'gamma' : i >= l && i < 1028 ? a = 'delta' : i >= 1028 && (a = 'epsilon'), a != 'epsilon' && a != 'delta' && (jQuery('.global-utility-bar .reveal-toggle .reveal').removeClass('is-active'), jQuery('.utility-bar-bottom').removeClass('is-active'), jQuery('.dynamic-ad-wrapper .ad-slot').remove(), jQuery('.global-utility-bar .dynamic-ad-wrapper').html('')), a; }; var e = {currentAdThreshold: ''}; var f = function () { var a = d(); e.currentAdThreshold !== a && (e.currentAdThreshold = a, c()); }; var g = function () { e.currentAdThreshold = d(); }; a(window).on('resize', function () { i = document.documentElement.clientWidth + h, f(); }); var h = b(); var i = document.documentElement.clientWidth + h; var l = 1012; g(); }(jQuery)); //\n };\n\n function loadUtag(){\n var loadMax = 5000;\n var loadCount = 0;\n var loadInterval = 300;\n var utagLoader = window.setInterval(function(){\n if(window.jQuery){\n setupUtag();\n window.clearInterval(utagLoader);\n } else {\n loadCount = loadCount + 1;\n }\n\n if(loadCount * loadInterval > loadMax){\n window.clearInterval(utagLoader);\n }\n }, loadInterval)\n }\n\n // Cross-Browser Ready Script\n if (document.attachEvent ? document.readyState === 'complete' : document.readyState !== 'loading') {\n loadUtag();\n } else {\n document.addEventListener('DOMContentLoaded', loadUtag);\n }\n "), props.children);
};
Head.defaultProps = {
title: null,
publishPath: null,
social: null,
'no-html': false,
'no-title': false,
'no-meta': false,
'no-social': false,
'no-battletoads': false,
'no-fontawesome': false,
'no-typekit': false,
'no-jquery': false,
'no-adBlockCookie': false,
'no-utag': false
};
export default Head;
// import React from 'react';
// import { Helmet } from 'react-helmet';
// import styles from './styles.scss';
//
// const Head = props => {
// return (
// <Helmet>
//
// {!props['no-html'] &&
// <html lang='en' dir='ltr' />
// }
//
// {props.title &&
// <title>{props.title}</title>
// }
//
// {props.title && props.social && [
// <meta key='description' name='description' content={props.social.twitter.card_description} />,
// <meta key='twitter:card' property='twitter:card' content='summary_large_image' />,
// <meta key='og:type' property='og:type' content='article' />,
// <meta key='twitter:site' property='twitter:site' content='@politico' />,
// <meta key='twitter:creator' property='twitter:creator' content='@politico' />,
// <meta key='article:author' property='article:author' content='https://www.facebook.com/politico' />,
// <meta key='fb:app_id' property='fb:app_id' content='114037015331397' />,
// <meta key='twitter:title' property='twitter:title' content={props.title} />,
// <meta key='og:title' property='og:title' content={props.title} />,
// <meta key='twitter:description' property='twitter:description' content={props.social.twitter.card_description} />,
// <meta key='og:description' property='og:description' content={props.social.fbook.card_description} />,
// <meta key='twitter:image' property='twitter:image' content={props.social.image.url} />,
// <meta key='twitter:image:alt' property='twitter:image:alt' content={props.title} />,
// <meta key='og:image' property='og:image' content={props.social.image.url} />,
// <meta key='og:image:type' property='og:image:type' content={props.social.image.type} />,
// <meta key='og:image:width' property='og:image:width' content={props.social.image.width} />,
// <meta key='og:image:height' property='og:image:height' content={props.social.image.height} />,
// ]}
//
// {props.publishPath && !props['no-meta'] && [
// <meta key='charSet' charSet='utf-8' />,
// <meta key="httpEquiv='Content-Type'" httpEquiv='Content-Type' content='text/html; charset=UTF-8' />,
// <meta key="httpEquiv='X-UA-Compatible'" httpEquiv='X-UA-Compatible' content='IE=edge,chrome=1' />,
// <meta key='viewport' name='viewport' content='width=device-width, initial-scale=1' />,
// <meta key='og:url' property='og:url' content={`https://politico.com/${props.publishPath}`} />,
// <link key='canonical' rel='canonical' href={`https://politico.com/${props.publishPath}`} />,
// ]}
//
// {!props['no-battletoads'] &&
// <link rel='stylesheet' type='text/css' href='https://www.politico.com/interactives/cdn/fonts/battletoads/icons/politico-battletoads-icons.min.css' />
// }
//
// {!props['no-fontawesome'] &&
// <link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.3.1/css/all.css' integrity='sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU' crossOrigin='anonymous' />
// }
//
// {!props['no-typekit'] && [
// <link rel='stylesheet' href='https://use.typekit.net/dsx2uhv.css' />,
// <script>{`try{Typekit.load({ async: true });}catch(e){}`}</script>,
// ]}
//
// {!props['no-jQuery'] &&
// <script
// src='https://code.jquery.com/jquery-3.2.1.slim.min.js'
// integrity='sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g='
// crossOrigin='anonymous' />
// }
//
// {!props['no-adBlockCookie'] &&
// <script>
// {`
// document.cookie = "__adblocker=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
// var setNptTechAdblockerCookie = function(adblocker) {
// var d = new Date();
// d.setTime(d.getTime() + 60 * 60 * 24 * 2 * 1000);
// document.cookie = "__adblocker=" + (adblocker ? "true" : "false") + "; expires=" + d.toUTCString() + "; path=/";
// };
// var script = document.createElement("script");
// script.setAttribute("async", true);
// script.setAttribute("src", "//www.npttech.com/advertising.js");
// script.setAttribute("onerror", "setNptTechAdblockerCookie(true);");
// document.getElementsByTagName("head")[0].appendChild(script);
// `}
// </script>
// }
//
// {!props['no-utag'] &&
// <script>
// {`// UTag Setup Script
// function get (obj, key, def) {
// if (obj.hasOwnProperty(key)) {
// return obj[key];
// } else {
// return def;
// }
// }
//
// function makeBylines (authors) {
// if (authors.length === 1) {
// return authors[0];
// } else if (authors.length === 0) {
// return null;
// }
//
// var output = authors.slice();
// var lastAuthor = output.pop();
// var secondToLastAuthor = output.pop();
//
// var commaAuthors = output.length > 0 ? output.join(', ') + ', ' : '';
//
// return commaAuthors + secondToLastAuthor + ' and ' + lastAuthor;
// }
//
// function setupUtag () {
// var conf = window.pibOptions;
//
// if (!window.pibOptions) {
// return;
// }
//
// const authors = get(conf, 'authors', []).map(function (a) {
// if (typeof a === 'string') {
// return a;
// } else if (typeof a === 'object' && 'name' in a) {
// return a.name;
// } else {
// return '';
// }
// });
//
// // Set up utag variables from project package.json
// window.utag_data = {
// 'page_level_1': 'interactives',
// 'free_paid_content': get(conf, 'freePaidContent', null),
// 'ad_unit_section': get(conf, 'adUnitSection', null),
// 'site_section': get(conf, 'siteSection', null),
// 'page_type': get(conf, 'pageType', null),
// 'site_domain': 'www.politico.com',
// 'internal_site_id': 'politico',
// 'page_name': get(conf, 'pageName', null),
// 'content_author': authors.join('|'),
// 'content_byline': 'By ' + makeBylines(authors),
// 'enable_prebid': true,
// };
//
// // load the utag script
// (function (a, b, c, d) {
// a = '//tags.tiqcdn.com/utag/politico/main/prod/utag.js';
// b = document; c = 'script'; d = b.createElement(c); d.src = a;
// d.type = 'text/java' + c;
// d.async = true;
// a = b.getElementsByTagName(c)[0]; a.parentNode.insertBefore(d, a);
// })();
//
// // responsive ad script
// !(function (a) { var b = function () { var a = document.createElement('p'); a.style.width = '100%', a.style.height = '200px'; var b = document.createElement('div'); b.style.position = 'absolute', b.style.top = '0px', b.style.left = '0px', b.style.visibility = 'hidden', b.style.width = '200px', b.style.height = '150px', b.style.overflow = 'hidden', b.appendChild(a), document.body.appendChild(b); var c = a.offsetWidth; b.style.overflow = 'scroll'; var d = a.offsetWidth; return c === d && (d = b.clientWidth), document.body.removeChild(b), c - d; }; var c = function () { typeof googletag !== 'undefined' && googletag.cmd.push(function () { googletag.pubads().refresh(); }); }; var d = function () { var a = 'alpha'; return i >= 748 && i < 990 ? a = 'beta' : i >= 990 && i < l ? a = 'gamma' : i >= l && i < 1028 ? a = 'delta' : i >= 1028 && (a = 'epsilon'), a != 'epsilon' && a != 'delta' && (jQuery('.global-utility-bar .reveal-toggle .reveal').removeClass('is-active'), jQuery('.utility-bar-bottom').removeClass('is-active'), jQuery('.dynamic-ad-wrapper .ad-slot').remove(), jQuery('.global-utility-bar .dynamic-ad-wrapper').html('')), a; }; var e = {currentAdThreshold: ''}; var f = function () { var a = d(); e.currentAdThreshold !== a && (e.currentAdThreshold = a, c()); }; var g = function () { e.currentAdThreshold = d(); }; a(window).on('resize', function () { i = document.documentElement.clientWidth + h, f(); }); var h = b(); var i = document.documentElement.clientWidth + h; var l = 1012; g(); }(jQuery)); //
// };
//
// function loadUtag(){
// var loadMax = 5000;
// var loadCount = 0;
// var loadInterval = 300;
// var utagLoader = window.setInterval(function(){
// if(window.jQuery){
// setupUtag();
// window.clearInterval(utagLoader);
// } else {
// loadCount = loadCount + 1;
// }
//
// if(loadCount * loadInterval > loadMax){
// window.clearInterval(utagLoader);
// }
// }, loadInterval)
// }
//
// // Cross-Browser Ready Script
// if (document.attachEvent ? document.readyState === 'complete' : document.readyState !== 'loading') {
// loadUtag();
// } else {
// document.addEventListener('DOMContentLoaded', loadUtag);
// }
// `}
// </script>
// }
//
// { props.children }
// </Helmet>
// );
// };
//
// Head.defaultProps = {
// title: null,
// publishPath: null,
// social: null,
//
// 'no-html': false,
// 'no-title': false,
// 'no-meta': false,
// 'no-social': false,
// 'no-battletoads': false,
// 'no-fontawesome': false,
// 'no-typekit': false,
// 'no-jquery': false,
// 'no-adBlockCookie': false,
// 'no-utag': false,
// };
//
// export default Head;

@@ -75,3 +75,3 @@ import './index.css';

var styles = {"styles":"politico_style___3ZROY9z821"};
var styles = {"fill-politico-red":"politico_style___2V-fyBu7uk","styles":"politico_style___3ZROY9z821"};

@@ -78,0 +78,0 @@ var makeBylines = function makeBylines(authors) {

@@ -74,3 +74,3 @@ import './index.css';

var styles = {"styles":"politico_style___1ByAqFNLip"};
var styles = {"fill-politico-red":"politico_style___3J_0Tvd2Gj","styles":"politico_style___1ByAqFNLip"};

@@ -77,0 +77,0 @@ var Navigation =

@@ -74,3 +74,3 @@ import './index.css';

var styles = {"styles":"politico_style___2oJ7uJATzT"};
var styles = {"fill-politico-red":"politico_style___3LaIKB4JZl","styles":"politico_style___2oJ7uJATzT"};

@@ -77,0 +77,0 @@ var Section =

@@ -90,3 +90,3 @@ import './index.css';

var styles = {"styles":"politico_style___ErGfgMUnoP"};
var styles = {"fill-politico-red":"politico_style___livFDDVW6K","styles":"politico_style___ErGfgMUnoP"};

@@ -93,0 +93,0 @@ var Share =

{
"name": "@politico/interactive-style",
"version": "0.0.1",
"version": "0.0.2",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "module": "dist/index.js",

@@ -1,205 +0,206 @@

import React from 'react';
import { Helmet } from 'react-helmet';
const Head = props => {
return (
<Helmet>
{!props['no-html'] &&
<html lang='en' dir='ltr' />
}
{props.title &&
<title>{props.title}</title>
}
{props.title && props.social && [
<meta key='description' name='description' content={props.social.twitter.card_description} />,
<meta key='twitter:card' property='twitter:card' content='summary_large_image' />,
<meta key='og:type' property='og:type' content='article' />,
<meta key='twitter:site' property='twitter:site' content='@politico' />,
<meta key='twitter:creator' property='twitter:creator' content='@politico' />,
<meta key='article:author' property='article:author' content='https://www.facebook.com/politico' />,
<meta key='fb:app_id' property='fb:app_id' content='114037015331397' />,
<meta key='twitter:title' property='twitter:title' content={props.title} />,
<meta key='og:title' property='og:title' content={props.title} />,
<meta key='twitter:description' property='twitter:description' content={props.social.twitter.card_description} />,
<meta key='og:description' property='og:description' content={props.social.fbook.card_description} />,
<meta key='twitter:image' property='twitter:image' content={props.social.image.url} />,
<meta key='twitter:image:alt' property='twitter:image:alt' content={props.title} />,
<meta key='og:image' property='og:image' content={props.social.image.url} />,
<meta key='og:image:type' property='og:image:type' content={props.social.image.type} />,
<meta key='og:image:width' property='og:image:width' content={props.social.image.width} />,
<meta key='og:image:height' property='og:image:height' content={props.social.image.height} />,
]}
{props.publishPath && !props['no-meta'] && [
<meta key='charSet' charSet='utf-8' />,
<meta key="httpEquiv='Content-Type'" httpEquiv='Content-Type' content='text/html; charset=UTF-8' />,
<meta key="httpEquiv='X-UA-Compatible'" httpEquiv='X-UA-Compatible' content='IE=edge,chrome=1' />,
<meta key='viewport' name='viewport' content='width=device-width, initial-scale=1' />,
<meta key='og:url' property='og:url' content={`https://politico.com/${props.publishPath}`} />,
<link key='canonical' rel='canonical' href={`https://politico.com/${props.publishPath}`} />,
]}
{!props['no-battletoads'] &&
<link rel='stylesheet' type='text/css' href='https://www.politico.com/interactives/cdn/fonts/battletoads/icons/politico-battletoads-icons.min.css' />
}
{!props['no-fontawesome'] &&
<link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.3.1/css/all.css' integrity='sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU' crossOrigin='anonymous' />
}
{!props['no-typekit'] && [
<link rel='stylesheet' href='https://use.typekit.net/dsx2uhv.css' />,
<script>{`try{Typekit.load({ async: true });}catch(e){}`}</script>,
]}
{!props['no-jQuery'] &&
<script
src='https://code.jquery.com/jquery-3.2.1.slim.min.js'
integrity='sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g='
crossOrigin='anonymous' />
}
{!props['no-adBlockCookie'] &&
<script>
{`
document.cookie = "__adblocker=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
var setNptTechAdblockerCookie = function(adblocker) {
var d = new Date();
d.setTime(d.getTime() + 60 * 60 * 24 * 2 * 1000);
document.cookie = "__adblocker=" + (adblocker ? "true" : "false") + "; expires=" + d.toUTCString() + "; path=/";
};
var script = document.createElement("script");
script.setAttribute("async", true);
script.setAttribute("src", "//www.npttech.com/advertising.js");
script.setAttribute("onerror", "setNptTechAdblockerCookie(true);");
document.getElementsByTagName("head")[0].appendChild(script);
`}
</script>
}
{!props['no-utag'] &&
<script>
{`// UTag Setup Script
function get (obj, key, def) {
if (obj.hasOwnProperty(key)) {
return obj[key];
} else {
return def;
}
}
function makeBylines (authors) {
if (authors.length === 1) {
return authors[0];
} else if (authors.length === 0) {
return null;
}
var output = authors.slice();
var lastAuthor = output.pop();
var secondToLastAuthor = output.pop();
var commaAuthors = output.length > 0 ? output.join(', ') + ', ' : '';
return commaAuthors + secondToLastAuthor + ' and ' + lastAuthor;
}
function setupUtag () {
var conf = window.pibOptions;
if (!window.pibOptions) {
return;
}
const authors = get(conf, 'authors', []).map(function (a) {
if (typeof a === 'string') {
return a;
} else if (typeof a === 'object' && 'name' in a) {
return a.name;
} else {
return '';
}
});
// Set up utag variables from project package.json
window.utag_data = {
'page_level_1': 'interactives',
'free_paid_content': get(conf, 'freePaidContent', null),
'ad_unit_section': get(conf, 'adUnitSection', null),
'site_section': get(conf, 'siteSection', null),
'page_type': get(conf, 'pageType', null),
'site_domain': 'www.politico.com',
'internal_site_id': 'politico',
'page_name': get(conf, 'pageName', null),
'content_author': authors.join('|'),
'content_byline': 'By ' + makeBylines(authors),
'enable_prebid': true,
};
// load the utag script
(function (a, b, c, d) {
a = '//tags.tiqcdn.com/utag/politico/main/prod/utag.js';
b = document; c = 'script'; d = b.createElement(c); d.src = a;
d.type = 'text/java' + c;
d.async = true;
a = b.getElementsByTagName(c)[0]; a.parentNode.insertBefore(d, a);
})();
// responsive ad script
!(function (a) { var b = function () { var a = document.createElement('p'); a.style.width = '100%', a.style.height = '200px'; var b = document.createElement('div'); b.style.position = 'absolute', b.style.top = '0px', b.style.left = '0px', b.style.visibility = 'hidden', b.style.width = '200px', b.style.height = '150px', b.style.overflow = 'hidden', b.appendChild(a), document.body.appendChild(b); var c = a.offsetWidth; b.style.overflow = 'scroll'; var d = a.offsetWidth; return c === d && (d = b.clientWidth), document.body.removeChild(b), c - d; }; var c = function () { typeof googletag !== 'undefined' && googletag.cmd.push(function () { googletag.pubads().refresh(); }); }; var d = function () { var a = 'alpha'; return i >= 748 && i < 990 ? a = 'beta' : i >= 990 && i < l ? a = 'gamma' : i >= l && i < 1028 ? a = 'delta' : i >= 1028 && (a = 'epsilon'), a != 'epsilon' && a != 'delta' && (jQuery('.global-utility-bar .reveal-toggle .reveal').removeClass('is-active'), jQuery('.utility-bar-bottom').removeClass('is-active'), jQuery('.dynamic-ad-wrapper .ad-slot').remove(), jQuery('.global-utility-bar .dynamic-ad-wrapper').html('')), a; }; var e = {currentAdThreshold: ''}; var f = function () { var a = d(); e.currentAdThreshold !== a && (e.currentAdThreshold = a, c()); }; var g = function () { e.currentAdThreshold = d(); }; a(window).on('resize', function () { i = document.documentElement.clientWidth + h, f(); }); var h = b(); var i = document.documentElement.clientWidth + h; var l = 1012; g(); }(jQuery)); //
};
function loadUtag(){
var loadMax = 5000;
var loadCount = 0;
var loadInterval = 300;
var utagLoader = window.setInterval(function(){
if(window.jQuery){
setupUtag();
window.clearInterval(utagLoader);
} else {
loadCount = loadCount + 1;
}
if(loadCount * loadInterval > loadMax){
window.clearInterval(utagLoader);
}
}, loadInterval)
}
// Cross-Browser Ready Script
if (document.attachEvent ? document.readyState === 'complete' : document.readyState !== 'loading') {
loadUtag();
} else {
document.addEventListener('DOMContentLoaded', loadUtag);
}
`}
</script>
}
{ props.children }
</Helmet>
);
};
Head.defaultProps = {
title: null,
publishPath: null,
social: null,
'no-html': false,
'no-title': false,
'no-meta': false,
'no-social': false,
'no-battletoads': false,
'no-fontawesome': false,
'no-typekit': false,
'no-jquery': false,
'no-adBlockCookie': false,
'no-utag': false,
};
export default Head;
// import React from 'react';
// import { Helmet } from 'react-helmet';
// import styles from './styles.scss';
//
// const Head = props => {
// return (
// <Helmet>
//
// {!props['no-html'] &&
// <html lang='en' dir='ltr' />
// }
//
// {props.title &&
// <title>{props.title}</title>
// }
//
// {props.title && props.social && [
// <meta key='description' name='description' content={props.social.twitter.card_description} />,
// <meta key='twitter:card' property='twitter:card' content='summary_large_image' />,
// <meta key='og:type' property='og:type' content='article' />,
// <meta key='twitter:site' property='twitter:site' content='@politico' />,
// <meta key='twitter:creator' property='twitter:creator' content='@politico' />,
// <meta key='article:author' property='article:author' content='https://www.facebook.com/politico' />,
// <meta key='fb:app_id' property='fb:app_id' content='114037015331397' />,
// <meta key='twitter:title' property='twitter:title' content={props.title} />,
// <meta key='og:title' property='og:title' content={props.title} />,
// <meta key='twitter:description' property='twitter:description' content={props.social.twitter.card_description} />,
// <meta key='og:description' property='og:description' content={props.social.fbook.card_description} />,
// <meta key='twitter:image' property='twitter:image' content={props.social.image.url} />,
// <meta key='twitter:image:alt' property='twitter:image:alt' content={props.title} />,
// <meta key='og:image' property='og:image' content={props.social.image.url} />,
// <meta key='og:image:type' property='og:image:type' content={props.social.image.type} />,
// <meta key='og:image:width' property='og:image:width' content={props.social.image.width} />,
// <meta key='og:image:height' property='og:image:height' content={props.social.image.height} />,
// ]}
//
// {props.publishPath && !props['no-meta'] && [
// <meta key='charSet' charSet='utf-8' />,
// <meta key="httpEquiv='Content-Type'" httpEquiv='Content-Type' content='text/html; charset=UTF-8' />,
// <meta key="httpEquiv='X-UA-Compatible'" httpEquiv='X-UA-Compatible' content='IE=edge,chrome=1' />,
// <meta key='viewport' name='viewport' content='width=device-width, initial-scale=1' />,
// <meta key='og:url' property='og:url' content={`https://politico.com/${props.publishPath}`} />,
// <link key='canonical' rel='canonical' href={`https://politico.com/${props.publishPath}`} />,
// ]}
//
// {!props['no-battletoads'] &&
// <link rel='stylesheet' type='text/css' href='https://www.politico.com/interactives/cdn/fonts/battletoads/icons/politico-battletoads-icons.min.css' />
// }
//
// {!props['no-fontawesome'] &&
// <link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.3.1/css/all.css' integrity='sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU' crossOrigin='anonymous' />
// }
//
// {!props['no-typekit'] && [
// <link rel='stylesheet' href='https://use.typekit.net/dsx2uhv.css' />,
// <script>{`try{Typekit.load({ async: true });}catch(e){}`}</script>,
// ]}
//
// {!props['no-jQuery'] &&
// <script
// src='https://code.jquery.com/jquery-3.2.1.slim.min.js'
// integrity='sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g='
// crossOrigin='anonymous' />
// }
//
// {!props['no-adBlockCookie'] &&
// <script>
// {`
// document.cookie = "__adblocker=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
// var setNptTechAdblockerCookie = function(adblocker) {
// var d = new Date();
// d.setTime(d.getTime() + 60 * 60 * 24 * 2 * 1000);
// document.cookie = "__adblocker=" + (adblocker ? "true" : "false") + "; expires=" + d.toUTCString() + "; path=/";
// };
// var script = document.createElement("script");
// script.setAttribute("async", true);
// script.setAttribute("src", "//www.npttech.com/advertising.js");
// script.setAttribute("onerror", "setNptTechAdblockerCookie(true);");
// document.getElementsByTagName("head")[0].appendChild(script);
// `}
// </script>
// }
//
// {!props['no-utag'] &&
// <script>
// {`// UTag Setup Script
// function get (obj, key, def) {
// if (obj.hasOwnProperty(key)) {
// return obj[key];
// } else {
// return def;
// }
// }
//
// function makeBylines (authors) {
// if (authors.length === 1) {
// return authors[0];
// } else if (authors.length === 0) {
// return null;
// }
//
// var output = authors.slice();
// var lastAuthor = output.pop();
// var secondToLastAuthor = output.pop();
//
// var commaAuthors = output.length > 0 ? output.join(', ') + ', ' : '';
//
// return commaAuthors + secondToLastAuthor + ' and ' + lastAuthor;
// }
//
// function setupUtag () {
// var conf = window.pibOptions;
//
// if (!window.pibOptions) {
// return;
// }
//
// const authors = get(conf, 'authors', []).map(function (a) {
// if (typeof a === 'string') {
// return a;
// } else if (typeof a === 'object' && 'name' in a) {
// return a.name;
// } else {
// return '';
// }
// });
//
// // Set up utag variables from project package.json
// window.utag_data = {
// 'page_level_1': 'interactives',
// 'free_paid_content': get(conf, 'freePaidContent', null),
// 'ad_unit_section': get(conf, 'adUnitSection', null),
// 'site_section': get(conf, 'siteSection', null),
// 'page_type': get(conf, 'pageType', null),
// 'site_domain': 'www.politico.com',
// 'internal_site_id': 'politico',
// 'page_name': get(conf, 'pageName', null),
// 'content_author': authors.join('|'),
// 'content_byline': 'By ' + makeBylines(authors),
// 'enable_prebid': true,
// };
//
// // load the utag script
// (function (a, b, c, d) {
// a = '//tags.tiqcdn.com/utag/politico/main/prod/utag.js';
// b = document; c = 'script'; d = b.createElement(c); d.src = a;
// d.type = 'text/java' + c;
// d.async = true;
// a = b.getElementsByTagName(c)[0]; a.parentNode.insertBefore(d, a);
// })();
//
// // responsive ad script
// !(function (a) { var b = function () { var a = document.createElement('p'); a.style.width = '100%', a.style.height = '200px'; var b = document.createElement('div'); b.style.position = 'absolute', b.style.top = '0px', b.style.left = '0px', b.style.visibility = 'hidden', b.style.width = '200px', b.style.height = '150px', b.style.overflow = 'hidden', b.appendChild(a), document.body.appendChild(b); var c = a.offsetWidth; b.style.overflow = 'scroll'; var d = a.offsetWidth; return c === d && (d = b.clientWidth), document.body.removeChild(b), c - d; }; var c = function () { typeof googletag !== 'undefined' && googletag.cmd.push(function () { googletag.pubads().refresh(); }); }; var d = function () { var a = 'alpha'; return i >= 748 && i < 990 ? a = 'beta' : i >= 990 && i < l ? a = 'gamma' : i >= l && i < 1028 ? a = 'delta' : i >= 1028 && (a = 'epsilon'), a != 'epsilon' && a != 'delta' && (jQuery('.global-utility-bar .reveal-toggle .reveal').removeClass('is-active'), jQuery('.utility-bar-bottom').removeClass('is-active'), jQuery('.dynamic-ad-wrapper .ad-slot').remove(), jQuery('.global-utility-bar .dynamic-ad-wrapper').html('')), a; }; var e = {currentAdThreshold: ''}; var f = function () { var a = d(); e.currentAdThreshold !== a && (e.currentAdThreshold = a, c()); }; var g = function () { e.currentAdThreshold = d(); }; a(window).on('resize', function () { i = document.documentElement.clientWidth + h, f(); }); var h = b(); var i = document.documentElement.clientWidth + h; var l = 1012; g(); }(jQuery)); //
// };
//
// function loadUtag(){
// var loadMax = 5000;
// var loadCount = 0;
// var loadInterval = 300;
// var utagLoader = window.setInterval(function(){
// if(window.jQuery){
// setupUtag();
// window.clearInterval(utagLoader);
// } else {
// loadCount = loadCount + 1;
// }
//
// if(loadCount * loadInterval > loadMax){
// window.clearInterval(utagLoader);
// }
// }, loadInterval)
// }
//
// // Cross-Browser Ready Script
// if (document.attachEvent ? document.readyState === 'complete' : document.readyState !== 'loading') {
// loadUtag();
// } else {
// document.addEventListener('DOMContentLoaded', loadUtag);
// }
// `}
// </script>
// }
//
// { props.children }
// </Helmet>
// );
// };
//
// Head.defaultProps = {
// title: null,
// publishPath: null,
// social: null,
//
// 'no-html': false,
// 'no-title': false,
// 'no-meta': false,
// 'no-social': false,
// 'no-battletoads': false,
// 'no-fontawesome': false,
// 'no-typekit': false,
// 'no-jquery': false,
// 'no-adBlockCookie': false,
// 'no-utag': false,
// };
//
// export default Head;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc