Created
January 17, 2017 05:20
-
-
Save N0taN3rd/539bc7534c7786afbd35502620c30fec to your computer and use it in GitHub Desktop.
Lets Make The CNN Archive Great Again: Unmangled Mins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
const <name> = min file unmangled | |
properties | |
'Global CNN varible w/ property chain': [ | |
{ | |
prop: 'lhs' // CNN w/ property chain assignee | |
to: 'rhs' // Assigned to | |
} | |
] | |
*/ | |
const cnn_analytics_min_js = { | |
'CNN.Analytics': [{ | |
prop: 'CNN.Analytics', | |
to: CNN.Analytics || {} | |
}], | |
'CNN.Gallery': [{ | |
prop: 'CNN.Gallery', | |
to: CNN.Gallery || {} | |
}], | |
'CNN.Analytics.utils': [{ | |
prop: 'CNN.Analytics.utils', | |
to: function() { | |
"use strict"; | |
function e() { | |
var e = CNN.CurrentWidth.getClientWidth(), | |
t = 640, | |
n = 960, | |
a = 1120, | |
i = "no-value-set"; | |
return i = e >= a ? "14col" : a > e && e >= n ? "12col" : n > | |
e && e >= t ? "8col" : "4col"; | |
} | |
function t(e) { | |
var t = {}; | |
return t.section = "section front", t.special = "specials", t | |
.videos = "video", "string" == typeof e && e in t && (e = t[ | |
e]), "undefined" == typeof CNN.contentModel || | |
"undefined" == typeof CNN.contentModel.sectionName || | |
"homepage" !== CNN.contentModel.sectionName && | |
"intl_homepage" !== CNN.contentModel.sectionName || (e = | |
"index"), e; | |
} | |
function n(e, t, n) { | |
var a = e.split(";"), | |
i = 0; | |
for (t = "string" == typeof t && t.length > 0 ? ";expires=" + | |
t : "", n = "string" == typeof n && n.length > 0 ? ";path=" + | |
n : ";path=/"; i < a.length; i++) document.cookie = a[i] + | |
n + t + ";"; | |
} | |
function a(e, t) { | |
"string" == typeof t && t.length > 0 && n(t), e.currentTarget | |
.attributes.hasOwnProperty("data-vr-track") && window._vrtrack({ | |
track_url: e.currentTarget.href, | |
event_type: "partner" | |
}); | |
} | |
function i() { | |
var n, a, i, r, l, c = CNN.contentModel.pageType, | |
s = "no-value-set", | |
d = s, | |
u = e(), | |
p = jQuery(CNN.Carousel.carouselSelector) | |
.first(), | |
g = jQuery("div[data-analytics-pivit]") | |
.length > 0, | |
h = s, | |
y = s, | |
_ = s, | |
f = jQuery(".js-media__video") | |
.length, | |
m = CNN.contentModel.env || s, | |
N = CNN.contentModel.analytics && CNN.contentModel.analytics | |
.showName || "", | |
b = CNN.contentModel.title || s, | |
v = [], | |
C = s, | |
w = s, | |
k = s, | |
j = s, | |
M = s, | |
T = s, | |
Q = "none", | |
z = 0, | |
x = ""; | |
if ("undefined" == typeof CNN.contentModel || "undefined" == | |
typeof CNN.contentModel.pageType || "undefined" == typeof CNN | |
.contentModel.sectionName || "section" !== CNN.contentModel | |
.pageType && "homepage" !== CNN.contentModel.sectionName && | |
"intl_homepage" !== CNN.contentModel.sectionName || (b = s), | |
"undefined" != typeof CNN.contentModel && "undefined" != | |
typeof CNN.contentModel.layout && "error" === CNN.contentModel | |
.layout && (c = "error"), p.length) switch (c) { | |
case "article": | |
h = p.data("galleryname"), y = p.find( | |
"[data-slidename]") | |
.first() | |
.data("slidename"); | |
break; | |
case "gallery": | |
h = b, y = p.find("[data-slidename]") | |
.first() | |
.data("slidename"), z = 1; | |
} | |
"undefined" != typeof CNN.contentModel.analytics && ( | |
"undefined" != typeof CNN.contentModel.analytics.publishDate && | |
(_ = CNN.contentModel.analytics.publishDate, v = CNN.contentModel | |
.analytics.publishDate.split("T")[0].split("-"), 3 === | |
v.length && (_ = v[0] + "/" + v[1] + "/" + v[2])), C = | |
CNN.contentModel.analytics.author || s, w = CNN.contentModel | |
.analytics.cap_genre || s, k = CNN.contentModel.analytics | |
.cap_franchise || s, j = CNN.contentModel.analytics.cap_mediaType || | |
s, M = CNN.contentModel.analytics.cap_topics || s, T = | |
CNN.contentModel.pageType || s, r = CNN.contentModel.analytics | |
.branding_content_page || s, n = CNN.contentModel.analytics | |
.branding_content_zone || s, a = CNN.contentModel.analytics | |
.branding_content_container || s, i = CNN.contentModel.analytics | |
.branding_content_card || s, l = CNN.contentModel.analytics | |
.contentId || s, "gallery" === T && "string" == typeof CNN | |
.contentModel.analytics.branding_content_page && | |
"default" !== CNN.contentModel.analytics.branding_content_page && | |
(x = CNN.contentModel.analytics.branding_content_page), g && | |
(Q = "pivit widget")), jQuery.extend(CNN.omniture, { | |
branding_ad_page: s, | |
branding_ad_zone: s, | |
branding_ad_container: s, | |
branding_ad_card: s, | |
branding_content_page: r, | |
branding_content_zone: n, | |
branding_content_container: a, | |
branding_content_card: i, | |
branding_gallery: x, | |
cap_author: C, | |
cap_content_type: T, | |
cap_genre: w, | |
cap_franchise: k, | |
cap_media_type: j, | |
cap_show_name: N, | |
cap_topic: M, | |
video_opportunity: f, | |
content_id: l, | |
content_type: Q, | |
friendly_name: d, | |
full_gallery: z, | |
gallery_name: h, | |
gallery_slide: y, | |
grid_size: u, | |
headline: b, | |
ireport_assignment: s, | |
publish_date: _, | |
rs_flag: m, | |
section: o(CNN.contentModel), | |
template_type: t(c) | |
}), "error" === CNN.omniture.template_type && (CNN.omniture | |
.section = ["error", s]), "function" == typeof jQuery.fn.triggerAnalyticsMetadataReady ? | |
jQuery(document) | |
.triggerAnalyticsMetadataReady() : jQuery(document) | |
.trigger("cnn-analytics-metadata-added"); | |
} | |
function o(e) { | |
var t = "", | |
n = "", | |
a = "", | |
i = e, | |
o = e.analytics || {}; | |
return a = "undefined" != typeof i.sectionName ? i.sectionName : | |
"undefined" != typeof o.parentPath ? o.parentPath.indexOf( | |
"/") > -1 ? o.parentPath.split("/")[1] : o.parentPath : | |
"undefined" != typeof i.layout && "search" === i.layout ? | |
"search" : "no-value-set", d[a] ? (t = d[a].section, n = d[ | |
a].subsection || "") : (t = a, n = ""), [t, n]; | |
} | |
function r() { | |
try { | |
var e = location.href.toLowerCase(); | |
window.jsmd = _jsmd.init(), -1 === e.indexOf( | |
"/.element/ssi/ads.iframes/") && -1 === e.indexOf( | |
"/doubleclick/dartiframe.html") && -1 === e.indexOf( | |
"/search/") && (_jsmd.plugin.gQuery("refresh") ? jsmd.trackMetrics( | |
"dynamic-autoRefresh", "autorefresh", | |
"cnn-autorefresh") : "gallery" !== CNN.omniture.template_type_content && | |
jsmd.send()); | |
} catch (t) { | |
console.log("JSMD/Analytics error: ", t); | |
} | |
} | |
function l(e) { | |
var t = jQuery(".nav--plain-header"), | |
n = jQuery("footer.l-footer"), | |
a = CNN.Analytics.hpt; | |
jQuery(e) | |
.find("a") | |
.each(function() { | |
var e, i = jQuery(this), | |
o = i.attr("href"); | |
"string" == typeof o && (e = "page", i.closest(".nav", | |
t) | |
.length > 0 ? e = "header" : i.closest( | |
".nav-flyout__menu-item", t) | |
.length > 0 ? e = "header" : i.closest(".l-footer", | |
n) | |
.length > 0 && (e = "footer"), a.getHptValues(i, e) | |
.done(function(e) { | |
var t; | |
"object" == typeof e && -1 === o.indexOf(e.hptValue) ? | |
(t = "hpt=" + e.hptValue + ";hpt2=" + e.hpt2Value, | |
i.click(jQuery.proxy(function(e, t) { | |
CNN.Analytics.utils.clickEventTracker( | |
t, e); | |
}, this, t))) : "string" == typeof i.data( | |
"vr-track") && o.length > 1 && i.click(CNN.Analytics | |
.utils.clickEventTracker); | |
})); | |
}); | |
} | |
function c() { | |
var e = jQuery("a", "div.metadata-header__follow-icon"), | |
t = jQuery("div.share-bar-whatsapp-container"), | |
n = jQuery("a", "div.nav-flyout-footer__social"); | |
e.click(function() { | |
return s(this, !1); | |
}), t.click(function() { | |
var e = document.querySelector( | |
".share-bar-whatsapp-container") | |
.dataset, | |
t = e.url + " " + e.title + " " + e.storyurl; | |
return jQuery("html") | |
.hasClass("phone") && (document.location = t), s(this, ! | |
1); | |
}), n.click(function() { | |
return s(this, !0); | |
}); | |
} | |
function s(e, t) { | |
var n = e.getAttribute("data-social-media-name"); | |
if ("function" == typeof window.trackMetrics) try { | |
window.trackMetrics({ | |
type: "social-click", | |
data: { | |
clickObj: { | |
socialType: "social: " + n, | |
isMainNav: t | |
} | |
} | |
}); | |
} catch (a) {} | |
return !0; | |
} | |
var d = { | |
videos: { | |
section: "videos" | |
}, | |
"watch-cnn": { | |
section: "watch-cnn" | |
}, | |
intl_homepage: { | |
section: "cnn homepage", | |
subsection: "" | |
}, | |
homepage: { | |
section: "cnn homepage", | |
subsection: "" | |
}, | |
us: { | |
section: "us", | |
subsection: "" | |
}, | |
world: { | |
section: "world", | |
subsection: "" | |
}, | |
politics: { | |
section: "politics", | |
subsection: "" | |
}, | |
tech: { | |
section: "tech", | |
subsection: "" | |
}, | |
health: { | |
section: "health", | |
subsection: "" | |
}, | |
entertainment: { | |
section: "entertainment", | |
subsection: "" | |
}, | |
living: { | |
section: "living", | |
subsection: "" | |
}, | |
aviation: { | |
section: "travel", | |
subsection: "aviation" | |
}, | |
destinations: { | |
section: "travel", | |
subsection: "destinations" | |
}, | |
foodanddrink: { | |
section: "travel", | |
subsection: "foodanddrink" | |
}, | |
hotels: { | |
section: "travel", | |
subsection: "hotels" | |
}, | |
intl_travel: { | |
section: "travel", | |
subsection: "" | |
}, | |
travel: { | |
section: "travel", | |
subsection: "" | |
}, | |
china: { | |
section: "world", | |
subsection: "china" | |
}, | |
africa: { | |
section: "world", | |
subsection: "africa" | |
}, | |
americas: { | |
section: "world", | |
subsection: "americas" | |
}, | |
asia: { | |
section: "world", | |
subsection: "asia" | |
}, | |
europe: { | |
section: "world", | |
subsection: "europe" | |
}, | |
middleeast: { | |
section: "world", | |
subsection: "middleeast" | |
}, | |
football: { | |
section: "sport", | |
subsection: "football" | |
}, | |
motorsport: { | |
section: "sport", | |
subsection: "motorsport" | |
}, | |
sailing: { | |
section: "sport", | |
subsection: "sailing" | |
}, | |
golf: { | |
section: "sport", | |
subsection: "golf" | |
}, | |
tennis: { | |
section: "sport", | |
subsection: "tennis" | |
}, | |
horseracing: { | |
section: "sport", | |
subsection: "horseracing" | |
}, | |
equestrian: { | |
section: "sport", | |
subsection: "equestrian" | |
}, | |
skiing: { | |
section: "sport", | |
subsection: "skiing" | |
}, | |
architecture: { | |
section: "style", | |
subsection: "architecture" | |
}, | |
arts: { | |
section: "style", | |
subsection: "arts" | |
}, | |
autos: { | |
section: "style", | |
subsection: "autos" | |
}, | |
design: { | |
section: "style", | |
subsection: "design" | |
}, | |
fashion: { | |
section: "style", | |
subsection: "fashion" | |
}, | |
luxury: { | |
section: "style", | |
subsection: "luxury" | |
}, | |
style: { | |
section: "style", | |
subsection: "" | |
} | |
}; | |
return CNN.omniture = CNN.omniture || {}, { | |
gridSize: e, | |
renamingTemplateType: t, | |
addMetadataObject: i, | |
jsmdTracking: r, | |
addTrackingTags: l, | |
setCookie: n, | |
clickEventTracker: a, | |
addSocialMediaInteractionMetrics: c | |
}; | |
}() | |
}], | |
'CNN.omniture.section': [{ | |
prop: 'CNN.omniture.section', | |
to: ["error", s] | |
}], | |
'CNN.omniture': [{ | |
prop: 'CNN.omniture', | |
to: CNN.omniture || {} | |
}], | |
'CNN.Analytics.hpt': [{ | |
prop: 'CNN.Analytics.hpt', | |
to: function() { | |
"use strict"; | |
function e(e) { | |
var t = ""; | |
return e = "undefined" == typeof e ? "" : e.replace(/^zn-/, | |
""), t = l[e] ? l[e] : "no-value-set"; | |
} | |
function t(e) { | |
var t = ""; | |
return e = "undefined" == typeof e ? "" : e.replace(/^cn-/, | |
""), t = r[e] ? r[e] : "no-value-set"; | |
} | |
function n(n, a) { | |
var i, o = {}, | |
r = "no-value-set", | |
l = r, | |
c = CNN.contentModel.pageType, | |
s = CNN.contentModel.sectionName || r, | |
d = CNN.contentModel.type || r, | |
u = r, | |
p = r, | |
g = r, | |
h = r, | |
y = r, | |
_ = r, | |
f = r, | |
m = "zone-level", | |
N = [], | |
b = r, | |
v = r, | |
C = r, | |
w = n.closest("[data-analytics]"), | |
k = n.closest("[class^=\'zn zn-\']"), | |
j = n.closest("section.zn"), | |
M = n.closest(".cn"), | |
T = n.closest("[data-analytics-header]"), | |
Q = r, | |
z = r, | |
x = r, | |
O = [], | |
S = CNN.Analytics.utils; | |
return m = n.text() | |
.length > 0 ? n.text() | |
.toLowerCase() : "zone-level", k.length && "A" !== k[0].tagName && | |
k[0].className && (i = k[0].className, "undefined" != | |
typeof i && (y = i.split(" ") | |
.length > 1 ? i.split(" ")[2] : r)), j.length && (i = j | |
.data("zone-label"), "undefined" != typeof i && i.length && | |
(h = i), i = j.data("vr-zone"), "undefined" != typeof i && | |
i.length && (_ = i)), i = w.length ? w.data("analytics") : | |
n[0].className.indexOf("cd-banner") >= 0 ? n.nextAll( | |
"[data-analytics]") | |
.data("analytics") : void 0, "undefined" != typeof i && i.length && | |
(l = i.split("_"), l = l.length ? l : [], b = l[0].length > | |
0 ? l[0] : r, b = b.replace(/\\s/g, "-"), v = l[1], g = l | |
.length > 2 ? l[2] : r, l.length >= 4 && l[3].length > 0 ? | |
f = l[3] : 0 === n.text() | |
.length || n.text() | |
.indexOf("<img") >= 0 ? (f = "image", m = "image") : f = | |
"text"), n.eq(0) | |
.text() && (p = n.eq(0) | |
.text(), p = p.replace(/[ ]/g, "-"), p.indexOf("<img") >= | |
0 && (p = "image-file")), i = T.data("analytics-header"), | |
"header" === a && "string" == typeof i && i.split("_") | |
.length && (u = "header", O = i.split("_"), O = O.length ? | |
O : [], Q = "main-menu" === O[0] || "flyout-menu" === O[0] ? | |
O[1].toLowerCase() : r, z = "flyout-submenu" === O[0] ? O[ | |
1].toLowerCase() : r, x = r), i = w.data("analytics"), | |
"footer" === a && "string" == typeof i && i.split("_") | |
.length && (O = i.split("_"), O = O.length ? O : [], 1 === | |
O.length && (u = "footer", Q = O[0].toLowerCase(), z = r, | |
x = r), 2 === O.length && (u = O[0].toLowerCase(), Q = | |
O[1].toLowerCase(), z = r, x = r), 3 === O.length && (u = | |
O[0].toLowerCase(), Q = O[1].toLowerCase(), z = O[2].toLowerCase(), | |
x = r)), "page" === a && M.length && (i = M[0].className, | |
"undefined" != typeof i && (N = i.split(/\\s+/), N.length && | |
(C = N[N.length - 1], C = C.replace(/_/g, "-")))), o = { | |
linkText: m, | |
hpt_page_pageIndicator: d, | |
hpt_page_gridSize: S.gridSize(), | |
hpt_page_section: s, | |
hpt_page_template: S.renamingTemplateType(c), | |
hpt_page_zoneId: _, | |
hpt_page_zoneLabel: h, | |
hpt_page_containerId: C, | |
hpt_page_containerLabel: b, | |
hpt2_page_pageIndicator: d, | |
hpt2_page_gridSize: S.gridSize(), | |
hpt2_page_section: s, | |
hpt2_page_template: S.renamingTemplateType(c), | |
hpt2_page_zoneId: _, | |
hpt2_page_zoneType: e(y), | |
hpt2_page_containerId: C, | |
hpt2_page_containerType: t(v), | |
hpt_header_globalIndicator: u, | |
hpt_header_gridSize: S.gridSize(), | |
hpt_header_section: s, | |
hpt_header_template: S.renamingTemplateType(c), | |
hpt_header_level1: Q, | |
hpt_header_level2: z, | |
hpt_header_level3: x, | |
hpt_header_linkElement: m, | |
hpt_header_linkType: f, | |
hpt2_header_globalIndicator: u, | |
hpt2_header_gridSize: S.gridSize(), | |
hpt2_header_section: s, | |
hpt2_header_template: S.renamingTemplateType(c), | |
hpt2_header_level1: Q, | |
hpt2_header_level2: z, | |
hpt2_header_level3: x, | |
hpt2_header_linkElement: m, | |
hpt2_header_linkType: f | |
}; | |
} | |
function a(e, t, n) { | |
var a = jQuery.Deferred(); | |
return fastdom.measure(function() { | |
var i, o, r, l = t.data("filter-hpt"), | |
c = t.data("filter-" + e), | |
s = "string" == typeof l, | |
d = "string" == typeof c, | |
u = "", | |
p = n.split("_"); | |
if (d || s) { | |
for (u = d ? c : l, i = u.split("_"), o = 0, r = i.length; r > | |
o; o += 1) p[o] && "" !== i[o] && (p[o] = i[o]); | |
n = p.join("_"); | |
} | |
a.resolve(n); | |
}), a.promise(); | |
} | |
function i(e, t) { | |
return { | |
hptValue: CNN.Utils.b64Encode(e.replace("…", "")) | |
.replace(/\r/g, ""), | |
hpt2Value: CNN.Utils.b64Encode(t.replace("…", "")) | |
.replace(/\r/g, "") | |
}; | |
} | |
function o(e, t) { | |
var o = n(e, t), | |
r = "", | |
l = ""; | |
return "page" === t ? (r = o.hpt_page_pageIndicator + "_" + o | |
.hpt_page_gridSize + "_" + o.hpt_page_section + "_" + o.hpt_page_template + | |
"_" + o.hpt_page_zoneId + "_" + o.hpt_page_zoneLabel + | |
"_" + o.hpt_page_containerId + "_" + o.hpt_page_containerLabel, | |
l = o.hpt2_page_pageIndicator + "_" + o.hpt2_page_gridSize + | |
"_" + o.hpt2_page_section + "_" + o.hpt2_page_template + | |
"_" + o.hpt2_page_zoneId + "_" + o.hpt2_page_zoneType + | |
"_" + o.hpt2_page_containerId + "_" + o.hpt2_page_containerType | |
) : (r = o.hpt_header_globalIndicator + "_" + o.hpt_header_gridSize + | |
"_" + o.hpt_header_section + "_" + o.hpt_header_template + | |
"_" + o.hpt_header_level1 + "_" + o.hpt_header_level2 + | |
"_" + o.hpt_header_linkElement + "_" + o.hpt_header_linkType, | |
l = o.hpt2_header_globalIndicator + "_" + o.hpt2_header_gridSize + | |
"_" + o.hpt2_header_section + "_" + o.hpt2_header_template + | |
"_" + o.hpt2_header_level1 + "_" + o.hpt2_header_level2 + | |
"_" + o.hpt2_header_linkElement + "_" + o.hpt2_header_linkType | |
), jQuery.when(a("hpt1", e, r), a("hpt2", e, l)) | |
.then(i); | |
} | |
var r = { | |
"list-hierarchical-small-horizontal": "lead+list:lead+headlines-w/images", | |
"list-hierarchical-xs": "lead+list:lead+headlines", | |
"list-large-horizontal": "list:full-cards", | |
"list-large-vertical": "vertical-strip:full-cards", | |
"list-small-horizontal": "list:headlines+images", | |
"list-small-vertical": "vertical-strip:headlines+images", | |
"list-xs": "headlines", | |
"grid-medium": "grid:grid(spaced)", | |
"grid-small": "grid:grid", | |
"stack-large-horizontal": "list:full-cards(spaced)", | |
"stack-large-vertical": "vertical-strip:full-cards(spaced)", | |
"stack-medium-horizontal": "list:headlines+images(spaced)", | |
"stack-medium-vertical": "vertical-strip:headlines+images(spaced)", | |
"carousel-large-strip": "carousel:large", | |
"carousel-medium-matrix": "carousel:double-deck", | |
"carousel-medium-strip": "carousel:standard", | |
"stack-ul": "unknown name", | |
"section-preview": "unknown name" | |
}, | |
l = { | |
"left-fluid-right-stack": "hero-3", | |
"left-fluid-bg-bleed": "superhero", | |
"left-fluid": "priority+2", | |
"right-stack-bg-inline": "hero-plus", | |
"right-stack-bg-bleed": "full-bleed", | |
staggered: "staggered", | |
balanced: "balanced", | |
"60-40": "priority+1", | |
"30-70": "grid-right", | |
"40-60": "unknown name", | |
"70-30": "unknown name", | |
body: "unknown name", | |
"single-column": "unknown name", | |
"zone-background": "unknown name", | |
"zone-banner": "unknown name", | |
"zone-header": "unknown name" | |
}; | |
return { | |
getHptValues: o | |
}; | |
}() | |
}], | |
'CNN.Gallery.analytics': [{ | |
prop: 'CNN.Gallery.analytics', | |
to: function() { | |
"use strict"; | |
function e(e, t) { | |
var n = jQuery(e), | |
a = {}, | |
i = [], | |
o = "", | |
r = {}, | |
l = "", | |
c = !1, | |
s = [], | |
d = "", | |
u = "", | |
p = 1; | |
for (c = "boolean" == typeof n.data("is-gallery") ? n.data( | |
"is-gallery") : !1, a = { | |
video: 0, | |
article: 0, | |
gallery: 0, | |
image: 0, | |
hyperlink: 0, | |
matched: 0 | |
}, jQuery("div.owl-item div[data-analytics]", e) | |
.each(function() { | |
var e, t = jQuery(this); | |
e = t.data("analytics") | |
.split("_"), s.push(e[2] || ""), u = e[1]; | |
}), d = s.length > 0 ? s[0] : d; p < s.length; p++) | |
if (s[p] !== d) { | |
d = "multimedia"; | |
break; | |
} | |
return "boolean" == typeof t && t && (o = "owl-nav" === e.className ? | |
e.offsetParent.id.split("_")[1] : e.id.split("_")[1], r = | |
document.getElementById("cn-jumbotron-details-container_" + | |
o), jQuery.each(jQuery(r) | |
.find( | |
".js-jumbotron-card-wrapper.jumbotron-card-wrapper.active-card" | |
), | |
function(e, t) { | |
i = t.firstChild.className.match(/cd\\-\\-article/), | |
null === i && (i = t.firstChild.className.match( | |
/cd\\-\\-(video|image|gallery|hyperlink)/)), null !== | |
i && (l = i[0].replace("cd--", "")); | |
}), jQuery.each(jQuery(r) | |
.find("article.cd"), | |
function(e, t) { | |
t.className.indexOf("cd--video") > -1 ? a.video++ : t | |
.className.indexOf("cd--article") > -1 ? a.article++ | |
: t.className.indexOf("cd--image") > -1 ? a.image++ | |
: t.className.indexOf("cd--gallery") > -1 ? a.gallery++ | |
: t.className.indexOf("cd--hyperlink") > -1 && a.hyperlink++; | |
}), a.video > 0 && (d = "video", a.matched++), a.article > | |
0 && (d = "article", a.matched++), a.image > 0 && (d = | |
"image", a.matched++), a.hyperlink > 0 && (d = | |
"hyperlink", a.matched++), a.gallery > 0 && (d = | |
"gallery", a.matched++), a.matched > 1 && (d = | |
"multimedia")), d = d.length > 0 ? "carousel_" + d : d, { | |
contentType: d, | |
carouselType: u, | |
isGallery: c | |
}; | |
} | |
function t(e) { | |
return "undefined" != typeof jQuery(e) | |
.data(u) ? jQuery(e) | |
.data(u) : ""; | |
} | |
function n(e) { | |
var t = -1, | |
n = "", | |
a = jQuery(e), | |
i = a.find(p) || []; | |
return t = a.data("active") || "", jQuery.isNumeric(t) && t > | |
0 && (n = jQuery(i[t - 1]) | |
.find("img") | |
.attr("src"), n = "undefined" != typeof n ? n.substring(n | |
.lastIndexOf("/") + 1) : ""), n; | |
} | |
function a(e, t) { | |
var n = [], | |
a = 0; | |
return t ? (n = jQuery(CNN.Jumbotron.Constants.CONST_SMALL_CAROUSEL_SELECTOR), | |
n.find(".owl-item") | |
.each(function(e, t) { | |
jQuery(t) | |
.hasClass("cloned") || a++; | |
})) : a = "undefined" != typeof jQuery(e) | |
.data(g) ? jQuery(e) | |
.data(g) : "", a; | |
} | |
function i(e) { | |
var t = jQuery(".owl-stage", e) | |
.find(".owl-item.active .el__resize img:first") | |
.attr("alt"); | |
return "string" != typeof t ? "" : t.replace( | |
/[\\u0250-\\ue007]/g, "") | |
.substr(0, 40); | |
} | |
function o(e, t) { | |
var n = [], | |
a = 0; | |
return t ? (n = jQuery(CNN.Jumbotron.Constants.CONST_SMALL_CAROUSEL_SELECTOR), | |
n.find(".owl-item") | |
.each(function(e, t) { | |
return !jQuery(t) | |
.hasClass("cloned") && (a++, jQuery(t) | |
.hasClass("active")) ? !1 : void 0; | |
})) : a = i(e), a; | |
} | |
function r(i, r) { | |
var l = {}; | |
return l = e(i, r), l.galleryName = t(i), l.galleryType = l.isGallery ? | |
"photo gallery" : "carousel", l.imageName = "carousel" !== | |
l.galleryType ? n(i) : "", l.slideCount = a(i, r), l.slideNumber = | |
o(i, r), "carousel" !== l.galleryType && (l.carouselType = | |
""), l; | |
} | |
function l(e, t) { | |
"undefined" != typeof t.isJumbotron && t.isJumbotron === !0 && | |
(e.data.page_view = !0, e.data.carousel_type = "jumbotron"); | |
} | |
function c(e) { | |
var t = CNN.CurrentWidth.getClientWidth() * CNN.CurrentHeight | |
.getClientHeight(), | |
n = t / 2 + 1, | |
a = e.target.clientWidth * e.target.clientHeight, | |
i = r(e.currentTarget, e.isJumbotron), | |
o = CNN.Analytics.hpt; | |
o.getHptValues(jQuery(e.currentTarget), "page") | |
.done(function(t) { | |
var o = { | |
type: "cnngallery-click", | |
data: { | |
page_view: !1, | |
gallery_name: i.galleryName, | |
image_name: i.imageName, | |
content_type: i.contentType, | |
carousel_type: i.carouselType, | |
gallery_type: i.galleryType, | |
gallery_slide_count: i.slideCount, | |
gallery_slide: i.slideNumber, | |
hpt: t.hptValue, | |
hpt2: t.hpt2Value | |
} | |
}; | |
o.data.page_view = a >= n, l(o, e), CNN.ads.events.refreshGalleryRailAd( | |
e), null !== window.trackMetrics && void 0 !== | |
window.trackMetrics && window.trackMetrics(o); | |
}); | |
} | |
function s(e) { | |
jQuery(CNN.Carousel.carouselSelector, e) | |
.off("carousel-action-event") | |
.on("carousel-action-event", c); | |
} | |
function d() { | |
var e, t, n = 0; | |
try { | |
if (t = function(e, t) { | |
"undefined" != typeof t && t.actionType === CNN.Jumbotron | |
.Constants.CONST_EVENT_CAROUSEL_ACTION_TYPE_CLICK ? ( | |
e.isJumbotron = !0, c(e)) : "click" !== e.type && | |
"changed" !== e.type && "dragged" !== e.type || (e.isJumbotron = ! | |
0, c(e)); | |
}, window.cnnJumbotronManager && window.cnnJumbotronManager | |
.getJumbotrons) | |
for (e = window.cnnJumbotronManager.getJumbotrons(); n < | |
e.length; n++) e[n] instanceof CNN.Jumbotron.Container && | |
"undefined" != typeof e[n].jumbotronElementRaw && ( | |
jQuery(e[n].jumbotronElementRaw) | |
.on("carousel-action-event", t), Modernizr.touchevents ? | |
jQuery(e[n].jumbotronElementRaw) | |
.find(".cn-jumbotron-card-details") | |
.on(CNN.Carousel.events.changed, t) : (jQuery(e[n].jumbotronElementRaw) | |
.find(".owl-nav") | |
.on("click", t), jQuery(e[n].jumbotronElementRaw) | |
.find(".jumbotron-small-carousel") | |
.on(CNN.Carousel.events.dragged, t))); | |
} catch (a) { | |
console.log("Error caught in initJumbotronTracking: %s", a.message); | |
} | |
} | |
var u = "galleryname", | |
p = "[data-slidename]", | |
g = "slide-count"; | |
return { | |
init: s, | |
initJumbotronTracking: d, | |
trackGalleryClick: c | |
}; | |
}() | |
}] | |
} | |
const cnn_footer_lib_min_js = { | |
'CNN.Window.width': [{ | |
prop: 'CNN.Window.width', | |
to: "0" | |
}, { | |
prop: 'CNN.Window.width', | |
to: "640" | |
}, { | |
prop: 'CNN.Window.width', | |
to: "800" | |
}, { | |
prop: 'CNN.Window.width', | |
to: CNN.Window.width || "" | |
}], | |
'CNN.Columns.current': [{ | |
prop: 'CNN.Columns.current', | |
to: "12" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "4" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "5" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "6" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "7" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "8" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "9" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "10" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "11" | |
}], | |
'CNN.iZLoading': [{ | |
prop: 'CNN.iZLoading', | |
to: !0 | |
}, { | |
prop: 'CNN.iZLoading', | |
to: !1 | |
}, { | |
prop: 'CNN.iZLoading', | |
to: CNN.iZLoading || !1 | |
}], | |
'CNN.DemandLoading.pageBottom': [{ | |
prop: 'CNN.DemandLoading.pageBottom', | |
to: !1 | |
}, { | |
prop: 'CNN.DemandLoading.pageBottom', | |
to: !r | |
}, { | |
prop: 'CNN.DemandLoading.pageBottom', | |
to: !0 | |
}], | |
'CNN.DemandLoading.thirdParty.money.markets': [{ | |
prop: 'CNN.DemandLoading.thirdParty.money.markets', | |
to: !0 | |
}], | |
'CNN.DemandLoading.thirdParty.money.currencies': [{ | |
prop: 'CNN.DemandLoading.thirdParty.money.currencies', | |
to: !0 | |
}], | |
'CNN.PlainNavigation': [{ | |
prop: 'CNN.PlainNavigation', | |
to: { | |
breakpoint: 1120, | |
pickerBreakpoint: 768, | |
init: function() { | |
this.$editionItems = jQuery(".js-edition-item"), this.$flyoutFooterEditionItems = | |
jQuery(".js-nav-flyout-footer-edition-list-item"), this.$hamburgerMenu = | |
jQuery(document.getElementById("menu")), this.$articleTitle = | |
jQuery(document.getElementById( | |
"js-nav-section-article-title")), this.$sectionExpandIcon = | |
jQuery(".js-nav-section-name"), this.$searchButton = jQuery( | |
document.getElementById("search-button")), this.$searchSubmitButton = | |
jQuery(document.getElementById("submit-button")), this.$editionPicker = | |
jQuery(".edition-picker__current-edition"), this.detectSubNav(), | |
jQuery("body") | |
.hasClass("pg-leaf") === !0 && (jQuery(window) | |
.on("scroll", function() { | |
jQuery("body") | |
.toggleClass("page-scrolled", jQuery(window) | |
.scrollTop() > 100); | |
}), CNN.contentModel && CNN.contentModel.title && this.$articleTitle | |
.html(CNN.contentModel.title)), this.$editionItems.on( | |
"click", this.changeEdition), this.$flyoutFooterEditionItems | |
.on("click", this.changeEdition), this.$hamburgerMenu.on( | |
"click", this.hideEdition), this.$searchSubmitButton.on( | |
"click", this.searchSubmit), this.$sectionExpandIcon.on( | |
"click", this.sectionRootExpand), this.$searchButton.on( | |
"click", | |
function(e) { | |
window.innerWidth < CNN.PlainNavigation.breakpoint ? | |
CNN.PlainNavigation.searchSubmit(e) : CNN.PlainNavigation | |
.searchExpand(e); | |
}), this.$editionPicker.on("click", this.toggleEdition); | |
}, | |
hideEdition: function() { | |
jQuery(".edition-picker__current-edition") | |
.removeClass("nav-section--expanded"), jQuery( | |
".js-nav-editions") | |
.removeClass("nav-section--expanded"); | |
}, | |
sectionRootExpand: function(e) { | |
window.innerWidth >= CNN.PlainNavigation.breakpoint || (e.preventDefault(), | |
jQuery(this) | |
.parent() | |
.toggleClass("nav-section--expanded"), jQuery(this) | |
.parent() | |
.hasClass("nav-section--expanded") === !0 ? jQuery( | |
document.getElementById("nav-section-submenu")) | |
.addClass("nav-section--expanded") : jQuery(document.getElementById( | |
"nav-section-submenu")) | |
.removeClass("nav-section--expanded")); | |
}, | |
searchSubmit: function(e) { | |
e.preventDefault(), jQuery(document.getElementById( | |
"search-form")) | |
.submit(); | |
}, | |
searchExpand: function(e) { | |
e.preventDefault(), jQuery("body") | |
.toggleClass("search-expanded"), jQuery(document.getElementById( | |
"search-input-field")) | |
.focus(); | |
}, | |
toggleEdition: function(e) { | |
e && e.preventDefault(), jQuery("body") | |
.hasClass("nav-open") === !0 && window.innerWidth >= CNN.PlainNavigation | |
.pickerBreakpoint || (jQuery( | |
".edition-picker__current-edition") | |
.toggleClass("nav-section--expanded"), jQuery( | |
".js-nav-editions") | |
.toggleClass("nav-section--expanded")); | |
}, | |
detectSubNav: function() { | |
var e = CNN.contentModel.sectionName, | |
t = jQuery("body") | |
.hasClass("pg-" + e), | |
n = jQuery("body") | |
.hasClass("pg-intl_" + e); | |
t !== !0 && n !== !0 || "homepage" === e || "intl_homepage" === | |
e || jQuery(document.getElementById("nav")) | |
.addClass(e); | |
}, | |
changeEdition: function(e, t) { | |
var n = e ? jQuery(e.currentTarget) : t, | |
i = n.parent(), | |
o = i.parent(), | |
s = o.data("location") + "_" + o.data("analytics"), | |
a = "/web/20160903014131/http://www.cnn.com", | |
r = n.data("value"), | |
d = r + "?hpt=" + s, | |
l = n.data("type"); | |
CNN.contentModel && CNN.contentModel.edition && (a = | |
"international" === CNN.contentModel.edition ? "edition" : | |
"www"), -1 === a.indexOf(l) && (window.location = d); | |
} | |
} | |
}], | |
'CNN.selectNavigation': [{ | |
prop: 'CNN.selectNavigation', | |
to: function(e, t) { | |
if ("undefined" == typeof e) throw "selector is not defined"; | |
t !== !0 && (t = !1), jQuery(e) | |
.on("change", function() { | |
var e = jQuery(this) | |
.find(":selected") | |
.val(); | |
t === !1 ? window.location = e : window.location.hash = | |
"#" + e; | |
}); | |
} | |
}], | |
'CNN.EditionPicker': [{ | |
prop: 'CNN.EditionPicker', | |
to: CNN.EditionPicker || function(e, t) { | |
function n(e) { | |
e.stopPropagation(); | |
} | |
function i() { | |
r.on("click", n) | |
.on("click", ".list .item--edition", o) | |
.on("click", ".current", s) | |
.on("click", ".item--select", CNN.EditionPrefs.showPreferences); | |
} | |
function o(n, i) { | |
var o = n ? e(n.currentTarget) : i, | |
s = o.children("input"), | |
a = o.closest(".list"), | |
r = a.data("location") + "_" + a.data("analytics"), | |
d = "/web/20160903014131/http://www.cnn.com", | |
l = o.data("value"), | |
c = l + "?hpt=" + r; | |
CNN.contentModel && CNN.contentModel.edition && (d = | |
"international" === CNN.contentModel.edition ? "edition" : | |
"www"), -1 === d.indexOf(s.val()) && (t.location = c); | |
} | |
function s(t) { | |
var n = t ? e(t.currentTarget) | |
.closest(".edition-picker") : r; | |
n.hasClass("open") ? (n.removeClass("open"), a.off("click", s)) : | |
(r.removeClass("open"), n.addClass("open"), a.one("click", | |
s)); | |
} | |
var a = e("body"), | |
r = e(".edition-picker"); | |
return e(document) | |
.onZonesAndDomReady(i), { | |
changeEdition: o, | |
togglePicker: s | |
}; | |
}(jQuery, window) | |
}], | |
'CNN.contentModel': [{ | |
prop: 'CNN.contentModel', | |
to: CNN.contentModel || {} | |
}], | |
'CNN.Window': [{ | |
prop: 'CNN.Window', | |
to: CNN.Window || {} | |
}], | |
'CNN.Columns': [{ | |
prop: 'CNN.Columns', | |
to: CNN.Columns || { | |
4: 4 * columnWidth, | |
5: 5 * columnWidth, | |
6: 6 * columnWidth, | |
7: 7 * columnWidth, | |
8: 8 * columnWidth, | |
9: 9 * columnWidth, | |
10: 10 * columnWidth, | |
11: 11 * columnWidth, | |
12: 12 * columnWidth | |
} | |
}], | |
'CNN.Zones': [{ | |
prop: 'CNN.Zones', | |
to: CNN.Zones || {} | |
}], | |
'CNN.Zones.runningZoneIds': [{ | |
prop: 'CNN.Zones.runningZoneIds', | |
to: [] | |
}], | |
'CNN.Zones.loadedZoneIds': [{ | |
prop: 'CNN.Zones.loadedZoneIds', | |
to: [] | |
}], | |
'CNN.processedContainers': [{ | |
prop: 'CNN.processedContainers', | |
to: [] | |
}], | |
'CNN.serverSentZones': [{ | |
prop: 'CNN.serverSentZones', | |
to: loadAllZonesLazy === !0 ? 0 : 1 | |
}], | |
'CNN.Containers': [{ | |
prop: 'CNN.Containers', | |
to: {} | |
}, { | |
prop: 'CNN.Containers', | |
to: f.containers ? f.containers[u] : {} | |
}], | |
'CNN.DemandLoading.thirdParty.outbrain': [{ | |
prop: 'CNN.DemandLoading.thirdParty.outbrain', | |
to: !0 | |
}], | |
'CNN.DemandLoading': [{ | |
prop: 'CNN.DemandLoading', | |
to: { | |
zoneImages: {}, | |
thirdParty: { | |
money: { | |
currencies: !1, | |
market: !1 | |
}, | |
outbrain: !1 | |
} | |
} | |
}], | |
'CNN.DemandLoading.allZoneImagesLoaded': [{ | |
prop: 'CNN.DemandLoading.allZoneImagesLoaded', | |
to: function(e, t) { | |
CNN.DemandLoading.zoneImages[e] = { | |
images: jQuery("#" + e + " img"), | |
count: 0 | |
}, CNN.DemandLoading.zoneImages[e].images.load(function() { | |
CNN.DemandLoading.zoneImages[e].count++, CNN.DemandLoading | |
.zoneImages[e].count === CNN.DemandLoading.zoneImages[e] | |
.images.length && "function" == typeof t && t(); | |
}); | |
} | |
}], | |
'CNN.DemandLoading.updateZoneView': [{ | |
prop: 'CNN.DemandLoading.updateZoneView', | |
to: function() { | |
var t, n = CNN.CurrentScrollTop.getClientScrollTop(), | |
i = !1, | |
o = n + jQuery(window) | |
.height(); | |
jQuery("section.zn-loaded") | |
.length > 0 && (jQuery("section.zn-loaded") | |
.each(function(n) { | |
return jQuery(this) | |
.offset() | |
.top > o ? (visibleZone = s(0 !== n ? t : e(this)), i = ! | |
0, !1) : void(t = e(this)); | |
}), i || (visibleZone = s(t))); | |
} | |
}], | |
'CNN.DemandLoading.updateZones': [{ | |
prop: 'CNN.DemandLoading.updateZones', | |
to: function() { | |
var t, s, a, r, d, l, c, u, h = !1, | |
f = CNN.Zones, | |
m = 0, | |
p = "video" === CNN.contentModel.pageType ? | |
"videos/index.html" : o(document.location.pathname), | |
g = $page.find("section.zn-loaded:not(.nativeSponsor)") | |
.length, | |
y = f.zones || {}, | |
v = y.minWidth || {}; | |
if (a = v[CNN.Window.width] || CNN.contentModel.zoneIds || [], | |
1 === CNN.serverSentZones && (u = a[0] || "", u.indexOf(":") > | |
-1 && (u = u.split(":"), u = u[1] || ""), CNN.Containers = | |
f.containers ? f.containers[u] : {}, setZoneWindowWidth(), | |
loadContainers(u)), 0 === renderZoneIds.length) | |
for (; m < a.length; m++) r = a[m], r = CNN.Utils.exists(r) && | |
r.indexOf(":") > 0 ? r.split(":")[1] : r, CNN.Utils.exists( | |
r) && (renderZoneIds.push(r), l = e(".zn--idx-" + m), d = | |
e(".zn--idx-" + (m - 1)), 0 === l.length && 1 === d.length && | |
d.after('<section class="zn--idx-' + m + | |
' zn-empty"></section>')); | |
for (; g < a.length; g++) | |
if (h = !1, r = a[g], CNN.Utils.exists(r) && r.indexOf(":") > | |
0) { | |
if (s = r.split(":"), s = s[1], CNN.Zones.loadedZoneIds.indexOf( | |
s) > -1) continue; | |
if (t = e(".zn--idx-" + g + ".zn-empty"), 0 === t.length && | |
(t = e(document.querySelectorAll(".zn-loaded")) | |
.last(), h = !0), 1 === t.length) { | |
if (CNN.Zones.runningZoneIds.indexOf(s) > -1) break; | |
if (c = { | |
path: p, | |
zone: t, | |
zoneIdx: g, | |
append: h, | |
idPath: r | |
}, n(s, c), i(g)) break; | |
} | |
} else { | |
if (s = a[g], CNN.Zones.loadedZoneIds.indexOf(s) > -1) | |
continue; | |
if (t = e(document.getElementById(s)), 1 === t.length) { | |
if (CNN.Zones.runningZoneIds.indexOf(s) > -1) break; | |
if (c = { | |
path: p, | |
zone: t, | |
zoneIdx: g | |
}, n(s, c), i(g)) break; | |
} | |
} | |
} | |
}], | |
'CNN.DemandLoading.allLoaded': [{ | |
prop: 'CNN.DemandLoading.allLoaded', | |
to: !1 | |
}, { | |
prop: 'CNN.DemandLoading.allLoaded', | |
to: !0 | |
}], | |
'CNN.DemandLoading.elements': [{ | |
prop: 'CNN.DemandLoading.elements', | |
to: [] | |
}, { | |
prop: 'CNN.DemandLoading.elements', | |
to: e(a) | |
}, { | |
prop: 'CNN.DemandLoading.elements', | |
to: s | |
}], | |
'CNN.DemandLoading.addElement': [{ | |
prop: 'CNN.DemandLoading.addElement', | |
to: function(n) { | |
var i = 0, | |
o = e("img", n); | |
if (0 === o.length && (o = e(n)), o.length > 0) | |
for (CNN.DemandLoading.allLoaded = !1, t(o), i = 0; i < o.length; i++) | |
CNN.DemandLoading.elements.push(o[i]); | |
return CNN.DemandLoading.process(); | |
} | |
}], | |
'CNN.DemandLoading.update': [{ | |
prop: 'CNN.DemandLoading.update', | |
to: function() { | |
var t = !1, | |
n = CNN.CurrentScrollTop.getClientScrollTop() + e(document) | |
.height() + d; | |
return n > l && (l = n, l >= e(document) | |
.height() && (CNN.DemandLoading.pageBottom = !0), t = CNN.DemandLoading | |
.process()), t; | |
} | |
}], | |
'CNN.DemandLoading.process': [{ | |
prop: 'CNN.DemandLoading.process', | |
to: function() { | |
var n, i, o, s, r, d = []; | |
if (0 === CNN.DemandLoading.elements.length && (CNN.DemandLoading | |
.elements = e(a)), n = CNN.DemandLoading.elements, i = n.length || | |
0, 0 === i) CNN.DemandLoading.allLoaded = !0; | |
else { | |
for (s = [], o = 0; i > o; o++) r = e(n[o]), r.offset() && r.offset() | |
.top <= l ? (t(r, !0), d.push(r[0])) : s.push(r[0]); | |
d.length > 0 && (CNN.DemandLoading.elements = s, CNN.DemandLoading | |
.allLoaded = !1); | |
} | |
return d; | |
} | |
}], | |
'CNN.DemandLoading.reProcess': [{ | |
prop: 'CNN.DemandLoading.reProcess', | |
to: function() { | |
return CNN.DemandLoading.elements = e(a), CNN.DemandLoading.process(); | |
} | |
}], | |
'CNN.DemandLoadConfig': [{ | |
prop: 'CNN.DemandLoadConfig', | |
to: CNN.DemandLoadConfig || {} | |
}], | |
'CNN.DemandLoading.zoneImages[e]': [{ | |
prop: 'CNN.DemandLoading.zoneImages[e]', | |
to: { | |
images: jQuery("#" + e + " img"), | |
count: 0 | |
} | |
}], | |
'CNN.Columns.previous': [{ | |
prop: 'CNN.Columns.previous', | |
to: CNN.Columns.current | |
}], | |
'CNN.Gallery': [{ | |
prop: 'CNN.Gallery', | |
to: CNN.Gallery || {} | |
}], | |
'CNN.Carousel': [{ | |
prop: 'CNN.Carousel', | |
to: CNN.Carousel || { | |
carouselSelector: ".js-owl-carousel", | |
events: { | |
initialize: "initialize.owl.carousel", | |
initialized: "initialized.owl.carousel", | |
loadedImage: "loaded.owl.lazy", | |
navigationInitialized: "initialized.owl.navigation", | |
destroy: "destroy.owl.carousel", | |
dragged: "dragged.owl.carousel", | |
change: "change.owl.carousel", | |
changed: "changed.owl.carousel", | |
resize: "resize.owl.carousel", | |
resized: "resized.owl.carousel", | |
refresh: "refresh.owl.carousel", | |
refreshed: "refreshed.owl.carousel", | |
to: "to.owl.carousel", | |
next: "next.owl.carousel", | |
prev: "prev.owl.carousel", | |
drag: "drag.owl.carousel" | |
}, | |
refreshCarousels: function() { | |
jQuery(CNN.Carousel.carouselSelector) | |
.trigger(CNN.Carousel.events.refresh); | |
}, | |
owl: function(e) { | |
var t = this, | |
n = 30; | |
return this.$carousel = jQuery(e), this.$filmstrip = this.$carousel | |
.next(".js-owl-filmstrip"), this.isPaginatedCarousel = | |
this.$carousel.hasClass("carousel-small-paginated"), this | |
.isGallery = this.$filmstrip.length > 0 || this.isPaginatedCarousel, | |
this.isAutoHeight = this.isGallery || this.$carousel.is( | |
'[data-auto-height="true"]'), this.galleryHeightRatio = | |
null, this.isFullCarousel = this.$carousel.is( | |
".carousel--full"), this.isLargeStripCarousel = this.$carousel | |
.is(".carousel-large-strip"), this.hasSingleItem = 1 === | |
this.$carousel.data("slide-count"), jQuery.extend(this.$filmstrip, | |
this), jQuery.extend(this.$carousel, this), this.carouselAdjustNavigation = | |
function(e) { | |
var i = "4:3" === t.$carousel.data("cut-format") ? .75 : | |
"9:16" === t.$carousel.data("cut-format") ? 16 / 9 : | |
9 / 16, | |
o = t.$carousel.find(".owl-item") | |
.find(".el__resize, .media") | |
.width() * i, | |
s = o / 2 - n, | |
a = t.$carousel.find(".owl-prev, .owl-next"); | |
"true" === t.$carousel.attr("data-is-gallery") ? a.css( | |
"top", s + "px") : a.css("height", o + "px"), t.$carousel | |
.siblings(".ad-slide") | |
.find(".ad-slide__prev, .ad-slide__next") | |
.css("top", s + "px"); | |
}, this.makeLazy = function(e) { | |
e.find("img") | |
.each(function() { | |
var e, t = jQuery(this), | |
n = (t.attr("data-eq-state") || "") | |
.replace(/^(\\S+\\s+)*/, ""); | |
e = n ? "xsmall" === n ? "data-src-small" : | |
"data-src-" + n : "src", t.attr("data-src", t.attr( | |
e)) | |
.addClass("owl-lazy"); | |
}); | |
}, this.setNumberOfItems = function(e) { | |
var t, n = e.relatedTarget; | |
if (0 !== n._widths[0]) return t = n.settings.items > 1 ? | |
n.$element.width() / n._widths[0] : n.settings.items, | |
t > 1 && (n.settings.items = Math.ceil(t), n.settings | |
.slideBy = Math.floor(t), n.$element.trigger(CNN.Carousel | |
.events.refresh)), t; | |
}, this.resetThumbnails = function(e) { | |
var n = t.$filmstrip.find(".owl-item"); | |
n.find("img") | |
.css("opacity", 1); | |
}, this.setAspectRatio = function() { | |
function e(e) { | |
if (!e) return 1; | |
var t = /\\d+:\\d+/.exec(e.data("cutFormat")) || []; | |
return t = (t[0] || "16:9") | |
.split(":"), t = t[1] / t[0] * 100; | |
} | |
t.$carousel.data("gallery-ratio-set") || (t.$carousel.data( | |
"gallery-ratio-set", !0), t.galleryHeightRatio = | |
e(t.$carousel), t.$carousel.find( | |
".js-gallery-aspect-ratio-wrapper") | |
.css("padding-bottom", t.galleryHeightRatio + "%"), | |
t.$carousel.find("[data-cut-format]") | |
.each(function() { | |
var t = jQuery(this), | |
n = e(this.$carousel); | |
n < this.galleryHeightRatio ? t.css("padding", | |
(this.galleryHeightRatio - n) / 2 + "% 0") : | |
n > this.galleryHeightRatio && t.css( | |
"padding", "0 " + (1 - this.galleryHeightRatio / | |
n) / 2 * 100 + "%"); | |
})); | |
}, this.stagePadding = function() { | |
var e, n; | |
if (t.isFullCarousel && !t.isGallery) switch (n = ( | |
jQuery("body") | |
.attr("data-eq-state") || "") | |
.replace(/^(\\S+\\s+)*/, "")) { | |
case "xsmall": | |
e = 50; | |
break; | |
case "medium": | |
e = 100; | |
break; | |
case "large": | |
case "full16x9": | |
e = 150; | |
} else e = 0; | |
return e; | |
}, this.onResize = function(e) { | |
e.relatedTarget.options.stagePadding = t.stagePadding(), | |
t.$carousel.trigger(CNN.Carousel.events.refresh); | |
}, this.onMainCarouselChange = function(e) { | |
"position" === e.property.name && t.$filmstrip.data() && | |
setTimeout(function() { | |
var n = e.property.value - e.relatedTarget.clones() | |
.length / 2, | |
i = t.$filmstrip.data("owl.carousel") | |
._items.length - 1, | |
o = t.$filmstrip.find(".owl-item"); | |
n = -1 === n ? i : n > i ? 0 : n, o.removeClass( | |
"synced"), t.isGallerySlide() && (o.eq(n) | |
.addClass("synced"), t.$filmstrip.trigger(CNN | |
.Carousel.events.to, [n])); | |
}, 0); | |
}, this.onLazyImageLoaded = function(e) { | |
CNN.ResponsiveImages.process(CNN.DemandLoading.addElement( | |
e.element)); | |
}, this.onRefreshed = function(e) { | |
CNN.ResponsiveImages.queryEqjs(e.target); | |
}, this.onInitialized = function(e) { | |
t.setNumberOfItems(e), t.$carousel.on(CNN.Carousel.events | |
.changed, t.onMainCarouselChange), t.$carousel.on( | |
CNN.Carousel.events.resized, t.carouselAdjustNavigation | |
), t.$carousel.on(CNN.Carousel.events.resized, t.setNumberOfItems), | |
t.$carousel.on(CNN.Carousel.events.resized, t.resetThumbnails), | |
t.$carousel.on(CNN.Carousel.events.resized, t.onResize), | |
t.$carousel.on(CNN.Carousel.events.refreshed, t.onRefreshed), | |
t.$carousel.on(CNN.Carousel.events.refreshed, t.carouselAdjustNavigation), | |
t.$carousel.on(CNN.Carousel.events.loadedImage, | |
function(e) { | |
t.onLazyImageLoaded(e), t.onRefreshed(e), t.resetThumbnails( | |
e); | |
}); | |
}, this.addAnalyticsListeners = function(e) { | |
t.$carousel.find(".owl-nav > div") | |
.on("click", function(e) { | |
t.$carousel.trigger("carousel-action-event"); | |
}), t.$carousel.on(CNN.Carousel.events.dragged, | |
function(e) { | |
t.$carousel.trigger("carousel-action-event"); | |
}); | |
}, this.isGallerySlide = function() { | |
return !!t.$carousel.find( | |
".owl-item.active > div[data-slidename]") | |
.length; | |
}, this.makeLazy(this.$carousel), this.setAspectRatio(), | |
this.$carousel.on(CNN.Carousel.events.initialized, this.onInitialized), | |
this.$carousel.on(CNN.Carousel.events.navigationInitialized, | |
this.carouselAdjustNavigation), this.$carousel.on(CNN.Carousel | |
.events.navigationInitialized, this.addAnalyticsListeners | |
), this.$carousel.owlCarousel({ | |
addClassActive: !0, | |
nav: !0, | |
navText: ["", ""], | |
dots: this.isPaginatedCarousel, | |
lazyLoad: !0, | |
transitionStyle: this.isGallery ? "fadeIn" : !1, | |
slideBy: this.isFullCarousel ? 1 : "page", | |
slideSpeed: 300, | |
responsive: this.$carousel.hasClass("carousel--fixed") ? | |
!1 : {}, | |
responsiveBaseWidth: this.$carousel[0], | |
autoWidth: !this.isFullCarousel, | |
autoHeight: this.isAutoHeight, | |
items: this.isFullCarousel ? 1 : 3, | |
stagePadding: this.stagePadding(), | |
margin: this.isFullCarousel && !this.isGallery ? 20 : 0, | |
loop: !this.isPaginatedCarousel || !this.hasSingleItem, | |
mouseDrag: !this.hasSingleItem, | |
touchDrag: !this.hasSingleItem | |
}), this.isGallery && !this.isPaginatedCarousel && (this.reBindBigCarousel = | |
function(e) { | |
"position" === e.property.name && (t.$carousel.trigger( | |
"carousel-action-event"), t.$carousel.off(CNN.Carousel | |
.events.changed, t.reBindBigCarousel), t.$carousel | |
.on(CNN.Carousel.events.changed, t.onMainCarouselChange) | |
); | |
}, this.enableLastItem = function(e) { | |
var n = e.relatedTarget, | |
i = n.settings.items, | |
o = Math.abs(n._coordinates.slice(-1)[0]), | |
s = n._width, | |
a = n._widths[0], | |
r = Math.ceil((o - s) / a); | |
o > s && a > 0 && (t.resetThumbnails(e), n.settings.items = | |
i > 1 ? Math.floor(s / a) : i, n._coordinates[r - | |
1] = s % a - a * r, n.maximum = function(e) { | |
var t = this.settings, | |
i = this._width, | |
o = this._coordinates.length, | |
s = this._current > 0 ? this._coordinates[ | |
this._current - 1] : 0, | |
a = Math.abs(n._coordinates.slice(-1)[0]) - ( | |
i - s); | |
return o = t.loop ? this._clones.length / 2 + | |
this._items.length - 1 : t.autoWidth || t.merge ? | |
Math.ceil((a > i ? i - s : a - s) / this._widths[ | |
0]) : t.center ? this._items.length - 1 : | |
this._items.length - t.items, e && (o -= this | |
._clones.length / 2), Math.max(o, 0); | |
}); | |
}, this.onFilmstripChange = function(e) { | |
if ("items" === e.property.name) { | |
var n = t.$filmstrip.find(".synced") | |
.index() < e.item.index ? e.item.index : t.$filmstrip | |
.find(".synced") | |
.index(); | |
t.$filmstrip.find(".owl-item") | |
.removeClass("synced"), t.$filmstrip.find( | |
".owl-item") | |
.eq(n) | |
.addClass("synced"), t.$carousel.trigger(CNN.Carousel | |
.events.to, [n]); | |
} | |
}, this.onFilmstripItemClicked = function(e) { | |
var n = jQuery(e.currentTarget) | |
.index(), | |
i = t.$filmstrip.find(".owl-item"); | |
i.eq(n) | |
.hasClass("synced") || (i.removeClass("synced"), i.eq( | |
n) | |
.addClass("synced"), t.$carousel.off(CNN.Carousel | |
.events.changed, t.onMainCarouselChange), t.$carousel | |
.on(CNN.Carousel.events.changed, t.reBindBigCarousel), | |
t.$carousel.on(CNN.Carousel.events.changed, t.resetThumbnails), | |
t.$carousel.trigger(CNN.Carousel.events.to, [n])); | |
}, this.onFilmstripInit = function(e) { | |
t.setNumberOfItems(e), t.enableLastItem(e), t.$filmstrip | |
.find(".owl-item") | |
.eq(0) | |
.addClass("synced"), t.$filmstrip.on("click", | |
".owl-item", t.onFilmstripItemClicked), t.$filmstrip | |
.on(CNN.Carousel.events.changed, t.onFilmstripChange), | |
t.$filmstrip.on(CNN.Carousel.events.resized, t.setNumberOfItems), | |
t.$filmstrip.on(CNN.Carousel.events.resized, t.enableLastItem), | |
t.$filmstrip.on(CNN.Carousel.events.refreshed, t.enableLastItem); | |
}, this.makeLazy(this.$filmstrip), this.$filmstrip.on( | |
CNN.Carousel.events.initialized, this.onFilmstripInit | |
), this.$filmstrip.owlCarousel({ | |
items: 10, | |
autoWidth: !0, | |
lazyLoad: !0, | |
loop: !1, | |
nav: !0, | |
dots: !1, | |
navText: ["", ""], | |
responsiveRefreshRate: 100 | |
})), this; | |
}, | |
restore: function(e) { | |
var t, n = | |
".cn-collection-player.el__videoexperience__collection,.el__leafmedia--video-leaf-player.el__videoexperience__collection"; | |
CNN.Features.enableVideoExperienceUnification ? jQuery(CNN.Carousel | |
.carouselSelector, e) | |
.each(function() { | |
return t = jQuery(this), t.parents(n) | |
.length > 0 ? void Modernizr.on("phone", function(e) { | |
function n(e) { | |
CNN.Videx && (clearInterval(e.interval), CNN.Videx | |
.SeeMore.init(t)); | |
} | |
var i = { | |
interval: 0 | |
}; | |
return e ? (CNN.Carousel.manualImageLoad(t), | |
void(CNN.Videx ? CNN.Videx.SeeMore.init(t) : | |
i.interval = setInterval(jQuery.proxy(n, | |
window, i), 250))) : new CNN.Carousel.owl( | |
t); | |
}) : new CNN.Carousel.owl(this); | |
}) : jQuery(CNN.Carousel.carouselSelector, e) | |
.each(function() { | |
return new CNN.Carousel.owl(this); | |
}); | |
}, | |
manualImageLoad: function(e) { | |
e.find("img") | |
.each(function() { | |
var e, t = jQuery(this), | |
n = (t.attr("data-eq-state") || "") | |
.replace(/^(\\S+\\s+)*/, ""); | |
e = n ? "xsmall" === n ? "data-src-small" : | |
"data-src-" + n : "src", t.attr("data-src", t.attr( | |
e)) | |
.addClass("owl-lazy"), CNN.ResponsiveImages.process( | |
CNN.DemandLoading.addElement(t)); | |
}), CNN.ResponsiveImages.queryEqjs(e); | |
}, | |
init: function(e) { | |
CNN.Carousel.restore(e), jQuery(window) | |
.throttleEvent("resize", function() { | |
jQuery(CNN.Carousel.carouselSelector) | |
.trigger(CNN.Carousel.events.refresh); | |
}, 100), jQuery(window) | |
.on("orientationchange", function() { | |
jQuery(CNN.Carousel.carouselSelector) | |
.trigger(CNN.Carousel.events.refresh); | |
}); | |
} | |
} | |
}, { | |
prop: 'CNN.Carousel', | |
to: CNN.Carousel || {} | |
}], | |
'CNN.ads': [{ | |
prop: 'CNN.ads', | |
to: CNN.ads || {} | |
}], | |
'CNN.ads.events': [{ | |
prop: 'CNN.ads.events', | |
to: CNN.ads.events || function() { | |
function e(e, t) { | |
var i; | |
"undefined" != typeof e && "undefined" != typeof window.AMPTManager && | |
jQuery(e.target) | |
.parents(t.galleryParent) | |
.length && CNN.contentModel.pageType === t.pageType && CNN.Features | |
.enableEpicAds === !0 && (n++, i = t.adId || jQuery(t.toolParent) | |
.find(t.tool + ":first-child div") | |
.attr("id"), n % 2 === 0 && window.AMPTManager.refreshAd( | |
i)); | |
} | |
function t(t) { | |
var n = { | |
adId: "ad_rect_atf_01", | |
pageType: "article", | |
galleryParent: ".zn-large-media", | |
toolParent: ".pg-rail", | |
tool: ".ad-desktop" | |
}; | |
t = t || null, e(t, n); | |
} | |
var n = 0; | |
return { | |
refreshGalleryRailAd: t | |
}; | |
}() | |
}], | |
'CNN.ResponsiveImages': [{ | |
prop: 'CNN.ResponsiveImages', | |
to: {} | |
}], | |
'CNN.ResponsiveImages.process': [{ | |
prop: 'CNN.ResponsiveImages.process', | |
to: function(t) { | |
function n(e, t) { | |
var n, a, r, d = o.filter(e) | |
.filter(i) | |
.not(s); | |
for (r = 0, a = d.length; a > r; r++) n = d.eq(r), n.attr( | |
"src", n.data(t)); | |
s = s.add(d); | |
} | |
var i = "[data-demand-load=loaded]", | |
o = e(t), | |
s = e(); | |
n( | |
'.cd--horizontal[data-eq-state$="xsmall"] img[data-src-mini1x1], .cd--horizontal[data-eq-state$="small"] img[data-src-mini1x1]', | |
"src-mini1x1"), n( | |
'.zn[data-eq-state$="full16x9"] .zn-top img[data-src-full16x9]', | |
"src-full16x9"), n( | |
'img[data-eq-state$="mini"][data-src-mini]', "src-mini"), n( | |
'img[data-eq-state$="xsmall"][data-src-xsmall]', | |
"src-xsmall"), n( | |
'img[data-eq-state$="small"][data-src-small]', "src-small"), | |
n('img[data-eq-state$="medium"][data-src-medium]', | |
"src-medium"), n( | |
'img[data-eq-state$="large"][data-src-large]', "src-large"); | |
} | |
}], | |
'CNN.ResponsiveImages.queryEqjs': [{ | |
prop: 'CNN.ResponsiveImages.queryEqjs', | |
to: function(n) { | |
var i = CNN.Utils.existsObject(n), | |
o = i ? e(n) | |
.filter("[data-eq-pts]") : e("[data-eq-pts]"), | |
s = []; | |
i && 0 === o.length && (o = e(n) | |
.find("[data-eq-pts]")), s = o instanceof jQuery ? o.toArray() : | |
o, 0 !== s.length && t.query(s, function() { | |
CNN.DemandLoading.allLoaded || CNN.DemandLoading.update(), | |
o.length > 0 && CNN.ResponsiveImages.process(o); | |
}); | |
} | |
}], | |
'CNN.ResponsiveImages.scroll': [{ | |
prop: 'CNN.ResponsiveImages.scroll', | |
to: function() { | |
if (CNN._zonesAndDomReadyEvent && (CNN.DemandLoading.pageBottom || | |
CNN.DemandLoading.allLoaded)) e(window) | |
.off("scroll.responsiveImages"); | |
else { | |
var t = CNN.DemandLoading.update(); | |
t.length > 0 && CNN.ResponsiveImages.process(t); | |
} | |
} | |
}], | |
'CNN.ResponsiveImages.reload': [{ | |
prop: 'CNN.ResponsiveImages.reload', | |
to: function() { | |
var e = CNN.DemandLoading.reProcess(); | |
e.length > 0 && CNN.ResponsiveImages.process(e); | |
} | |
}], | |
'CNN.ResponsiveImages.processChildrenImages': [{ | |
prop: 'CNN.ResponsiveImages.processChildrenImages', | |
to: function(e) { | |
var n = CNN.contentModel && "boolean" == typeof CNN.contentModel | |
.lazyLoad ? CNN.contentModel.lazyLoad : !1, | |
i = CNN.contentModel && "boolean" == typeof CNN.contentModel.enablePictureFill ? | |
CNN.contentModel.enablePictureFill : !1; | |
n && i ? window.picturefill && picturefill() : t.query(e.querySelectorAll( | |
"[data-eq-pts]"), function(e) { | |
e.length > 0 && CNN.ResponsiveImages.process(e); | |
}); | |
} | |
}], | |
'CNN.ResponsiveImages.resize': [{ | |
prop: 'CNN.ResponsiveImages.resize', | |
to: function() { | |
CNN.ResponsiveImages.queryEqjs(document); | |
} | |
}], | |
'CNN.LocatorMap': [{ | |
prop: 'CNN.LocatorMap', | |
to: function(t) { | |
"undefined" != typeof t && "undefined" != typeof t.id && (a.data = | |
t, a.$mapCanvas = e(n.getElementById("mapToolCanvas-" + a.data | |
.id)), o()); | |
} | |
}], | |
'CNN.VideoAjax': [{ | |
prop: 'CNN.VideoAjax', | |
to: CNN.VideoAjax || function() { | |
return function(e) { | |
var t = {}, | |
n = { | |
id: "VideoAjax", | |
eventName: "CNN_VideoAjax_autoUpdated", | |
ajaxFrequency: 3e5 | |
}; | |
return t.config = jQuery.extend({}, n, e), t.autoUpdateEvent = | |
jQuery.Event(t.config.eventName), t.fetchOnNowTimer = | |
null, t.isFetching = !1, t.serverData = null, t.logError = | |
function(e, t) { | |
if ("undefined" != typeof t) throw t; | |
throw e; | |
}, t.updateOnNowData = function() { | |
this.fetchExternalData(jQuery.proxy(function(e) { | |
this.serverData = e, jQuery(document) | |
.trigger(this.autoUpdateEvent); | |
}, this)); | |
}, t.id = t.config.id, t.init = function() { | |
this.updateOnNowData(), this.startPeriodicFetch(); | |
}, t.stopPeriodicFetch = function() { | |
null !== this.fetchOnNowTimer && (clearInterval(this.fetchOnNowTimer), | |
this.fetchOnNowTimer = null); | |
}, t.startPeriodicFetch = function() { | |
null === this.fetchOnNowTimer && (this.fetchOnNowTimer = | |
setInterval(jQuery.proxy(this.updateOnNowData, this), | |
this.config.ajaxFrequency)); | |
}, t.fetchExternalData = function() { | |
throw "fetchExternalData in the ajax was intended to be overridden."; | |
}, t.filterNetwork = function(e) { | |
var t = 0, | |
n = null; | |
if ("undefined" != typeof this.serverData && null !== | |
this.serverData) { | |
for (t = this.serverData.channel.length - 1; t >= 0; t--) | |
if (this.serverData.channel[t].id.toLowerCase() === | |
e.toLowerCase()) { | |
n = this.serverData.channel[t]; | |
break; | |
} | |
return n; | |
} | |
}, t.getServerData = function() { | |
return this.serverData; | |
}, t.getEventName = function() { | |
return this.config.eventName; | |
}, t.getIsFetching = function() { | |
return this.isFetching; | |
}, t.setIsFetching = function(e) { | |
this.isFetching = e; | |
}, t; | |
}; | |
}() | |
}], | |
'CNN.VideoAjax.NowPlaying': [{ | |
prop: 'CNN.VideoAjax.NowPlaying', | |
to: CNN.VideoAjax.NowPlaying || function() { | |
var e = CNN.VideoAjax({ | |
id: "NowPlaying", | |
eventName: "CNN_NowPlaying_autoUpdated" | |
}); | |
return e.fetchExternalData = function(t) { | |
if (e.getIsFetching() !== !0) { | |
if ("undefined" == typeof t || "function" != typeof t) | |
throw "callback parameter is not defined or is not a function. Ajax request was not sent."; | |
e.setIsFetching(!0), jQuery.ajax({ | |
url: "/web/20160903014131/http://data.cnn.com/jsonp/video/nowPlayingSchedule.json", | |
type: "get", | |
error: function(t, n) { | |
e.logError(t, n); | |
}, | |
success: function(e) { | |
t(e); | |
}, | |
timeout: function(t, n) { | |
e.logError(t, n); | |
}, | |
complete: function() { | |
e.setIsFetching(!1); | |
}, | |
dataType: "jsonp", | |
jsonpCallback: "nowPlayingScheduleCallbackWrapper" | |
}); | |
} | |
}, e; | |
}() | |
}], | |
'CNN.VideoAjax.LiveStream': [{ | |
prop: 'CNN.VideoAjax.LiveStream', | |
to: CNN.VideoAjax.LiveStream || function() { | |
var e = CNN.VideoAjax({ | |
id: "LiveStream", | |
eventName: "CNN_LiveEvent_autoUpdated" | |
}); | |
return e.fetchExternalData = function(t) { | |
function n(t) { | |
return jQuery.ajax({ | |
url: "/CNNLiveFlash/StreamStatus/metadata/stream_dvr_" + | |
t + ".xml", | |
type: "get", | |
error: function(t, n) { | |
e.logError(t, n); | |
}, | |
success: function(e) { | |
o["live" + t] = { | |
xml: e, | |
thumbnail: void 0, | |
isStreaming: !1 | |
}; | |
}, | |
timeout: function(t, n) { | |
e.logError(t, n); | |
}, | |
dataType: "xml", | |
crossDomain: !1 | |
}); | |
} | |
function i() { | |
var e, t = [], | |
n = {}; | |
for (e in o) e in o && "undefined" != typeof o[e].isStreaming && | |
o[e].isStreaming !== !1 && (n = jQuery(o[e].xml) | |
.find("stream") | |
.first(), t.push({ | |
id: o[e].id, | |
url: n.find("affiliate url") | |
.text(), | |
kicker: n.find("affiliate headline") | |
.text(), | |
program: n.find("title") | |
.text(), | |
images: { | |
"120x68": o[e].thumbnail | |
}, | |
description: n.find("description") | |
.text(), | |
streamIndex: o[e].index | |
})); | |
return t.sort(function(e, t) { | |
return parseInt(e.streamIndex, 10) - parseInt(t.streamIndex, | |
10); | |
}), { | |
channel: t | |
}; | |
} | |
var o = {}; | |
if (e.getIsFetching() !== !0) { | |
if ("undefined" == typeof t || "function" != typeof t) | |
throw "callback parameter is not defined or is not a function. Ajax request was not sent."; | |
e.setIsFetching(!0), jQuery.when(n(1), n(2), n(3), n(4)) | |
.done(function() { | |
jQuery.ajax({ | |
url: "/.element/ssi/www/auto/2.0/video/xml/pipeline.xml", | |
type: "get", | |
error: function(t, n) { | |
e.logError(t, n); | |
}, | |
success: function(n) { | |
var s = 0, | |
a = "", | |
r = jQuery(n) | |
.find("video"); | |
for (s = r.length - 1; s >= 0; s--) a = | |
parseInt(r.eq(s) | |
.find("video_url") | |
.text() | |
.substring(7), 10), isNaN(a) || (o[ | |
"live" + a].id = "live-" + a, o[ | |
"live" + a].thumbnail = r.eq(s) | |
.find("image_url") | |
.text(), o["live" + a].isStreaming = ! | |
0, o["live" + a].streamIndex = a); | |
e.setIsFetching(!1), t(i()); | |
}, | |
timeout: function(t, n) { | |
e.logError(t, n); | |
}, | |
dataType: "xml", | |
crossDomain: !1 | |
}); | |
}); | |
} | |
}, e; | |
}() | |
}], | |
'CNN.Features': [{ | |
prop: 'CNN.Features', | |
to: CNN.Features || {} | |
}], | |
'CNN.VideoEndSlateBase': [{ | |
prop: 'CNN.VideoEndSlateBase', | |
to: function(e, t) { | |
this.endSlateFlag = "boolean" == typeof t ? t : "boolean" == | |
typeof CNN.Features.enableVideoEndSlate ? CNN.Features.enableVideoEndSlate : | |
!0, this.containerId = e, this.initialize(); | |
} | |
}], | |
'CNN.VideoEndSlateBase.extend': [{ | |
prop: 'CNN.VideoEndSlateBase.extend', | |
to: function(e, t) { | |
var n, i = t.prototype; | |
t.prototype = Object.create(e.prototype); | |
for (n in i) t.prototype[n] = i[n]; | |
t.prototype.constructor = t; | |
try { | |
Object.defineProperty(t.prototype, "constructor", { | |
enumerable: !1, | |
value: t | |
}); | |
} catch (o) {} | |
} | |
}], | |
'CNN.VideoEndSlateBase.prototype': [{ | |
prop: 'CNN.VideoEndSlateBase.prototype', | |
to: { | |
getVideoPlayerContainerId: function() { | |
return this.containerId; | |
}, | |
renderRecommendedVideos: function(e, t) { | |
function n(e) { | |
return e.stopPropagation(), e.preventDefault(), !1; | |
} | |
var i = e.data("owl.carousel"); | |
this.setResponsiveState(), e.empty() | |
.append(t), e.on(CNN.Carousel.events.change, n), e.on(CNN.Carousel | |
.events.changed, n), e.on(CNN.Carousel.events.drag, n), e | |
.on(CNN.Carousel.events.initialize, n), e.on(CNN.Carousel.events | |
.initialized, n), e.on(CNN.Carousel.events.resized, n), e | |
.on(CNN.Carousel.events.navigationInitialized, n), | |
"undefined" != typeof i && i.destroy(), e.owlCarousel({ | |
mouseDrag: !0, | |
touchDrag: !0, | |
nav: !0, | |
navText: ["", ""], | |
dots: !1, | |
autoWidth: !0, | |
autoHeight: !0, | |
margin: 20, | |
rewindNav: !0, | |
responsive: !1, | |
scrollPerPage: !1, | |
items: 3, | |
itemsDesktop: [1100, 3], | |
itemsDesktopSmall: [900, 3], | |
itemsTablet: [600, 2], | |
itemsMobile: !1, | |
loop: !0 | |
}); | |
}, | |
getRecommendedVideos: function(e) { | |
var t, n = this.getRelatedContentUrl(), | |
i = "end-slate-carousel" + Math.floor(100 * Math.random()); | |
return t = n.substring(n.indexOf("/video/data/3.0")), jQuery.Deferred( | |
function(n) { | |
jQuery.ajax({ | |
url: t, | |
type: "GET", | |
dataType: "json", | |
error: function(e, t, n) { | |
"undefined" != typeof console && console.log( | |
n); | |
}, | |
success: function(t) { | |
var o = { | |
relatedVideos: { | |
id: i, | |
containerContents: [], | |
layout: "carousel-medium-strip", | |
type: "container" | |
} | |
}; | |
"undefined" != typeof t && null !== t && | |
"undefined" != typeof t.videos && (jQuery(t | |
.videos) | |
.each(function(e, t) { | |
o.relatedVideos.containerContents.push({ | |
cardContents: { | |
headlineText: t.headline, | |
iconType: "video", | |
media: { | |
contentType: "image", | |
cutFormat: "16:9", | |
duration: t.duration, | |
elementContents: { | |
imageAlt: t.headline, | |
imageUrl: t.thumbnail_url, | |
cuts: { | |
small: { | |
uri: t.endslate_url_small | |
}, | |
medium: { | |
uri: t.endslate_url_medium | |
}, | |
large: { | |
uri: t.endslate_url_large | |
} | |
}, | |
type: "element" | |
} | |
}, | |
type: "card", | |
url: t.clickback_url.substring( | |
"/video/?/video") | |
.replace("/video/?/video", | |
"/videos"), | |
videoId: t.id | |
}, | |
contentType: "video", | |
type: "card" | |
}); | |
}), dust.render( | |
"views/pages/common/video-end-slate-carousel", | |
o, | |
function(t, n) { | |
e.push(n); | |
})), n.resolve(); | |
} | |
}); | |
}) | |
.promise(); | |
}, | |
setCurrentVideoHeadline: function(e) { | |
var t, n = this.getEndSlateForContainer(this.getContainerId()), | |
i = JSON.parse(e); | |
"undefined" != typeof n && n && (t = jQuery(n) | |
.find(".js-cd__headline-text"), t && t.text(i.headline)); | |
}, | |
fetchAndShowRecommendedVideos: function(e, t) { | |
var n, i = [], | |
o = | |
".js-video__end-slate__tertiary .js-video__end-slate__carousel"; | |
t = t || !0, this.$videoEndSlate = this.getEndSlateForContainer(), | |
this.setCurrentVideoHeadline(e), n = this.$videoEndSlate.find( | |
o), this.setRelatedContentUrl(e), t && this.fetchRecommendedVideos( | |
n, i); | |
}, | |
fetchRecommendedVideos: function(e, t) { | |
var n = this; | |
jQuery.when(this.getRecommendedVideos(t)) | |
.done(function() { | |
n.renderRecommendedVideos(e, t); | |
}); | |
}, | |
destroy: function() { | |
var e = this.getCurrentCarousel(), | |
t = e.data("owl.carousel"); | |
this.hideEndSlateForContainer(), e.empty(), "undefined" != | |
typeof t && t.destroy(); | |
}, | |
getCurrentCarousel: function() { | |
var e, t = | |
".js-video__end-slate__tertiary .js-video__end-slate__carousel"; | |
return this.$videoEndSlate = this.getEndSlateForContainer(), | |
e = this.$videoEndSlate.find(t); | |
}, | |
setResponsiveState: function(e) { | |
e = e || !1, "undefined" != typeof this.getContainerId() && | |
"undefined" == typeof $videoEndSlate && (this.$videoEndSlate = | |
this.getEndSlateForContainer()), eqjs.query(this.$videoEndSlate), | |
e && this.showEndSlateForContainer(); | |
}, | |
getContainerId: function() { | |
return this.containerId; | |
}, | |
onReplayClickedHandler: function() { | |
var e = this.getEndSlateForContainer(); | |
e.removeClass("video__end-slate--active") | |
.addClass("video__end-slate--inactive"), window.cnnVideoManager | |
.getPlayerByContainer(this.getVideoPlayerContainerId()) | |
.replay(); | |
}, | |
initialize: function() { | |
this.addEventListeners(); | |
}, | |
addEventListeners: function() { | |
var e = this.getEndSlateForContainer(); | |
e.on("click", ".js-video__end-slate__replay", jQuery.proxy( | |
this.onReplayClickedHandler, this)), e.on("click", | |
".js-video__end-slate__replay-text", jQuery.proxy(this.onReplayClickedHandler, | |
this)), e.on("click", ".js-el__video__replayer-wrapper", | |
jQuery.proxy(this.onReplayClickedHandler, this)); | |
}, | |
removeEventListeners: function() { | |
var e = this.getEndSlateForContainer(); | |
e.off("click", ".js-video__end-slate__replay"), e.off("click", | |
".js-video__end-slate__replay-text"); | |
}, | |
handleShowEndSlate: function(e) { | |
"undefined" != typeof e && null !== e && (this.setResponsiveState(), | |
e.removeClass("video__end-slate--inactive") | |
.addClass("video__end-slate--active")); | |
}, | |
handleHideEndSlate: function(e) { | |
"undefined" != typeof e && null !== e && (this.setResponsiveState(), | |
e.removeClass("video__end-slate--active") | |
.addClass("video__end-slate--inactive")); | |
}, | |
hideEndSlateForContainer: function() { | |
var e = this.getEndSlateForContainer(); | |
this.handleHideEndSlate(e); | |
}, | |
showEndSlateForContainer: function() { | |
var e = this.getEndSlateForContainer(); | |
this.handleShowEndSlate(e); | |
}, | |
setRelatedContentUrl: function(e) { | |
var t; | |
t = JSON.parse(e), this.relatedContentUrl = t.relatedVideosJson; | |
}, | |
getRelatedContentUrl: function() { | |
return this.relatedContentUrl; | |
}, | |
getEndSlateElement: function() { | |
return this.$videoEndSlate; | |
}, | |
isEndSlateEnabled: function() { | |
return this.endSlateFlag; | |
} | |
} | |
}], | |
'CNN.VideoEndSlate': [{ | |
prop: 'CNN.VideoEndSlate', | |
to: function(e, t) { | |
this.relatedContentUrl = "", this.$videoEndSlate = {}, CNN.VideoEndSlateBase | |
.call(this, e, t); | |
} | |
}], | |
'CNN.VideoEndSlate.prototype': [{ | |
prop: 'CNN.VideoEndSlate.prototype', | |
to: { | |
getEndSlateForContainer: function() { | |
var e = jQuery(document.getElementById(this.getContainerId())) | |
.parent() | |
.find(".js-video__end-slate") | |
.eq(0); | |
return e; | |
} | |
} | |
}], | |
'CNN.JumbotronVideoEndSlate': [{ | |
prop: 'CNN.JumbotronVideoEndSlate', | |
to: function(e, t) { | |
this.jumbotron = e, this.mode = t || "desktop", CNN.VideoEndSlate | |
.call(this, jQuery(e.jumbotronElementRaw) | |
.attr("id"), !0); | |
} | |
}], | |
'CNN.JumbotronVideoEndSlate.prototype': [{ | |
prop: 'CNN.JumbotronVideoEndSlate.prototype', | |
to: { | |
addEventListeners: function() { | |
CNN.VideoEndSlateBase.prototype.addEventListeners.call(this), | |
"undefined" != typeof this.jumbotron && (jQuery(this.jumbotron | |
.jumbotronElementRaw) | |
.on("CVPEvent", jQuery.proxy(this.onVideoEventHandler, | |
this)), jQuery(this.jumbotron) | |
.on("jumbotron-item-selected", jQuery.proxy(this.hideEndSlateForContainer, | |
this)), jQuery(this.jumbotron) | |
.on("jumbotron-mode-change", jQuery.proxy(this.onJumbotronModeChangeHandler, | |
this))); | |
}, | |
removeEventListeners: function() { | |
CNN.VideoEndSlateBase.prototype.removeEventListeners.call( | |
this), "undefined" != typeof this.jumbotron && (jQuery( | |
this.jumbotron.jumbotronElementRaw) | |
.off("CVPEvent"), jQuery(this.jumbotron) | |
.off("jumbotron-item-selected"), jQuery(this.jumbotron) | |
.off("jumbotron-mode-change")); | |
}, | |
onJumbotronModeChangeHandler: function(e, t) { | |
this.mode = t, this.destroy(); | |
}, | |
onVideoEventHandler: function(e, t) { | |
if (t && t.eventType) switch (t.eventType) { | |
case "onContentMetadata": | |
this.fetchAndShowRecommendedVideos(t.metadata, "mobile" !== | |
this.mode); | |
break; | |
case "onContentComplete": | |
this.showEndSlateForContainer(); | |
break; | |
case "onContentPlay": | |
this.hideEndSlateForContainer(); | |
} | |
}, | |
getVideoPlayerContainerId: function() { | |
try { | |
var e = jQuery(jQuery(document.getElementById(this.getContainerId())) | |
.find(".js-jumbotron-video-player") | |
.eq(0)); | |
return e.attr("id"); | |
} catch (t) { | |
return this.containerId; | |
} | |
}, | |
getEndSlateForContainer: function() { | |
var e = jQuery(document.getElementById(this.getContainerId())) | |
.find(".js-video__end-slate") | |
.eq(0); | |
return e; | |
} | |
} | |
}], | |
'CNN.VideoConfig': [{ | |
prop: 'CNN.VideoConfig', | |
to: CNN.VideoConfig || {} | |
}], | |
'CNN.VideoPlayer': [{ | |
prop: 'CNN.VideoPlayer', | |
to: CNN.VideoPlayer || {} | |
}], | |
'CNN.VideoPlayer.SimpleEmbedCodeCopy': [{ | |
prop: 'CNN.VideoPlayer.SimpleEmbedCodeCopy', | |
to: function(e, t, n) { | |
this.videoContainerId = e, this.embedDivId = t, this.parentElement = | |
jQuery(n); | |
} | |
}], | |
'CNN.VideoPlayer.SimpleEmbedCodeCopy.prototype': [{ | |
prop: 'CNN.VideoPlayer.SimpleEmbedCodeCopy.prototype', | |
to: { | |
onSuccessfulCopy: function() { | |
"undefined" != typeof this.parentElement && (this.parentElement | |
.find(".metadata__embed-video-confirmation") | |
.remove(), this.parentElement.append( | |
'<span class="metadata__embed-video-confirmation"><p>Embed Code copied successfully</p></span>' | |
), setTimeout(jQuery.proxy(function() { | |
jQuery(this.parentElement.find( | |
".metadata__embed-video-confirmation")) | |
.slideUp(500); | |
}, this), 3e3)); | |
}, | |
generateEmbedContainer: function() { | |
"undefined" != typeof this.parentElement && (this.parentElement | |
.find(this.getEmbedContainerId()) | |
.remove(), this.movieDivId = this.getEmbedContainerId() + | |
"--movie", this.parentElement.append( | |
'<span class="metadata__embed-video-button" id="' + | |
this.getEmbedContainerId() + '"><div id="' + this.movieDivId + | |
'"/></span>')); | |
}, | |
getEmbedContainer: function() { | |
var e = this.getEmbedContainerId(); | |
return jQuery("#" + e); | |
}, | |
getEmbedContainerId: function() { | |
return this.embedDivId; | |
}, | |
getVideoContainerId: function() { | |
return this.videoContainerId; | |
}, | |
show: function(e) { | |
var t, n, i, o = "successCallback" + this.getVideoContainerId(), | |
s = this.getEmbedContainer(); | |
t = window[o] = jQuery.proxy(this.onSuccessfulCopy, this), | |
"object" == typeof e && "undefined" != typeof e.isEmbeddable && | |
"false" !== e.isEmbeddable && "no" !== e.isEmbeddable && s && | |
"undefined" != typeof CVP && "undefined" != typeof CNN.VideoConfig | |
.embedLinks && "undefined" != typeof CNN.VideoConfig.embedLinks | |
.clipboardOperationsSWF ? (n = CNN.VideoConfig.embedLinks.embedLinkPattern, | |
n = n.replace("{host}", window.location.hostname) | |
.replace("{videoId}", e.id), i = CNN.VideoConfig.embedLinks | |
.buttonImage, i = i.replace("{cdnassetpath}", | |
"/web/20160903014131/http://www.i.cdn.cnn.com/.a") | |
.replace("{build}", "1.292.4"), (!Array.isArray(s) || s.length <= | |
0) && this.generateEmbedContainer(), CVP.swfobject.embedSWF( | |
CNN.VideoConfig.embedLinks.clipboardOperationsSWF, this | |
.movieDivId, "80px", "21px", "10.0.0", CNN.VideoConfig.embedLinks | |
.clipboardOperationsSWF + "?nocache=" + new Date() | |
.valueOf(), { | |
callback: 'window["' + o + '"]', | |
buttonImage: i, | |
copyValue: n, | |
xOffset: CNN.VideoConfig.embedLinks.imageButtonXOffset, | |
yOffset: CNN.VideoConfig.embedLinks.imageButtonYOffset | |
}, { | |
allowScriptAccess: "always", | |
quality: "high", | |
wmode: "transparent" | |
}, {})) : this.hide(); | |
}, | |
hide: function() { | |
this.getEmbedContainer() && this.getEmbedContainer() | |
.remove(); | |
} | |
} | |
}], | |
'CNN.Feeds': [{ | |
prop: 'CNN.Feeds', | |
to: CNN.Feeds || {} | |
}], | |
'CNN.EditionPrefs': [{ | |
prop: 'CNN.EditionPrefs', | |
to: CNN.EditionPrefs || function(e) { | |
function t() { | |
n(), i(); | |
} | |
function n() { | |
l.on("click", ".js-edition-preferences__confirm", s); | |
} | |
function i() { | |
jQuery(".js-edition-option") | |
.prop("checked", !1) | |
.filter('[data-type="' + m + '"]') | |
.prop("checked", !0), jQuery( | |
".js-edition-preferences__choice") | |
.prop("checked", !1) | |
.filter('[value="' + m + '"]') | |
.prop("checked", !0); | |
} | |
function o(e, t) { | |
a(e, c), CNN.EditionPicker.togglePicker(), CNN.EditionPicker.changeEdition(! | |
1, t); | |
} | |
function s(t) { | |
var n = e(t.currentTarget) | |
.parent(), | |
i = n.find("input") | |
.filter(":checked"); | |
o(i.val(), i.parent()); | |
} | |
function a(e, t) { | |
CNN.Utils.setCNNCookie(u, e, t); | |
} | |
function r() { | |
setTimeout(function() { | |
l.removeClass("list--set"); | |
}, 0); | |
} | |
function d(t) { | |
e(t.currentTarget) | |
.closest(".js-edition-picker__list") | |
.addClass("list--set"); | |
} | |
var l = e(".js-edition-picker__list"), | |
c = 854400, | |
u = "PreferredEdition", | |
h = "international" === CNN.contentModel.edition ? "edition" : | |
"www", | |
f = CNN.Utils.getCookie(u), | |
m = CNN.Utils.exists(f) ? f : h; | |
return t(), { | |
showPreferences: d, | |
hidePreferences: r, | |
indicateCurrentEdition: i | |
}; | |
}(jQuery) | |
}], | |
'CNN.EditionPickerPrefs': [{ | |
prop: 'CNN.EditionPickerPrefs', | |
to: CNN.EditionPickerPrefs || function(e) { | |
function t() { | |
n(); | |
} | |
function n() { | |
jQuery(".js-edition-confirm") | |
.on("click", s); | |
} | |
function i(e, t) { | |
CNN.Utils.setCNNCookie(r, e, t); | |
} | |
function o(e, t) { | |
i(e, a), CNN.PlainNavigation.toggleEdition(!1), CNN.PlainNavigation | |
.changeEdition(!1, t); | |
} | |
function s(e) { | |
e.preventDefault(); | |
var t = jQuery(e.target.form) | |
.children() | |
.filter("label") | |
.children() | |
.filter("input") | |
.filter(":checked"); | |
o(t.data("type"), t); | |
} | |
var a = 854400, | |
r = "PreferredEdition"; | |
return t(), { | |
init: t | |
}; | |
}(jQuery) | |
}], | |
'CNN.AdSlide': [{ | |
prop: 'CNN.AdSlide', | |
to: function(e, t, n) { | |
CNN.Features.enableGalleryAds && !CNN.Features.displayDisplayAds && | |
(this.wrapperId = e, this.wrapperEl = void 0, this.adSlideEl = | |
void 0, this.adPrevEl = void 0, this.adNextEl = void 0, | |
this.singleton = n, this.clickCounter = 0, this.initAdSlide( | |
e, t)); | |
} | |
}], | |
'CNN.AdSlide.prototype': [{ | |
prop: 'CNN.AdSlide.prototype', | |
to: { | |
getWrapper: function(e, t) { | |
var n, i; | |
return n = t ? e : "." + e, i = t ? jQuery(document.getElementById( | |
e)) | |
.eq(0) : jQuery(n) | |
.eq(0), this.wrapperEl = i, i; | |
}, | |
getAdSlide: function() { | |
var e, t = ".el-carousel__wrapper .ad-slide", | |
n = this.wrapperEl || this.getWrapper(); | |
return e = jQuery(n) | |
.find(t) | |
.eq(0), this.adSlideEl = e, e; | |
}, | |
getAdSlidePrev: function() { | |
var e, t = ".ad-slide__prev", | |
n = this.adSlideEl || this.getAdSlide(); | |
return e = jQuery(n) | |
.find(t) | |
.eq(0), this.adPrevEl = e, e; | |
}, | |
getAdSlideNext: function() { | |
var e, t = ".ad-slide__next", | |
n = this.adSlideEl || this.getAdSlide(); | |
return e = jQuery(n) | |
.find(t) | |
.eq(0), this.adNextEl = e, e; | |
}, | |
getSingletonAd: function(e) { | |
var t = this; | |
jQuery.getScript(this.singleton) | |
.done(function(e, n) { | |
jQuery(t) | |
.trigger("ad-single-loaded"); | |
}) | |
.fail(function(e, t, n) { | |
"object" == typeof console && "function" == typeof console | |
.log && console.log("Could not load singleton script"); | |
}); | |
}, | |
showAdSlide: function() { | |
var e, t = this.adSlideEl || this.getAdSlide(), | |
n = !0; | |
jQuery(document) | |
.on("GPTRenderComplete", function(i) { | |
"undefined" != typeof i.originalEvent.detail && null !== | |
i.originalEvent.detail && "undefined" != typeof i.originalEvent | |
.detail.pos && Array.isArray(i.originalEvent.detail.pos) && | |
i.originalEvent.detail.pos.length > 0 && "boolean" == | |
typeof i.originalEvent.detail.empty && (n = "mod" === | |
i.originalEvent.detail.pos[0] ? i.originalEvent.detail | |
.empty : !0, e = t.find("iframe"), e.length > 0 && | |
!n && t.removeClass("ad-slide--inactive") | |
.addClass("ad-slide--active")); | |
}); | |
}, | |
hideAdSlide: function() { | |
var e = this.adSlideEl || this.getAdSlide(); | |
e.removeClass("ad-slide--active") | |
.addClass("ad-slide--inactive"), this.removeCloseAd(), | |
"function" == typeof CNN.Carousel.refreshCarousels && | |
setTimeout(CNN.Carousel.refreshCarousels, 0); | |
}, | |
showAdHandler: function() { | |
this.showAdSlide(), this.bindCloseAd(); | |
}, | |
adTriggerHandler: function() { | |
var e = CNN.AdsConfig && CNN.AdsConfig.galleryAdClicks ? CNN.AdsConfig | |
.galleryAdClicks : 5; | |
this.clickCounter++, this.clickCounter === e && (this.clickCounter = | |
0, this.getSingletonAd(), jQuery(this) | |
.on("ad-single-loaded", this.showAdHandler)); | |
}, | |
closeAdHandler: function() { | |
this.removeCloseAd(), this.hideAdSlide(), this.clickCounter = - | |
1; | |
}, | |
bindWrapperClick: function() { | |
var e = this.wrapperEl || this.getWrapper(); | |
e.on("click", jQuery.proxy(this.adTriggerHandler, this)); | |
}, | |
bindCloseAd: function() { | |
var e = this.adPrevEl || this.getAdSlidePrev(), | |
t = this.adNextEl || this.getAdSlideNext(), | |
n = this.adSlideEl || this.getAdSlide(); | |
e.on("click", jQuery.proxy(this.closeAdHandler, this)), t.on( | |
"click", jQuery.proxy(this.closeAdHandler, this)), n.siblings( | |
".js-owl-filmstrip") | |
.one("click", jQuery.proxy(this.closeAdHandler, this)); | |
}, | |
initAdSlide: function(e, t) { | |
this.getWrapper(e, t), this.bindWrapperClick(), this.bindCloseAd(); | |
}, | |
removeWrapperClick: function() { | |
var e = this.wrapperEl || this.getWrapper(); | |
e.off("click"); | |
}, | |
removeCloseAd: function() { | |
var e = this.getAdSlidePrev(), | |
t = this.getAdSlideNext(); | |
e.off("click"), t.off("click"); | |
} | |
} | |
}], | |
'CNN.renderAds': [{ | |
prop: 'CNN.renderAds', | |
to: function(e, t, n) { | |
var i, o, s, a = jQuery(e) | |
.not(".m-navigation"); | |
for (o = 0, s = a.length; s > o; o++) | |
if (i = a.eq(o), i.parents(".zn-staggered") | |
.length) { | |
if (n.staggeredZone === !1) continue; | |
jQuery(i) | |
.next(t) | |
.append(i.val()); | |
} else "undefined" != typeof i[0] && jQuery(i) | |
.next(t) | |
.html(i.val()); | |
} | |
}], | |
'CNN.companionAdState': [{ | |
prop: 'CNN.companionAdState', | |
to: CNN.companionAdState || "" | |
}, { | |
prop: 'CNN.companionAdState', | |
to: "" | |
}, { | |
prop: 'CNN.companionAdState', | |
to: o.getCompanionAdStateLabel(i) | |
}], | |
'CNN.companion': [{ | |
prop: 'CNN.companion', | |
to: CNN.companion || {} | |
}, { | |
prop: 'CNN.companion', | |
to: t.extend({}, CNN.companion, { | |
registry: CNN.contentModel && CNN.contentModel.registryURL || | |
"", | |
knownEpicIds: {}, | |
config: CNN.contentModel && CNN.contentModel.companion || {}, | |
currentLayout: "", | |
updateCompanionLayout: function(n) { | |
var i, o, s, a, r = n, | |
d = ""; | |
if (n !== this.currentLayout && e.companionAdState && | |
this.config.layoutStates && this.config.layoutStates[e.companionAdState] && | |
(this.config.layoutStates[e.companionAdState][r] || (r = | |
"default"), s = this.config.layoutStates[e.companionAdState] | |
[r], s && t.isArray(s))) { | |
for (o = s.length - 1; o >= 0; o -= 1) i = s[o], a = | |
this.getTargetDOM(i), a && (a.innerHTML = this.getReplacementHTML( | |
i), d += a.innerHTML); | |
this.refreshAnyEpicIds(d), this.currentLayout = n; | |
} | |
}, | |
refreshAnyEpicIds: function(e) { | |
var n, i = this, | |
o = t(e) | |
.filter('[id^="ad_"]'); | |
o && 0 !== o.length && o.each(function() { | |
n = t(this) | |
.attr("id"), i.refreshEpicSlot(n); | |
}); | |
}, | |
getAdlib: function() { | |
var e = AMPTManager && AMPTManager.processNewRegistry && | |
AMPTManager.refreshAd && AMPTManager.registry; | |
return e || console.warn( | |
"companion.js: Could not find the AMPTManager! Using a mock object instead." | |
), e ? AMPTManager : { | |
registry: [], | |
processNewRegistry: function() {}, | |
refreshAd: function() {} | |
}; | |
}, | |
getEpicIdsFromRegistry: function() { | |
var e, n, i, o = this.getAdlib(); | |
for (this.knownEpicIds = {}, e = o.registry.length - 1; CNN >= | |
0; e -= 1) | |
if (t.isArray(o.registry[CNN])) | |
for (n = o.registry[CNN].length - 1; n >= 0; n -= 1) i = | |
o.registry[CNN][n] || {}, i.present && i.present === | |
!0 && i.rktr_slot_id && (this.knownEpicIds[i.rktr_slot_id] = | |
i.present); | |
return this.knownEpicIds; | |
}, | |
hasEpicId: function(e) { | |
var t = this.knownEpicIds; | |
return t[e] || (t = this.getEpicIdsFromRegistry()), t.hasOwnProperty( | |
e) && "boolean" == typeof t[e] ? t[e] : !1; | |
}, | |
refreshEpicRegistry: function() { | |
var e; | |
"" !== this.registry && (e = this.getAdlib(), e.processNewRegistry( | |
this.registry)); | |
}, | |
refreshEpicSlot: function(e) { | |
var t = this.getAdlib(); | |
this.hasEpicId(e) || this.refreshEpicRegistry(), t.refreshAd( | |
e); | |
}, | |
getTargetDOM: function(t) { | |
var n = e.MultiAds || {}, | |
i = !!(e.MultiAds && e.MultiAds.adGroups && e.MultiAds.domAds), | |
o = i && t && t.target ? n.adGroups[t.target] : {}, | |
s = null; | |
return "undefined" != typeof o && "number" == typeof o.active && | |
-1 !== o.active && (s = e.MultiAds.domAds[o.active]), s; | |
}, | |
getReplacementHTML: function(e) { | |
var t, i = ""; | |
return e && e.replace && "empty" !== e.replace && (t = n.querySelectorAll( | |
'textarea[data-ad-name="' + e.replace + '"]'), t && | |
t.length && t[0] && t[0].value && (i = t[0].value)), | |
i; | |
}, | |
initCompanionLayout: function() { | |
var e = this.config || {}; | |
e.enabled && "string" == typeof e.layoutType && | |
"function" == typeof this.updateCompanionLayout && this | |
.updateCompanionLayout(e.layoutType); | |
} | |
}) | |
}], | |
'CNN.contentModel.entitlementSingletons': [{ | |
prop: 'CNN.contentModel.entitlementSingletons', | |
to: [] | |
}], | |
CNN: [{ | |
prop: 'CNN', | |
to: "international" === CNN ? "CNNI" : "CNN" | |
}], | |
'CNN.slotTargets': [{ | |
prop: 'CNN.slotTargets', | |
to: CNN.slotTargets || {} | |
}], | |
'CNN.slotTargets[c]': [{ | |
prop: 'CNN.slotTargets[c]', | |
to: CNN.slotTargets[c] || {} | |
}], | |
'CNN.slotTargets[c].spec': [{ | |
prop: 'CNN.slotTargets[c].spec', | |
to: CNN.slotTargets[c].spec || d | |
}], | |
'CNN.RefreshAds': [{ | |
prop: 'CNN.RefreshAds', | |
to: CNN.RefreshAds || { | |
lastKnownViewportWidth: 0, | |
breakpoint1: 480, | |
breakpoint2: 782, | |
breakpoint3: 1024, | |
refreshAllAds: function() { | |
var e = this.getViewPortSize(); | |
(e.width >= this.breakpoint1 && this.lastKnownViewportWidth < | |
this.breakpoint1 || e.width <= this.breakpoint1 && this.lastKnownViewportWidth > | |
this.breakpoint1 || e.width >= this.breakpoint2 && this.lastKnownViewportWidth < | |
this.breakpoint2 || e.width <= this.breakpoint2 && this.lastKnownViewportWidth > | |
this.breakpoint2 || e.width >= this.breakpoint3 && this.lastKnownViewportWidth < | |
this.breakpoint3 || e.width <= this.breakpoint3 && this.lastKnownViewportWidth > | |
this.breakpoint3) && this.amptResizeAllAds(), this.lastKnownViewportWidth = | |
e.width; | |
}, | |
getViewPortSize: function() { | |
var t = 0; | |
return "number" == typeof n.innerWidth ? t = n.innerHeight : | |
i.documentElement && (i.documentElement.clientWidth || i.documentElement | |
.clientHeight) ? t = i.documentElement.clientHeight : i | |
.body && (i.body.clientWidth || i.body.clientHeight) && ( | |
t = i.body.clientHeight), { | |
width: e.CurrentWidth && "function" == typeof e.CurrentWidth | |
.getClientWidth ? e.CurrentWidth.getClientWidth() : 0, | |
height: t | |
}; | |
}, | |
amptResizeAllAds: function() { | |
var t = e.MultiAds && e.MultiAds.getAdlib ? e.MultiAds.getAdlib() : {}; | |
t.refreshAllAds && t.refreshAllAds(); | |
} | |
} | |
}], | |
'CNN.MultiAds': [{ | |
prop: 'CNN.MultiAds', | |
to: CNN.MultiAds || { | |
domAds: [], | |
updatedAds: [], | |
updatePosition: "desktop", | |
adGroups: {}, | |
adGroupIds: [], | |
getAdlib: function() { | |
var e = n[o], | |
t = e && e.processNewRegistry && e.refreshAd && e.requestAndRenderAds && | |
e.refreshAllAds; | |
return t || console.warn( | |
"cnn-epic-multi-ads::getAdlib: Could not find %s! Using a mock object instead.", | |
o), t ? e : { | |
processNewRegistry: function() {}, | |
refreshAd: function() {}, | |
requestAndRenderAds: function() {}, | |
refreshAllAds: function() {} | |
}; | |
}, | |
isEmptyNode: function(e) { | |
var t = null, | |
n = !0; | |
if (e.hasChildNodes()) { | |
for (t = CNN.firstChild; null !== t.nextSibling && t.nodeType !== | |
Node.ELEMENT_NODE;) t = t.nextSibling; | |
n = null !== t && t.nodeType !== Node.ELEMENT_NODE; | |
} | |
return t = null, n; | |
}, | |
isActive: function(e) { | |
var t; | |
return t = "function" == typeof n.getComputedStyle ? n.getComputedStyle( | |
e) | |
.getPropertyValue("display") : e.currentStyle.display, | |
"none" !== t; | |
}, | |
addAdTagToPage: function(e, t) { | |
var n, o, s, a = this; | |
a.isEmptyNode(e) && (s = e.getAttribute("data-ad-refresh"), | |
n = i.createElement("div"), o = "ad-" + t + (s ? | |
" ad-refresh-" + s : ""), n.setAttribute("id", t), n.setAttribute( | |
"class", o), e.appendChild(n)); | |
}, | |
removeAdTagFromPage: function(e) { | |
var t = this; | |
if (!t.isEmptyNode(e)) | |
for (; CNN.firstChild;) CNN.removeChild(CNN.firstChild); | |
}, | |
allDone: function(n, i) { | |
var o = e.MultiAds.getAdlib(); | |
n = n || !1, i = i || [], t("body") | |
.addClass("multi-ads--complete"), "string" == typeof s && | |
"" !== s && (n ? o.queueRegistry(s, { | |
slots: i | |
}) : o.queueRegistry(s)); | |
}, | |
getPlaceholderOnlyIds: function() { | |
var t = e.contentModel && e.contentModel.companion && e.contentModel | |
.companion.enabled, | |
n = t ? e.contentModel.companion.ids || {} : {}; | |
return n; | |
}, | |
handleAdStatus: function() {}, | |
loadSingleton: function(e) { | |
return t.ajax({ | |
url: e, | |
type: "GET", | |
dataType: "script", | |
cache: !0, | |
error: function(t, n, i) { | |
console.error("Could not load singleton script: " + | |
e); | |
} | |
}); | |
}, | |
setExactSingleton: function(e) { | |
var n, i, o, s, a, r, d, l = this, | |
c = ".js-doubleton-info", | |
u = ".owl-item", | |
h = "ad-doubleton", | |
f = "cloned", | |
m = ".ad-doubleton"; | |
d = t(m), d.length && t.each(d, function() { | |
a = t(this), r = a.parent() | |
.siblings(c), n = a.closest(u) | |
.hasClass(f), i = a.hasClass(h), n ? (o = r.data( | |
"cloneid"), s = r.data("clonefile")) : (o = r.data( | |
"origid"), s = r.data("origfile")), a.attr("id", | |
o), i && (a.removeClass(h), a.addClass("ad-" + o)), | |
l.loadSingleton(s) | |
.success(l.handleAdStatus); | |
}); | |
}, | |
getDoubletons: function() { | |
var n, i, o = ".js-owl-carousel", | |
s = ".ad-doubleton"; | |
i = t(s), i.length && (n = i.eq(0) | |
.closest(o), n.on(e.Carousel.events.initialized, t.proxy( | |
this.setExactSingleton, this))); | |
}, | |
setupAdSpace: function(e, t) { | |
var n, i, o = this, | |
s = o.getPlaceholderOnlyIds(); | |
n = e.getAttribute("data-ad-id"), i = o.isActive(e), o.adGroups | |
.hasOwnProperty(n) || (o.adGroupIds.push(n), o.adGroups[n] = { | |
active: -1, | |
inactive: [] | |
}), i && -1 === o.adGroups[n].active && (o.adGroups[n].active = | |
t, "suppress" !== s[n] && o.addAdTagToPage(e, n)), i || | |
(o.adGroups[n].inactive.push(t), o.removeAdTagFromPage(e)); | |
}, | |
update: function(e) { | |
var t, n, o, s = this, | |
a = s.domAds.length, | |
r = [], | |
d = [], | |
l = []; | |
if (e = e || [], 0 !== e.length) { | |
for (t = 0; t < CNN.length; t++) r.push(CNN[t] + | |
" [data-ad-id]"); | |
if (d = [].slice.call(i.querySelectorAll(r.join(", "))), | |
d.length > 0) { | |
for (t = d.length - 1; t >= 0; t -= 1) n = d[t].getAttribute( | |
"data-ad-id"), o = d[t].getAttribute( | |
"data-ad-position"), o !== s.updatePosition || s.updatedAds | |
.indexOf(n) >= 0 ? s.removeAdTagFromPage(d[t]) : (s.setupAdSpace( | |
d[t], a + t), -1 === l.indexOf(n) && (l.push(n), | |
s.updatedAds.push(n)), s.domAds.push(d[t])); | |
s.getDoubletons(), s.allDone(!0, l); | |
} | |
} | |
}, | |
init: function() { | |
var t, n = this, | |
o = e.RefreshAds.getViewPortSize(); | |
for (n.domAds = [].slice.call(i.querySelectorAll( | |
"[data-ad-id]")), o.width < CNN.RefreshAds.breakpoint2 ? | |
n.updatePosition = "mobile" : o.width >= CNN.RefreshAds.breakpoint2 && | |
o.width < CNN.RefreshAds.breakpoint3 && (n.updatePosition = | |
"tablet"), t = n.domAds.length - 1; t >= 0; t -= 1) n.setupAdSpace( | |
n.domAds[t], t); | |
n.getDoubletons(), n.allDone(); | |
} | |
} | |
}], | |
'CNN.RefreshAds.lastKnownViewportWidth': [{ | |
prop: 'CNN.RefreshAds.lastKnownViewportWidth', | |
to: t.width | |
}], | |
'CNN.Jumbotron': [{ | |
prop: 'CNN.Jumbotron', | |
to: CNN.Jumbotron || {} | |
}], | |
'CNN.Jumbotron.Bootstrapper': [{ | |
prop: 'CNN.Jumbotron.Bootstrapper', | |
to: CNN.Jumbotron.Bootstrapper || { | |
carouselSelector: ".js-owl-carousel", | |
jumbotronContainerSelector: ".js-jumbotron-container", | |
CONST_JUMBOTRON_LOAD_COMPLETE_EVENT: "jumbotron-initialization-complete", | |
jumbotronElements: [], | |
initialize: function() { | |
this.shouldLoadJumbotronDependencies() && this.loadJumbotronDependencies(); | |
}, | |
shouldLoadJumbotronDependencies: function() { | |
return this.jumbotronElements = jQuery(this.jumbotronContainerSelector), | |
"undefined" != typeof this.jumbotronElements && | |
"undefined" != typeof this.jumbotronElements.length && | |
this.jumbotronElements.length > 0; | |
}, | |
loadJumbotronDependencies: function() { | |
this.loadScript( | |
"/web/20160903014131/http://www.i.cdn.cnn.com/.a/1.292.4/js/jumbotron.min.js", | |
jQuery.proxy(this.onJumbotronDependencyLoadComplete, | |
this)); | |
}, | |
loadScript: function(e, t) { | |
var n = document.createElement("script"); | |
n.readyState ? n.onreadystatechange = function() { | |
"loaded" !== n.readyState && "complete" !== n.readyState || | |
(n.onreadystatechange = null, t()); | |
} : n.onload = function() { | |
t(); | |
}, n.src = e, document.getElementsByTagName("head")[0].appendChild( | |
n); | |
}, | |
onJumbotronDependencyLoadComplete: function() { | |
"undefined" != typeof CNN.Jumbotron.Manager && (window.cnnJumbotronManager || | |
(window.cnnJumbotronManager = new CNN.Jumbotron.Manager( | |
this.jumbotronElements)), jQuery(document) | |
.trigger(CNN.Jumbotron.Bootstrapper.CONST_JUMBOTRON_LOAD_COMPLETE_EVENT) | |
); | |
}, | |
onJumbotronDependencyLoadFailure: function() {} | |
} | |
}], | |
'CNN.AirportDelaysConfig': [{ | |
prop: 'CNN.AirportDelaysConfig', | |
to: CNN.AirportDelaysConfig || {} | |
}], | |
'CNN.AirportDelays': [{ | |
prop: 'CNN.AirportDelays', | |
to: {} | |
}], | |
'CNN.AirportDelays.airportDelaysBody': [{ | |
prop: 'CNN.AirportDelays.airportDelaysBody', | |
to: e(".cd--tool__weather-airport-delays") | |
}], | |
'CNN.AirportDelays.airportShortList': [{ | |
prop: 'CNN.AirportDelays.airportShortList', | |
to: ["EWR", "JFK", "LGA", "PHL"] | |
}], | |
'CNN.AirportDelays.airportLongList': [{ | |
prop: 'CNN.AirportDelays.airportLongList', | |
to: ["ATL", "BOS", "ORD", "DFW", "DEN", "DTW", "IAH", "LAS", "LAX", | |
"MIA", "MSP", "EWR", "JFK", "LGA", "MCO", "PHL", "PHX", "STL", | |
"SFO", "SEA", "IAD" | |
] | |
}], | |
'CNN.AirportDelays.requestAirportData': [{ | |
prop: 'CNN.AirportDelays.requestAirportData', | |
to: function(n) { | |
return e.ajax({ | |
url: t.AirportDelaysConfig.getAirportData + "/" + n, | |
type: "GET", | |
data: { | |
format: "application/json" | |
} | |
}); | |
} | |
}], | |
'CNN.AirportDelays.getDelayMinutes': [{ | |
prop: 'CNN.AirportDelays.getDelayMinutes', | |
to: function(e) { | |
var t = 0, | |
n = 0, | |
i = 0; | |
return e += "", e && (e.match(/(\\d+)\\s+minutes?/i) && (n = e.match( | |
/(\\d+)\\s+minutes?/i) | |
.length > 1 ? e.match(/(\\d+)\\s+minutes?/i)[1] / 1 : 0), | |
e.match(/(\\d+)\\s+hours?/i) && (i = e.match( | |
/(\\d+)\\s+hours?/i) | |
.length > 1 ? e.match(/(\\d+)\\s+hours?/i)[1] / 1 : 0), t = | |
n + 60 * i), t; | |
} | |
}], | |
'CNN.AirportDelays.formatDelayData': [{ | |
prop: 'CNN.AirportDelays.formatDelayData', | |
to: function(e) { | |
var n = {}, | |
i = e.status.avgDelay || e.status.minDelay || e.status.maxDelay || | |
"", | |
o = 0; | |
return "true" === e.delay ? (o = t.AirportDelays.getDelayMinutes( | |
i), o >= 45 ? (n.descriptionClass = "major", n.descriptionString = | |
"Major Delays") : o ? (n.descriptionClass = "minor", n.descriptionString = | |
"Minor Delays") : (n.descriptionClass = "minor", n.descriptionString = | |
"Delay")) : (n.descriptionClass = "none", n.descriptionString = | |
"No Delays"), n; | |
} | |
}], | |
'CNN.AirportDelays.processDelays': [{ | |
prop: 'CNN.AirportDelays.processDelays', | |
to: function(n) { | |
var o, s, a = [], | |
r = {}; | |
for (s = 0; s < n.length; s++) a.push(CNN.AirportDelays.requestAirportData( | |
n[s])); | |
o = e.when.apply(null, a), o.done(function() { | |
r.airports = [], e.each(arguments, function(e, n) { | |
var i = n[0], | |
o = CNN.AirportDelays.formatDelayData(i); | |
r.airports.push({ | |
airportCode: i.IATA, | |
airportCity: i.city, | |
airportState: i.state, | |
delayDescriptionString: o.descriptionString, | |
delayDescriptionClass: o.descriptionClass, | |
averageDelay: i.status.avgDelay || i.status.minDelay || | |
i.status.maxDelay || !1, | |
reason: i.status.reason.replace( | |
"this airport", i.IATA) | |
}); | |
}), r.timestamp = i() | |
.format("h:mm a, MMM Do"), r["$var-size"] = e( | |
".js-weather__delays") | |
.data("size"), dust.render( | |
"views/cards/tool/weather-airport-delays", r, | |
function(e, n) { | |
e || CNN.AirportDelays.airportDelaysBody.empty() | |
.append(n); | |
}); | |
}); | |
} | |
}], | |
'CNN.GridResize': [{ | |
prop: 'CNN.GridResize', | |
to: { | |
fixHeight: function(e) { | |
var t, n, i, o, s, a, r, d, l = jQuery(e), | |
c = Math.round(l.eq(0) | |
.width() / jQuery(".cn__column", l) | |
.eq(0) | |
.width()), | |
u = Math.ceil(l.find(".cn__column") | |
.length / c), | |
h = c * u, | |
f = new Array(u), | |
m = 0; | |
if (l.attr("class") | |
.indexOf("carousel") > -1) return !1; | |
if (l.hasClass("cn-grid") && !l.hasClass( | |
"cn-grid-add-carousel")) { | |
for (t = 0; h > t; t++) i = Math.floor(t / c), a = l.find( | |
".cd") | |
.eq(t) | |
.height(), (void 0 === f[i] || null === f[i] || a > f[i]) && | |
(f[i] = a); | |
for (n = 0; h > n; n++) o = l.find(".cd") | |
.eq(n), a = o.height(), s = jQuery(".cd__content", o), r = | |
s.height(), s.height(r + (f[Math.floor(n / c)] - a) + | |
"px"); | |
} else d = jQuery(".cd", e) | |
.each(function() { | |
var e = jQuery(this) | |
.height(); | |
e > m && (m = e); | |
}), d.each(function() { | |
var e = jQuery(this), | |
t = e.height(), | |
n = jQuery(".cd__content", e), | |
i = n.height(); | |
n.height(i + (m - t) + "px"); | |
}); | |
}, | |
fixGridHeights: function(e) { | |
if (e) { | |
var t, n; | |
for (t = 0, n = e.length; n > t; t++) Modernizr.ie8 || e.eq( | |
t) | |
.find(".cd__content") | |
.css("height", "auto"), CNN.GridResize.fixHeight(e[t]); | |
} | |
} | |
} | |
}], | |
'CNN.Chartbeat': [{ | |
prop: 'CNN.Chartbeat', | |
to: CNN.Chartbeat || {} | |
}], | |
'CNN.Outbrain': [{ | |
prop: 'CNN.Outbrain', | |
to: CNN.Outbrain || {} | |
}], | |
'CNN.Outbrain.init': [{ | |
prop: 'CNN.Outbrain.init', | |
to: function() { | |
function e() { | |
CNN.CurrentWidth.getClientWidth() <= s && o.filter(function() { | |
return i(this) | |
.closest(".pg-rail") | |
.length; | |
}) | |
.removeClass("OUTBRAIN"); | |
} | |
function t() { | |
i.ajax({ | |
url: "/web/20160903014131/http://widgets.outbrain.com/outbrain.js", | |
dataType: "script", | |
cache: !0 | |
}); | |
} | |
function n() { | |
fastdom.mutate(function() { | |
"section" === CNN.contentModel.pageType && CNN.Utils.existsObject( | |
CNN.ToggleOutbrain) && CNN.Utils.existsObject(CNN.ToggleOutbrain[ | |
CNN.contentModel.sectionName]) && jQuery( | |
"div.m-outbrain[data-widget-id=" + CNN.ToggleOutbrain[ | |
CNN.contentModel.sectionName].zone.outBrainId + | |
"]") | |
.hide(); | |
}); | |
} | |
var i = jQuery, | |
o = i(".js-m-outbrain"), | |
s = 640; | |
CNN.CurrentWidth = CNN.CurrentWidth || {}, CNN.CurrentWidth.getClientWidth = | |
CNN.CurrentWidth.getClientWidth || i.noop, e(), t(), n(), CNN | |
.Features.enableZoneOutbrain && jQuery(document) | |
.on("GPTRenderComplete ProgrammaticResizeComplete", function() { | |
fastdom.measure(function() { | |
var e, t, n, i, o, s, a = 0; | |
"section" === CNN.contentModel.pageType && CNN.Utils | |
.existsObject(CNN.ToggleOutbrain) && CNN.Utils.existsObject( | |
CNN.ToggleOutbrain[CNN.contentModel.sectionName] | |
) && CNN.Utils.existsObject(CNN.ToggleOutbrain[ | |
CNN.contentModel.sectionName].zone) && (e = | |
jQuery(".ad-" + CNN.ToggleOutbrain[CNN.contentModel | |
.sectionName].zone.adId), t = e.find("iframe")[ | |
0], n = t && t.contentDocument.body || {}, i = | |
jQuery(n) | |
.html() || "", o = e.parent() | |
.attr("data-ad-position"), s = CNN.ToggleOutbrain[ | |
CNN.contentModel.sectionName].zone.outBrainId, | |
i.length > 0 && (a = t.height), fastdom.mutate( | |
function() { | |
jQuery("div.m-outbrain[data-widget-id=" + s + | |
"]") | |
.hide(), "desktop" === o && "250" === a && | |
jQuery("div.m-outbrain[data-widget-id=" + | |
s + "]") | |
.show(); | |
})); | |
}); | |
}); | |
} | |
}], | |
'CNN.CurrentWidth': [{ | |
prop: 'CNN.CurrentWidth', | |
to: CNN.CurrentWidth || {} | |
}], | |
'CNN.CurrentWidth.getClientWidth': [{ | |
prop: 'CNN.CurrentWidth.getClientWidth', | |
to: CNN.CurrentWidth.getClientWidth || i.noop | |
}], | |
'CNN.Money': [{ | |
prop: 'CNN.Money', | |
to: { | |
cardLoaded: { | |
currencies: !1, | |
commodities: !1, | |
markets: !1, | |
marketsBasic: !1 | |
} | |
} | |
}, { | |
prop: 'CNN.Money', | |
to: CNN.Money || {} | |
}], | |
'CNN.Financial': [{ | |
prop: 'CNN.Financial', | |
to: function(e, t, n) { | |
function i() { | |
var t = { | |
currencies: { | |
$el: e(n.getElementById("js-financial-currencies")), | |
ssiPath: "/.element/ssi/auto/4.0/sect/INTLEDITION/iBUSINESS/wsod_currencies.html" | |
}, | |
commodities: { | |
$el: e(n.getElementById("js-financial-commodities")), | |
ssiPath: "/.element/ssi/auto/4.0/sect/INTLEDITION/iBUSINESS/wsod_commodities.html" | |
}, | |
markets: { | |
$el: e(n.getElementById("js-financial-markets")), | |
ssiPath: "/.element/ssi/auto/4.0/sect/MAIN/markets_wsod_expansion.html" | |
}, | |
marketsBasic: { | |
$el: e(n.getElementById("js-financial-markets-basic")), | |
ssiPath: "/.element/ssi/auto/4.0/sect/MAIN/hp_markets_wsod_expansion.html" | |
} | |
}; | |
e.each(t, a); | |
} | |
function o(t) { | |
return e.Deferred(function(n) { | |
e.ajax({ | |
url: t.ssiPath, | |
dataType: "html", | |
type: "get", | |
success: function(e) { | |
t.$el.append(e), n.resolve(); | |
} | |
}); | |
}) | |
.promise(); | |
} | |
function s(t) { | |
var n = t.find(".js-quote-items"), | |
i = t.find(".js-quote-headers"); | |
return function(o) { | |
var s = e(o.currentTarget), | |
a = s.index(); | |
s.addClass("m-financial__tabs-item--active") | |
.siblings() | |
.removeClass("m-financial__tabs-item--active"), n.removeClass( | |
"m-financial__quote-content--active") | |
.eq(a) | |
.addClass("m-financial__quote-content--active"), i.hide() | |
.eq(a) | |
.show(), l(t, "tabs", a); | |
}; | |
} | |
function a(t, n) { | |
CNN.Money.cardLoaded[t] !== !0 && e.Deferred(function(i) { | |
n.$el.length && (e.when(o(n)) | |
.done(function() { | |
r(n.$el), d(n.$el), i.resolve(n.$el); | |
}), CNN.Money.cardLoaded[t] = !0, f[t] = i.promise() | |
); | |
}); | |
} | |
function r(e) { | |
e.on("click", ".js-tab-item", s(e)); | |
} | |
function d(e) { | |
e.find(".js-tab-item") | |
.eq(l(e, "tabs")) | |
.click(); | |
} | |
function l(e, t, n) { | |
var i = e.attr("id") + "_" + t + "_domestic"; | |
return h ? "undefined" == typeof n ? store.get(i) : store.set( | |
i, n) : void 0; | |
} | |
function c(t) { | |
return f[t] || e.Deferred() | |
.reject(); | |
} | |
function u() { | |
return !1; | |
} | |
var h = "undefined" != typeof store && store.enabled, | |
f = {}; | |
return { | |
restoreState: d, | |
dataStore: l, | |
checkLoaded: c, | |
stopSubmit: u, | |
init: i | |
}; | |
}(jQuery, window, document) | |
}], | |
'CNN.Money.cardLoaded[t]': [{ | |
prop: 'CNN.Money.cardLoaded[t]', | |
to: !0 | |
}], | |
'CNN.MarketsConfig': [{ | |
prop: 'CNN.MarketsConfig', | |
to: CNN.MarketsConfig || {} | |
}], | |
'CNN.Money.markets': [{ | |
prop: 'CNN.Money.markets', | |
to: function() { | |
function e(e) { | |
return a.parseJSON((a("#jsCode", e) | |
.val() || "{}") | |
.replace("WSOD = ", "") | |
.replace("data", '"data"')); | |
} | |
function t() { | |
var t = s.find(".js-quote-input"), | |
n = new Bloodhound({ | |
limit: 5, | |
queryTokenizer: Bloodhound.tokenizers.whitespace, | |
datumTokenizer: function(e) { | |
return Bloodhound.tokenizers.whitespace(e.name); | |
}, | |
remote: { | |
url: r + "/cnn.com/%QUERY", | |
filter: function(t) { | |
var n = e(t), | |
i = []; | |
return "undefined" != typeof n.data && a.each(n.data, | |
function(e, t) { | |
a.each(t, function(e, t) { | |
i.push({ | |
name: t.n, | |
symbol: t.s | |
}); | |
}); | |
}), i; | |
}, | |
ajax: { | |
dataType: "html" | |
} | |
} | |
}); | |
n.initialize(), t.typeahead({ | |
hint: !1 | |
}, { | |
name: "user-quote", | |
displayKey: "symbol", | |
source: n.ttAdapter(), | |
templates: { | |
suggestion: function(e) { | |
var t; | |
return dust.render( | |
"views/cards/tool/markets-typeahead-suggestion", | |
e, | |
function(e, n) { | |
t = n; | |
}), t; | |
} | |
} | |
}), s.closest(".column") | |
.addClass("column--top"); | |
} | |
function n() { | |
var e = s.find(".js-quote-input"); | |
return function() { | |
var t = e.val(); | |
return t && window.open( | |
"/web/20160903014131/http://money.cnn.com/quote/quote.html?symb=" + | |
t, "_blank") | |
.focus(), !1; | |
}; | |
} | |
function i(e) { | |
s = e.find(".js-market-quote"), CNN.Financial.restoreState(e), | |
o(), "undefined" != typeof Bloodhound && t(); | |
} | |
function o() { | |
var e = n(); | |
s.on("submit", e) | |
.on("click", ".js-quote-button", e); | |
} | |
var s, a = jQuery, | |
r = CNN.MarketsConfig.lookupService; | |
"function" == typeof CNN.Financial.checkLoaded && (a.when(CNN.Financial | |
.checkLoaded("markets")) | |
.done(i), a.when(CNN.Financial.checkLoaded("marketsBasic")) | |
.done(i)); | |
} | |
}], | |
'CNN.Money.currencies': [{ | |
prop: 'CNN.Money.currencies', | |
to: function() { | |
function e() { | |
var e = i.find(".js-conversion-output"); | |
return function() { | |
var t = i.find(".js-field-list"), | |
n = i.find(".js-field-item") | |
.first() | |
.val(), | |
a = t.first() | |
.val(), | |
r = t.last() | |
.val(); | |
o.ajax({ | |
url: s + "/1/" + a + "/" + r + "/" + n, | |
dataType: "html", | |
type: "get", | |
success: function(t) { | |
e.val(t.replace("= ", "")); | |
} | |
}); | |
}; | |
} | |
function t() { | |
var e = i.find(".js-field-list"), | |
t = e.first(), | |
n = e.last(); | |
return function() { | |
var e = t.val(), | |
i = n.val(); | |
t.val(i), n.val(e) | |
.change(); | |
}; | |
} | |
function n(n) { | |
n.on("blur change", ".js-field-item, .js-field-list", e()) | |
.on("click", ".js-conversion-flip", t()) | |
.on("submit", ".js-currency-converter", CNN.Financial.stopSubmit); | |
} | |
var i, o = jQuery, | |
s = CNN.MarketsConfig.converterService; | |
"function" == typeof CNN.Financial.checkLoaded && o.when(CNN.Financial | |
.checkLoaded("currencies")) | |
.done(function(e) { | |
i = e.find(".js-currency-converter"); | |
}, n); | |
} | |
}], | |
'CNN.PushAlerts': [{ | |
prop: 'CNN.PushAlerts', | |
to: CNN.PushAlerts || {} | |
}], | |
'CNN.PushAlertsConfig': [{ | |
prop: 'CNN.PushAlertsConfig', | |
to: CNN.PushAlertsConfig || {} | |
}], | |
'CNN.PushAlertsConfig.safari': [{ | |
prop: 'CNN.PushAlertsConfig.safari', | |
to: CNN.PushAlertsConfig.safari || {} | |
}], | |
'CNN.PushAlerts.Safari': [{ | |
prop: 'CNN.PushAlerts.Safari', | |
to: { | |
webServiceURL: CNN.PushAlertsConfig.safari.webServiceURL || "", | |
websitePushID: CNN.PushAlertsConfig.safari.websitePushID || "", | |
checkRemotePermission: function(e) { | |
if (CNN.Utils.existsObject(e)) | |
if ("default" === e.permission) { | |
console.info( | |
"Requesting user permission for Safari push alerts."); | |
try { | |
window.safari.pushNotification.requestPermission(CNN.PushAlerts | |
.Safari.webServiceURL, CNN.PushAlerts.Safari.websitePushID, {}, | |
CNN.PushAlerts.Safari.checkRemotePermission); | |
} catch (t) { | |
console.info( | |
"Safari push alerts permission request failed:", t); | |
} | |
} else "denied" === e.permission ? console.info( | |
"User said no to Safari push alerts.") : "granted" === | |
e.permission && console.info( | |
"User said yes to Safari push alerts. deviceToken=" + | |
e.deviceToken); | |
}, | |
init: function() { | |
var e, t; | |
CNN.Utils.existsObject(CNN.Features) && CNN.Features.enableSafariPushAlerts && | |
"safari" in window && "pushNotification" in window.safari && | |
(e = window.location.origin, | |
"/web/20160903014131/http://www.cnn.com" === e || | |
"/web/20160903014131/http://us.cnn.com" === e || | |
"/web/20160903014131/http://edition.cnn.com" === e ? (t = | |
window.safari.pushNotification.permission(CNN.PushAlerts | |
.Safari.websitePushID), CNN.PushAlerts.Safari.checkRemotePermission( | |
t)) : console.info( | |
"Safari push alerts are not available on " + e)); | |
} | |
} | |
}], | |
'CNN.PushAlerts.init': [{ | |
prop: 'CNN.PushAlerts.init', | |
to: function() { | |
CNN.PushAlerts.Safari.init(); | |
} | |
}], | |
'CNN.UserMessageConfig': [{ | |
prop: 'CNN.UserMessageConfig', | |
to: CNN.UserMessageConfig || {} | |
}], | |
'CNN.userMessage': [{ | |
prop: 'CNN.userMessage', | |
to: CNN.userMessage || function(e, t, n) { | |
function i(e) { | |
return x.getCookie(e); | |
} | |
function o() { | |
E && D && P && x.setCNNCookie(E, D, P); | |
} | |
function s() { | |
return "tos" === A && CNN.Features.enableAspenForTOS === !0; | |
} | |
function a() { | |
s() && void 0 !== AspenCNNTOS.initialized && "function" == | |
typeof AspenCNNTOS.send && t.addEventListener( | |
"beforeunload", | |
function(e) { | |
j(E) && !j(i(E)) && AspenCNNTOS.send("userClickedTOS", { | |
userClickedTOS: !1 | |
}); | |
}); | |
} | |
function r() { | |
O || o(), C.animate({ | |
height: 0 | |
}, 1e3, function() { | |
C.hide(), s() && void 0 !== AspenCNNTOS.initialized && | |
"function" == typeof AspenCNNTOS.send && AspenCNNTOS.send( | |
"userClickedTOS", { | |
userClickedTOS: !0 | |
}), m(); | |
}); | |
} | |
function d() { | |
R && D && $ && x.setCNNCookie(R, D, $); | |
} | |
function l() { | |
var i = e.Deferred(), | |
o = (e("body[data-eq-state]") | |
.attr("data-eq-state") || "") | |
.replace(/^(\\S+\\s+)*/, ""), | |
r = e(n.body) | |
.hasClass("breaking-news--showing"); | |
return r || (isNaN(A) && e(n.getElementById( | |
"js-user-msg--body-text")) | |
.attr("id", A), c(), C.height(0) | |
.show(), C.animate({ | |
height: L[o] | |
}, 1e3, function() { | |
s() && "function" == typeof AspenCNNTOS.init && ( | |
AspenCNNTOS.init({ | |
site: "cnn", | |
appName: "cnntos", | |
environment: CNN.contentModel.env, | |
pageUrl: t.location.href | |
}), a()), i.resolve(); | |
})), i.promise(); | |
} | |
function c() { | |
e(".js-user-msg--close, .js-user-msg--agree") | |
.one("click", function(e) { | |
r(); | |
}); | |
} | |
function u() { | |
return b[k]; | |
} | |
function h() { | |
return k < b.length; | |
} | |
function f() { | |
h() && v(u()); | |
} | |
function m() { | |
k++, f(); | |
} | |
function p() { | |
e(n) | |
.trigger(A + T); | |
} | |
function g() { | |
j(E) && j(i(E)) ? m() : l(); | |
} | |
function y() { | |
g(); | |
} | |
function v(t) { | |
var n; | |
A = j(t.id) ? t.id : k, M = j(t.headerText) ? t.headerText : | |
"", I = j(t.messageText) ? t.messageText : "", M.length > 0 && | |
I.length > 0 && (e(".js-user-msg--header-text") | |
.html(M), e(".js-user-msg--body-text") | |
.html(I)), L = t.height, L.xsmall = L.small, L.full16x9 = | |
L.large, S(t.dismissCookie) && (n = t.dismissCookie, E = j( | |
n.name) ? n.name : "", D = j(n.name) ? n.value : "", P = | |
w(n), O = j(n.skip) && n.skip, z = j(n.defer) && n.defer, | |
R = j(n.oldCookieName) ? n.oldCookieName : "", $ = j(n.oldCookieExpiration) ? | |
n.oldCookieExpiration : ""), d(), O || z ? p() : g(); | |
} | |
function _(e) { | |
var t, n; | |
for (t = 0; t < b.length; t++) n = b[t], (j(n.id) ? n.id : t) === | |
e && b.splice(t, 1); | |
} | |
function w(e) { | |
var t, n, i, o = new Date(); | |
return j(e.expiration) && (n = new Date(e.expiration)), j(e.expirationPeriod) && | |
(i = new Date(e.expirationPeriod + o.getTime())), t = n && | |
i ? n > i ? i : n : n || i, t ? t.toUTCString() : ""; | |
} | |
function N() { | |
var e = CNN.UserMessageConfig; | |
b = Array.isArray(e) ? e : "object" == typeof e && null !== e ? [ | |
e | |
] : [], B = CNN.Features.enableUserMessage === !0, B && ( | |
Modernizr.ie8 || _("ie8"), f()); | |
} | |
var C = e(".user-msg"), | |
b = [], | |
k = 0, | |
x = CNN.Utils, | |
j = x.exists, | |
S = x.existsObject, | |
B = !1, | |
A = "", | |
T = "_userMessageReady", | |
E = "", | |
D = "", | |
P = "", | |
M = "", | |
I = "", | |
L = {}, | |
O = !1, | |
z = !1, | |
R = "", | |
$ = ""; | |
return { | |
showMessage: l, | |
showDeferredMessage: y, | |
closeMessage: r, | |
init: N | |
}; | |
}(jQuery, window, document) | |
}], | |
'CNN.siblingNavigation': [{ | |
prop: 'CNN.siblingNavigation', | |
to: i.extend({}, { | |
fastdomIds: [], | |
threshold: r.threshold, | |
template: "views/pages/common/navigation-siblings", | |
disableHoverThreshold: r.disableHoverThreshold, | |
disableHover: !1, | |
getAnalyticsLib: function() { | |
var t = e.Analytics && e.Analytics.utils && "function" == | |
typeof e.Analytics.utils.addTrackingTags, | |
n = t ? e.Analytics.utils : { | |
addTrackingTags: i.noop | |
}; | |
return t || console.warn( | |
"navigation-siblings::getTrackingTags: Unable to find analytics library. Using mock object instead!" | |
), n; | |
}, | |
getCurrentWidthLib: function() { | |
var t = e.CurrentWidth && "function" == typeof e.CurrentWidth | |
.getClientWidth, | |
n = t ? e.CurrentWidth : { | |
getClientWidth: i.noop | |
}; | |
return t || console.warn( | |
"navigation-siblings::getCurrentWidthLib: Unable to find current width library. Using mock object instead!" | |
), n; | |
}, | |
isEndOfPage: function() { | |
s.measure(i.proxy(function() { | |
var CNN = "do nothing", | |
t = i(".sibling"), | |
o = i(n) | |
.height(), | |
a = t.eq(0) | |
.offset() | |
.top / o, | |
r = a > this.disableHoverThreshold; | |
r && !this.disableHover && (e = "add"), !r && | |
this.disableHover && (e = "remove"), this.disableHover = | |
r, "do nothing" !== CNN && s.mutate(function() { | |
switch (CNN) { | |
case "add": | |
t.addClass("sibling--disable-hover"); | |
break; | |
case "remove": | |
t.removeClass("sibling--disable-hover"); | |
} | |
}); | |
}, this)); | |
}, | |
finishedRenderingSiblingNavigation: function(e, n) { | |
var o, r = "number" == typeof this.disableHoverThreshold; | |
e ? (console.error( | |
"Could not render %s with given template model %o", | |
this.template, a), console.error(e)) : (o = s.mutate( | |
function() { | |
i("body") | |
.append(this.html), this.analytics.addTrackingTags( | |
".sibling"), this.enableScrolling && i(t) | |
.throttleEvent("scroll.siblingNavigation", i.proxy( | |
this.isEndOfPage, this.self), 100); | |
}, { | |
html: n, | |
analytics: this.getAnalyticsLib(), | |
isEndOfPage: this.isEndOfPage, | |
enableScrolling: r, | |
self: this | |
}), this.fastdomIds.push(o)); | |
}, | |
processTheSection: function(e) { | |
var t, n, i, o, s = { | |
siblings: { | |
previous: {}, | |
next: {} | |
} | |
}, | |
a = {}, | |
r = {}, | |
d = "object" == typeof location && location.pathname ? | |
location.pathname : ""; | |
if ("object" == typeof e && null !== e) | |
for (n = CNN.nav && CNN.nav.siblings && CNN.nav.siblings | |
.articleList ? CNN.nav.siblings.articleList : [], s.siblings | |
.next = n[0] || {}, i = 0, o = n.length; o > i; i += | |
1) | |
if (a = n[i - 1] || {}, t = n[i] || {}, r = n[i + 1] || {}, | |
t.uri === d) { | |
s.siblings.previous = a, s.siblings.next = r; | |
break; | |
} | |
return s; | |
}, | |
requestTheModel: function() { | |
var e, t = "/data/ocs/section/index.html:*.json", | |
n = a; | |
return a.siblings.isUsable || (e = i.ajax(t, { | |
async: !0, | |
dataType: "json", | |
cache: !0, | |
method: "GET" | |
}) | |
.pipe(this.processTheSection), n = e.promise()), n; | |
}, | |
render: function(e) { | |
o.render(this.template, e, i.proxy(this.finishedRenderingSiblingNavigation, | |
this)); | |
}, | |
shouldIAddSiblingNavigation: function() { | |
console.timeStamp( | |
"navigation-sibling::shouldIAddSiblingNavigation: start" | |
); | |
var e = this.getCurrentWidthLib() | |
.getClientWidth(); | |
e >= this.threshold && (i.when(this.requestTheModel()) | |
.done(i.proxy(this.render, this)), i(t) | |
.off("resize.siblingNavigation")), console.timeStamp( | |
"navigation-sibling::shouldIAddArticleNavigation: end" | |
); | |
}, | |
clearAllJobs: function() { | |
var e, t = this.fastdomIds; | |
for (e = t.length - 1; CNN >= 0; e -= 1) s.clear(t.pop()); | |
}, | |
readySetGo: function() { | |
var e = a.hasOwnProperty("siblings") && a.siblings.hasOwnProperty( | |
"isUsable") && "number" == typeof this.threshold; | |
e && (i(t) | |
.throttleEvent("resize.siblingNavigation", i.proxy( | |
this.shouldIAddSiblingNavigation, this), 100), | |
"function" == typeof i.fn.onZonesAndDomReady ? i(n) | |
.onZonesAndDomReady(i.proxy(this.shouldIAddSiblingNavigation, | |
this)) : i(n) | |
.load(i.proxy(this.shouldIAddSiblingNavigation, this)), | |
i(t) | |
.on("pageHide", i.proxy(this.clearAllJobs, this))); | |
} | |
}, CNN.siblingNavigation || {}) | |
}], | |
'CNN.merge_fields': [{ | |
prop: 'CNN.merge_fields', | |
to: {} | |
}], | |
'CNN[t.name]': [{ | |
prop: 'CNN[t.name]', | |
to: t.value | |
}], | |
'CNN.newsletterSubscriptionCard': [{ | |
prop: 'CNN.newsletterSubscriptionCard', | |
to: function() { | |
var t, n, s, a, r = { | |
inputcontext: "cmcs-input-include", | |
uicontext: ".js-cmcs-card" | |
}, | |
d = { | |
inputcontext: "cmcs-input-footer", | |
uicontext: ".js-cmcs-footer-card" | |
}, | |
l = { | |
inputcontext: "cmcs-article-embed", | |
uicontext: ".js-cmcs-embedded" | |
}, | |
CNN = CNN.Mailchimp || {}, | |
u = CNN.section, | |
h = { | |
errorblock: ".js-subscribe-error", | |
form: ".js-cmcs-subscription-form", | |
section: CNN.contentModel.sectionName || "", | |
submitbutton: ".js-mc-submit", | |
success: "submit-success" | |
}, | |
f = { | |
email: "Your e-mail address is invalid.", | |
success: "Check your email to confirm your subscription.", | |
invalidType: "Your submission was not accepted." | |
}, | |
m = function(t) { | |
var CNN, o = e.Deferred(); | |
return "object" == typeof t && t.activelist && t.cardtext && | |
t.branding ? (i = { | |
activeList: t.activelist, | |
base: t.baselist, | |
formAction: t.action, | |
intro: t.cardtext.intro, | |
label: t.cardtext.label, | |
title: t.cardtext.title | |
}, n = e.extend(!0, { | |
enableInFooter: u[h.section].enableFooter, | |
overrideSectionFooter: t.overrideSectionFooter, | |
footer: !0 | |
}, CNN, d), s = e.extend(!0, { | |
enableInclude: u[h.section].enableInclude, | |
cmsinclude: !0, | |
hasBranding: t.branding.imageUrl, | |
imageBreakpoints: CNN.ImageBreakpoints, | |
imageCutPaths: { | |
mini: "/web/20160903014131/http://i.cdn.turner.com/cnn" + | |
t.branding.paths.mini.uri, | |
xsmall: "/web/20160903014131/http://i.cdn.turner.com/cnn" + | |
t.branding.paths.xsmall.uri, | |
small: "/web/20160903014131/http://i.cdn.turner.com/cnn" + | |
t.branding.paths.small.uri, | |
medium: "/web/20160903014131/http://i.cdn.turner.com/cnn" + | |
t.branding.paths.medium.uri, | |
large: "/web/20160903014131/http://i.cdn.turner.com/cnn" + | |
t.branding.paths.large.uri, | |
full16x9: "/web/20160903014131/http://i.cdn.turner.com/cnn" + | |
t.branding.paths.full16x9.uri | |
} | |
}, r, CNN), a = e.extend(!0, { | |
articleEmbed: t.articleEmbed, | |
media: "/web/20160903014131/http://i.cdn.turner.com/cnn" + | |
t.branding.paths.small.uri | |
}, l, CNN), o.resolveWith({ | |
footer: n, | |
branded: s, | |
embedded: a | |
})) : o.reject(), o.promise() | |
.fail(function() { | |
console.log( | |
"Newsletter subscription card failed before render" | |
); | |
}); | |
}, | |
p = function(t) { | |
var n, CNN = e.Deferred(), | |
o = !1, | |
s = "views/cards/tool/mailchimp-subscribe-form"; | |
return n = t, n[0].enableInFooter === !0 && n[0].overrideSectionFooter === | |
!1 && (n[0].enableInFooter = !1), (n[0].enableInFooter || | |
n[0].overrideSectionFooter) && dust.render(s, n[0], | |
function(t, s) { | |
t && (CNN.reject(), console.log( | |
"Rendering footer subscription card failed during - " + | |
t)), e(n[0].uicontext) | |
.eq(0) | |
.html(s) | |
.closest(".cmcs-subscription-wrapper") | |
.addClass("cmcs-footer-active"), o = !0; | |
}), n[1].enableInclude && dust.render(s, n[1], function( | |
t, s) { | |
t && (CNN.reject(t), console.log( | |
"Including subscription card failed during - " + | |
t)), e(n[1].uicontext) | |
.empty() | |
.html(s), o = !0; | |
}), n[2].articleEmbed && dust.render(s, n[2], function(t, | |
s) { | |
t && (CNN.reject(t), console.log( | |
"Embedding subscription card failed during - " + | |
t)), e(n[2].uicontext) | |
.empty() | |
.html(s) | |
.children(".js-cmcs-subscription-form") | |
.addClass("cmcs-embedded"), o = !0; | |
}), o ? CNN.resolve() : CNN.reject(), CNN.promise() | |
.then(_) | |
.fail(function() { | |
console.log( | |
"Newsletter subscription card failed to render"); | |
}); | |
}, | |
g = function(e, t) { | |
var n, CNN = ""; | |
if (e && "object" == typeof e) { | |
if (!t) return e; | |
for (n in t) t.hasOwnProperty(n) && !Array.isArray(t[n]) && | |
(i += t[n] + ":"); | |
i = CNN.substr(0, CNN.length - 1), e.merge_fields.SOURCE = | |
i; | |
} | |
return e; | |
}, | |
y = function(t, n) { | |
var o, s, a = g(n, { | |
edition: CNN.contentModel.edition, | |
pageType: CNN.contentModel.pageType, | |
sectionName: CNN.contentModel.sectionName | |
}); | |
try { | |
o = JSON.stringify(a); | |
} catch (r) { | |
return void w(f.invalidType); | |
} | |
e.ajax({ | |
type: "POST", | |
url: t, | |
data: o, | |
dataType: "json", | |
contentType: "application/json", | |
cache: !1, | |
success: function(e, t, n) { | |
200 === n.status && N(f.success); | |
}, | |
error: function(e, t, n) { | |
"error" === t && e.responseText && (s = JSON.parse( | |
e.responseText), w(s.message)); | |
} | |
}); | |
}, | |
v = function(e, t) { | |
var n = | |
/^([\\w\\.\\\'\\+\\-]+)\\@([\\w\\-]{1,63}\\.)+[\\w\\-]{2,63}$/; | |
n.test(h.input.val()) ? y(e, t) : (b(), w(f.email)); | |
}, | |
_ = function() { | |
e(h.submitbutton) | |
.on("click", function(t) { | |
h.input = e(this) | |
.siblings(".cmcs-input-email") | |
.find("[type=email]"), h.submit = e(this); | |
}), e(".cmcs-subscription-wrapper form") | |
.on("submit", function(t) { | |
var n = e(t.target) | |
.serializeArray(), | |
CNN = {}, | |
s = t.target.action; | |
t.preventDefault(), e.each(n, function(e, t) { | |
CNN[t.name] = t.value; | |
}), CNN.merge_fields = {}, o.mutate(function() { | |
h.submit.prop("disabled", !0); | |
}), v(s, CNN); | |
}); | |
}, | |
w = function(e) { | |
o.mutate(function() { | |
b(), h.submit.siblings(".cmcs-input-email") | |
.find(h.errorblock) | |
.append(e); | |
}); | |
}, | |
N = function(e) { | |
o.mutate(function() { | |
h.submit.closest(h.form) | |
.addClass(h.success), h.submit.closest(h.form) | |
.find(".js-cnn-news-ok") | |
.text(e), C(); | |
}); | |
}, | |
C = function() { | |
var t = e(".js-cnn-sub-ok"); | |
h.submit.prop("disabled", !1), t.on("click", function(e) { | |
o.mutate(function() { | |
b(), h.input.val(""), h.submit.closest(h.form) | |
.removeClass("submit-success"); | |
}); | |
}); | |
}, | |
b = function() { | |
var t = e(h.errorblock); | |
t && t.each(function(t, n) { | |
e(n) | |
.empty(); | |
}), h.submit.prop("disabled", !1); | |
}; | |
return { | |
init: function(n) { | |
t || (t = m(n) | |
.then(function() { | |
p([this.footer, this.branded, this.embedded]); | |
}) | |
.then(function() { | |
CNN.DemandLoading.addElement(e(".cmcs-eqjs")); | |
})); | |
} | |
}; | |
}() | |
}], | |
'CNN.BylineImages': [{ | |
prop: 'CNN.BylineImages', | |
to: function() { | |
function r() { | |
var CNN = n.Deferred(); | |
return i.measure(function() { | |
CNN.resolve(n(".js-byline-images")); | |
}), CNN.promise(); | |
} | |
function d() { | |
n.when(v, r()) | |
.done(function(e, t) { | |
i.mutate(function() { | |
t.before(CNN); | |
}); | |
}); | |
} | |
function l(CNN, t) { | |
CNN ? v.reject(CNN) : v.resolve(t); | |
} | |
function c() { | |
"pending" === v.state() && i.mutate(function() { | |
o.render(g, y, l); | |
}); | |
} | |
function u() { | |
n(s) | |
.off("resize.bylineimages"), n(a) | |
.off("bylineimages.start"), n(a) | |
.onZonesAndDomReady(d), c(); | |
} | |
function h() { | |
m && CNN.CurrentWidth.getClientWidth() > p && (m = !1, n(a) | |
.trigger("bylineimages.start")); | |
} | |
function f() { | |
var t = "object" == typeof CNN.contentModel && "object" == | |
typeof CNN.contentModel.bylineImages && CNN.contentModel.bylineImages | |
.length > 0; | |
t && "number" == typeof p && (y = { | |
bylineImages: CNN.contentModel.bylineImages | |
}, n(a) | |
.on("bylineimages.start", u), n(s) | |
.throttleEvent("resize.bylineimages", h, 263), h()); | |
} | |
var m, p, g, y, v; | |
return m = !0, p = t.threshold, g = | |
"views/pages/common/byline-images", y = [], v = n.Deferred(), { | |
readySetGo: f | |
}; | |
}() | |
}], | |
'CNN.SocialConfig': [{ | |
prop: 'CNN.SocialConfig', | |
to: CNN.SocialConfig || {} | |
}], | |
'CNN.SocialConfig.avatar': [{ | |
prop: 'CNN.SocialConfig.avatar', | |
to: CNN.SocialConfig.avatar || {} | |
}], | |
'CNN.SocialConfig.gigya': [{ | |
prop: 'CNN.SocialConfig.gigya', | |
to: CNN.SocialConfig.gigya || {} | |
}], | |
'CNN.SocialConfig.livefyre': [{ | |
prop: 'CNN.SocialConfig.livefyre', | |
to: CNN.SocialConfig.livefyre || {} | |
}], | |
'CNN.SocialConfig.msib': [{ | |
prop: 'CNN.SocialConfig.msib', | |
to: CNN.SocialConfig.msib || {} | |
}], | |
'CNN.accounts': [{ | |
prop: 'CNN.accounts', | |
to: CNN.accounts || {} | |
}], | |
'CNN.accounts.localCfg': [{ | |
prop: 'CNN.accounts.localCfg', | |
to: CNN.accounts.localCfg || {} | |
}], | |
'CNN.accounts.localCfg.avatar': [{ | |
prop: 'CNN.accounts.localCfg.avatar', | |
to: CNN.accounts.localCfg.avatar || {} | |
}], | |
'CNN.accounts.localCfg.avatar.host': [{ | |
prop: 'CNN.accounts.localCfg.avatar.host', | |
to: CNN.SocialConfig.avatar.host | |
}], | |
'CNN.accounts.localCfg.gigya': [{ | |
prop: 'CNN.accounts.localCfg.gigya', | |
to: CNN.accounts.localCfg.gigya || {} | |
}], | |
'CNN.accounts.localCfg.gigya.appId': [{ | |
prop: 'CNN.accounts.localCfg.gigya.appId', | |
to: CNN.SocialConfig.gigya.appId | |
}], | |
'CNN.accounts.localCfg.gigya.shareButtons': [{ | |
prop: 'CNN.accounts.localCfg.gigya.shareButtons', | |
to: "Email,Facebook,Twitter,Share" | |
}], | |
'CNN.accounts.localCfg.livefyre': [{ | |
prop: 'CNN.accounts.localCfg.livefyre', | |
to: CNN.accounts.localCfg.livefyre || {} | |
}], | |
'CNN.accounts.localCfg.livefyre.network': [{ | |
prop: 'CNN.accounts.localCfg.livefyre.network', | |
to: CNN.SocialConfig.livefyre.network | |
}], | |
'CNN.accounts.localCfg.livefyre.networkName': [{ | |
prop: 'CNN.accounts.localCfg.livefyre.networkName', | |
to: CNN.SocialConfig.livefyre.networkName | |
}], | |
'CNN.accounts.localCfg.livefyre.siteId': [{ | |
prop: 'CNN.accounts.localCfg.livefyre.siteId', | |
to: CNN.SocialConfig.livefyre.siteId | |
}], | |
'CNN.accounts.localCfg.livefyre.srcDomain': [{ | |
prop: 'CNN.accounts.localCfg.livefyre.srcDomain', | |
to: CNN.SocialConfig.livefyre.srcDomain | |
}], | |
'CNN.accounts.localCfg.livefyre.tokenEndpoint': [{ | |
prop: 'CNN.accounts.localCfg.livefyre.tokenEndpoint', | |
to: CNN.SocialConfig.livefyre.tokenEndpoint | |
}], | |
'CNN.accounts.localCfg.livefyre.pingEndpoint': [{ | |
prop: 'CNN.accounts.localCfg.livefyre.pingEndpoint', | |
to: CNN.SocialConfig.livefyre.pingEndpoint | |
}], | |
'CNN.accounts.localCfg.accounts': [{ | |
prop: 'CNN.accounts.localCfg.accounts', | |
to: CNN.accounts.localCfg.accounts || {} | |
}], | |
'CNN.accounts.localCfg.accounts.loginUrl': [{ | |
prop: 'CNN.accounts.localCfg.accounts.loginUrl', | |
to: "/login.html" | |
}], | |
'CNN.accounts.avatarForScreenName': [{ | |
prop: 'CNN.accounts.avatarForScreenName', | |
to: a | |
}], | |
'CNN.accounts.getLoginUrl': [{ | |
prop: 'CNN.accounts.getLoginUrl', | |
to: n | |
}], | |
'CNN.accounts.isLoaded': [{ | |
prop: 'CNN.accounts.isLoaded', | |
to: !1 | |
}, { | |
prop: 'CNN.accounts.isLoaded', | |
to: !0 | |
}], | |
'CNN.accounts.loadGigya': [{ | |
prop: 'CNN.accounts.loadGigya', | |
to: d | |
}], | |
'CNN.accounts.pingLivefyre': [{ | |
prop: 'CNN.accounts.pingLivefyre', | |
to: m | |
}], | |
'CNN.accounts.clearLivefyre': [{ | |
prop: 'CNN.accounts.clearLivefyre', | |
to: r | |
}], | |
'CNN.accounts.onInitialized': [{ | |
prop: 'CNN.accounts.onInitialized', | |
to: o | |
}], | |
'CNN.accounts.setLivefyreToken': [{ | |
prop: 'CNN.accounts.setLivefyreToken', | |
to: p | |
}], | |
'CNN.accounts.cfg': [{ | |
prop: 'CNN.accounts.cfg', | |
to: v | |
}], | |
'CNN.accounts.user': [{ | |
prop: 'CNN.accounts.user', | |
to: CNN.accounts.user || this | |
}], | |
'CNN.Videx.mobile.backdropContainer': [{ | |
prop: 'CNN.Videx.mobile.backdropContainer', | |
to: n | |
}], | |
'CNN.Videx.mobile.oneTapContainer': [{ | |
prop: 'CNN.Videx.mobile.oneTapContainer', | |
to: o | |
}], | |
'CNN.Videx.mobile.playlist': [{ | |
prop: 'CNN.Videx.mobile.playlist', | |
to: this.currentVideoCollection | |
}], | |
'CNN.Videx.mobile.playlistQueue': [{ | |
prop: 'CNN.Videx.mobile.playlistQueue', | |
to: CNN.Videx.mobile.playlist.slice(1) | |
}], | |
'CNN.goActiveUntil': [{ | |
prop: 'CNN.goActiveUntil', | |
to: 0 | |
}, { | |
prop: 'CNN.goActiveUntil', | |
to: 6e4 * CNN.VideoConfig.liveStream.pageRefreshTime + Date.now() | |
}], | |
'CNN.Utils': [{ | |
prop: 'CNN.Utils', | |
to: CNN.Utils || {} | |
}], | |
'CNN.Videx': [{ | |
prop: 'CNN.Videx', | |
to: CNN.Videx || {} | |
}], | |
'CNN.Videx.mobile': [{ | |
prop: 'CNN.Videx.mobile', | |
to: {} | |
}], | |
'CNN.Videx.mobile.videoUrl': [{ | |
prop: 'CNN.Videx.mobile.videoUrl', | |
to: CNN.Videx.mobile.playlist[0].videoUrl | |
}, { | |
prop: 'CNN.Videx.mobile.videoUrl', | |
to: i[0].dataset.vrContentbox || i[0].dataset.videoPlaylistUrl || | |
null | |
}] | |
} | |
const cnn_header_second_min_js = { | |
CNN: [{ | |
prop: 'CNN', | |
to: window.CNN || {} | |
}], | |
'CNN.AdsConfig': [{ | |
prop: 'CNN.AdsConfig', | |
to: CNN.AdsConfig || {} | |
}], | |
'CNN.AdsConfig.amazon': [{ | |
prop: 'CNN.AdsConfig.amazon', | |
to: CNN.AdsConfig.amazon || {} | |
}], | |
'CNN.Features': [{ | |
prop: 'CNN.Features', | |
to: CNN.Features || {} | |
}], | |
'CNN.Utils': [{ | |
prop: 'CNN.Utils', | |
to: CNN.Utils || function(e, t, n, i) { | |
"use strict"; | |
function r(e) { | |
var t = null; | |
return "string" == typeof e && Date.parse(e) ? t = e : | |
"number" == typeof e && (t = new Date(Date.now() + e * A) | |
.toGMTString()), t; | |
} | |
function o(e) { | |
var t, n = !0, | |
r = function(e) { | |
return e !== i && null !== e; | |
}; | |
for (t = 0; t < arguments.length; t++) | |
if (!r(arguments[t])) { | |
n = !1; | |
break; | |
} | |
return n; | |
} | |
function a(e) { | |
var t, n = !0, | |
i = function(e) { | |
return "object" == typeof e && null !== e; | |
}; | |
for (t = 0; t < arguments.length; t++) | |
if (!i(arguments[t])) { | |
n = !1; | |
break; | |
} | |
return n; | |
} | |
function s() { | |
var e, t, i = {}, | |
r = 0; | |
if (n.cookie) | |
for (e = n.cookie.split("; "); r < e.length; r++) t = e[r].split( | |
"="), i[t[0]] = decodeURIComponent(t[1]) || null; | |
return i; | |
} | |
function l(e) { | |
return null !== c(e); | |
} | |
function c(e) { | |
var t = new RegExp("(^|;)\\\\s*" + e + "\\\\s*=\\\\s*([^;]+)"), | |
i = n.cookie.match(t); | |
return i ? i.pop() : null; | |
} | |
function u(e, t, i, a, s, l) { | |
var c = ""; | |
o(e) && o(t) && (i = r(i), a = o(a) ? a : "/", s = o(s) ? s : | |
"", l = o(l) ? l : !1, c += e + "=" + encodeURIComponent( | |
t), o(i) && (c += ";expires=" + i), a && (c += ";path=" + | |
a), s && (c += ";domain=" + s), l && (c += "; secure"), | |
n.cookie = c); | |
} | |
function d(e, t, n, i) { | |
u(e, t, n, "/", ".cnn.com", i); | |
} | |
function f(e, t, i) { | |
var r = ""; | |
o(e) && (t = o(t) ? t : "/", i = o(i) ? i : "", r += e + | |
"=;expires=" + T, t && (r += ";path=" + t), i && (r += | |
";domain=" + i), n.cookie = r); | |
} | |
function p(e) { | |
f(e, "/", ".cnn.com"); | |
} | |
function h(e, n, i) { | |
var r; | |
if ("string" == typeof e && e.length > 0 && "string" == | |
typeof n) | |
if (C === !1) u(e, n, "session" === i ? null : i, "/", | |
".cnn.com", !1); | |
else try { | |
"session" === i ? t.sessionStorage.setItem(e, n) : (t.localStorage | |
.setItem(e, n), "number" == typeof i ? (r = new Date( | |
Date.now() + i * A), t.localStorage.setItem(e + | |
"__expires", r.getTime() | |
.toString(10))) : "string" == typeof i && | |
"session" !== i && (r = new Date(i), r.getTime() > | |
Date.now() && t.localStorage.setItem(e + | |
"__expires", r.getTime() | |
.toString(10)))); | |
} catch (o) {} | |
} | |
function g(e) { | |
if ("string" == typeof e && e.length > 0) { | |
if (C === !1) return l(e); | |
try { | |
if (o(t.sessionStorage.getItem(e)) || o(t.localStorage.getItem( | |
e + "__expires"))) return !0; | |
} catch (n) {} | |
} | |
return !1; | |
} | |
function m(e) { | |
if ("string" == typeof e && e.length > 0) | |
if (C === !1) f(e); | |
else { | |
try { | |
t.localStorage.removeItem(e), t.localStorage.removeItem( | |
e + "__expires"); | |
} catch (n) {} | |
try { | |
t.sessionStorage.removeItem(e); | |
} catch (n) {} | |
} | |
} | |
function v(e) { | |
var n, i = null; | |
if ("string" == typeof e && e.length > 0) try { | |
C === !1 ? c(e) : null !== (n = t.localStorage.getItem(e + | |
"__expires")) ? parseInt(n, 10) > Date.now() ? i = t.localStorage | |
.getItem(e) : m(e) : (i = t.sessionStorage.getItem(e), | |
o(i) || (i = t.localStorage.getItem(e))); | |
} catch (r) {} | |
return i; | |
} | |
function y(e) { | |
var n, i, r, o, a, s, l = e; | |
if ("function" == typeof t.btoa) try { | |
n = t.btoa(l); | |
} catch (c) { | |
n = t.btoa(e.replace( | |
/[^\\w\\s\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\-\\=\\+\\.\\,\\\\\\;\\:\\\'\\"\\?]/, | |
"-")); | |
} else { | |
if (i = | |
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" | |
.split(""), r = "", o = "", a = l.length % 3, a > 0) | |
for (; 3 > a; a++) o += "=", l += "\\x00"; | |
for (a = 0; a < l.length; a += 3) a > 0 && a / 3 * 4 % 76 === | |
0 && (r += "\r"), s = (l.charCodeAt(a) << 16) + (l.charCodeAt( | |
a + 1) << 8) + l.charCodeAt(a + 2), s = [s >>> 18 & | |
63, s >>> 12 & 63, s >>> 6 & 63, 63 & s | |
], r += i[s[0]] + i[s[1]] + i[s[2]] + i[s[3]]; | |
n = r.substring(0, r.length - o.length) + o; | |
} | |
return n; | |
} | |
function _(e) { | |
var n, i, r, o, a, s, l, c, u = e; | |
if ("function" == typeof t.atob) try { | |
n = t.atob(u); | |
} catch (d) { | |
console.log(d.message, "String to decode: " + u); | |
} else { | |
for (i = | |
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" | |
.split(""), r = {}, c = 0; c < i.length; c++) r[i[c]] = | |
c; | |
for (u = u.replace(new RegExp("[^" + i.join("") + "=]", | |
"g"), ""), a = "=" === u.charAt(u.length - 1) ? "=" === | |
u.charAt(u.length - 2) ? "AA" : "A" : "", o = "", u = u | |
.substr(0, u.length - a.length) + a, s = 0; s < u.length; s += | |
4) l = (r[u.charAt(s)] << 18) + (r[u.charAt(s + 1)] << | |
12) + (r[u.charAt(s + 2)] << 6) + r[u.charAt(s + 3)], | |
o += String.fromCharCode(l >>> 16 & 255, l >>> 8 & 255, | |
255 & l); | |
n = o.substring(0, o.length - a.length); | |
} | |
return n; | |
} | |
function w(e) { | |
return e.replace("#", ""); | |
} | |
function b() { | |
return t.Modernizr.phone; | |
} | |
var C, A = 36e5, | |
T = "Thu, 01 Jan 1970 00:00:00 UTC"; | |
return C = function() { | |
try { | |
var e = "__test_it"; | |
return t.localStorage.setItem(e, e), t.localStorage.removeItem( | |
e), t.sessionStorage.setItem(e, e), t.sessionStorage.removeItem( | |
e), !0; | |
} catch (n) { | |
return !1; | |
} | |
}(), { | |
exists: o, | |
existsObject: a, | |
getCookies: s, | |
getCookie: c, | |
cookieExists: l, | |
setCookie: u, | |
deleteCookie: f, | |
setCNNCookie: d, | |
deleteCNNCookie: p, | |
storeLocalValue: h, | |
hasLocalValue: g, | |
deleteLocalValue: m, | |
getLocalValue: v, | |
b64Encode: y, | |
b64Decode: _, | |
stripHash: w, | |
isPhone: b | |
}; | |
}(jQuery, window, document) | |
}], | |
'CNN.contentModel': [{ | |
prop: 'CNN.contentModel', | |
to: CNN.contentModel || {} | |
}], | |
'CNN.CurrentWidth': [{ | |
prop: 'CNN.CurrentWidth', | |
to: CNN.CurrentWidth || {} | |
}], | |
'CNN.CurrentWidth.getClientWidth': [{ | |
prop: 'CNN.CurrentWidth.getClientWidth', | |
to: CNN.CurrentWidth.getClientWidth || jQuery.noop | |
}], | |
'CNN.minWidthForExpandElements': [{ | |
prop: 'CNN.minWidthForExpandElements', | |
to: 480 | |
}], | |
'CNN.showGalleryCaptionWidth': [{ | |
prop: 'CNN.showGalleryCaptionWidth', | |
to: 640 | |
}], | |
'CNN.orientationLandscape': [{ | |
prop: 'CNN.orientationLandscape', | |
to: !1 | |
}], | |
'CNN.adLockingDisableWidth': [{ | |
prop: 'CNN.adLockingDisableWidth', | |
to: 960 | |
}], | |
'CNN.adLockEnable': [{ | |
prop: 'CNN.adLockEnable', | |
to: !!(F(CNN.AdsConfig) && CNN.AdsConfig.enableAdLock === !0 && CNN | |
.CurrentWidth.getClientWidth() >= CNN.adLockingDisableWidth && | |
jQuery(".pg-rail.pg-rail-tall__rail") | |
.length > 0 && jQuery(".pg-rail-tall__head") | |
.length > 0) | |
}, { | |
prop: 'CNN.adLockEnable', | |
to: !1 | |
}], | |
'CNN.adLockLongArticleEnable': [{ | |
prop: 'CNN.adLockLongArticleEnable', | |
to: !(!CNN.adLockEnable || !D || CNN.rightRailConfig.longArticle.enableAdLock !== | |
!0 || 0 === X) | |
}] | |
} | |
const cnn_header_dd8bbc58158edece6f16_first_bundle_js = { | |
'CNN.Features': [{ | |
prop: 'CNN.Features', | |
to: CNN.Features || {} | |
}], | |
'CNN.PageParams': [{ | |
prop: 'CNN.PageParams', | |
to: {} | |
}], | |
'CNN.pageVis': [{ | |
prop: 'CNN.pageVis', | |
to: { | |
hiddenEvent: "", | |
hiddenKey: "", | |
isDocumentHidden: function() { | |
return this.hiddenKey.length > 0 && e[this.hiddenKey] === !0; | |
}, | |
isDocumentVisible: function() { | |
return this.hiddenKey.length > 0 && e[this.hiddenKey] === !1; | |
} | |
} | |
}], | |
'CNN._analyticsMetadataEvent': [{ | |
prop: 'CNN._analyticsMetadataEvent', | |
to: !1 | |
}, { | |
prop: 'CNN._analyticsMetadataEvent', | |
to: !0 | |
}], | |
'CNN._corePlayerReady': [{ | |
prop: 'CNN._corePlayerReady', | |
to: !1 | |
}, { | |
prop: 'CNN._corePlayerReady', | |
to: !0 | |
}], | |
'CNN._zonesRenderedEvent': [{ | |
prop: 'CNN._zonesRenderedEvent', | |
to: !1 | |
}, { | |
prop: 'CNN._zonesRenderedEvent', | |
to: !0 | |
}], | |
'CNN._zonesAndDomReadyEvent': [{ | |
prop: 'CNN._zonesAndDomReadyEvent', | |
to: !1 | |
}, { | |
prop: 'CNN._zonesAndDomReadyEvent', | |
to: !0 | |
}], | |
'CNN._zoneRenderedEvent': [{ | |
prop: 'CNN._zoneRenderedEvent', | |
to: !1 | |
}], | |
'CNN.pageVis.hiddenKey': [{ | |
prop: 'CNN.pageVis.hiddenKey', | |
to: "hidden" | |
}, { | |
prop: 'CNN.pageVis.hiddenKey', | |
to: "mozHidden" | |
}, { | |
prop: 'CNN.pageVis.hiddenKey', | |
to: "msHidden" | |
}, { | |
prop: 'CNN.pageVis.hiddenKey', | |
to: "webkitHidden" | |
}], | |
'CNN.pageVis.hiddenEvent': [{ | |
prop: 'CNN.pageVis.hiddenEvent', | |
to: "visibilitychange" | |
}, { | |
prop: 'CNN.pageVis.hiddenEvent', | |
to: "mozvisibilitychange" | |
}, { | |
prop: 'CNN.pageVis.hiddenEvent', | |
to: "msvisibilitychange" | |
}, { | |
prop: 'CNN.pageVis.hiddenEvent', | |
to: "webkitvisibilitychange" | |
}], | |
'CNN.PageParams[n[t].substr(0, e)]': [{ | |
prop: 'CNN.PageParams[n[t].substr(0, e)]', | |
to: decodeURIComponent(n[t].substr(e + 1) | |
.replace(/\\+/g, " ")) | |
}], | |
'CNN.PageParams[n[t]]': [{ | |
prop: 'CNN.PageParams[n[t]]', | |
to: "" | |
}], | |
'CNN.goActiveUntil': [{ | |
prop: 'CNN.goActiveUntil', | |
to: "number" == typeof CNN.goActiveUntil ? CNN.goActiveUntil : 0 | |
}], | |
'CNN.refreshTimer': [{ | |
prop: 'CNN.refreshTimer', | |
to: { | |
adList: [], | |
forceReset: 0, | |
hiddenResetDelay: 0, | |
hiddenResetThreshold: 0, | |
hiddenTime: 0, | |
intervals: {}, | |
intervalsCount: 0, | |
intervalsId: null, | |
intervalsVis: {}, | |
intervalsVisCount: 0, | |
intervalsVisId: null, | |
startTime: n, | |
visibleTime: 0, | |
visibleTimeAccrued: 0 | |
} | |
}], | |
'CNN.pageTimer.isPage': [{ | |
prop: 'CNN.pageTimer.isPage', | |
to: !0 | |
}], | |
'CNN.refreshTimer.intervalsVis[CNN.pageTimer.interval]': [{ | |
prop: 'CNN.refreshTimer.intervalsVis[CNN.pageTimer.interval]', | |
to: [CNN.pageTimer] | |
}], | |
'CNN.refreshTimer.hiddenResetThreshold': [{ | |
prop: 'CNN.refreshTimer.hiddenResetThreshold', | |
to: 6e4 * CNN.pageTimer.resetThreshold | |
}], | |
'CNN.refreshTimer.hiddenResetDelay': [{ | |
prop: 'CNN.refreshTimer.hiddenResetDelay', | |
to: 6e4 * ("number" == typeof CNN.pageTimer.resetDelay ? CNN.pageTimer | |
.resetDelay : 0) | |
}], | |
'CNN.refreshTimer.intervals[CNN.pageTimer.interval]': [{ | |
prop: 'CNN.refreshTimer.intervals[CNN.pageTimer.interval]', | |
to: [CNN.pageTimer] | |
}], | |
'CNN.refreshTimer.triggerTimer': [{ | |
prop: 'CNN.refreshTimer.triggerTimer', | |
to: function(t) { | |
var n, r, o; | |
if ("string" == typeof t.eventName && t.eventName.length > 0 && | |
i(e) | |
.trigger(t.eventName), t.isPage === !0) return void(window.location | |
.href.search(/[\\&\\?]refresh\\=/) >= 0 ? window.location | |
.reload(!0) : (n = window.location.href.indexOf("#"), | |
window.location.href.indexOf("?") >= 0 ? n >= 0 ? | |
window.location.replace(window.location.href.substr(0, | |
n) + "&refresh=1" + window.location.href.substr(n)) : | |
window.location.replace(window.location.href + | |
"&refresh=1") : n >= 0 ? window.location.replace( | |
window.location.href.substr(0, n) + "?refresh=1" + | |
window.location.href.substr(n)) : window.location.replace( | |
window.location.href + "?refresh=1"))); | |
if ("object" == typeof AMPTManager && "function" == typeof AMPTManager | |
.refreshAds && "string" == typeof t.className && t.className.length > | |
0 && (r = i(t.className), null !== r && r.length > 0)) | |
for (n = 0; n < r.length; n++) o = r.eq(n) | |
.attr("id"), "string" == typeof o && o.length > 0 && CNN.refreshTimer | |
.adList.push(o); | |
} | |
}], | |
'CNN.refreshTimer.intervalAction': [{ | |
prop: 'CNN.refreshTimer.intervalAction', | |
to: function() { | |
var e, t, n, r = CNN.refreshTimer, | |
o = new Date() | |
.getTime(), | |
a = Math.floor((o - r.startTime + 1e4) / 6e4); | |
if (a > 0) { | |
r.adList = []; | |
for (e in r.intervals) | |
if (t = parseInt(e, 10), r.intervals.hasOwnProperty(e) && t > | |
0 && a % t === 0 && "undefined" != typeof r.intervals[e] && | |
i.isArray(r.intervals[e])) | |
for (n = 0; n < r.intervals[e].length; n++) r.triggerTimer( | |
r.intervals[e][n]); | |
if (r.adList.length > 0) try { | |
AMPTManager.refreshAds(r.adList); | |
} catch (s) { | |
console.log("Failed to refresh ads (" + r.adList.join(",") + | |
"): ", s); | |
} | |
} | |
} | |
}], | |
'CNN.refreshTimer.intervalVisAction': [{ | |
prop: 'CNN.refreshTimer.intervalVisAction', | |
to: function() { | |
var e, t, n, r, o, a = CNN.refreshTimer, | |
s = new Date() | |
.getTime(); | |
if (a.visibleTime > 0 && (e = s - a.visibleTime, a.visibleTimeAccrued += | |
e, s >= CNN.goActiveUntil && a.forceReset > 0 && (a.forceReset -= | |
e, a.forceReset <= 0 && a.triggerTimer(CNN.pageTimer)), a | |
.visibleTime = s), CNN.pageVis.isDocumentHidden()) a.handleVisibilityChange(); | |
else if (n = Math.floor((a.visibleTimeAccrued + 1e4) / 6e4), a.intervalsVisId = | |
setTimeout(a.intervalVisAction, 6e4 * (n + 1) - a.visibleTimeAccrued), | |
n > 0) { | |
a.adList = []; | |
for (t in a.intervalsVis) | |
if (r = parseInt(t, 10), a.intervalsVis.hasOwnProperty(t) && | |
r > 0 && n % r === 0 && "undefined" != typeof a.intervalsVis[ | |
t] && i.isArray(a.intervalsVis[t])) | |
for (o = 0; o < a.intervalsVis[t].length; o++)(!a.intervalsVis[ | |
t][o].isPage || s >= CNN.goActiveUntil) && a.triggerTimer( | |
a.intervalsVis[t][o]); | |
if (a.adList.length > 0) try { | |
AMPTManager.refreshAds(a.adList); | |
} catch (l) { | |
console.log("Failed to refresh ads (" + a.adList.join(",") + | |
"): ", l); | |
} | |
} | |
} | |
}], | |
'CNN.refreshTimer.handleVisibilityChange': [{ | |
prop: 'CNN.refreshTimer.handleVisibilityChange', | |
to: function() { | |
var e, t, n = CNN.refreshTimer, | |
i = new Date() | |
.getTime(); | |
CNN.pageVis.isDocumentHidden() ? null !== n.intervalsVisId && ( | |
clearTimeout(n.intervalsVisId), n.intervalsVisId = null, n.hiddenTime = | |
i, n.visibleTime > 0 && (n.visibleTimeAccrued += i - n.visibleTime, | |
n.visibleTime = 0)) : null === n.intervalsVisId && (t = | |
6e4 - n.visibleTimeAccrued % 6e4, n.visibleTime = i, n.hiddenResetThreshold > | |
0 && n.hiddenTime > 0 && CNN.goActiveUntil <= i && (e = i - | |
n.hiddenTime, (n.forceReset > 0 || n.hiddenResetThreshold < | |
e && n.hiddenResetDelay < 6e4 * (CNN.pageTimer.interval - | |
1) - n.visibleTimeAccrued) && (n.forceReset > 0 ? n.forceReset -= | |
e : n.forceReset = n.hiddenResetDelay, n.forceReset <= | |
0 && n.triggerTimer(CNN.pageTimer))), n.hiddenTime = 0, | |
n.intervalsVisId = setTimeout(n.intervalVisAction, t)); | |
} | |
}], | |
'CNN.refreshTimer.intervalsId': [{ | |
prop: 'CNN.refreshTimer.intervalsId', | |
to: setInterval(CNN.refreshTimer.intervalAction, 6e4) | |
}], | |
'CNN.refreshTimer.hiddenTime': [{ | |
prop: 'CNN.refreshTimer.hiddenTime', | |
to: n | |
}], | |
'CNN.refreshTimer.visibleTime': [{ | |
prop: 'CNN.refreshTimer.visibleTime', | |
to: n | |
}], | |
'CNN.refreshTimer.intervalsVisId': [{ | |
prop: 'CNN.refreshTimer.intervalsVisId', | |
to: setTimeout(CNN.refreshTimer.intervalVisAction, 6e4) | |
}], | |
'CNN.CurrentHeight': [{ | |
prop: 'CNN.CurrentHeight', | |
to: n.extend({}, { | |
lastKnownHeight: -1, | |
working: !1, | |
isWorking: function() { | |
return "number" == typeof this.working; | |
}, | |
getClientHeight: function() { | |
var e = | |
"Requesting the height before this object has had a chance to do a first read of the client\'s height"; | |
return this.lastKnownHeight === -1 && console.warn( | |
"current-height::getClientHeight: %s", e), this.lastKnownHeight; | |
}, | |
trackClientHeight: function() { | |
var e; | |
this.isWorking() || (e = i.measure(function() { | |
this.lastKnownHeight = n(t) | |
.height(), this.clearWorking(); | |
}, this), this.working = e); | |
}, | |
clearWorking: function() { | |
this.isWorking() && (i.clear(this.working), this.working = ! | |
1); | |
}, | |
readySetGo: function() { | |
this.lastKnownHeight = n(t) | |
.height(), n(t) | |
.on("resize", n.proxy(this.trackClientHeight, this)), n( | |
t) | |
.on("pagehide", n.proxy(this.clearWorking, this)); | |
} | |
}, CNN.CurrentHeight) | |
}], | |
'CNN.CurrentWidth': [{ | |
prop: 'CNN.CurrentWidth', | |
to: n.extend({}, { | |
lastKnownWidth: -1, | |
working: !1, | |
isWorking: function() { | |
return "number" == typeof this.working; | |
}, | |
getClientWidth: function() { | |
var e = | |
"Requesting the width before this object has had a chance to do a first read of the client\'s width"; | |
return this.lastKnownWidth === -1 && console.warn( | |
"current-width::getClientWidth: %s", e), this.lastKnownWidth; | |
}, | |
trackClientWidth: function() { | |
var e; | |
this.isWorking() || (e = i.measure(function() { | |
this.lastKnownWidth = n(t) | |
.width(), this.clearWorking(); | |
}, this), this.working = e); | |
}, | |
clearWorking: function() { | |
this.isWorking() && (i.clear(this.working), this.working = ! | |
1); | |
}, | |
readySetGo: function() { | |
this.lastKnownWidth = n(t) | |
.width(), n(t) | |
.on("resize", n.proxy(this.trackClientWidth, this)), n( | |
t) | |
.on("pagehide", n.proxy(this.clearWorking, this)); | |
} | |
}, CNN.CurrentWidth) | |
}], | |
'CNN.CurrentScrollTop': [{ | |
prop: 'CNN.CurrentScrollTop', | |
to: n.extend({}, { | |
lastKnownScrollTop: -1, | |
working: !1, | |
isWorking: function() { | |
return "number" == typeof this.working; | |
}, | |
getClientScrollTop: function() { | |
var e = | |
"Requesting the ScrollTop before this object has had a chance to do a first read of the client\'s ScrollTop"; | |
return this.lastKnownScrollTop === -1 && console.warn( | |
"current-ScrollTop::getClientScrollTop: %s", e), this | |
.lastKnownScrollTop; | |
}, | |
trackClientScrollTop: function() { | |
var e; | |
this.isWorking() || (e = i.measure(function() { | |
this.lastKnownScrollTop = n(t) | |
.scrollTop(), this.clearWorking(); | |
}, this), this.working = e); | |
}, | |
clearWorking: function() { | |
this.isWorking() && (i.clear(this.working), this.working = ! | |
1); | |
}, | |
readySetGo: function() { | |
this.lastKnownScrollTop = n(t) | |
.scrollTop(), n(t) | |
.on("scroll", n.proxy(this.trackClientScrollTop, this)), | |
n(t) | |
.on("pagehide", n.proxy(this.clearWorking, this)); | |
} | |
}, CNN.CurrentScrollTop) | |
}], | |
'CNN.INJECTOR': [{ | |
prop: 'CNN.INJECTOR', | |
to: CNN.INJECTOR || {} | |
}], | |
'CNN.INJECTOR.getUrlForFeatureName': [{ | |
prop: 'CNN.INJECTOR.getUrlForFeatureName', | |
to: function(e, t) { | |
var n, i, r = "", | |
o = 0, | |
a = 0; | |
for (o = 0; o < s.length; o++) | |
for (i = s[o], n = i.chunkNames, a = 0; a < n.length; a++) n[ | |
a] === e && (r = | |
"/web/20160903014109/http://www.i.cdn.cnn.com/.a/bundles/" + | |
i.name, t && (r += "?version=latest&client=expansion")); | |
return r; | |
} | |
}], | |
'CNN.INJECTOR.loadFeature': [{ | |
prop: 'CNN.INJECTOR.loadFeature', | |
to: function(i) { | |
var r = !1, | |
a = e(i), | |
s = CNN.INJECTOR.getUrlForFeatureName(i, r); | |
return "undefined" == typeof a && (a = t(i, r), "rejected" !== | |
a.state() && jQuery.ajax({ | |
dataType: "script", | |
cache: !0, | |
url: s | |
}) | |
.done(jQuery.proxy(o, null, a)) | |
.fail(jQuery.proxy(n, null, a))), a.promise(); | |
} | |
}], | |
'CNN.INJECTOR.executeFeature': [{ | |
prop: 'CNN.INJECTOR.executeFeature', | |
to: function(n, o) { | |
var a = e(n), | |
s = CNN.INJECTOR.getUrlForFeatureName(n, o); | |
return "undefined" == typeof a && (a = t(n, o), "rejected" !== | |
a.state() && jQuery.ajax({ | |
dataType: "script", | |
cache: !0, | |
url: s | |
}) | |
.done(jQuery.proxy(r, null, a)) | |
.fail(jQuery.proxy(i, null, a))), a.promise(); | |
} | |
}], | |
'CNN.INJECTOR.scriptComplete': [{ | |
prop: 'CNN.INJECTOR.scriptComplete', | |
to: function(e) { | |
l[e].resolve({ | |
isLoaded: !0, | |
exists: !0, | |
executed: !0 | |
}); | |
} | |
}], | |
'CNN.INJECTOR.resetNameSpaceFeature': [{ | |
prop: 'CNN.INJECTOR.resetNameSpaceFeature', | |
to: function(e) { | |
u[e] = jQuery.Deferred(); | |
} | |
}], | |
'CNN.INJECTOR.getNameSpaceFeature': [{ | |
prop: 'CNN.INJECTOR.getNameSpaceFeature', | |
to: function(e) { | |
var t, n, i = e.split("."), | |
r = window, | |
o = !0; | |
if (u[e]) t = u[e].promise(); | |
else { | |
for (u[e] = jQuery.Deferred(), t = u[e].promise(), n = 0; n < | |
i.length; n++) r = r[i[n]], "undefined" == typeof r && (o = ! | |
1); | |
o ? u[e].resolve({ | |
isLoaded: !0 | |
}) : u[e].reject({ | |
isLoaded: !1 | |
}); | |
} | |
return t; | |
} | |
}] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
const name // min file unmangled | |
properties | |
'Global CNN varible w/ property chain': [ | |
{ | |
prop: 'lhs' // CNN w/ property chain assignee | |
to: 'rhs' // Assigned to | |
} | |
] | |
*/ | |
const cnn_analytics_min_js = { | |
'CNN.Analytics': [{ | |
prop: 'CNN.Analytics', | |
to: CNN.Analytics || {} | |
}], | |
'CNN.contentModel': [{ | |
prop: 'CNN.contentModel', | |
to: CNN.contentModel || {} | |
}], | |
'CNN.Gallery': [{ | |
prop: 'CNN.Gallery', | |
to: CNN.Gallery || {} | |
}], | |
'CNN.Analytics.utils': [{ | |
prop: 'CNN.Analytics.utils', | |
to: function () { | |
"use strict"; | |
function e () { | |
var e = CNN.CurrentSize.getClientWidth(), | |
t = 640, | |
n = 960, | |
a = 1120, | |
i = "no-value-set"; | |
return i = e >= a ? "14col" : a > e && e >= n ? "12col" : n > | |
e && e >= t ? "8col" : "4col"; | |
} | |
function t (e) { | |
var t = {}; | |
return t.section = "section front", t.special = "specials", t | |
.videos = "video", "string" == typeof e && e in t && (e = t[ | |
e]), "undefined" == typeof CNN.contentModel || | |
"undefined" == typeof CNN.contentModel.sectionName || | |
"homepage" !== CNN.contentModel.sectionName && | |
"intl_homepage" !== CNN.contentModel.sectionName || (e = | |
"index"), e; | |
} | |
function n (e, t, n) { | |
var a = e.split(";"), | |
i = 0; | |
for (t = "string" == typeof t && t.length > 0 ? ";expires=" + | |
t : "", n = "string" == typeof n && n.length > 0 ? ";path=" + | |
n : ";path=/"; i < a.length; i++) document.cookie = a[i] + | |
n + t + ";"; | |
} | |
function a (e, t) { | |
"string" == typeof t && t.length > 0 && n(t), e.currentTarget | |
.attributes.hasOwnProperty("data-vr-track") && window._vrtrack({ | |
track_url: e.currentTarget.href, | |
event_type: "partner" | |
}); | |
} | |
function i () { | |
var n, a, i, r, c, l = CNN.contentModel.pageType, | |
s = "no-value-set", | |
d = s, | |
u = e(), | |
p = jQuery(CNN.Carousel.carouselSelector) | |
.first(), | |
g = jQuery("div[data-analytics-pivit]") | |
.length > 0, | |
h = s, | |
y = s, | |
_ = s, | |
m = jQuery(".js-media__video") | |
.length, | |
f = CNN.contentModel.env || s, | |
N = CNN.contentModel.analytics && CNN.contentModel.analytics | |
.showName || "", | |
b = CNN.contentModel.title || s, | |
C = [], | |
v = s, | |
w = s, | |
k = s, | |
j = s, | |
M = s, | |
T = s, | |
Q = "none", | |
z = 0, | |
S = ""; | |
if ("undefined" == typeof CNN.contentModel || "undefined" == typeof CNN.contentModel.pageType || "undefined" == typeof CNN | |
.contentModel.sectionName || "section" !== CNN.contentModel | |
.pageType && "homepage" !== CNN.contentModel.sectionName && | |
"intl_homepage" !== CNN.contentModel.sectionName || (b = s), | |
"undefined" != typeof CNN.contentModel && "undefined" != typeof CNN.contentModel.layout && "error" === CNN.contentModel | |
.layout && (l = "error"), p.length) switch (l) { | |
case "article": | |
h = p.data("galleryname"), y = p.find( | |
"[data-slidename]") | |
.first() | |
.data("slidename"); | |
break; | |
case "gallery": | |
h = b, y = p.find("[data-slidename]") | |
.first() | |
.data("slidename"), z = 1; | |
} | |
"undefined" != typeof CNN.contentModel.analytics && ( | |
"undefined" != typeof CNN.contentModel.analytics.publishDate && | |
(_ = CNN.contentModel.analytics.publishDate, C = CNN.contentModel | |
.analytics.publishDate.split("T")[0].split("-"), 3 === | |
C.length && (_ = C[0] + "/" + C[1] + "/" + C[2])), v = | |
CNN.contentModel.analytics.author || s, w = CNN.contentModel | |
.analytics.cap_genre || s, k = CNN.contentModel.analytics | |
.cap_franchise || s, j = CNN.contentModel.analytics.cap_mediaType || | |
s, M = CNN.contentModel.analytics.cap_topics || s, T = | |
CNN.contentModel.pageType || s, r = CNN.contentModel.analytics | |
.branding_content_page || s, n = CNN.contentModel.analytics | |
.branding_content_zone || s, a = CNN.contentModel.analytics | |
.branding_content_container || s, i = CNN.contentModel.analytics | |
.branding_content_card || s, c = CNN.contentModel.analytics | |
.contentId || s, "gallery" === T && "string" == typeof CNN | |
.contentModel.analytics.branding_content_page && | |
"default" !== CNN.contentModel.analytics.branding_content_page && | |
(S = CNN.contentModel.analytics.branding_content_page), g && | |
(Q = "pivit widget")), jQuery.extend(CNN.omniture, { | |
branding_ad_page: s, | |
branding_ad_zone: s, | |
branding_ad_container: s, | |
branding_ad_card: s, | |
branding_content_page: r, | |
branding_content_zone: n, | |
branding_content_container: a, | |
branding_content_card: i, | |
branding_gallery: S, | |
cap_author: v, | |
cap_content_type: T, | |
cap_genre: w, | |
cap_franchise: k, | |
cap_media_type: j, | |
cap_show_name: N, | |
cap_topic: M, | |
video_opportunity: m, | |
content_id: c, | |
content_type: Q, | |
friendly_name: d, | |
full_gallery: z, | |
gallery_name: h, | |
gallery_slide: y, | |
grid_size: u, | |
headline: b, | |
ireport_assignment: s, | |
publish_date: _, | |
rs_flag: f, | |
section: o(CNN.contentModel), | |
template_type: t(l) | |
}), "error" === CNN.omniture.template_type && (CNN.omniture | |
.section = ["error", s]), "function" == typeof jQuery.fn.triggerAnalyticsMetadataReady ? | |
jQuery(document) | |
.triggerAnalyticsMetadataReady() : jQuery(document) | |
.trigger("cnn-analytics-metadata-added"); | |
} | |
function o (e) { | |
var t = "", | |
n = "", | |
a = "", | |
i = e, | |
o = e.analytics || {}; | |
return a = "undefined" != typeof i.sectionName ? i.sectionName : | |
"undefined" != typeof o.parentPath ? o.parentPath.indexOf( | |
"/") > -1 ? o.parentPath.split("/")[1] : o.parentPath : | |
"undefined" != typeof i.layout && "search" === i.layout ? | |
"search" : "no-value-set", d[a] ? (t = d[a].section, n = d[ | |
a].subsection || "") : (t = a, n = ""), "undefined" != typeof o.subSectionName && "" !== o.subSectionName && (n = | |
o.subSectionName), [t, n]; | |
} | |
function r () { | |
var e; | |
try { | |
e = location.href.toLowerCase(), window.jsmd = _jsmd.init(), - | |
1 === e.indexOf("/.element/ssi/ads.iframes/") && -1 === e | |
.indexOf("/doubleclick/dartiframe.html") && -1 === e.indexOf( | |
"/search/") && (_jsmd.plugin.gQuery("refresh") ? jsmd.trackMetrics( | |
"dynamic-autoRefresh", "autorefresh", | |
"cnn-autorefresh") : "gallery" !== CNN.omniture.template_type_content && | |
jsmd.send()); | |
} catch (t) { | |
console.log("JSMD/Analytics error: ", t); | |
} | |
} | |
function c (e) { | |
var t = jQuery(".nav--plain-header"), | |
n = jQuery("footer.l-footer"), | |
a = CNN.Analytics.hpt; | |
jQuery(e) | |
.find("a") | |
.each(function () { | |
var e, i = jQuery(this), | |
o = i.attr("href"); | |
"string" == typeof o && (e = "page", i.closest(".nav", | |
t) | |
.length > 0 ? e = "header" : i.closest( | |
".nav-flyout__menu-item", t) | |
.length > 0 ? e = "header" : i.closest(".l-footer", | |
n) | |
.length > 0 && (e = "footer"), a.getHptValues(i, e) | |
.done(function (e) { | |
var t; | |
"object" == typeof e && -1 === o.indexOf(e.hptValue) ? | |
(t = "hpt=" + e.hptValue + ";hpt2=" + e.hpt2Value, | |
i.click(jQuery.proxy(function (e, t) { | |
CNN.Analytics.utils.clickEventTracker( | |
t, e); | |
}, this, t))) : "string" == typeof i.data( | |
"vr-track") && o.length > 1 && i.click(CNN.Analytics | |
.utils.clickEventTracker); | |
})); | |
}); | |
} | |
function l () { | |
var e = jQuery("a", "div.metadata-header__follow-icon"), | |
t = jQuery("div.share-bar-whatsapp-container"), | |
n = jQuery("a", "div.nav-flyout-footer__social"); | |
e.click(function () { | |
return s(this, !1); | |
}), t.click(function () { | |
var e = document.querySelector( | |
".share-bar-whatsapp-container") | |
.dataset, | |
t = e.url + " " + e.title + " " + e.storyurl; | |
return jQuery("html") | |
.hasClass("phone") && (document.location = t), s(this, ! | |
1); | |
}), n.click(function () { | |
return s(this, !0); | |
}); | |
} | |
function s (e, t) { | |
var n = e.getAttribute("data-social-media-name"); | |
if ("function" == typeof window.trackMetrics) try { | |
window.trackMetrics({ | |
type: "social-click", | |
data: { | |
clickObj: { | |
socialType: "social: " + n, | |
isMainNav: t | |
} | |
} | |
}); | |
} catch (a) {} | |
return !0; | |
} | |
var d = { | |
videos: { | |
section: "videos" | |
}, | |
"watch-cnn": { | |
section: "watch-cnn" | |
}, | |
intl_homepage: { | |
section: "cnn homepage", | |
subsection: "" | |
}, | |
homepage: { | |
section: "cnn homepage", | |
subsection: "" | |
}, | |
us: { | |
section: "us", | |
subsection: "" | |
}, | |
world: { | |
section: "world", | |
subsection: "" | |
}, | |
politics: { | |
section: "politics", | |
subsection: "" | |
}, | |
tech: { | |
section: "tech", | |
subsection: "" | |
}, | |
health: { | |
section: "health", | |
subsection: "" | |
}, | |
entertainment: { | |
section: "entertainment", | |
subsection: "" | |
}, | |
living: { | |
section: "living", | |
subsection: "" | |
}, | |
aviation: { | |
section: "travel", | |
subsection: "aviation" | |
}, | |
destinations: { | |
section: "travel", | |
subsection: "destinations" | |
}, | |
foodanddrink: { | |
section: "travel", | |
subsection: "foodanddrink" | |
}, | |
hotels: { | |
section: "travel", | |
subsection: "hotels" | |
}, | |
intl_travel: { | |
section: "travel", | |
subsection: "" | |
}, | |
travel: { | |
section: "travel", | |
subsection: "" | |
}, | |
china: { | |
section: "world", | |
subsection: "china" | |
}, | |
africa: { | |
section: "world", | |
subsection: "africa" | |
}, | |
americas: { | |
section: "world", | |
subsection: "americas" | |
}, | |
asia: { | |
section: "world", | |
subsection: "asia" | |
}, | |
europe: { | |
section: "world", | |
subsection: "europe" | |
}, | |
middleeast: { | |
section: "world", | |
subsection: "middleeast" | |
}, | |
football: { | |
section: "sport", | |
subsection: "football" | |
}, | |
motorsport: { | |
section: "sport", | |
subsection: "motorsport" | |
}, | |
sailing: { | |
section: "sport", | |
subsection: "sailing" | |
}, | |
golf: { | |
section: "sport", | |
subsection: "golf" | |
}, | |
tennis: { | |
section: "sport", | |
subsection: "tennis" | |
}, | |
horseracing: { | |
section: "sport", | |
subsection: "horseracing" | |
}, | |
equestrian: { | |
section: "sport", | |
subsection: "equestrian" | |
}, | |
skiing: { | |
section: "sport", | |
subsection: "skiing" | |
}, | |
architecture: { | |
section: "style", | |
subsection: "architecture" | |
}, | |
arts: { | |
section: "style", | |
subsection: "arts" | |
}, | |
autos: { | |
section: "style", | |
subsection: "autos" | |
}, | |
design: { | |
section: "style", | |
subsection: "design" | |
}, | |
fashion: { | |
section: "style", | |
subsection: "fashion" | |
}, | |
luxury: { | |
section: "style", | |
subsection: "luxury" | |
}, | |
style: { | |
section: "style", | |
subsection: "" | |
} | |
}; | |
return CNN.omniture = CNN.omniture || {}, { | |
gridSize: e, | |
renamingTemplateType: t, | |
addMetadataObject: i, | |
jsmdTracking: r, | |
addTrackingTags: c, | |
setCookie: n, | |
clickEventTracker: a, | |
addSocialMediaInteractionMetrics: l | |
}; | |
}() | |
}], | |
'CNN.omniture.section': [{ | |
prop: 'CNN.omniture.section', | |
to: ["error", s] | |
}], | |
'CNN.omniture': [{ | |
prop: 'CNN.omniture', | |
to: CNN.omniture || {} | |
}], | |
'CNN.Analytics.hpt': [{ | |
prop: 'CNN.Analytics.hpt', | |
to: function () { | |
"use strict"; | |
function e (e) { | |
var t = ""; | |
return e = "undefined" == typeof e ? "" : e.replace(/^zn-/, | |
""), t = c[e] ? c[e] : "no-value-set"; | |
} | |
function t (e) { | |
var t = ""; | |
return e = "undefined" == typeof e ? "" : e.replace(/^cn-/, | |
""), t = r[e] ? r[e] : "no-value-set"; | |
} | |
function n (n, a) { | |
var i, o = {}, | |
r = "no-value-set", | |
c = r, | |
l = CNN.contentModel.pageType, | |
s = CNN.contentModel.sectionName || r, | |
d = CNN.contentModel.type || r, | |
u = r, | |
p = r, | |
g = r, | |
h = r, | |
y = r, | |
_ = r, | |
m = "zone-level", | |
f = [], | |
N = r, | |
b = r, | |
C = r, | |
v = n.closest("[data-analytics]"), | |
w = n.closest("[class^='zn zn-\]"), | |
k = n.closest("section.zn"), | |
j = n.closest(".cn"), | |
M = n.closest("[data-analytics-header]"), | |
T = r, | |
Q = r, | |
z = r, | |
S = [], | |
A = CNN.Analytics.utils; | |
return m = n.text() | |
.length > 0 ? n.text() | |
.toLowerCase() : "zone-level", w.length && "A" !== w[0].tagName && | |
w[0].className && (i = w[0].className, "undefined" != typeof i && (h = i.split(" ") | |
.length > 1 ? i.split(" ")[2] : r)), k.length && (i = k | |
.data("zone-label"), "undefined" != typeof i && i.length && | |
(g = i), i = k.data("vr-zone"), "undefined" != typeof i && | |
i.length && (y = i)), i = v.length ? v.data("analytics") : | |
n[0].className.indexOf("cd-banner") >= 0 ? n.nextAll( | |
"[data-analytics]") | |
.data("analytics") : void 0, "undefined" != typeof i && i.length && | |
(c = i.split("_"), c = c.length ? c : [], N = c[0].length > | |
0 ? c[0] : r, N = N.replace(/\\s/g, "-"), b = c[1], c.length >= | |
4 && c[3].length > 0 ? _ = c[3] : 0 === n.text() | |
.length || n.text() | |
.indexOf("<img") >= 0 ? (_ = "image", m = "image") : _ = | |
"text"), n.eq(0) | |
.text() && (p = n.eq(0) | |
.text(), p = p.replace(/[ ]/g, "-"), p.indexOf("<img") >= | |
0 && (p = "image-file")), i = M.data("analytics-header"), | |
"header" === a && "string" == typeof i && i.split("_") | |
.length && (u = "header", S = i.split("_"), S = S.length ? | |
S : [], T = "main-menu" === S[0] || "flyout-menu" === S[0] ? | |
S[1].toLowerCase() : r, Q = "flyout-submenu" === S[0] ? S[ | |
1].toLowerCase() : r, z = r), i = v.data("analytics"), | |
"footer" === a && "string" == typeof i && i.split("_") | |
.length && (S = i.split("_"), S = S.length ? S : [], 1 === | |
S.length && (u = "footer", T = S[0].toLowerCase(), Q = r, | |
z = r), 2 === S.length && (u = S[0].toLowerCase(), T = | |
S[1].toLowerCase(), Q = r, z = r), 3 === S.length && (u = | |
S[0].toLowerCase(), T = S[1].toLowerCase(), Q = S[2].toLowerCase(), | |
z = r)), "page" === a && j.length && (i = j[0].className, | |
"undefined" != typeof i && (f = i.split(/\\s+/), f.length && | |
(C = f[f.length - 1], C = C.replace(/_/g, "-")))), o = { | |
linkText: m, | |
hpt_page_pageIndicator: d, | |
hpt_page_gridSize: A.gridSize(), | |
hpt_page_section: s, | |
hpt_page_template: A.renamingTemplateType(l), | |
hpt_page_zoneId: y, | |
hpt_page_zoneLabel: g, | |
hpt_page_containerId: C, | |
hpt_page_containerLabel: N, | |
hpt2_page_pageIndicator: d, | |
hpt2_page_gridSize: A.gridSize(), | |
hpt2_page_section: s, | |
hpt2_page_template: A.renamingTemplateType(l), | |
hpt2_page_zoneId: y, | |
hpt2_page_zoneType: e(h), | |
hpt2_page_containerId: C, | |
hpt2_page_containerType: t(b), | |
hpt_header_globalIndicator: u, | |
hpt_header_gridSize: A.gridSize(), | |
hpt_header_section: s, | |
hpt_header_template: A.renamingTemplateType(l), | |
hpt_header_level1: T, | |
hpt_header_level2: Q, | |
hpt_header_level3: z, | |
hpt_header_linkElement: m, | |
hpt_header_linkType: _, | |
hpt2_header_globalIndicator: u, | |
hpt2_header_gridSize: A.gridSize(), | |
hpt2_header_section: s, | |
hpt2_header_template: A.renamingTemplateType(l), | |
hpt2_header_level1: T, | |
hpt2_header_level2: Q, | |
hpt2_header_level3: z, | |
hpt2_header_linkElement: m, | |
hpt2_header_linkType: _ | |
}; | |
} | |
function a (e, t, n) { | |
var a = jQuery.Deferred(); | |
return fastdom.measure(function () { | |
var i, o, r, c = t.data("filter-hpt"), | |
l = t.data("filter-" + e), | |
s = "string" == typeof c, | |
d = "string" == typeof l, | |
u = "", | |
p = n.split("_"); | |
if (d || s) { | |
for (u = d ? l : c, i = u.split("_"), o = 0, r = i.length; r > | |
o; o += 1) p[o] && "" !== i[o] && (p[o] = i[o]); | |
n = p.join("_"); | |
} | |
a.resolve(n); | |
}), a.promise(); | |
} | |
function i (e, t) { | |
return { | |
hptValue: CNN.Utils.b64Encode(e.replace("…", "")) | |
.replace(/\r/g, ""), | |
hpt2Value: CNN.Utils.b64Encode(t.replace("…", "")) | |
.replace(/\r/g, "") | |
}; | |
} | |
function o (e, t) { | |
var o = n(e, t), | |
r = "", | |
c = ""; | |
return "page" === t ? (r = o.hpt_page_pageIndicator + "_" + o | |
.hpt_page_gridSize + "_" + o.hpt_page_section + "_" + o.hpt_page_template + | |
"_" + o.hpt_page_zoneId + "_" + o.hpt_page_zoneLabel + | |
"_" + o.hpt_page_containerId + "_" + o.hpt_page_containerLabel, | |
c = o.hpt2_page_pageIndicator + "_" + o.hpt2_page_gridSize + | |
"_" + o.hpt2_page_section + "_" + o.hpt2_page_template + | |
"_" + o.hpt2_page_zoneId + "_" + o.hpt2_page_zoneType + | |
"_" + o.hpt2_page_containerId + "_" + o.hpt2_page_containerType | |
) : (r = o.hpt_header_globalIndicator + "_" + o.hpt_header_gridSize + | |
"_" + o.hpt_header_section + "_" + o.hpt_header_template + | |
"_" + o.hpt_header_level1 + "_" + o.hpt_header_level2 + | |
"_" + o.hpt_header_linkElement + "_" + o.hpt_header_linkType, | |
c = o.hpt2_header_globalIndicator + "_" + o.hpt2_header_gridSize + | |
"_" + o.hpt2_header_section + "_" + o.hpt2_header_template + | |
"_" + o.hpt2_header_level1 + "_" + o.hpt2_header_level2 + | |
"_" + o.hpt2_header_linkElement + "_" + o.hpt2_header_linkType | |
), jQuery.when(a("hpt1", e, r), a("hpt2", e, c)) | |
.then(i); | |
} | |
var r = { | |
"list-hierarchical-small-horizontal": "lead+list:lead+headlines-w/images", | |
"list-hierarchical-xs": "lead+list:lead+headlines", | |
"list-large-horizontal": "list:full-cards", | |
"list-large-vertical": "vertical-strip:full-cards", | |
"list-small-horizontal": "list:headlines+images", | |
"list-small-vertical": "vertical-strip:headlines+images", | |
"list-xs": "headlines", | |
"grid-medium": "grid:grid(spaced)", | |
"grid-small": "grid:grid", | |
"stack-large-horizontal": "list:full-cards(spaced)", | |
"stack-large-vertical": "vertical-strip:full-cards(spaced)", | |
"stack-medium-horizontal": "list:headlines+images(spaced)", | |
"stack-medium-vertical": "vertical-strip:headlines+images(spaced)", | |
"carousel-large-strip": "carousel:large", | |
"carousel-medium-matrix": "carousel:double-deck", | |
"carousel-medium-strip": "carousel:standard", | |
"stack-ul": "unknown name", | |
"section-preview": "unknown name" | |
}, | |
c = { | |
"left-fluid-right-stack": "hero-3", | |
"left-fluid-bg-bleed": "superhero", | |
"left-fluid": "priority+2", | |
"right-stack-bg-inline": "hero-plus", | |
"right-stack-bg-bleed": "full-bleed", | |
staggered: "staggered", | |
balanced: "balanced", | |
"60-40": "priority+1", | |
"30-70": "grid-right", | |
"40-60": "unknown name", | |
"70-30": "unknown name", | |
body: "unknown name", | |
"single-column": "unknown name", | |
"zone-background": "unknown name", | |
"zone-banner": "unknown name", | |
"zone-header": "unknown name" | |
}; | |
return { | |
getHptValues: o | |
}; | |
}() | |
}], | |
'CNN.Gallery.analytics': [{ | |
prop: 'CNN.Gallery.analytics', | |
to: function () { | |
"use strict"; | |
function e (e, t) { | |
var n = jQuery(e), | |
a = {}, | |
i = [], | |
o = "", | |
r = {}, | |
c = !1, | |
l = [], | |
s = "", | |
d = "", | |
u = 1; | |
for (c = "boolean" == typeof n.data("is-gallery") ? n.data( | |
"is-gallery") : !1, a = { | |
video: 0, | |
article: 0, | |
gallery: 0, | |
image: 0, | |
hyperlink: 0, | |
matched: 0 | |
}, jQuery("div.owl-item div[data-analytics]", e) | |
.each(function () { | |
var e, t = jQuery(this); | |
e = t.data("analytics") | |
.split("_"), l.push(e[2] || ""), d = e[1]; | |
}), s = l.length > 0 ? l[0] : s; u < l.length; u++) | |
if (l[u] !== s) { | |
s = "multimedia"; | |
break; | |
} | |
return "boolean" == typeof t && t && (o = "owl-nav" === e.className ? | |
e.offsetParent.id.split("_")[1] : e.id.split("_")[1], r = | |
document.getElementById("cn-jumbotron-details-container_" + | |
o), jQuery.each(jQuery(r) | |
.find( | |
".js-jumbotron-card-wrapper.jumbotron-card-wrapper.active-card" | |
), | |
function (e, t) { | |
i = t.firstChild.className.match(/cd\\-\\-article/), | |
null === i && (i = t.firstChild.className.match( | |
/cd\\-\\-(video|image|gallery|hyperlink)/)); | |
}), jQuery.each(jQuery(r) | |
.find("article.cd"), | |
function (e, t) { | |
t.className.indexOf("cd--video") > -1 ? a.video++ : t | |
.className.indexOf("cd--article") > -1 ? a.article++ | |
: t.className.indexOf("cd--image") > -1 ? a.image++ | |
: t.className.indexOf("cd--gallery") > -1 ? a.gallery++ | |
: t.className.indexOf("cd--hyperlink") > -1 && a.hyperlink++; | |
}), a.video > 0 && (s = "video", a.matched++), a.article > | |
0 && (s = "article", a.matched++), a.image > 0 && (s = | |
"image", a.matched++), a.hyperlink > 0 && (s = | |
"hyperlink", a.matched++), a.gallery > 0 && (s = | |
"gallery", a.matched++), a.matched > 1 && (s = | |
"multimedia")), s = s.length > 0 ? "carousel_" + s : s, { | |
contentType: s, | |
carouselType: d, | |
isGallery: c | |
}; | |
} | |
function t (e) { | |
return "undefined" != typeof jQuery(e) | |
.data(u) ? jQuery(e) | |
.data(u) : ""; | |
} | |
function n (e) { | |
var t = -1, | |
n = "", | |
a = jQuery(e), | |
i = a.find(p) || []; | |
return t = a.data("active") || "", jQuery.isNumeric(t) && t > | |
0 && (n = jQuery(i[t - 1]) | |
.find("img") | |
.attr("src"), n = "undefined" != typeof n ? n.substring(n | |
.lastIndexOf("/") + 1) : ""), n; | |
} | |
function a (e, t) { | |
var n = [], | |
a = 0; | |
return t ? (n = jQuery(CNN.Jumbotron.Constants.CONST_SMALL_CAROUSEL_SELECTOR), | |
n.find(".owl-item") | |
.each(function (e, t) { | |
jQuery(t) | |
.hasClass("cloned") || a++; | |
})) : a = "undefined" != typeof jQuery(e) | |
.data(g) ? jQuery(e) | |
.data(g) : "", a; | |
} | |
function i (e) { | |
var t = jQuery(".owl-stage", e) | |
.find(".owl-item.active .el__resize img:first") | |
.attr("alt"); | |
return "string" != typeof t ? "" : t.replace( | |
/[\\u0250-\\ue007]/g, "") | |
.substr(0, 40); | |
} | |
function o (e, t) { | |
var n = [], | |
a = 0; | |
return t ? (n = jQuery(CNN.Jumbotron.Constants.CONST_SMALL_CAROUSEL_SELECTOR), | |
n.find(".owl-item") | |
.each(function (e, t) { | |
return !jQuery(t) | |
.hasClass("cloned") && (a++, jQuery(t) | |
.hasClass("active")) ? !1 : void 0; | |
})) : a = i(e), a; | |
} | |
function r (i, r) { | |
var c = {}; | |
return c = e(i, r), c.galleryName = t(i), c.galleryType = c.isGallery ? | |
"photo gallery" : "carousel", c.imageName = "carousel" !== | |
c.galleryType ? n(i) : "", c.slideCount = a(i, r), c.slideNumber = | |
o(i, r), "carousel" !== c.galleryType && (c.carouselType = | |
""), c; | |
} | |
function c (e, t) { | |
"undefined" != typeof t.isJumbotron && t.isJumbotron === !0 && | |
(e.data.page_view = !0, e.data.carousel_type = "jumbotron"); | |
} | |
function l (e) { | |
var t = CNN.CurrentSize.getClientWidth() * CNN.CurrentSize.getClientHeight(), | |
n = t / 2 + 1, | |
a = e.target.clientWidth * e.target.clientHeight, | |
i = r(e.currentTarget, e.isJumbotron), | |
o = CNN.Analytics.hpt; | |
o.getHptValues(jQuery(e.currentTarget), "page") | |
.done(function (t) { | |
var o = { | |
type: "cnngallery-click", | |
data: { | |
page_view: !1, | |
gallery_name: i.galleryName, | |
image_name: i.imageName, | |
content_type: i.contentType, | |
carousel_type: i.carouselType, | |
gallery_type: i.galleryType, | |
gallery_slide_count: i.slideCount, | |
gallery_slide: i.slideNumber, | |
hpt: t.hptValue, | |
hpt2: t.hpt2Value | |
} | |
}; | |
o.data.page_view = a >= n, c(o, e), CNN.ads.events.refreshGalleryRailAd( | |
e), null !== window.trackMetrics && void 0 !== | |
window.trackMetrics && window.trackMetrics(o); | |
}); | |
} | |
function s (e) { | |
jQuery(CNN.Carousel.carouselSelector, e) | |
.off("carousel-action-event") | |
.on("carousel-action-event", l); | |
} | |
function d () { | |
var e, t, n = 0; | |
try { | |
if (t = function (e, t) { | |
"undefined" != typeof t && t.actionType === CNN.Jumbotron | |
.Constants.CONST_EVENT_CAROUSEL_ACTION_TYPE_CLICK ? ( | |
e.isJumbotron = !0, l(e)) : "click" !== e.type && | |
"changed" !== e.type && "dragged" !== e.type || (e.isJumbotron = ! | |
0, l(e)); | |
}, window.cnnJumbotronManager && window.cnnJumbotronManager | |
.getJumbotrons) | |
for (e = window.cnnJumbotronManager.getJumbotrons(); n < | |
e.length; n++) e[n] instanceof CNN.Jumbotron.Container && | |
"undefined" != typeof e[n].jumbotronElementRaw && ( | |
jQuery(e[n].jumbotronElementRaw) | |
.on("carousel-action-event", t), Modernizr.touchevents ? | |
jQuery(e[n].jumbotronElementRaw) | |
.find(".cn-jumbotron-card-details") | |
.on(CNN.Carousel.events.changed, t) : (jQuery(e[n].jumbotronElementRaw) | |
.find(".owl-nav") | |
.on("click", t), jQuery(e[n].jumbotronElementRaw) | |
.find(".jumbotron-small-carousel") | |
.on(CNN.Carousel.events.dragged, t))); | |
} catch (a) { | |
console.log("Error caught in initJumbotronTracking: %s", a.message); | |
} | |
} | |
var u = "galleryname", | |
p = "[data-slidename]", | |
g = "slide-count"; | |
return { | |
init: s, | |
initJumbotronTracking: d, | |
trackGalleryClick: l | |
}; | |
}() | |
}] | |
} | |
const cnn_footer_lib_min_js = { | |
'CNN.Window.width': [{ | |
prop: 'CNN.Window.width', | |
to: "0" | |
}, { | |
prop: 'CNN.Window.width', | |
to: "640" | |
}, { | |
prop: 'CNN.Window.width', | |
to: "800" | |
}, { | |
prop: 'CNN.Window.width', | |
to: CNN.Window.width || "" | |
}], | |
'CNN.Columns.current': [{ | |
prop: 'CNN.Columns.current', | |
to: "12" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "4" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "5" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "6" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "7" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "8" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "9" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "10" | |
}, { | |
prop: 'CNN.Columns.current', | |
to: "11" | |
}], | |
'CNN.Containers': [{ | |
prop: 'CNN.Containers', | |
to: r.containers ? r.containers : {} | |
}, { | |
prop: 'CNN.Containers', | |
to: {} | |
}, { | |
prop: 'CNN.Containers', | |
to: f.containers ? f.containers[u] : {} | |
}], | |
'CNN.iZLoading': [{ | |
prop: 'CNN.iZLoading', | |
to: !0 | |
}, { | |
prop: 'CNN.iZLoading', | |
to: !1 | |
}, { | |
prop: 'CNN.iZLoading', | |
to: !!CNN.iZLoading | |
}], | |
'CNN.DemandLoading.pageBottom': [{ | |
prop: 'CNN.DemandLoading.pageBottom', | |
to: !1 | |
}, { | |
prop: 'CNN.DemandLoading.pageBottom', | |
to: !l | |
}, { | |
prop: 'CNN.DemandLoading.pageBottom', | |
to: !0 | |
}], | |
'CNN.navigation': [{ | |
prop: 'CNN.navigation', | |
to: { | |
willShowMeganav: !1, | |
$header: jQuery(".nav-header"), | |
init: function () { | |
this.$body = jQuery("body"), this.isMobileDevice = jQuery( | |
"html") | |
.is(".iemobile, .android, .ios"), this.$showPoster = jQuery( | |
".nav .specials .show-poster"), this.$search = jQuery( | |
".nav .search input"), this.isSuperSkinnyNav = function () { | |
return jQuery(".nav") | |
.is(".super-skinny"); | |
}, this.isEnableSkinny = function () { | |
return jQuery(".nav") | |
.is(".js-skinny"); | |
}, this.$thirdPartyNav = function () { | |
return jQuery(".cnn-js-navigation .nav"); | |
}, this.$staticNav = function () { | |
return jQuery(".nav.super-skinny"); | |
}, this.$skinnyNav = function () { | |
var e = this.$thirdPartyNav(); | |
return e.length > 0 ? e : this.$staticNav(); | |
}, !this.isSuperSkinnyNav() && this.isEnableSkinny() && ( | |
this.navAutoSkinny(!0), this.subnavAutoHide(!1)), window.onresize = | |
function () { | |
window.CNN.navigation.isMobileDevice || window.CNN.navigation | |
.$search.blur(); | |
}, this.$body.on("click", ".menu-collapse", this.hamburgerClick), | |
this.$body.on("click", ".nav-menu", this.hamburgerClick), | |
this.$body.on("click", ".js-search-toggle", this.searchClick), | |
this.$body.on("click", ".bucket > a", this.bucketClick), | |
this.isMobileDevice || (this.$body.on("mouseenter", | |
".search__button", this.showSearch), this.$body.on( | |
"mouseout", ".search__field", this.hideSearch)), this.$body | |
.on("blur", ".search__input-field", this.hideSearch), this.$body | |
.on("focus", ".search__input-field", this.disableSearchMouseOut), | |
this.$body.on("mouseenter", ".bucket > a", this.bucketHover), | |
this.$body.on("mouseenter", ".section", this.sectionEnter), | |
this.$body.throttleEvent("mouseenter", this.sectionHover, | |
100, ".section > a"), this.$body.on("mouseout", ".nav", | |
this.navMouseOut), this.$body.on("mouseout", | |
".mega-nav, .section", this.meganavMouseOut), this.$showPoster | |
.on("mouseover", this.showPosterMouseOver), this.$showPoster | |
.on("mouseout", this.showPosterMouseOut), this.toggleWatchLiveButton(); | |
}, | |
toggleWatchLiveButton: function () { | |
var e = CNN.Utils.getCookie("countryCode"); | |
(!e && "domestic" === CNN.contentModel.edition || -1 !== CNN.WatchLiveCountries | |
.indexOf(e)) && (jQuery(".js-nav__live-tv") | |
.show(), jQuery("body") | |
.hasClass("pg-error-page") && jQuery("body") | |
.addClass("show_live-tv")); | |
}, | |
subnavAutoHide: function (e) { | |
"boolean" == typeof e && e ? jQuery(window) | |
.on("scroll.cnnSubNavigation", jQuery.proxy(window.CNN.navigation | |
.toggleHeaderClass, this, "skinny--without-subnav", !0)) : | |
(jQuery(window) | |
.off("scroll.cnnSubNavigation"), this.toggleHeaderClass( | |
"skinny--without-subnav", !1)); | |
}, | |
navAutoSkinny: function (e) { | |
"boolean" == typeof e && e ? jQuery(window) | |
.on("scroll.cnnNavigation", jQuery.proxy(window.CNN.navigation | |
.toggleHeaderClass, this, "skinny", !0)) : (jQuery(window) | |
.off("scroll.cnnNavigation"), this.toggleHeaderClass( | |
"skinny", !1)); | |
}, | |
toggleHeaderClass: function (e, t) { | |
var n = this; | |
t = "boolean" == typeof t ? t : !0, fastdom.mutate(function () { | |
n.checkScrollPosition() && t === !0 ? n.$header.addClass( | |
e) : n.$header.removeClass(e); | |
}, n); | |
}, | |
checkScrollPosition: function () { | |
var e = window.pageYOffset || document.documentElement.scrollTop, | |
t = 60; | |
return e > t; | |
}, | |
hamburgerClick: function (e) { | |
window.CNN.navigation.$search.blur(), fastdom.mutate(function () { | |
window.CNN.navigation.isSuperSkinnyNav() ? window.CNN.navigation | |
.$skinnyNav() | |
.toggleClass("nav-open") | |
.removeClass("search-open") : (window.CNN.navigation.$body | |
.toggleClass("nav-open") | |
.removeClass("search-open"), window.CNN.navigation.headerTracking | |
.adjustNav()); | |
}); | |
}, | |
isTabletSize: function () { | |
var e = window.CNN.navigation.$body; | |
return e.is('[data-eq-state$="xsmall"]') || e.is( | |
'[data-eq-state$="small"]') || e.is( | |
'[data-eq-state$="medium"]'); | |
}, | |
isMobile: function () { | |
var e = jQuery("html"); | |
return e.is(".iemobile") || e.is(".android") || e.is(".ios"); | |
}, | |
showSearch: function (e) { | |
window.CNN.navigation.isMobile() || (fastdom.mutate(function () { | |
window.CNN.navigation.$body.addClass("search-open"); | |
}), window.CNN.navigation.isTabletSize() && jQuery( | |
".search__input-field") | |
.focus()); | |
}, | |
disableSearchMouseOut: function (e) { | |
window.CNN.navigation.$body.off("mouseout", ".search__field", | |
window.CNN.navigation.hideSearch); | |
}, | |
hideSearch: function (e) { | |
fastdom.measure(function () { | |
"mouseout" === e.type && (jQuery(e.toElement) | |
.parents(".search__field") | |
.length > 0 || jQuery(e.relatedTarget) | |
.parents(".search__field") | |
.length > 0) || ("mouseout" !== e.type && | |
"focusout" !== e.type || !window.CNN.navigation.isTabletSize() && !window.CNN.navigation.isMobile()) && fastdom.mutate( | |
function () { | |
window.CNN.navigation.$body.removeClass( | |
"search-open"); | |
}); | |
}), window.CNN.navigation.$body.off("mouseout", | |
".search__field", window.CNN.navigation.hideSearch), | |
window.CNN.navigation.$body.on("mouseout", ".search__field", | |
window.CNN.navigation.hideSearch); | |
}, | |
searchClick: function (e) { | |
fastdom.mutate(function () { | |
window.CNN.navigation.isSuperSkinnyNav() ? window.CNN.navigation | |
.$skinnyNav() | |
.toggleClass("search-open") | |
.removeClass("nav-open") : window.CNN.navigation.$body | |
.removeClass("nav-open") | |
.toggleClass("search-open"); | |
}), window.CNN.navigation.$body.is(".search-open") && ( | |
jQuery("html") | |
.is(".ios") ? (jQuery(".nav .search input") | |
.on("focus", function () { | |
window.CNN.navigation.$body.scrollTop(0), fastdom.mutate( | |
function () { | |
window.CNN.navigation.$body.addClass( | |
"fixsearch"); | |
}), jQuery(".nav .search input") | |
.on("blur", function () { | |
jQuery(this) | |
.off("blur"), fastdom.mutate(function () { | |
window.CNN.navigation.$body.removeClass( | |
"fixsearch"); | |
}); | |
}); | |
}), setTimeout(function () { | |
jQuery(".nav .search input") | |
.focus(); | |
}, 10)) : jQuery(".nav .search input") | |
.focus()); | |
}, | |
bucketClick: function (e) { | |
var t = this; | |
fastdom.mutate(function () { | |
jQuery(".bucket.open") | |
.removeClass("open"), jQuery(".bucket.selected") | |
.removeClass("selected"), jQuery(t) | |
.parents(".bucket") | |
.addClass("open selected"); | |
}, t); | |
}, | |
bucketHover: function (e) { | |
var t, n = this; | |
fastdom.measure(function () { | |
t = jQuery(n) | |
.parents(".bucket"), window.CNN.navigation.isMobileDevice || | |
fastdom.mutate(function () { | |
jQuery(".bucket") | |
.removeClass("open"), t.hasClass("more") && t.find( | |
".show-poster") | |
.each(function () { | |
this.src = jQuery(this) | |
.data("img-bw"); | |
}), t.addClass("open"); | |
}, n); | |
}, n); | |
}, | |
sectionEnter: function (e) { | |
window.CNN.navigation.willShowMeganav = !0; | |
}, | |
sectionHover: function (e) { | |
var t = this; | |
fastdom.measure(function () { | |
var e = jQuery(t), | |
n = e.parents(".section"), | |
i = jQuery(".js-mega-nav"), | |
s = jQuery( | |
".nav .container > .mega-nav .m-navigation__mega-nav-item" | |
) | |
.eq(n.index()), | |
o = s.prev(), | |
a = s.next(), | |
r = !n.is(".js-has-meganav"); | |
window.CNN.navigation.willShowMeganav && (window.CNN.navigation | |
.isMobileDevice || fastdom.mutate(function () { | |
return jQuery(".section") | |
.removeClass("open"), r ? void i.removeClass( | |
"open") : (n.addClass("open"), jQuery( | |
".nav .container > .mega-nav .m-navigation__mega-nav-item" | |
) | |
.removeClass("selected previous next"), o.addClass( | |
"previous"), s.addClass("selected"), a.addClass( | |
"next"), void i.addClass("open")); | |
})); | |
}, t); | |
}, | |
navMouseOut: function (e) { | |
0 === jQuery(e.toElement) | |
.parents(".nav") | |
.length && 0 === jQuery(e.relatedTarget) | |
.parents(".nav") | |
.length && fastdom.measure(function () { | |
var e = jQuery(".bucket.selected"), | |
t = !e.is(".more"); | |
fastdom.mutate(function () { | |
jQuery(".bucket, .section") | |
.removeClass("open"), window.CNN.navigation.willShowMeganav = ! | |
1, t && e.addClass("open"); | |
}); | |
}); | |
}, | |
meganavMouseOut: function (e) { | |
fastdom.measure(function () { | |
0 === jQuery(e.toElement) | |
.parents(".section, .js-mega-nav") | |
.length && 0 === jQuery(e.relatedTarget) | |
.parents(".section, .js-mega-nav") | |
.length && (fastdom.mutate(function () { | |
jQuery(".mega-nav, .section") | |
.removeClass("open"); | |
}), window.CNN.navigation.willShowMeganav = !1); | |
}); | |
}, | |
showPosterMouseOver: function (e) { | |
var t = this; | |
fastdom.measure(function () { | |
t.src = jQuery(t) | |
.data("img"); | |
}, t); | |
}, | |
showPosterMouseOut: function (e) { | |
var t = this; | |
fastdom.measure(function () { | |
t.src = jQuery(t) | |
.data("img-bw"); | |
}, t); | |
} | |
} | |
}], | |
'CNN.PlainNavigation': [{ | |
prop: 'CNN.PlainNavigation', | |
to: { | |
breakpoint: 1120, | |
pickerBreakpoint: 768, | |
init: function () { | |
this.$editionItems = jQuery(".js-edition-item"), this.$flyoutFooterEditionItems = | |
jQuery(".js-nav-flyout-footer-edition-list-item"), this.$hamburgerMenu = | |
jQuery(document.getElementById("menu")), this.$articleTitle = | |
jQuery(document.getElementById( | |
"js-nav-section-article-title")), this.$sectionExpandIcon = | |
jQuery(".js-nav-section-name"), this.$searchButton = jQuery( | |
document.getElementById("search-button")), this.$searchSubmitButton = | |
jQuery(document.getElementById("submit-button")), this.$editionPicker = | |
jQuery(".edition-picker__current-edition"), this.detectSubNav(), | |
jQuery("body") | |
.hasClass("pg-leaf") === !0 && (jQuery(window) | |
.on("scroll", function () { | |
jQuery("body") | |
.toggleClass("page-scrolled", jQuery(window) | |
.scrollTop() > 100); | |
}), CNN.contentModel && CNN.contentModel.title && this.$articleTitle | |
.html(CNN.contentModel.title)), this.$editionItems.on( | |
"click", this.changeEdition), this.$flyoutFooterEditionItems | |
.on("click", this.changeEdition), this.$hamburgerMenu.on( | |
"click", this.hideEdition), this.$searchSubmitButton.on( | |
"click", this.searchSubmit), this.$sectionExpandIcon.on( | |
"click", this.sectionRootExpand), this.$searchButton.on( | |
"click", | |
function (e) { | |
window.innerWidth < CNN.PlainNavigation.breakpoint ? | |
CNN.PlainNavigation.searchSubmit(e) : CNN.PlainNavigation | |
.searchExpand(e); | |
}), this.$editionPicker.on("click", this.toggleEdition); | |
}, | |
hideEdition: function () { | |
jQuery(".edition-picker__current-edition") | |
.removeClass("nav-section--expanded"), jQuery( | |
".js-nav-editions") | |
.removeClass("nav-section--expanded"); | |
}, | |
sectionRootExpand: function (e) { | |
window.innerWidth >= CNN.PlainNavigation.breakpoint || (e.preventDefault(), | |
jQuery(this) | |
.parent() | |
.toggleClass("nav-section--expanded"), jQuery(this) | |
.parent() | |
.hasClass("nav-section--expanded") === !0 ? jQuery( | |
document.getElementById("nav-section-submenu")) | |
.addClass("nav-section--expanded") : jQuery(document.getElementById( | |
"nav-section-submenu")) | |
.removeClass("nav-section--expanded")); | |
}, | |
searchSubmit: function (e) { | |
e.preventDefault(), jQuery(document.getElementById( | |
"search-form")) | |
.submit(); | |
}, | |
searchExpand: function (e) { | |
e.preventDefault(), jQuery("body") | |
.toggleClass("search-expanded"), jQuery(document.getElementById( | |
"search-input-field")) | |
.focus(); | |
}, | |
toggleEdition: function (e) { | |
e && e.preventDefault(), jQuery("body") | |
.hasClass("nav-open") === !0 && window.innerWidth >= CNN.PlainNavigation | |
.pickerBreakpoint || (jQuery( | |
".edition-picker__current-edition") | |
.toggleClass("nav-section--expanded"), jQuery( | |
".js-nav-editions") | |
.toggleClass("nav-section--expanded")); | |
}, | |
detectSubNav: function () { | |
var e = CNN.contentModel.sectionName, | |
t = jQuery("body") | |
.hasClass("pg-" + e), | |
n = jQuery("body") | |
.hasClass("pg-intl_" + e); | |
t !== !0 && n !== !0 || "homepage" === e || "intl_homepage" === | |
e || jQuery(document.getElementById("nav")) | |
.addClass(e); | |
}, | |
changeEdition: function (e, t) { | |
var n = e ? jQuery(e.currentTarget) : t, | |
i = n.parent(), | |
s = i.parent(), | |
o = s.data("location") + "_" + s.data("analytics"), | |
a = CNN.Host && CNN.Host.domain || window.location.hostname, | |
r = n.data("value"), | |
l = r + "?hpt=" + o, | |
d = n.data("type"); | |
CNN.contentModel && CNN.contentModel.edition && (a = | |
"international" === CNN.contentModel.edition ? "edition" : | |
"www"), -1 === a.indexOf(d) && (window.location = l); | |
} | |
} | |
}], | |
'CNN.selectNavigation': [{ | |
prop: 'CNN.selectNavigation', | |
to: function (e, t) { | |
if ("undefined" == typeof e) throw "selector is not defined"; | |
t !== !0 && (t = !1), jQuery(e) | |
.on("change", function () { | |
var e = jQuery(this) | |
.find(":selected") | |
.val(); | |
t === !1 ? window.location = e : window.location.hash = | |
"#" + e; | |
}); | |
} | |
}], | |
'CNN.EditionPrefs': [{ | |
prop: 'CNN.EditionPrefs', | |
to: CNN.EditionPrefs || function (e) { | |
function t () { | |
n(), i(); | |
} | |
function n () { | |
d.on("click", ".js-edition-preferences__confirm", o); | |
} | |
function i () { | |
jQuery(".js-edition-option") | |
.prop("checked", !1) | |
.filter('[data-type="' + g + '"]') | |
.prop("checked", !0), jQuery( | |
".js-edition-preferences__choice") | |
.prop("checked", !1) | |
.filter('[value="' + g + '"]') | |
.prop("checked", !0); | |
} | |
function s (e, t) { | |
a(e, c), CNN.EditionPicker.togglePicker(), CNN.EditionPicker.changeEdition(! | |
1, t); | |
} | |
function o (t) { | |
var n = e(t.currentTarget) | |
.parent(), | |
i = n.find("input") | |
.filter(":checked"); | |
s(i.val(), i.parent()); | |
} | |
function a (e, t) { | |
CNN.Utils.setCNNCookie(u, e, t); | |
} | |
function r () { | |
setTimeout(function () { | |
d.removeClass("list--set"); | |
}, 0); | |
} | |
function l (t) { | |
e(t.currentTarget) | |
.closest(".js-edition-picker__list") | |
.addClass("list--set"); | |
} | |
var d = e(".js-edition-picker__list"), | |
c = 854400, | |
u = CNN.EditionCookie, | |
h = "international" === CNN.contentModel.edition ? "edition" : | |
"www", | |
f = CNN.Utils.getCookie(u), | |
g = CNN.Utils.exists(f) ? f : h; | |
return t(), { | |
showPreferences: l, | |
hidePreferences: r, | |
indicateCurrentEdition: i | |
}; | |
}(jQuery) | |
}], | |
'CNN.EditionPicker': [{ | |
prop: 'CNN.EditionPicker', | |
to: CNN.EditionPicker || function (e, t) { | |
function n (e) { | |
e.stopPropagation(); | |
} | |
function i () { | |
r.on("click", n) | |
.on("click", ".list .item--edition", s) | |
.on("click", ".current", o) | |
.on("click", ".item--select", CNN.EditionPrefs.showPreferences); | |
} | |
function s (n, i) { | |
var s = n ? e(n.currentTarget) : i, | |
o = s.children("input"), | |
a = s.closest(".list"), | |
r = a.data("location") + "_" + a.data("analytics"), | |
l = CNN.Host && CNN.Host.domain || t.location.hostname, | |
d = s.data("value"), | |
c = d + "?hpt=" + r; | |
CNN.contentModel && CNN.contentModel.edition && (l = | |
"international" === CNN.contentModel.edition ? "edition" : | |
"www"), -1 === l.indexOf(o.val()) && (t.location = c); | |
} | |
function o (t) { | |
var n = t ? e(t.currentTarget) | |
.closest(".edition-picker") : r; | |
n.hasClass("open") ? (n.removeClass("open"), a.off("click", o)) : | |
(r.removeClass("open"), n.addClass("open"), a.one("click", | |
o)); | |
} | |
var a = e("body"), | |
r = e(".edition-picker"); | |
return e(document) | |
.onZonesAndDomReady(i), { | |
changeEdition: s, | |
togglePicker: o | |
}; | |
}(jQuery, window) | |
}], | |
'CNN.RefreshAds': [{ | |
prop: 'CNN.RefreshAds', | |
to: CNN.RefreshAds || { | |
lastKnownViewportWidth: 0, | |
breakpoint1: 480, | |
breakpoint2: 782, | |
breakpoint3: 1024, | |
refreshAllAds: function () { | |
var e = this.getViewPortSize(); | |
(e.width >= this.breakpoint1 && this.lastKnownViewportWidth < | |
this.breakpoint1 || e.width <= this.breakpoint1 && this.lastKnownViewportWidth > | |
this.breakpoint1 || e.width >= this.breakpoint2 && this.lastKnownViewportWidth < | |
this.breakpoint2 || e.width <= this.breakpoint2 && this.lastKnownViewportWidth > | |
this.breakpoint2 || e.width >= this.breakpoint3 && this.lastKnownViewportWidth < | |
this.breakpoint3 || e.width <= this.breakpoint3 && this.lastKnownViewportWidth > | |
this.breakpoint3) && this.amptResizeAllAds(), this.lastKnownViewportWidth = | |
e.width; | |
}, | |
getViewPortSize: function () { | |
var t = 0; | |
return "number" == typeof n.innerWidth ? t = n.innerHeight : | |
i.documentElement && (i.documentElement.clientWidth || i.documentElement | |
.clientHeight) ? t = i.documentElement.clientHeight : i | |
.body && (i.body.clientWidth || i.body.clientHeight) && ( | |
t = i.body.clientHeight), { | |
width: e.CurrentSize && "function" == typeof e.CurrentSize | |
.getClientWidth ? e.CurrentSize.getClientWidth() : 0, | |
height: t | |
}; | |
}, | |
amptResizeAllAds: function () { | |
var t = e.MultiAds && e.MultiAds.getAdlib ? e.MultiAds.getAdlib() : {}; | |
t.refreshAllAds && t.refreshAllAds(); | |
} | |
} | |
}], | |
'CNN.MultiAds': [{ | |
prop: 'CNN.MultiAds', | |
to: CNN.MultiAds || { | |
domAds: [], | |
updatedAds: [], | |
updatePosition: "desktop", | |
adGroups: {}, | |
adGroupIds: [], | |
getAdlib: function () { | |
var e = n[s], | |
t = e && e.processNewRegistry && e.refreshAd && e.requestAndRenderAds && | |
e.refreshAllAds; | |
return t || console.warn( | |
"cnn-epic-multi-ads::getAdlib: Could not find %s! Using a mock object instead.", | |
s), t ? e : { | |
processNewRegistry: function () {}, | |
refreshAd: function () {}, | |
requestAndRenderAds: function () {}, | |
refreshAllAds: function () {} | |
}; | |
}, | |
isEmptyNode: function (e) { | |
var t = null, | |
n = !0; | |
if (e.hasChildNodes()) { | |
for (t = CNN.firstChild; null !== t.nextSibling && t.nodeType !== | |
Node.ELEMENT_NODE;) t = t.nextSibling; | |
n = null !== t && t.nodeType !== Node.ELEMENT_NODE; | |
} | |
return t = null, n; | |
}, | |
isActive: function (e) { | |
var t; | |
return t = "function" == typeof n.getComputedStyle ? n.getComputedStyle( | |
e) | |
.getPropertyValue("display") : e.currentStyle.display, | |
"none" !== t; | |
}, | |
addAdTagToPage: function (e, t) { | |
var n, s, o, a = this; | |
a.isEmptyNode(e) && (o = e.getAttribute("data-ad-refresh"), | |
n = i.createElement("div"), s = "ad-" + t + (o ? | |
" ad-refresh-" + o : ""), n.setAttribute("id", t), n.setAttribute( | |
"class", s), e.appendChild(n)); | |
}, | |
removeAdTagFromPage: function (e) { | |
var t = this; | |
if (!t.isEmptyNode(e)) | |
for (; CNN.firstChild;) CNN.removeChild(CNN.firstChild); | |
}, | |
allDone: function (n, i) { | |
var s = e.MultiAds.getAdlib(); | |
t("body") | |
.addClass("multi-ads--complete"), "string" == typeof o && | |
"" !== o && (n = n || !1, n !== !0 ? s.queueRegistry(o) : | |
s.queueRegistry(o, { | |
slots: i || [] | |
})); | |
}, | |
getPlaceholderOnlyIds: function () { | |
var t = e.contentModel && e.contentModel.companion && e.contentModel | |
.companion.enabled, | |
n = t ? e.contentModel.companion.ids || {} : {}; | |
return n; | |
}, | |
handleAdStatus: function () {}, | |
loadSingleton: function (e) { | |
return t.ajax({ | |
url: e, | |
type: "GET", | |
dataType: "script", | |
cache: !0, | |
error: function (t, n, i) { | |
console.error("Could not load singleton script: " + | |
e); | |
} | |
}); | |
}, | |
setExactSingleton: function (e) { | |
var n, i, s, o, a, r, l, d = this, | |
c = ".js-doubleton-info", | |
u = ".owl-item", | |
h = "ad-doubleton", | |
f = "cloned", | |
g = ".ad-doubleton"; | |
l = t(g), l.length && t.each(l, function () { | |
a = t(this), r = a.parent() | |
.siblings(c), n = a.closest(u) | |
.hasClass(f), i = a.hasClass(h), n ? (s = r.data( | |
"cloneid"), o = r.data("clonefile")) : (s = r.data( | |
"origid"), o = r.data("origfile")), a.attr("id", | |
s), i && (a.removeClass(h), a.addClass("ad-" + s)), | |
d.loadSingleton(o) | |
.success(d.handleAdStatus); | |
}); | |
}, | |
getDoubletons: function () { | |
var n, i, s = ".js-owl-carousel", | |
o = ".ad-doubleton"; | |
i = t(o), i.length && (n = i.eq(0) | |
.closest(s), n.on(e.Carousel.events.initialized, t.proxy( | |
this.setExactSingleton, this))); | |
}, | |
setupAdSpace: function (e, t) { | |
var n, i, s = this, | |
o = s.getPlaceholderOnlyIds(); | |
n = e.getAttribute("data-ad-id"), i = s.isActive(e), s.adGroups | |
.hasOwnProperty(n) || (s.adGroupIds.push(n), s.adGroups[n] = { | |
active: -1, | |
inactive: [] | |
}), i && -1 === s.adGroups[n].active && (s.adGroups[n].active = | |
t, "suppress" !== o[n] && s.addAdTagToPage(e, n)), i || | |
(s.adGroups[n].inactive.push(t), s.removeAdTagFromPage(e)); | |
}, | |
update: function (e) { | |
var t, n, s, o = this, | |
a = o.domAds.length, | |
r = [], | |
l = [], | |
d = []; | |
if (e = e || [], 0 !== e.length) { | |
for (t = 0; t < CNN.length; t++) r.push(CNN[t] + | |
" [data-ad-id]"); | |
if (l = [].slice.call(i.querySelectorAll(r.join(", "))), | |
l.length > 0) { | |
for (t = l.length - 1; t >= 0; t -= 1) n = l[t].getAttribute( | |
"data-ad-id"), s = l[t].getAttribute( | |
"data-ad-position"), s !== o.updatePosition || o.updatedAds | |
.indexOf(n) >= 0 ? o.removeAdTagFromPage(l[t]) : (o.setupAdSpace( | |
l[t], a + t), -1 === d.indexOf(n) && (d.push(n), | |
o.updatedAds.push(n)), o.domAds.push(l[t])); | |
o.getDoubletons(), Array.isArray(d) && d.length > 0 && | |
o.allDone(!0, d); | |
} | |
} | |
}, | |
init: function () { | |
var t, n = this, | |
s = e.RefreshAds.getViewPortSize(); | |
for (n.domAds = [].slice.call(i.querySelectorAll( | |
"[data-ad-id]")), s.width < CNN.RefreshAds.breakpoint2 ? | |
n.updatePosition = "mobile" : s.width >= CNN.RefreshAds.breakpoint2 && | |
s.width < CNN.RefreshAds.breakpoint3 && (n.updatePosition = | |
"tablet"), t = n.domAds.length - 1; t >= 0; t -= 1) n.setupAdSpace( | |
n.domAds[t], t); | |
n.getDoubletons(), n.allDone(); | |
} | |
} | |
}], | |
'CNN.RefreshAds.lastKnownViewportWidth': [{ | |
prop: 'CNN.RefreshAds.lastKnownViewportWidth', | |
to: t.width | |
}], | |
'CNN.Features': [{ | |
prop: 'CNN.Features', | |
to: CNN.Features || {} | |
}], | |
'CNN.DemandLoadConfig': [{ | |
prop: 'CNN.DemandLoadConfig', | |
to: CNN.DemandLoadConfig || {} | |
}], | |
'CNN.contentModel': [{ | |
prop: 'CNN.contentModel', | |
to: CNN.contentModel || {} | |
}], | |
'CNN.Window': [{ | |
prop: 'CNN.Window', | |
to: CNN.Window || {} | |
}], | |
'CNN.Columns': [{ | |
prop: 'CNN.Columns', | |
to: CNN.Columns || { | |
4: 4 * columnWidth, | |
5: 5 * columnWidth, | |
6: 6 * columnWidth, | |
7: 7 * columnWidth, | |
8: 8 * columnWidth, | |
9: 9 * columnWidth, | |
10: 10 * columnWidth, | |
11: 11 * columnWidth, | |
12: 12 * columnWidth | |
} | |
}], | |
'CNN.Zones': [{ | |
prop: 'CNN.Zones', | |
to: CNN.Zones || {} | |
}], | |
'CNN.Zones.runningZoneIds': [{ | |
prop: 'CNN.Zones.runningZoneIds', | |
to: [] | |
}], | |
'CNN.Zones.loadedZoneIds': [{ | |
prop: 'CNN.Zones.loadedZoneIds', | |
to: [] | |
}], | |
'CNN.processedContainers': [{ | |
prop: 'CNN.processedContainers', | |
to: [] | |
}], | |
'CNN.serverSentZones': [{ | |
prop: 'CNN.serverSentZones', | |
to: loadAllZonesLazy === !0 ? 0 : 1 | |
}], | |
'CNN.DemandLoading.thirdParty.outbrain': [{ | |
prop: 'CNN.DemandLoading.thirdParty.outbrain', | |
to: !0 | |
}], | |
'CNN.DemandLoading': [{ | |
prop: 'CNN.DemandLoading', | |
to: { | |
zoneImages: {}, | |
thirdParty: { | |
money: { | |
currencies: !1, | |
market: !1 | |
}, | |
outbrain: !1 | |
} | |
} | |
}], | |
'CNN.DemandLoading.allZoneImagesLoaded': [{ | |
prop: 'CNN.DemandLoading.allZoneImagesLoaded', | |
to: function (e, t) { | |
CNN.DemandLoading.zoneImages[e] = { | |
images: jQuery("#" + e + " img"), | |
count: 0 | |
}, CNN.DemandLoading.zoneImages[e].images.load(function () { | |
CNN.DemandLoading.zoneImages[e].count++, CNN.DemandLoading | |
.zoneImages[e].count === CNN.DemandLoading.zoneImages[e] | |
.images.length && "function" == typeof t && t(); | |
}); | |
} | |
}], | |
'CNN.DemandLoading.updateZoneView': [{ | |
prop: 'CNN.DemandLoading.updateZoneView', | |
to: function () { | |
var t, n = CNN.CurrentSize.getClientScrollTop(), | |
i = !1, | |
s = n + jQuery(window) | |
.height(); | |
jQuery("section.zn-loaded") | |
.length > 0 && (jQuery("section.zn-loaded") | |
.each(function (n) { | |
return jQuery(this) | |
.offset() | |
.top > s ? (visibleZone = o(0 !== n ? t : e(this)), i = ! | |
0, !1) : void(t = e(this)); | |
}), i || (visibleZone = o(t))); | |
} | |
}], | |
'CNN.DemandLoading.updateZones': [{ | |
prop: 'CNN.DemandLoading.updateZones', | |
to: function () { | |
var t, o, a, r, l, d, c, u, h = !1, | |
f = CNN.Zones, | |
g = 0, | |
m = "video" === CNN.contentModel.pageType ? | |
"videos/index.html" : s(document.location.pathname), | |
p = $page.find("section.zn-loaded:not(.nativeSponsor)") | |
.length, | |
y = f.zones || {}, | |
v = y.minWidth || {}; | |
if (a = v[CNN.Window.width] || CNN.contentModel.zoneIds || [], | |
1 === CNN.serverSentZones && (u = a[0] || "", u.indexOf(":") > -1 && (u = u.split(":"), u = u[1] || ""), CNN.Containers = | |
f.containers ? f.containers[u] : {}, setZoneWindowWidth(), | |
loadContainers(u)), 0 === renderZoneIds.length) | |
for (; g < a.length; g++) r = a[g], r = CNN.Utils.exists(r) && | |
r.indexOf(":") > 0 ? r.split(":")[1] : r, CNN.Utils.exists( | |
r) && (renderZoneIds.push(r), d = e(".zn--idx-" + g), l = | |
e(".zn--idx-" + (g - 1)), 0 === d.length && 1 === l.length && | |
l.after('<section class="zn--idx-' + g + | |
' zn-empty"></section>')); | |
for (; p < a.length; p++) | |
if (h = !1, r = a[p], CNN.Utils.exists(r) && r.indexOf(":") > | |
0) { | |
if (o = r.split(":"), o = o[1], CNN.Zones.loadedZoneIds.indexOf( | |
o) > -1) continue; | |
if (t = e(".zn--idx-" + p + ".zn-empty"), 0 === t.length && | |
(t = e(document.querySelectorAll(".zn-loaded")) | |
.last(), h = !0), 1 === t.length) { | |
if (CNN.Zones.runningZoneIds.indexOf(o) > -1) break; | |
if (c = { | |
path: m, | |
zone: t, | |
zoneIdx: p, | |
append: h, | |
idPath: r | |
}, n(o, c), i(p)) break; | |
} | |
} else { | |
if (o = a[p], CNN.Zones.loadedZoneIds.indexOf(o) > -1) | |
continue; | |
if (t = e(document.getElementById(o)), 1 === t.length) { | |
if (CNN.Zones.runningZoneIds.indexOf(o) > -1) break; | |
if (c = { | |
path: m, | |
zone: t, | |
zoneIdx: p | |
}, n(o, c), i(p)) break; | |
} | |
} | |
} | |
}], | |
'CNN.DemandLoading.allLoaded': [{ | |
prop: 'CNN.DemandLoading.allLoaded', | |
to: !1 | |
}, { | |
prop: 'CNN.DemandLoading.allLoaded', | |
to: !0 | |
}], | |
'CNN.DemandLoading.elements': [{ | |
prop: 'CNN.DemandLoading.elements', | |
to: [] | |
}, { | |
prop: 'CNN.DemandLoading.elements', | |
to: e(r) | |
}, { | |
prop: 'CNN.DemandLoading.elements', | |
to: o | |
}], | |
'CNN.DemandLoading.addElement': [{ | |
prop: 'CNN.DemandLoading.addElement', | |
to: function (n) { | |
var i = 0, | |
s = e("img", n); | |
if (0 === s.length && (s = e(n)), s.length > 0) | |
for (CNN.DemandLoading.allLoaded = !1, t(s), i = 0; i < s.length; i++) | |
CNN.DemandLoading.elements.push(s[i]); | |
return CNN.DemandLoading.process(); | |
} | |
}], | |
'CNN.DemandLoading.update': [{ | |
prop: 'CNN.DemandLoading.update', | |
to: function () { | |
var t = !1, | |
n = CNN.CurrentSize.getClientScrollTop() + e(document) | |
.height() + d; | |
return n > c && (c = n, c >= e(document) | |
.height() && (CNN.DemandLoading.pageBottom = !0), t = CNN.DemandLoading | |
.process()), t; | |
} | |
}], | |
'CNN.DemandLoading.process': [{ | |
prop: 'CNN.DemandLoading.process', | |
to: function () { | |
var n, i, s, o, a, l = []; | |
if (0 === CNN.DemandLoading.elements.length && (CNN.DemandLoading | |
.elements = e(r)), n = CNN.DemandLoading.elements, i = n.length || | |
0, 0 === i) CNN.DemandLoading.allLoaded = !0; | |
else { | |
for (o = [], s = 0; i > s; s++) a = e(n[s]), a.offset() && a.offset() | |
.top <= c ? (t(a, !0), l.push(a[0])) : o.push(a[0]); | |
l.length > 0 && (CNN.DemandLoading.elements = o, CNN.DemandLoading | |
.allLoaded = !1); | |
} | |
return l; | |
} | |
}], | |
'CNN.DemandLoading.reProcess': [{ | |
prop: 'CNN.DemandLoading.reProcess', | |
to: function () { | |
return CNN.DemandLoading.elements = e(r), CNN.DemandLoading.process(); | |
} | |
}], | |
'CNN.Zones.zones': [{ | |
prop: 'CNN.Zones.zones', | |
to: r | |
}], | |
'CNN.DemandLoading.zoneImages[e]': [{ | |
prop: 'CNN.DemandLoading.zoneImages[e]', | |
to: { | |
images: jQuery("#" + e + " img"), | |
count: 0 | |
} | |
}], | |
'CNN.Columns.previous': [{ | |
prop: 'CNN.Columns.previous', | |
to: CNN.Columns.current | |
}], | |
'CNN.StaggeredZone': [{ | |
prop: 'CNN.StaggeredZone', | |
to: function (t, n) { | |
function i (CNN) { | |
window.clearTimeout(r), r = window.setTimeout(CNN, 100); | |
} | |
var s = jQuery(t), | |
a = o(s, n), | |
r = null; | |
void 0 !== s && void 0 !== n && (e.StaggeredZone.columnResizeEvent = | |
e.StaggeredZone.columnResizeEvent || jQuery.Event( | |
"resize.staggeredZoneWidth"), jQuery(window) | |
.resize(function () { | |
i(a); | |
}), a()); | |
} | |
}], | |
'CNN.Gallery': [{ | |
prop: 'CNN.Gallery', | |
to: CNN.Gallery || {} | |
}], | |
'CNN.Carousel': [{ | |
prop: 'CNN.Carousel', | |
to: CNN.Carousel || { | |
carouselSelector: ".js-owl-carousel", | |
events: { | |
initialize: "initialize.owl.carousel", | |
initialized: "initialized.owl.carousel", | |
loadedImage: "loaded.owl.lazy", | |
navigationInitialized: "initialized.owl.navigation", | |
destroy: "destroy.owl.carousel", | |
dragged: "dragged.owl.carousel", | |
change: "change.owl.carousel", | |
changed: "changed.owl.carousel", | |
resize: "resize.owl.carousel", | |
resized: "resized.owl.carousel", | |
refresh: "refresh.owl.carousel", | |
refreshed: "refreshed.owl.carousel", | |
to: "to.owl.carousel", | |
next: "next.owl.carousel", | |
prev: "prev.owl.carousel", | |
drag: "drag.owl.carousel" | |
}, | |
refreshCarousels: function () { | |
jQuery(CNN.Carousel.carouselSelector) | |
.trigger(CNN.Carousel.events.refresh); | |
}, | |
owl: function (e) { | |
var t = this, | |
n = 30; | |
return this.$carousel = jQuery(e), this.$filmstrip = this.$carousel | |
.next(".js-owl-filmstrip"), this.isPaginatedCarousel = | |
this.$carousel.hasClass("carousel-small-paginated"), this | |
.isGallery = this.$filmstrip.length > 0 || this.isPaginatedCarousel, | |
this.isAutoHeight = this.isGallery || this.$carousel.is( | |
'[data-auto-height="true"]'), this.galleryHeightRatio = | |
null, this.isFullCarousel = this.$carousel.is( | |
".carousel--full"), this.isLargeStripCarousel = this.$carousel | |
.is(".carousel-large-strip"), this.hasSingleItem = 1 === | |
this.$carousel.data("slide-count"), jQuery.extend(this.$filmstrip, | |
this), jQuery.extend(this.$carousel, this), this.carouselAdjustNavigation = | |
function (e) { | |
var i = "4:3" === t.$carousel.data("cut-format") ? .75 : | |
"9:16" === t.$carousel.data("cut-format") ? 16 / 9 : | |
9 / 16, | |
s = t.$carousel.find(".owl-item") | |
.find(".el__resize, .media") | |
.width() * i, | |
o = s / 2 - n, | |
a = t.$carousel.find(".owl-prev, .owl-next"); | |
"true" === t.$carousel.attr("data-is-gallery") ? a.css( | |
"top", o + "px") : a.css("height", s + "px"), t.$carousel | |
.siblings(".ad-slide") | |
.find(".ad-slide__prev, .ad-slide__next") | |
.css("top", o + "px"); | |
}, this.makeLazy = function (e) { | |
e.find("img") | |
.each(function () { | |
var e, t = jQuery(this), | |
n = (t.attr("data-eq-state") || "") | |
.replace(/^(\\S+\\s+)*/, ""); | |
e = n ? "xsmall" === n ? "data-src-small" : | |
"data-src-" + n : "src", t.attr("data-src", t.attr( | |
e)) | |
.addClass("owl-lazy"); | |
}); | |
}, this.setNumberOfItems = function (e) { | |
var t, n = e.relatedTarget; | |
if (0 !== n._widths[0]) return t = n.settings.items > 1 ? | |
n.$element.width() / n._widths[0] : n.settings.items, | |
t > 1 && (n.settings.items = Math.ceil(t), n.settings | |
.slideBy = Math.floor(t), n.$element.trigger(CNN.Carousel | |
.events.refresh)), t; | |
}, this.resetThumbnails = function (e) { | |
t.$filmstrip.find(".owl-item") | |
.find("img") | |
.css("opacity", 1), t.$carousel.find(".owl-item") | |
.find("img") | |
.css("opacity", 1); | |
}, this.setAspectRatio = function () { | |
function e (e) { | |
var t; | |
return e ? (t = /\\d+:\\d+/.exec(e.data("cutFormat")) || [], | |
t = (t[0] || "16:9") | |
.split(":"), +t[1] / +t[0] * 100 || 1) : 1; | |
} | |
t.$carousel.data("gallery-ratio-set") || (t.$carousel.data( | |
"gallery-ratio-set", !0), t.galleryHeightRatio = | |
e(t.$carousel), t.$carousel.find( | |
".js-gallery-aspect-ratio-wrapper") | |
.css("padding-bottom", t.galleryHeightRatio + "%"), | |
t.$carousel.find("[data-cut-format]") | |
.each(function () { | |
var t = jQuery(this), | |
n = e(this.$carousel); | |
n < this.galleryHeightRatio ? t.css("padding", | |
(this.galleryHeightRatio - n) / 2 + "% 0") : | |
n > this.galleryHeightRatio && t.css( | |
"padding", "0 " + (1 - this.galleryHeightRatio / | |
n) / 2 * 100 + "%"); | |
})); | |
}, this.stagePadding = function () { | |
var e, n; | |
if (t.isFullCarousel && !t.isGallery) switch (n = ( | |
jQuery("body") | |
.attr("data-eq-state") || "") | |
.replace(/^(\\S+\\s+)*/, "")) { | |
case "xsmall": | |
e = 50; | |
break; | |
case "medium": | |
e = 100; | |
break; | |
case "large": | |
case "full16x9": | |
e = 150; | |
} else e = 0; | |
return e; | |
}, this.onResize = function (e) { | |
e.relatedTarget.options.stagePadding = t.stagePadding(), | |
t.$carousel.trigger(CNN.Carousel.events.refresh); | |
}, this.onMainCarouselChange = function (e) { | |
"position" === e.property.name && t.$filmstrip.data() && | |
setTimeout(function () { | |
var n = e.property.value - e.relatedTarget.clones() | |
.length / 2, | |
i = t.$filmstrip.data("owl.carousel") | |
._items.length - 1, | |
s = t.$filmstrip.find(".owl-item"); | |
n = -1 === n ? i : n > i ? 0 : n, s.removeClass( | |
"synced"), t.isGallerySlide() && (s.eq(n) | |
.addClass("synced"), t.$filmstrip.trigger(CNN | |
.Carousel.events.to, [n])); | |
}, 0); | |
}, this.onLazyImageLoaded = function (e) { | |
CNN.ResponsiveImages.process(CNN.DemandLoading.addElement( | |
e.element)); | |
}, this.onRefreshed = function (e) { | |
CNN.ResponsiveImages.queryEqjs(e.target); | |
}, this.onInitialized = function (e) { | |
t.setNumberOfItems(e), t.$carousel.on(CNN.Carousel.events | |
.changed, t.onMainCarouselChange), t.$carousel.on( | |
CNN.Carousel.events.resized, t.carouselAdjustNavigation | |
), t.$carousel.on(CNN.Carousel.events.resized, t.setNumberOfItems), | |
t.$carousel.on(CNN.Carousel.events.resized, t.resetThumbnails), | |
t.$carousel.on(CNN.Carousel.events.resized, t.onResize), | |
t.$carousel.on(CNN.Carousel.events.refreshed, t.onRefreshed), | |
t.$carousel.on(CNN.Carousel.events.refreshed, t.carouselAdjustNavigation), | |
t.$carousel.on(CNN.Carousel.events.loadedImage, | |
function (e) { | |
t.onLazyImageLoaded(e), t.onRefreshed(e), t.resetThumbnails( | |
e); | |
}); | |
}, this.addAnalyticsListeners = function (e) { | |
t.$carousel.find(".owl-nav > div") | |
.on("click", function (e) { | |
t.$carousel.trigger("carousel-action-event"); | |
}), t.$carousel.on(CNN.Carousel.events.dragged, | |
function (e) { | |
t.$carousel.trigger("carousel-action-event"); | |
}); | |
}, this.isGallerySlide = function () { | |
return !!t.$carousel.find( | |
".owl-item.active > div[data-slidename]") | |
.length; | |
}, this.makeLazy(this.$carousel), this.setAspectRatio(), | |
this.$carousel.on(CNN.Carousel.events.initialized, this.onInitialized), | |
this.$carousel.on(CNN.Carousel.events.navigationInitialized, | |
this.carouselAdjustNavigation), this.$carousel.on(CNN.Carousel | |
.events.navigationInitialized, this.addAnalyticsListeners | |
), this.$carousel.owlCarousel({ | |
addClassActive: !0, | |
nav: !0, | |
navText: ["", ""], | |
dots: this.isPaginatedCarousel, | |
lazyLoad: !0, | |
transitionStyle: this.isGallery ? "fadeIn" : !1, | |
slideBy: this.isFullCarousel ? 1 : "page", | |
slideSpeed: 300, | |
responsive: this.$carousel.hasClass("carousel--fixed") ? | |
!1 : {}, | |
responsiveBaseWidth: this.$carousel[0], | |
autoWidth: !this.isFullCarousel, | |
autoHeight: this.isAutoHeight, | |
items: this.isFullCarousel ? 1 : 3, | |
stagePadding: this.stagePadding(), | |
margin: this.isFullCarousel && !this.isGallery ? 20 : 0, | |
loop: !this.isPaginatedCarousel || !this.hasSingleItem, | |
mouseDrag: !this.hasSingleItem, | |
touchDrag: !this.hasSingleItem | |
}), this.isGallery && !this.isPaginatedCarousel && (this.reBindBigCarousel = | |
function (e) { | |
"position" === e.property.name && (t.$carousel.trigger( | |
"carousel-action-event"), t.$carousel.off(CNN.Carousel | |
.events.changed, t.reBindBigCarousel), t.$carousel | |
.on(CNN.Carousel.events.changed, t.onMainCarouselChange) | |
); | |
}, this.enableLastItem = function (e) { | |
var n = e.relatedTarget, | |
i = n.settings.items, | |
s = Math.abs(n._coordinates.slice(-1)[0]), | |
o = n._width, | |
a = n._widths[0], | |
r = Math.ceil((s - o) / a); | |
s > o && a > 0 && (t.resetThumbnails(e), n.settings.items = | |
i > 1 ? Math.floor(o / a) : i, n._coordinates[r - | |
1] = o % a - a * r, n.maximum = function (e) { | |
var t = this.settings, | |
i = this._width, | |
s = this._coordinates.length, | |
o = this._current > 0 ? this._coordinates[ | |
this._current - 1] : 0, | |
a = Math.abs(n._coordinates.slice(-1)[0]) - ( | |
i - o); | |
return s = t.loop ? this._clones.length / 2 + | |
this._items.length - 1 : t.autoWidth || t.merge ? | |
Math.ceil((a > i ? i - o : a - o) / this._widths[ | |
0]) : t.center ? this._items.length - 1 : | |
this._items.length - t.items, e && (s -= this | |
._clones.length / 2), Math.max(s, 0); | |
}); | |
}, this.onFilmstripChange = function (e) { | |
var n; | |
"items" === e.property.name && (n = t.$filmstrip.find( | |
".synced") | |
.index() < e.item.index ? e.item.index : t.$filmstrip | |
.find(".synced") | |
.index(), t.$filmstrip.find(".owl-item") | |
.removeClass("synced"), t.$filmstrip.find( | |
".owl-item") | |
.eq(n) | |
.addClass("synced"), t.$carousel.trigger(CNN.Carousel | |
.events.to, [n])); | |
}, this.onFilmstripItemClicked = function (e) { | |
var n = jQuery(e.currentTarget) | |
.index(), | |
i = t.$filmstrip.find(".owl-item"); | |
i.eq(n) | |
.hasClass("synced") || (i.removeClass("synced"), i.eq( | |
n) | |
.addClass("synced"), t.$carousel.off(CNN.Carousel | |
.events.changed, t.onMainCarouselChange), t.$carousel | |
.on(CNN.Carousel.events.changed, t.reBindBigCarousel), | |
t.$carousel.on(CNN.Carousel.events.changed, t.resetThumbnails), | |
t.$carousel.trigger(CNN.Carousel.events.to, [n])); | |
}, this.onFilmstripInit = function (e) { | |
t.setNumberOfItems(e), t.enableLastItem(e), t.$filmstrip | |
.find(".owl-item") | |
.eq(0) | |
.addClass("synced"), t.$filmstrip.on("click", | |
".owl-item", t.onFilmstripItemClicked), t.$filmstrip | |
.on(CNN.Carousel.events.changed, t.onFilmstripChange), | |
t.$filmstrip.on(CNN.Carousel.events.resized, t.setNumberOfItems), | |
t.$filmstrip.on(CNN.Carousel.events.resized, t.enableLastItem), | |
t.$filmstrip.on(CNN.Carousel.events.refreshed, t.enableLastItem); | |
}, this.makeLazy(this.$filmstrip), this.$filmstrip.on( | |
CNN.Carousel.events.initialized, this.onFilmstripInit | |
), this.$filmstrip.owlCarousel({ | |
items: 10, | |
autoWidth: !0, | |
lazyLoad: !0, | |
loop: !1, | |
nav: !0, | |
dots: !1, | |
navText: ["", ""], | |
responsiveRefreshRate: 100 | |
})), this; | |
}, | |
restore: function (e) { | |
var t, n = [], | |
i = ""; | |
n.push( | |
".cn-collection-player.el__videoexperience__collection" | |
), n.push( | |
".el__leafmedia--video-leaf-player.el__videoexperience__collection" | |
), n.push(".el__leafmedia--featured-video-collection"), i = | |
n.join(", "), CNN.Features.enableVideoExperienceUnification ? | |
jQuery(CNN.Carousel.carouselSelector, e) | |
.each(function () { | |
function e (e) { | |
Modernizr.on("phone", function (t) { | |
!t || CNN.contentModel && CNN.contentModel.pageType && | |
"article" === CNN.contentModel.pageType ? ! | |
function (e) { | |
CNN.Carousel.FeatureVideoContentStarted.then( | |
function () { | |
var t = new CNN.Carousel.owl(e); | |
return jQuery( | |
".loading-video-carousel") | |
.hide(), jQuery(document) | |
.triggerCarouselLoaded(), t; | |
}); | |
}(e) : !function (e) { | |
CNN.Carousel.FeatureVideoContentStarted.then( | |
function () { | |
CNN.INJECTOR.executeFeature("videx") | |
.done(function () { | |
jQuery( | |
".loading-video-carousel" | |
) | |
.hide(), CNN.Videx.SeeMore.init( | |
e), jQuery(document) | |
.triggerCarouselLoaded(); | |
}); | |
}); | |
}(e); | |
}); | |
} | |
t = jQuery(this), t.parents(i) | |
.length > 0 ? e(t) : !function (e) { | |
var t = new CNN.Carousel.owl(e); | |
return jQuery(document) | |
.triggerCarouselLoaded(), t; | |
}(t); | |
}) : jQuery(CNN.Carousel.carouselSelector, e) | |
.each(function () { | |
return jQuery(document) | |
.triggerCarouselLoaded(), new CNN.Carousel.owl(this); | |
}); | |
}, | |
manualImageLoad: function (e) { | |
e.find("img") | |
.each(function () { | |
var e, t = jQuery(this), | |
n = (t.attr("data-eq-state") || "") | |
.replace(/^(\\S+\\s+)*/, ""); | |
e = n ? "xsmall" === n ? "data-src-small" : | |
"data-src-" + n : "src", t.attr("data-src", t.attr( | |
e)) | |
.addClass("owl-lazy"), CNN.ResponsiveImages.process( | |
CNN.DemandLoading.addElement(t)); | |
}), CNN.ResponsiveImages.queryEqjs(e); | |
}, | |
init: function (e) { | |
CNN.Carousel.restore(e), jQuery(window) | |
.throttleEvent("resize", function () { | |
jQuery(CNN.Carousel.carouselSelector) | |
.trigger(CNN.Carousel.events.refresh); | |
}, 100), jQuery(window) | |
.on("orientationchange", function () { | |
jQuery(CNN.Carousel.carouselSelector) | |
.trigger(CNN.Carousel.events.refresh); | |
}); | |
} | |
} | |
}, { | |
prop: 'CNN.Carousel', | |
to: CNN.Carousel || {} | |
}], | |
'CNN.ads': [{ | |
prop: 'CNN.ads', | |
to: CNN.ads || {} | |
}], | |
'CNN.ads.events': [{ | |
prop: 'CNN.ads.events', | |
to: CNN.ads.events || function () { | |
function e (e, t) { | |
var i, s = CNN.AdsConfig.enableGalleryAdRefresh; | |
"undefined" != typeof e && "undefined" != typeof window.AMPTManager && | |
jQuery(e.target) | |
.parents(t.galleryParent) | |
.length && CNN.contentModel.pageType === t.pageType && CNN.Features | |
.enableEpicAds === !0 && (n++, i = t.adId || jQuery(t.toolParent) | |
.find(t.tool + ":first-child div") | |
.attr("id"), n % 2 === 0 && s === !0 && window.AMPTManager | |
.refreshAd(i)); | |
} | |
function t (t) { | |
t = t || null, e(t, { | |
adId: "ad_rect_atf_01", | |
pageType: "article", | |
galleryParent: ".zn-large-media", | |
toolParent: ".pg-rail", | |
tool: ".ad-desktop" | |
}); | |
} | |
var n = 0; | |
return { | |
refreshGalleryRailAd: t | |
}; | |
}() | |
}], | |
'CNN.Carousel.FeatureVideoContentStarted': [{ | |
prop: 'CNN.Carousel.FeatureVideoContentStarted', | |
to: jQuery.Deferred() | |
}], | |
'CNN.ResponsiveImages': [{ | |
prop: 'CNN.ResponsiveImages', | |
to: {} | |
}], | |
'CNN.ResponsiveImages.process': [{ | |
prop: 'CNN.ResponsiveImages.process', | |
to: function (t) { | |
function n (e, t) { | |
var n, a, r, l = s.filter(e) | |
.filter(i) | |
.not(o); | |
for (r = 0, a = l.length; a > r; r++) n = l.eq(r), n.attr( | |
"src", n.data(t)); | |
o = o.add(l); | |
} | |
var i = "[data-demand-load=loaded]", | |
s = e(t), | |
o = e(); | |
n( | |
'.cd--horizontal[data-eq-state$="xsmall"] img[data-src-mini1x1], .cd--horizontal[data-eq-state$="small"] img[data-src-mini1x1]', | |
"src-mini1x1"), n( | |
'.zn[data-eq-state$="full16x9"] .zn-top img[data-src-full16x9]', | |
"src-full16x9"), n( | |
'img[data-eq-state$="mini"][data-src-mini]', "src-mini"), n( | |
'img[data-eq-state$="xsmall"][data-src-xsmall]', | |
"src-xsmall"), n( | |
'img[data-eq-state$="small"][data-src-small]', "src-small"), | |
n('img[data-eq-state$="medium"][data-src-medium]', | |
"src-medium"), n( | |
'img[data-eq-state$="large"][data-src-large]', "src-large"); | |
} | |
}], | |
'CNN.ResponsiveImages.queryEqjs': [{ | |
prop: 'CNN.ResponsiveImages.queryEqjs', | |
to: function (n) { | |
var i = CNN.Utils.existsObject(n), | |
s = i ? e(n) | |
.filter("[data-eq-pts]") : e("[data-eq-pts]"), | |
o = []; | |
i && 0 === s.length && (s = e(n) | |
.find("[data-eq-pts]")), o = s instanceof jQuery ? s.toArray() : | |
s, 0 !== o.length && t.query(o, function () { | |
CNN.DemandLoading.allLoaded || CNN.DemandLoading.update(), | |
s.length > 0 && CNN.ResponsiveImages.process(s); | |
}); | |
} | |
}], | |
'CNN.ResponsiveImages.scroll': [{ | |
prop: 'CNN.ResponsiveImages.scroll', | |
to: function () { | |
var t; | |
CNN._zonesAndDomReadyEvent && (CNN.DemandLoading.pageBottom || | |
CNN.DemandLoading.allLoaded) ? e(window) | |
.off("scroll.responsiveImages") : (t = CNN.DemandLoading.update(), | |
t.length > 0 && CNN.ResponsiveImages.process(t)); | |
} | |
}], | |
'CNN.ResponsiveImages.reload': [{ | |
prop: 'CNN.ResponsiveImages.reload', | |
to: function () { | |
var e = CNN.DemandLoading.reProcess(); | |
e.length > 0 && CNN.ResponsiveImages.process(e); | |
} | |
}], | |
'CNN.ResponsiveImages.processChildrenImages': [{ | |
prop: 'CNN.ResponsiveImages.processChildrenImages', | |
to: function (e) { | |
var n = CNN.contentModel && "boolean" == typeof CNN.contentModel | |
.lazyLoad ? CNN.contentModel.lazyLoad : !1, | |
i = CNN.contentModel && "boolean" == typeof CNN.contentModel.enablePictureFill ? | |
CNN.contentModel.enablePictureFill : !1; | |
n && i ? window.picturefill && picturefill() : t.query(e.querySelectorAll( | |
"[data-eq-pts]"), function (e) { | |
e.length > 0 && CNN.ResponsiveImages.process(e); | |
}); | |
} | |
}], | |
'CNN.ResponsiveImages.resize': [{ | |
prop: 'CNN.ResponsiveImages.resize', | |
to: function () { | |
CNN.ResponsiveImages.queryEqjs(document); | |
} | |
}], | |
'CNN.VideoAjax': [{ | |
prop: 'CNN.VideoAjax', | |
to: CNN.VideoAjax || function () { | |
return function (e) { | |
var t = {}, | |
n = { | |
id: "VideoAjax", | |
eventName: "CNN_VideoAjax_autoUpdated", | |
ajaxFrequency: 3e5 | |
}; | |
return t.config = jQuery.extend({}, n, e), t.autoUpdateEvent = | |
jQuery.Event(t.config.eventName), t.fetchOnNowTimer = | |
null, t.isFetching = !1, t.serverData = null, t.logError = | |
function (e, t) { | |
if ("undefined" != typeof t) throw t; | |
throw e; | |
}, t.updateOnNowData = function () { | |
this.fetchExternalData(jQuery.proxy(function (e) { | |
this.serverData = e, jQuery(document) | |
.trigger(this.autoUpdateEvent); | |
}, this)); | |
}, t.id = t.config.id, t.init = function () { | |
this.updateOnNowData(), this.startPeriodicFetch(); | |
}, t.stopPeriodicFetch = function () { | |
null !== this.fetchOnNowTimer && (clearInterval(this.fetchOnNowTimer), | |
this.fetchOnNowTimer = null); | |
}, t.startPeriodicFetch = function () { | |
null === this.fetchOnNowTimer && (this.fetchOnNowTimer = | |
setInterval(jQuery.proxy(this.updateOnNowData, this), | |
this.config.ajaxFrequency)); | |
}, t.fetchExternalData = function () { | |
throw "fetchExternalData in the ajax was intended to be overridden."; | |
}, t.filterNetwork = function (e) { | |
var t = 0, | |
n = null; | |
if ("undefined" == typeof this.serverData || null === | |
this.serverData) return n; | |
for (t = this.serverData.channel.length - 1; t >= 0; t--) | |
if (this.serverData.channel[t].id.toLowerCase() === e | |
.toLowerCase()) { | |
n = this.serverData.channel[t]; | |
break; | |
} | |
return n; | |
}, t.getServerData = function () { | |
return this.serverData; | |
}, t.getEventName = function () { | |
return this.config.eventName; | |
}, t.getIsFetching = function () { | |
return this.isFetching; | |
}, t.setIsFetching = function (e) { | |
this.isFetching = e; | |
}, t; | |
}; | |
}() | |
}], | |
'CNN.VideoAjax.NowPlaying': [{ | |
prop: 'CNN.VideoAjax.NowPlaying', | |
to: CNN.VideoAjax.NowPlaying || function () { | |
var e = CNN.VideoAjax({ | |
id: "NowPlaying", | |
eventName: "CNN_NowPlaying_autoUpdated" | |
}); | |
return e.fetchExternalData = function (t) { | |
if (e.getIsFetching() !== !0) { | |
if ("undefined" == typeof t || "function" != typeof t) | |
throw "callback parameter is not defined or is not a function. Ajax request was not sent."; | |
e.setIsFetching(!0), jQuery.ajax({ | |
url: CNN.Host.nowPlaying + | |
"/jsonp/video/nowPlayingSchedule.json", | |
type: "get", | |
error: function (t, n) { | |
e.logError(t, n); | |
}, | |
success: function (e) { | |
t(e); | |
}, | |
timeout: function (t, n) { | |
e.logError(t, n); | |
}, | |
complete: function () { | |
e.setIsFetching(!1); | |
}, | |
dataType: "jsonp", | |
jsonpCallback: "nowPlayingScheduleCallbackWrapper" | |
}); | |
} | |
}, e; | |
}() | |
}], | |
'CNN.VideoAjax.LiveStream': [{ | |
prop: 'CNN.VideoAjax.LiveStream', | |
to: CNN.VideoAjax.LiveStream || function () { | |
var e = CNN.VideoAjax({ | |
id: "LiveStream", | |
eventName: "CNN_LiveEvent_autoUpdated" | |
}); | |
return e.fetchExternalData = function (t) { | |
function n (t) { | |
return jQuery.ajax({ | |
url: "/CNNLiveFlash/StreamStatus/metadata/stream_dvr_" + | |
t + ".xml", | |
type: "get", | |
error: function (t, n) { | |
e.logError(t, n); | |
}, | |
success: function (e) { | |
s["live" + t] = { | |
xml: e, | |
thumbnail: void 0, | |
isStreaming: !1 | |
}; | |
}, | |
timeout: function (t, n) { | |
e.logError(t, n); | |
}, | |
dataType: "xml", | |
crossDomain: !1 | |
}); | |
} | |
function i () { | |
var e, t = [], | |
n = {}; | |
for (e in s) e in s && "undefined" != typeof s[e].isStreaming && | |
s[e].isStreaming !== !1 && (n = jQuery(s[e].xml) | |
.find("stream") | |
.first(), t.push({ | |
id: s[e].id, | |
url: n.find("affiliate url") | |
.text(), | |
kicker: n.find("affiliate headline") | |
.text(), | |
program: n.find("title") | |
.text(), | |
images: { | |
"120x68": s[e].thumbnail | |
}, | |
description: n.find("description") | |
.text(), | |
streamIndex: s[e].index | |
})); | |
return t.sort(function (e, t) { | |
return parseInt(e.streamIndex, 10) - parseInt(t.streamIndex, | |
10); | |
}), { | |
channel: t | |
}; | |
} | |
var s = {}; | |
if (e.getIsFetching() !== !0) { | |
if ("undefined" == typeof t || "function" != typeof t) | |
throw "callback parameter is not defined or is not a function. Ajax request was not sent."; | |
e.setIsFetching(!0), jQuery.when(n(1), n(2), n(3), n(4)) | |
.done(function () { | |
jQuery.ajax({ | |
url: "/.element/ssi/www/auto/2.0/video/xml/pipeline.xml", | |
type: "get", | |
error: function (t, n) { | |
e.logError(t, n); | |
}, | |
success: function (n) { | |
var o = 0, | |
a = "", | |
r = jQuery(n) | |
.find("video"); | |
for (o = r.length - 1; o >= 0; o--) a = | |
parseInt(r.eq(o) | |
.find("video_url") | |
.text() | |
.substring(7), 10), isNaN(a) || (s[ | |
"live" + a].id = "live-" + a, s[ | |
"live" + a].thumbnail = r.eq(o) | |
.find("image_url") | |
.text(), s["live" + a].isStreaming = ! | |
0, s["live" + a].streamIndex = a); | |
e.setIsFetching(!1), t(i()); | |
}, | |
timeout: function (t, n) { | |
e.logError(t, n); | |
}, | |
dataType: "xml", | |
crossDomain: !1 | |
}); | |
}); | |
} | |
}, e; | |
}() | |
}], | |
'CNN.VideoEndSlateBase': [{ | |
prop: 'CNN.VideoEndSlateBase', | |
to: function (e, t) { | |
this.endSlateFlag = "boolean" == typeof t ? t : "boolean" == typeof CNN.Features.enableVideoEndSlate ? CNN.Features.enableVideoEndSlate : | |
!0, this.containerId = e, this.initialize(); | |
} | |
}], | |
'CNN.VideoEndSlateBase.extend': [{ | |
prop: 'CNN.VideoEndSlateBase.extend', | |
to: function (e, t) { | |
var n, i = t.prototype; | |
t.prototype = Object.create(e.prototype); | |
for (n in i) i.hasOwnProperty(n) && (t.prototype[n] = i[n]); | |
t.prototype.constructor = t; | |
try { | |
Object.defineProperty(t.prototype, "constructor", { | |
enumerable: !1, | |
value: t | |
}); | |
} catch (s) {} | |
} | |
}], | |
'CNN.VideoEndSlateBase.prototype': [{ | |
prop: 'CNN.VideoEndSlateBase.prototype', | |
to: { | |
getVideoPlayerContainerId: function () { | |
return this.containerId; | |
}, | |
renderRecommendedVideos: function (e, t) { | |
function n (e) { | |
return e.stopPropagation(), e.preventDefault(), !1; | |
} | |
var i = e.data("owl.carousel"); | |
this.setResponsiveState(), e.empty() | |
.append(t), e.on(CNN.Carousel.events.change, n), e.on(CNN.Carousel | |
.events.changed, n), e.on(CNN.Carousel.events.drag, n), e | |
.on(CNN.Carousel.events.initialize, n), e.on(CNN.Carousel.events | |
.initialized, n), e.on(CNN.Carousel.events.resized, n), e | |
.on(CNN.Carousel.events.navigationInitialized, n), | |
"undefined" != typeof i && i.destroy(), e.owlCarousel({ | |
mouseDrag: !0, | |
touchDrag: !0, | |
nav: !0, | |
navText: ["", ""], | |
dots: !1, | |
autoWidth: !0, | |
autoHeight: !0, | |
margin: 20, | |
rewindNav: !0, | |
responsive: !1, | |
scrollPerPage: !1, | |
items: 3, | |
itemsDesktop: [1100, 3], | |
itemsDesktopSmall: [900, 3], | |
itemsTablet: [600, 2], | |
itemsMobile: !1, | |
loop: !0 | |
}); | |
}, | |
getRecommendedVideos: function (e) { | |
var t, n = this.getRelatedContentUrl(), | |
i = "end-slate-carousel" + Math.floor(100 * Math.random()); | |
return t = n.substring(n.indexOf("/video/data/3.0")), jQuery.Deferred( | |
function (n) { | |
jQuery.ajax({ | |
url: t, | |
type: "GET", | |
dataType: "json", | |
error: function (e, t, n) { | |
"undefined" != typeof console && console.log( | |
n); | |
}, | |
success: function (t) { | |
var s = { | |
relatedVideos: { | |
id: i, | |
containerContents: [], | |
layout: "carousel-medium-strip", | |
type: "container" | |
} | |
}; | |
"undefined" != typeof t && null !== t && | |
"undefined" != typeof t.videos && (jQuery(t | |
.videos) | |
.each(function (e, t) { | |
s.relatedVideos.containerContents.push({ | |
cardContents: { | |
headlineText: t.headline, | |
iconType: "video", | |
media: { | |
contentType: "image", | |
cutFormat: "16:9", | |
duration: t.duration, | |
elementContents: { | |
imageAlt: t.headline, | |
imageUrl: t.thumbnail_url, | |
cuts: { | |
small: { | |
uri: t.endslate_url_small | |
}, | |
medium: { | |
uri: t.endslate_url_medium | |
}, | |
large: { | |
uri: t.endslate_url_large | |
} | |
}, | |
type: "element" | |
} | |
}, | |
type: "card", | |
url: t.clickback_url.substring( | |
"/video/?/video") | |
.replace("/video/?/video", | |
"/videos"), | |
videoId: t.id | |
}, | |
contentType: "video", | |
type: "card" | |
}); | |
}), dust.render( | |
"views/pages/common/video-end-slate-carousel", | |
s, | |
function (t, n) { | |
e.push(n); | |
})), n.resolve(); | |
} | |
}); | |
}) | |
.promise(); | |
}, | |
setCurrentVideoHeadline: function (e) { | |
var t, n = this.getEndSlateForContainer(this.getContainerId()), | |
i = "string" == typeof e ? JSON.parse(e) : e; | |
"undefined" != typeof n && n && (t = jQuery(n) | |
.find(".js-cd__headline-text"), t && t.text(i.headline)); | |
}, | |
fetchAndShowRecommendedVideos: function (e, t) { | |
var n, i = [], | |
s = | |
".js-video__end-slate__tertiary .js-video__end-slate__carousel"; | |
t = t || !0, this.$videoEndSlate = this.getEndSlateForContainer(), | |
this.setCurrentVideoHeadline(e), n = this.$videoEndSlate.find( | |
s), this.setRelatedContentUrl(e), t && this.fetchRecommendedVideos( | |
n, i); | |
}, | |
fetchRecommendedVideos: function (e, t) { | |
var n = this; | |
jQuery.when(this.getRecommendedVideos(t)) | |
.done(function () { | |
n.renderRecommendedVideos(e, t); | |
}); | |
}, | |
destroy: function () { | |
var e = this.getCurrentCarousel(), | |
t = e.data("owl.carousel"); | |
this.hideEndSlateForContainer(), e.empty(), "undefined" != typeof t && t.destroy(); | |
}, | |
getCurrentCarousel: function () { | |
var e, t = | |
".js-video__end-slate__tertiary .js-video__end-slate__carousel"; | |
return this.$videoEndSlate = this.getEndSlateForContainer(), | |
e = this.$videoEndSlate.find(t); | |
}, | |
setResponsiveState: function (e) { | |
e = e || !1, "undefined" != typeof this.getContainerId() && | |
"undefined" == typeof $videoEndSlate && (this.$videoEndSlate = | |
this.getEndSlateForContainer()), eqjs.query(this.$videoEndSlate), | |
e && this.showEndSlateForContainer(); | |
}, | |
getContainerId: function () { | |
return this.containerId; | |
}, | |
onReplayClickedHandler: function () { | |
var e = this.getEndSlateForContainer(), | |
t = this.getVideoPlayerContainerId(); | |
e.removeClass("video__end-slate--active") | |
.addClass("video__end-slate--inactive"), "fave" === CNN.VideoPlayer | |
.getLibraryName(t) ? FAVE.player.getInstance(t) | |
.replay() : window.cnnVideoManager.getPlayerByContainer(t) | |
.replay(); | |
}, | |
initialize: function () { | |
this.addEventListeners(); | |
}, | |
addEventListeners: function () { | |
var e = this.getEndSlateForContainer(); | |
e.on("click", ".js-video__end-slate__replay", jQuery.proxy( | |
this.onReplayClickedHandler, this)), e.on("click", | |
".js-video__end-slate__replay-text", jQuery.proxy(this.onReplayClickedHandler, | |
this)), e.on("click", ".js-el__video__replayer-wrapper", | |
jQuery.proxy(this.onReplayClickedHandler, this)); | |
}, | |
removeEventListeners: function () { | |
var e = this.getEndSlateForContainer(); | |
e.off("click", ".js-video__end-slate__replay"), e.off("click", | |
".js-video__end-slate__replay-text"); | |
}, | |
handleShowEndSlate: function (e) { | |
"undefined" != typeof e && null !== e && (this.setResponsiveState(), | |
e.removeClass("video__end-slate--inactive") | |
.addClass("video__end-slate--active")); | |
}, | |
handleHideEndSlate: function (e) { | |
"undefined" != typeof e && null !== e && (this.setResponsiveState(), | |
e.removeClass("video__end-slate--active") | |
.addClass("video__end-slate--inactive")); | |
}, | |
hideEndSlateForContainer: function () { | |
var e = this.getEndSlateForContainer(); | |
this.handleHideEndSlate(e); | |
}, | |
showEndSlateForContainer: function () { | |
var e = this.getEndSlateForContainer(); | |
this.handleShowEndSlate(e); | |
}, | |
setRelatedContentUrl: function (e) { | |
var t; | |
t = "string" == typeof e ? JSON.parse(e) : e, this.relatedContentUrl = | |
t.relatedVideosJson; | |
}, | |
getRelatedContentUrl: function () { | |
return this.relatedContentUrl; | |
}, | |
getEndSlateElement: function () { | |
return this.$videoEndSlate; | |
}, | |
isEndSlateEnabled: function () { | |
return this.endSlateFlag; | |
} | |
} | |
}], | |
'CNN.VideoEndSlate': [{ | |
prop: 'CNN.VideoEndSlate', | |
to: function (e, t) { | |
this.relatedContentUrl = "", this.$videoEndSlate = {}, CNN.VideoEndSlateBase | |
.call(this, e, t); | |
} | |
}], | |
'CNN.VideoEndSlate.prototype': [{ | |
prop: 'CNN.VideoEndSlate.prototype', | |
to: { | |
getEndSlateForContainer: function () { | |
var e = jQuery(document.getElementById(this.getContainerId())) | |
.parent() | |
.find(".js-video__end-slate") | |
.eq(0); | |
return e; | |
} | |
} | |
}], | |
'CNN.JumbotronVideoEndSlate': [{ | |
prop: 'CNN.JumbotronVideoEndSlate', | |
to: function (e, t) { | |
this.jumbotron = e, this.mode = t || "desktop", CNN.VideoEndSlate | |
.call(this, jQuery(e.jumbotronElementRaw) | |
.attr("id"), !0); | |
} | |
}], | |
'CNN.JumbotronVideoEndSlate.prototype': [{ | |
prop: 'CNN.JumbotronVideoEndSlate.prototype', | |
to: { | |
addEventListeners: function () { | |
CNN.VideoEndSlateBase.prototype.addEventListeners.call(this), | |
"undefined" != typeof this.jumbotron && (jQuery(this.jumbotron | |
.jumbotronElementRaw) | |
.on("CVPEvent", jQuery.proxy(this.onVideoEventHandler, | |
this)), jQuery(this.jumbotron) | |
.on("jumbotron-item-selected", jQuery.proxy(this.hideEndSlateForContainer, | |
this)), jQuery(this.jumbotron) | |
.on("jumbotron-mode-change", jQuery.proxy(this.onJumbotronModeChangeHandler, | |
this))); | |
}, | |
removeEventListeners: function () { | |
CNN.VideoEndSlateBase.prototype.removeEventListeners.call( | |
this), "undefined" != typeof this.jumbotron && (jQuery( | |
this.jumbotron.jumbotronElementRaw) | |
.off("CVPEvent"), jQuery(this.jumbotron) | |
.off("jumbotron-item-selected"), jQuery(this.jumbotron) | |
.off("jumbotron-mode-change")); | |
}, | |
onJumbotronModeChangeHandler: function (e, t) { | |
this.mode = t, this.destroy(); | |
}, | |
onVideoEventHandler: function (e, t) { | |
if (t && t.eventType) switch (t.eventType) { | |
case "onContentMetadata": | |
this.fetchAndShowRecommendedVideos(t.metadata, "mobile" !== | |
this.mode); | |
break; | |
case "onContentComplete": | |
this.showEndSlateForContainer(); | |
break; | |
case "onContentPlay": | |
this.hideEndSlateForContainer(); | |
} | |
}, | |
getVideoPlayerContainerId: function () { | |
var e; | |
try { | |
return e = jQuery(jQuery(document.getElementById(this.getContainerId())) | |
.find(".js-jumbotron-video-player") | |
.eq(0)), e.attr("id"); | |
} catch (t) { | |
return this.containerId; | |
} | |
}, | |
getEndSlateForContainer: function () { | |
var e = jQuery(document.getElementById(this.getContainerId())) | |
.find(".js-video__end-slate") | |
.eq(0); | |
return e; | |
} | |
} | |
}], | |
'CNN.VideoConfig': [{ | |
prop: 'CNN.VideoConfig', | |
to: CNN.VideoConfig || {} | |
}], | |
'CNN.VideoPlayer': [{ | |
prop: 'CNN.VideoPlayer', | |
to: CNN.VideoPlayer || {} | |
}], | |
'CNN.VideoPlayer.SimpleEmbedCodeCopy': [{ | |
prop: 'CNN.VideoPlayer.SimpleEmbedCodeCopy', | |
to: function (e, t, n) { | |
this.videoContainerId = e, this.embedDivId = t, this.parentElement = | |
jQuery(n); | |
} | |
}], | |
'CNN.VideoPlayer.SimpleEmbedCodeCopy.prototype': [{ | |
prop: 'CNN.VideoPlayer.SimpleEmbedCodeCopy.prototype', | |
to: { | |
onSuccessfulCopy: function () { | |
"undefined" != typeof this.parentElement && (this.parentElement | |
.find(".metadata__embed-video-confirmation") | |
.remove(), this.parentElement.append( | |
'<span class="metadata__embed-video-confirmation"><p>Embed Code copied successfully</p></span>' | |
), setTimeout(jQuery.proxy(function () { | |
jQuery(this.parentElement.find( | |
".metadata__embed-video-confirmation")) | |
.slideUp(500); | |
}, this), 3e3)); | |
}, | |
generateEmbedContainer: function () { | |
"undefined" != typeof this.parentElement && (this.parentElement | |
.find(this.getEmbedContainerId()) | |
.remove(), this.movieDivId = this.getEmbedContainerId() + | |
"--movie", this.parentElement.append( | |
'<span class="metadata__embed-video-button" id="' + | |
this.getEmbedContainerId() + '"><div id="' + this.movieDivId + | |
'"/></span>')); | |
}, | |
getEmbedContainer: function () { | |
var e = this.getEmbedContainerId(); | |
return jQuery("#" + e); | |
}, | |
getEmbedContainerId: function () { | |
return this.embedDivId; | |
}, | |
getVideoContainerId: function () { | |
return this.videoContainerId; | |
}, | |
show: function (e) { | |
var t, n, i = "successCallback" + this.getVideoContainerId(), | |
s = this.getEmbedContainer(); | |
window[i] = jQuery.proxy(this.onSuccessfulCopy, this), | |
"object" == typeof e && "undefined" != typeof e.isEmbeddable && | |
"false" !== e.isEmbeddable && "no" !== e.isEmbeddable && s && | |
"undefined" != typeof CVP && "undefined" != typeof CNN.VideoConfig | |
.embedLinks && "undefined" != typeof CNN.VideoConfig.embedLinks | |
.clipboardOperationsSWF ? (t = CNN.VideoConfig.embedLinks.embedLinkPattern, | |
t = t.replace("{host}", window.location.hostname) | |
.replace("{videoId}", e.id), n = CNN.VideoConfig.embedLinks | |
.buttonImage.replace("{cdnassetpath}", CNN.Host.assetPath), | |
(!Array.isArray(s) || s.length <= 0) && this.generateEmbedContainer(), | |
CVP.swfobject.embedSWF(CNN.VideoConfig.embedLinks.clipboardOperationsSWF, | |
this.movieDivId, "80px", "21px", "10.0.0", CNN.VideoConfig | |
.embedLinks.clipboardOperationsSWF + "?nocache=" + new Date() | |
.valueOf(), { | |
callback: 'window["' + i + '"]', | |
buttonImage: n, | |
copyValue: t, | |
xOffset: CNN.VideoConfig.embedLinks.imageButtonXOffset, | |
yOffset: CNN.VideoConfig.embedLinks.imageButtonYOffset | |
}, { | |
allowScriptAccess: "always", | |
quality: "high", | |
wmode: "transparent" | |
}, {})) : this.hide(); | |
}, | |
hide: function () { | |
this.getEmbedContainer() && this.getEmbedContainer() | |
.remove(); | |
} | |
} | |
}], | |
'CNN.Feeds': [{ | |
prop: 'CNN.Feeds', | |
to: CNN.Feeds || {} | |
}], | |
'CNN.EditionPickerPrefs': [{ | |
prop: 'CNN.EditionPickerPrefs', | |
to: CNN.EditionPickerPrefs || function (e) { | |
function t () { | |
n(); | |
} | |
function n () { | |
e(".js-edition-confirm") | |
.on("click", o); | |
} | |
function i (e, t) { | |
CNN.Utils.setCNNCookie(r, e, t); | |
} | |
function s (e, t) { | |
i(e, a), CNN.PlainNavigation.toggleEdition(!1), CNN.PlainNavigation | |
.changeEdition(!1, t); | |
} | |
function o (t) { | |
var n; | |
t.preventDefault(), n = e(t.target.form) | |
.children() | |
.filter("label") | |
.children() | |
.filter("input") | |
.filter(":checked"), s(n.data("type"), n); | |
} | |
var a = 854400, | |
r = CNN.EditionCookie; | |
return t(), { | |
init: t | |
}; | |
}(jQuery) | |
}], | |
'CNN.AdSlide': [{ | |
prop: 'CNN.AdSlide', | |
to: function (e, t, n) { | |
CNN.Features.enableGalleryAds && !CNN.Features.displayDisplayAds && | |
(this.wrapperId = e, this.wrapperEl = void 0, this.adSlideEl = void 0, this.adPrevEl = void 0, this.adNextEl = void 0, | |
this.singleton = n, this.clickCounter = 0, this.initAdSlide( | |
e, t)); | |
} | |
}], | |
'CNN.AdSlide.prototype': [{ | |
prop: 'CNN.AdSlide.prototype', | |
to: { | |
getWrapper: function (e, t) { | |
var n, i; | |
return n = t ? e : "." + e, i = t ? jQuery(document.getElementById( | |
e)) | |
.eq(0) : jQuery(n) | |
.eq(0), this.wrapperEl = i, i; | |
}, | |
getAdSlide: function () { | |
var e, t = ".el-carousel__wrapper .ad-slide", | |
n = this.wrapperEl || this.getWrapper(); | |
return e = jQuery(n) | |
.find(t) | |
.eq(0), this.adSlideEl = e, e; | |
}, | |
getAdSlidePrev: function () { | |
var e, t = ".ad-slide__prev", | |
n = this.adSlideEl || this.getAdSlide(); | |
return e = jQuery(n) | |
.find(t) | |
.eq(0), this.adPrevEl = e, e; | |
}, | |
getAdSlideNext: function () { | |
var e, t = ".ad-slide__next", | |
n = this.adSlideEl || this.getAdSlide(); | |
return e = jQuery(n) | |
.find(t) | |
.eq(0), this.adNextEl = e, e; | |
}, | |
getSingletonAd: function (e) { | |
var t = this; | |
jQuery.getScript(this.singleton) | |
.done(function (e, n) { | |
jQuery(t) | |
.trigger("ad-single-loaded"); | |
}) | |
.fail(function (e, t, n) { | |
"object" == typeof console && "function" == typeof console | |
.log && console.log("Could not load singleton script"); | |
}); | |
}, | |
showAdSlide: function () { | |
var e, t = this.adSlideEl || this.getAdSlide(), | |
n = !0; | |
jQuery(document) | |
.on("GPTRenderComplete", function (i) { | |
"undefined" != typeof i.originalEvent.detail && null !== | |
i.originalEvent.detail && "undefined" != typeof i.originalEvent | |
.detail.pos && Array.isArray(i.originalEvent.detail.pos) && | |
i.originalEvent.detail.pos.length > 0 && "boolean" == typeof i.originalEvent.detail.empty && (n = "mod" === | |
i.originalEvent.detail.pos[0] ? i.originalEvent.detail | |
.empty : !0, e = t.find("iframe"), e.length > 0 && !n && t.removeClass("ad-slide--inactive") | |
.addClass("ad-slide--active")); | |
}); | |
}, | |
hideAdSlide: function () { | |
var e = this.adSlideEl || this.getAdSlide(); | |
e.removeClass("ad-slide--active") | |
.addClass("ad-slide--inactive"), this.removeCloseAd(), | |
"function" == typeof CNN.Carousel.refreshCarousels && | |
setTimeout(CNN.Carousel.refreshCarousels, 0); | |
}, | |
showAdHandler: function () { | |
this.showAdSlide(), this.bindCloseAd(); | |
}, | |
adTriggerHandler: function () { | |
var e = CNN.AdsConfig && CNN.AdsConfig.galleryAdClicks ? CNN.AdsConfig | |
.galleryAdClicks : 5; | |
this.clickCounter++, this.clickCounter === e && (this.clickCounter = | |
0, this.getSingletonAd(), jQuery(this) | |
.on("ad-single-loaded", this.showAdHandler)); | |
}, | |
closeAdHandler: function () { | |
this.removeCloseAd(), this.hideAdSlide(), this.clickCounter = - | |
1; | |
}, | |
bindWrapperClick: function () { | |
var e = this.wrapperEl || this.getWrapper(); | |
e.on("click", jQuery.proxy(this.adTriggerHandler, this)); | |
}, | |
bindCloseAd: function () { | |
var e = this.adPrevEl || this.getAdSlidePrev(), | |
t = this.adNextEl || this.getAdSlideNext(), | |
n = this.adSlideEl || this.getAdSlide(); | |
e.on("click", jQuery.proxy(this.closeAdHandler, this)), t.on( | |
"click", jQuery.proxy(this.closeAdHandler, this)), n.siblings( | |
".js-owl-filmstrip") | |
.one("click", jQuery.proxy(this.closeAdHandler, this)); | |
}, | |
initAdSlide: function (e, t) { | |
this.getWrapper(e, t), this.bindWrapperClick(), this.bindCloseAd(); | |
}, | |
removeWrapperClick: function () { | |
var e = this.wrapperEl || this.getWrapper(); | |
e.off("click"); | |
}, | |
removeCloseAd: function () { | |
var e = this.getAdSlidePrev(), | |
t = this.getAdSlideNext(); | |
e.off("click"), t.off("click"); | |
} | |
} | |
}], | |
'CNN.renderAds': [{ | |
prop: 'CNN.renderAds', | |
to: function (e, t, n) { | |
var i, s, o, a = jQuery(e) | |
.not(".m-navigation"); | |
for (s = 0, o = a.length; o > s; s++) | |
if (i = a.eq(s), i.parents(".zn-staggered") | |
.length) { | |
if (n.staggeredZone === !1) continue; | |
jQuery(i) | |
.next(t) | |
.append(i.val()); | |
} else "undefined" != typeof i[0] && jQuery(i) | |
.next(t) | |
.html(i.val()); | |
} | |
}], | |
'CNN.companionAdState': [{ | |
prop: 'CNN.companionAdState', | |
to: "" | |
}, { | |
prop: 'CNN.companionAdState', | |
to: CNN.companionAdState || "" | |
}, { | |
prop: 'CNN.companionAdState', | |
to: s.getCompanionAdStateLabel(i) | |
}], | |
'CNN.companion': [{ | |
prop: 'CNN.companion', | |
to: CNN.companion || {} | |
}, { | |
prop: 'CNN.companion', | |
to: t.extend({}, CNN.companion, { | |
registry: CNN.contentModel && CNN.contentModel.registryURL || | |
"", | |
knownEpicIds: {}, | |
config: CNN.contentModel && CNN.contentModel.companion || {}, | |
currentLayout: "", | |
updateCompanionLayout: function (n) { | |
var i, s, o, a, r = n, | |
l = ""; | |
if (n !== this.currentLayout && e.companionAdState && | |
this.config.layoutStates && this.config.layoutStates[e.companionAdState] && | |
(this.config.layoutStates[e.companionAdState][r] || (r = | |
"default"), o = this.config.layoutStates[e.companionAdState] | |
[r], o && t.isArray(o))) { | |
for (s = o.length - 1; s >= 0; s -= 1) i = o[s], a = | |
this.getTargetDOM(i), a && (a.innerHTML = this.getReplacementHTML( | |
i), l += a.innerHTML); | |
this.refreshAnyEpicIds(l), this.currentLayout = n; | |
} | |
}, | |
refreshAnyEpicIds: function (e) { | |
var n, i = this, | |
s = t(e) | |
.filter('[id^="ad_"]'); | |
s && 0 !== s.length && s.each(function () { | |
n = t(this) | |
.attr("id"), i.refreshEpicSlot(n); | |
}); | |
}, | |
getAdlib: function () { | |
var e = AMPTManager && AMPTManager.processNewRegistry && | |
AMPTManager.refreshAd && AMPTManager.registry; | |
return e || console.warn( | |
"companion.js: Could not find the AMPTManager! Using a mock object instead." | |
), e ? AMPTManager : { | |
registry: [], | |
processNewRegistry: function () {}, | |
refreshAd: function () {} | |
}; | |
}, | |
getEpicIdsFromRegistry: function () { | |
var e, n, i, s = this.getAdlib(); | |
for (this.knownEpicIds = {}, e = s.registry.length - 1; CNN >= | |
0; e -= 1) | |
if (t.isArray(s.registry[CNN])) | |
for (n = s.registry[CNN].length - 1; n >= 0; n -= 1) i = | |
s.registry[CNN][n] || {}, i.present && i.present === !0 && i.rktr_slot_id && (this.knownEpicIds[i.rktr_slot_id] = | |
i.present); | |
return this.knownEpicIds; | |
}, | |
hasEpicId: function (e) { | |
var t = this.knownEpicIds; | |
return t[e] || (t = this.getEpicIdsFromRegistry()), t.hasOwnProperty( | |
e) && "boolean" == typeof t[e] ? t[e] : !1; | |
}, | |
refreshEpicRegistry: function () { | |
var e; | |
"" !== this.registry && (e = this.getAdlib(), e.processNewRegistry( | |
this.registry)); | |
}, | |
refreshEpicSlot: function (e) { | |
var t = this.getAdlib(); | |
this.hasEpicId(e) || this.refreshEpicRegistry(), t.refreshAd( | |
e); | |
}, | |
getTargetDOM: function (t) { | |
var n = e.MultiAds || {}, | |
i = !!(e.MultiAds && e.MultiAds.adGroups && e.MultiAds.domAds), | |
s = i && t && t.target ? n.adGroups[t.target] : {}, | |
o = null; | |
return "undefined" != typeof s && "number" == typeof s.active && | |
-1 !== s.active && (o = e.MultiAds.domAds[s.active]), o; | |
}, | |
getReplacementHTML: function (e) { | |
var t, i = ""; | |
return e && e.replace && "empty" !== e.replace && (t = n.querySelectorAll( | |
'textarea[data-ad-name="' + e.replace + '"]'), t && | |
t.length && t[0] && t[0].value && (i = t[0].value)), | |
i; | |
}, | |
initCompanionLayout: function () { | |
var e = this.config || {}; | |
e.enabled && "string" == typeof e.layoutType && | |
"function" == typeof this.updateCompanionLayout && this | |
.updateCompanionLayout(e.layoutType); | |
} | |
}) | |
}], | |
'CNN.dynamicEpicAdCount': [{ | |
prop: 'CNN.dynamicEpicAdCount', | |
to: 0 | |
}], | |
CNN: [{ | |
prop: 'CNN', | |
to: "international" === CNN ? "CNNI" : "CNN" | |
}], | |
'CNN.contentModel.entitlementSingletons': [{ | |
prop: 'CNN.contentModel.entitlementSingletons', | |
to: [] | |
}], | |
'CNN.Chartbeat': [{ | |
prop: 'CNN.Chartbeat', | |
to: CNN.Chartbeat || {} | |
}], | |
'CNN.Outbrain': [{ | |
prop: 'CNN.Outbrain', | |
to: CNN.Outbrain || {} | |
}], | |
'CNN.Outbrain.init': [{ | |
prop: 'CNN.Outbrain.init', | |
to: function () { | |
function e () { | |
CNN.CurrentSize.getClientWidth() <= o && s.filter(function () { | |
return i(this) | |
.closest(".pg-rail") | |
.length; | |
}) | |
.removeClass("OUTBRAIN"); | |
} | |
function t () { | |
i.ajax({ | |
url: "http://widgets.outbrain.com/outbrain.js", | |
dataType: "script", | |
cache: !0 | |
}); | |
} | |
function n () { | |
fastdom.mutate(function () { | |
"section" === CNN.contentModel.pageType && CNN.Utils.existsObject( | |
CNN.ToggleOutbrain) && CNN.Utils.existsObject(CNN.ToggleOutbrain[ | |
CNN.contentModel.sectionName]) && jQuery( | |
"div.m-outbrain[data-widget-id=" + CNN.ToggleOutbrain[ | |
CNN.contentModel.sectionName].zone.outBrainId + | |
"]") | |
.hide(); | |
}); | |
} | |
var i = jQuery, | |
s = i(".js-m-outbrain"), | |
o = 640; | |
CNN.CurrentSize = CNN.CurrentSize || {}, CNN.CurrentSize.getClientWidth = | |
CNN.CurrentSize.getClientWidth || i.noop, e(), t(), n(), CNN.Features | |
.enableZoneOutbrain && jQuery(document) | |
.on("GPTRenderComplete ProgrammaticResizeComplete", function () { | |
fastdom.measure(function () { | |
var e, t, n, i, s, o, a = 0; | |
"section" === CNN.contentModel.pageType && CNN.Utils | |
.existsObject(CNN.ToggleOutbrain) && CNN.Utils.existsObject( | |
CNN.ToggleOutbrain[CNN.contentModel.sectionName] | |
) && CNN.Utils.existsObject(CNN.ToggleOutbrain[ | |
CNN.contentModel.sectionName].zone) && (e = | |
jQuery(".ad-" + CNN.ToggleOutbrain[CNN.contentModel | |
.sectionName].zone.adId), t = e.find("iframe")[ | |
0], n = t && t.contentDocument.body || {}, i = | |
jQuery(n) | |
.html() || "", s = e.parent() | |
.attr("data-ad-position"), o = CNN.ToggleOutbrain[ | |
CNN.contentModel.sectionName].zone.outBrainId, | |
i.length > 0 && (a = t.height), fastdom.mutate( | |
function () { | |
jQuery("div.m-outbrain[data-widget-id=" + o + | |
"]") | |
.hide(), "desktop" === s && "250" === a && | |
jQuery("div.m-outbrain[data-widget-id=" + | |
o + "]") | |
.show(); | |
})); | |
}); | |
}); | |
} | |
}], | |
'CNN.CurrentSize': [{ | |
prop: 'CNN.CurrentSize', | |
to: CNN.CurrentSize || {} | |
}], | |
'CNN.CurrentSize.getClientWidth': [{ | |
prop: 'CNN.CurrentSize.getClientWidth', | |
to: CNN.CurrentSize.getClientWidth || i.noop | |
}], | |
'CNN.PushAlerts': [{ | |
prop: 'CNN.PushAlerts', | |
to: CNN.PushAlerts || {} | |
}], | |
'CNN.PushAlertsConfig': [{ | |
prop: 'CNN.PushAlertsConfig', | |
to: CNN.PushAlertsConfig || {} | |
}], | |
'CNN.PushAlertsConfig.safari': [{ | |
prop: 'CNN.PushAlertsConfig.safari', | |
to: CNN.PushAlertsConfig.safari || {} | |
}], | |
'CNN.PushAlerts.Safari': [{ | |
prop: 'CNN.PushAlerts.Safari', | |
to: { | |
webServiceURL: CNN.PushAlertsConfig.safari.webServiceURL || "", | |
websitePushID: CNN.PushAlertsConfig.safari.websitePushID || "", | |
checkRemotePermission: function (e) { | |
if (CNN.Utils.existsObject(e)) | |
if ("default" === e.permission) { | |
console.info( | |
"Requesting user permission for Safari push alerts."); | |
try { | |
window.safari.pushNotification.requestPermission(CNN.PushAlerts | |
.Safari.webServiceURL, CNN.PushAlerts.Safari.websitePushID, {}, | |
CNN.PushAlerts.Safari.checkRemotePermission); | |
} catch (t) { | |
console.info( | |
"Safari push alerts permission request failed:", t); | |
} | |
} else "denied" === e.permission ? console.info( | |
"User said no to Safari push alerts.") : "granted" === | |
e.permission && console.info( | |
"User said yes to Safari push alerts. deviceToken=" + | |
e.deviceToken); | |
}, | |
init: function () { | |
var e, t; | |
CNN.Utils.existsObject(CNN.Features) && CNN.Features.enableSafariPushAlerts && | |
"safari" in window && "pushNotification" in window.safari && | |
(e = window.location.origin, e === CNN.Host.www || e === | |
CNN.Host.us || e === CNN.Host.intl ? (t = window.safari.pushNotification | |
.permission(CNN.PushAlerts.Safari.websitePushID), CNN.PushAlerts | |
.Safari.checkRemotePermission(t)) : console.info( | |
"Safari push alerts are not available on " + e)); | |
} | |
} | |
}], | |
'CNN.PushAlerts.init': [{ | |
prop: 'CNN.PushAlerts.init', | |
to: function () { | |
CNN.PushAlerts.Safari.init(); | |
} | |
}], | |
'CNN.UserMessageConfig': [{ | |
prop: 'CNN.UserMessageConfig', | |
to: CNN.UserMessageConfig || {} | |
}], | |
'CNN.userMessage': [{ | |
prop: 'CNN.userMessage', | |
to: CNN.userMessage || function (e, t, n) { | |
function i () { | |
return "tos" === x && CNN.Features.enableAspenForTOS === !0; | |
} | |
function s () { | |
i() && CNN.Utils.exists(t.AspenCNNTOS) && void 0 !== | |
AspenCNNTOS.initialized && "function" == typeof AspenCNNTOS | |
.send && t.addEventListener("beforeunload", function (e) { | |
C(B) && !C(N.getCookie(B)) && AspenCNNTOS.send( | |
"userClickedTOS", { | |
userClickedTOS: !1 | |
}); | |
}); | |
} | |
function o () { | |
D || B && j && T && N.setCNNCookie(B, j, T), fastdom.mutate( | |
function () { | |
v.animate({ | |
height: 0 | |
}, 1e3, function () { | |
v.hide(), i() && CNN.Utils.exists(t.AspenCNNTOS) && | |
void 0 !== AspenCNNTOS.initialized && | |
"function" == typeof AspenCNNTOS.send && | |
AspenCNNTOS.send("userClickedTOS", { | |
userClickedTOS: !0 | |
}), d(); | |
}); | |
}); | |
} | |
function a () { | |
I && j && z && N.setCNNCookie(I, j, z); | |
} | |
function r () { | |
var a = e.Deferred(); | |
return fastdom.measure(function () { | |
var r = e(n.body) | |
.hasClass("breaking-news--showing"), | |
l = (e("body[data-eq-state]") | |
.attr("data-eq-state") || "small") | |
.replace(/^(\\S+\\s+)*/, ""); | |
r || (v = e(".user-msg"), fastdom.mutate(function () { | |
isNaN(x) && e(n.getElementById( | |
"js-user-msg--body-text")) | |
.attr("id", x), v.height(0) | |
.addClass("user-msg-flexbox"), v.animate({ | |
height: E[l] | |
}, 1e3, function () { | |
i() && CNN.Utils.exists(t.AspenCNNTOS) && | |
"function" == typeof AspenCNNTOS.init && | |
(AspenCNNTOS.init({ | |
site: "cnn", | |
appName: "cnntos", | |
environment: CNN.contentModel.env, | |
pageUrl: t.location.href | |
}), s()), a.resolve(); | |
}); | |
}), e(".js-user-msg--close, .js-user-msg--agree") | |
.one("click", function (e) { | |
o(); | |
})); | |
}), a.promise(); | |
} | |
function l () { | |
w < _.length && f(_[w]); | |
} | |
function d () { | |
w++, l(); | |
} | |
function c (e) { | |
var n, i, s, o = e.targeting; | |
try { | |
if (Array.isArray(o.pageTypes) && o.pageTypes.length > 0 && | |
o.pageTypes.indexOf(CNN.contentModel.pageType) < 0 || | |
Array.isArray(o.sectionNames) && o.sectionNames.length > | |
0 && o.sectionNames.indexOf(CNN.contentModel.sectionName) < | |
0 || Array.isArray(o.geoTargets) && o.geoTargets.length > | |
0 && CNN.GeoCheck.inTarget(o.geoTargets) === !1) return void d(); | |
if ("object" == typeof o.browserTests && null !== o.browserTests) { | |
if (Array.isArray(o.browserTests.useragents) && o.browserTests | |
.useragents.length > 0) { | |
for (n = !1, i = 0; i < o.browserTests.useragents.length; i++) | |
if (s = o.browserTests.useragents[i], s.length > 0) | |
if ("-" === s.charAt(0)) { | |
if (t.navigator.userAgent.search(new RegExp(s.slice( | |
1))) >= 0) return void d(); | |
} else t.navigator.userAgent.search(new RegExp(s)) >= | |
0 && (n = !0); | |
if (n === !1) return void d(); | |
} | |
if ("object" == typeof o.browserTests.modernizrTests && | |
null !== o.browserTests.modernizrTests) { | |
for (s in o.browserTests.modernizrTests) | |
if (o.browserTests.modernizrTests.hasOwnProperty(s) && | |
"flash" !== s && Modernizr[s].valueOf() !== o.browserTests | |
.modernizrTests[s]) return void d(); | |
if (o.browserTests.modernizrTests.hasOwnProperty( | |
"flash")) return void Modernizr.on("flash", | |
function () { | |
(Modernizr.flash.valueOf() && !Modernizr.flash.blocked) !== | |
o.browserTests.modernizrTests[s] ? d() : g(e); | |
}); | |
} | |
} | |
g(e); | |
} catch (a) { | |
d(); | |
} | |
} | |
function u () { | |
return C(B) && C(N.getCookie(B)) ? void d() : void r(); | |
} | |
function h () { | |
u(); | |
} | |
function f (e) { | |
"object" == typeof e.targeting && null !== e.targeting ? c(e) : | |
g(e); | |
} | |
function g (t) { | |
var i; | |
x = C(t.id) ? t.id : w, A = C(t.headerText) ? t.headerText : | |
"", P = C(t.messageText) ? t.messageText : "", 0 === A.length && | |
e(".user-msg") | |
.addClass("headerless"), e(".js-user-msg--header-text") | |
.html(A), e(".js-user-msg--body-text") | |
.html(P), E = t.height, E.xsmall = E.small, E.full16x9 = E.large, | |
b(t.dismissCookie) && (i = t.dismissCookie, B = C(i.name) ? | |
i.name : "", j = C(i.name) ? i.value : "", T = p(i), D = | |
C(i.skip) && i.skip, M = C(i.defer) && i.defer, I = C(i.oldCookieName) ? | |
i.oldCookieName : "", z = C(i.oldCookieExpiration) ? i.oldCookieExpiration : | |
""), a(), D || M ? e(n) | |
.trigger(x + S) : u(); | |
} | |
function m (e) { | |
var t, n; | |
for (t = 0; t < _.length; t++) n = _[t], (C(n.id) ? n.id : t) === | |
e && _.splice(t, 1); | |
} | |
function p (e) { | |
var t, n, i, s = new Date(); | |
return C(e.expiration) && (n = new Date(e.expiration)), C(e.expirationPeriod) && | |
(i = new Date(e.expirationPeriod + s.getTime())), t = n && | |
i ? n > i ? i : n : n || i, t ? t.toUTCString() : ""; | |
} | |
function y () { | |
var e = CNN.UserMessageConfig; | |
_ = Array.isArray(e) ? e : "object" == typeof e && null !== e ? [ | |
e | |
] : [], k = CNN.Features.enableUserMessage === !0, k && ( | |
"boolean" == typeof Modernizr.ieunsupported && Modernizr.ieunsupported || | |
m("ieUnsupported"), l()); | |
} | |
var v, _ = [], | |
w = 0, | |
N = CNN.Utils, | |
C = N.exists, | |
b = N.existsObject, | |
k = !1, | |
x = "", | |
S = "_userMessageReady", | |
B = "", | |
j = "", | |
T = "", | |
A = "", | |
P = "", | |
E = {}, | |
D = !1, | |
M = !1, | |
I = "", | |
z = ""; | |
return { | |
showMessage: r, | |
showDeferredMessage: h, | |
closeMessage: o, | |
init: y | |
}; | |
}(jQuery, window, document) | |
}], | |
'CNN.siblingNavigation': [{ | |
prop: 'CNN.siblingNavigation', | |
to: i.extend({}, { | |
fastdomIds: [], | |
threshold: r.threshold, | |
template: "views/pages/common/navigation-siblings", | |
disableHoverThreshold: r.disableHoverThreshold, | |
disableHover: !1, | |
getAnalyticsLib: function () { | |
var t = e.Analytics && e.Analytics.utils && "function" == typeof e.Analytics.utils.addTrackingTags, | |
n = t ? e.Analytics.utils : { | |
addTrackingTags: i.noop | |
}; | |
return t || console.warn( | |
"navigation-siblings::getTrackingTags: Unable to find analytics library. Using mock object instead!" | |
), n; | |
}, | |
getCurrentSizeLib: function () { | |
var t = e.CurrentSize && "function" == typeof e.CurrentSize | |
.getClientWidth, | |
n = t ? e.CurrentSize : { | |
getClientWidth: i.noop | |
}; | |
return t || console.warn( | |
"navigation-siblings::getCurrentSizeLib: Unable to find current width library. Using mock object instead!" | |
), n; | |
}, | |
isEndOfPage: function () { | |
o.measure(i.proxy(function () { | |
var CNN = "do nothing", | |
t = i(".sibling"), | |
s = i(n) | |
.height(), | |
a = t.eq(0) | |
.offset() | |
.top / s, | |
r = a > this.disableHoverThreshold; | |
r && !this.disableHover && (e = "add"), !r && | |
this.disableHover && (e = "remove"), this.disableHover = | |
r, "do nothing" !== CNN && o.mutate(function () { | |
switch (CNN) { | |
case "add": | |
t.addClass("sibling--disable-hover"); | |
break; | |
case "remove": | |
t.removeClass("sibling--disable-hover"); | |
} | |
}); | |
}, this)); | |
}, | |
finishedRenderingSiblingNavigation: function (e, n) { | |
var s, r = "number" == typeof this.disableHoverThreshold; | |
e ? (console.error( | |
"Could not render %s with given template model %o", | |
this.template, a), console.error(e)) : (s = o.mutate( | |
function () { | |
i("body") | |
.append(this.html), this.analytics.addTrackingTags( | |
".sibling"), this.enableScrolling && i(t) | |
.throttleEvent("scroll.siblingNavigation", i.proxy( | |
this.isEndOfPage, this.self), 100); | |
}, { | |
html: n, | |
analytics: this.getAnalyticsLib(), | |
isEndOfPage: this.isEndOfPage, | |
enableScrolling: r, | |
self: this | |
}), this.fastdomIds.push(s)); | |
}, | |
processTheSection: function (e) { | |
var t, n, i, s, o = { | |
siblings: { | |
previous: {}, | |
next: {} | |
} | |
}, | |
a = {}, | |
r = {}, | |
l = "object" == typeof location && location.pathname ? | |
location.pathname : ""; | |
if ("object" == typeof e && null !== e) | |
for (n = CNN.nav && CNN.nav.siblings && CNN.nav.siblings | |
.articleList ? CNN.nav.siblings.articleList : [], o.siblings | |
.next = n[0] || {}, i = 0, s = n.length; s > i; i += | |
1) | |
if (a = n[i - 1] || {}, t = n[i] || {}, r = n[i + 1] || {}, | |
t.uri === l) { | |
o.siblings.previous = a, o.siblings.next = r; | |
break; | |
} | |
return o; | |
}, | |
requestTheModel: function () { | |
var e, t = "/data/ocs/section/index.html:*.json", | |
n = a; | |
return a.siblings.isUsable || (e = i.ajax(t, { | |
async: !0, | |
dataType: "json", | |
cache: !0, | |
method: "GET" | |
}) | |
.pipe(this.processTheSection), n = e.promise()), n; | |
}, | |
render: function (e) { | |
s.render(this.template, e, i.proxy(this.finishedRenderingSiblingNavigation, | |
this)); | |
}, | |
shouldIAddSiblingNavigation: function () { | |
var e; | |
console.timeStamp( | |
"navigation-sibling::shouldIAddSiblingNavigation: start" | |
), e = this.getCurrentSizeLib() | |
.getClientWidth(), e >= this.threshold && (i.when(this.requestTheModel()) | |
.done(i.proxy(this.render, this)), i(t) | |
.off("resize.siblingNavigation")), console.timeStamp( | |
"navigation-sibling::shouldIAddArticleNavigation: end" | |
); | |
}, | |
clearAllJobs: function () { | |
var e, t = this.fastdomIds; | |
for (e = t.length - 1; CNN >= 0; e -= 1) o.clear(t.pop()); | |
}, | |
readySetGo: function () { | |
var e = a.hasOwnProperty("siblings") && a.siblings.hasOwnProperty( | |
"isUsable") && "number" == typeof this.threshold; | |
e && (i(t) | |
.throttleEvent("resize.siblingNavigation", i.proxy( | |
this.shouldIAddSiblingNavigation, this), 100), | |
"function" == typeof i.fn.onZonesAndDomReady ? i(n) | |
.onZonesAndDomReady(i.proxy(this.shouldIAddSiblingNavigation, | |
this)) : i(n) | |
.load(i.proxy(this.shouldIAddSiblingNavigation, this)), | |
i(t) | |
.on("pageHide", i.proxy(this.clearAllJobs, this))); | |
} | |
}, CNN.siblingNavigation || {}) | |
}], | |
'CNN.SocialConfig': [{ | |
prop: 'CNN.SocialConfig', | |
to: CNN.SocialConfig || {} | |
}], | |
'CNN.SocialConfig.avatar': [{ | |
prop: 'CNN.SocialConfig.avatar', | |
to: CNN.SocialConfig.avatar || {} | |
}], | |
'CNN.SocialConfig.gigya': [{ | |
prop: 'CNN.SocialConfig.gigya', | |
to: CNN.SocialConfig.gigya || {} | |
}], | |
'CNN.SocialConfig.livefyre': [{ | |
prop: 'CNN.SocialConfig.livefyre', | |
to: CNN.SocialConfig.livefyre || {} | |
}], | |
'CNN.SocialConfig.msib': [{ | |
prop: 'CNN.SocialConfig.msib', | |
to: CNN.SocialConfig.msib || {} | |
}], | |
'CNN.accounts': [{ | |
prop: 'CNN.accounts', | |
to: CNN.accounts || {} | |
}], | |
'CNN.accounts.localCfg': [{ | |
prop: 'CNN.accounts.localCfg', | |
to: CNN.accounts.localCfg || {} | |
}], | |
'CNN.accounts.localCfg.avatar': [{ | |
prop: 'CNN.accounts.localCfg.avatar', | |
to: CNN.accounts.localCfg.avatar || {} | |
}], | |
'CNN.accounts.localCfg.avatar.host': [{ | |
prop: 'CNN.accounts.localCfg.avatar.host', | |
to: CNN.SocialConfig.avatar.host | |
}], | |
'CNN.accounts.localCfg.gigya': [{ | |
prop: 'CNN.accounts.localCfg.gigya', | |
to: CNN.accounts.localCfg.gigya || {} | |
}], | |
'CNN.accounts.localCfg.gigya.appId': [{ | |
prop: 'CNN.accounts.localCfg.gigya.appId', | |
to: CNN.SocialConfig.gigya.appId | |
}], | |
'CNN.accounts.localCfg.gigya.shareButtons': [{ | |
prop: 'CNN.accounts.localCfg.gigya.shareButtons', | |
to: "Email,Facebook,Twitter,Share" | |
}], | |
'CNN.accounts.localCfg.livefyre': [{ | |
prop: 'CNN.accounts.localCfg.livefyre', | |
to: CNN.accounts.localCfg.livefyre || {} | |
}], | |
'CNN.accounts.localCfg.livefyre.network': [{ | |
prop: 'CNN.accounts.localCfg.livefyre.network', | |
to: CNN.SocialConfig.livefyre.network | |
}], | |
'CNN.accounts.localCfg.livefyre.networkName': [{ | |
prop: 'CNN.accounts.localCfg.livefyre.networkName', | |
to: CNN.SocialConfig.livefyre.networkName | |
}], | |
'CNN.accounts.localCfg.livefyre.siteId': [{ | |
prop: 'CNN.accounts.localCfg.livefyre.siteId', | |
to: CNN.SocialConfig.livefyre.siteId | |
}], | |
'CNN.accounts.localCfg.livefyre.srcDomain': [{ | |
prop: 'CNN.accounts.localCfg.livefyre.srcDomain', | |
to: CNN.SocialConfig.livefyre.srcDomain | |
}], | |
'CNN.accounts.localCfg.livefyre.tokenEndpoint': [{ | |
prop: 'CNN.accounts.localCfg.livefyre.tokenEndpoint', | |
to: CNN.SocialConfig.livefyre.tokenEndpoint | |
}], | |
'CNN.accounts.localCfg.livefyre.pingEndpoint': [{ | |
prop: 'CNN.accounts.localCfg.livefyre.pingEndpoint', | |
to: CNN.SocialConfig.livefyre.pingEndpoint | |
}], | |
'CNN.accounts.localCfg.accounts': [{ | |
prop: 'CNN.accounts.localCfg.accounts', | |
to: CNN.accounts.localCfg.accounts || {} | |
}], | |
'CNN.accounts.localCfg.accounts.loginUrl': [{ | |
prop: 'CNN.accounts.localCfg.accounts.loginUrl', | |
to: "/login.html" | |
}], | |
'CNN.accounts.avatarForScreenName': [{ | |
prop: 'CNN.accounts.avatarForScreenName', | |
to: a | |
}], | |
'CNN.accounts.getLoginUrl': [{ | |
prop: 'CNN.accounts.getLoginUrl', | |
to: n | |
}], | |
'CNN.accounts.isLoaded': [{ | |
prop: 'CNN.accounts.isLoaded', | |
to: !1 | |
}, { | |
prop: 'CNN.accounts.isLoaded', | |
to: !0 | |
}], | |
'CNN.accounts.loadGigya': [{ | |
prop: 'CNN.accounts.loadGigya', | |
to: l | |
}], | |
'CNN.accounts.pingLivefyre': [{ | |
prop: 'CNN.accounts.pingLivefyre', | |
to: g | |
}], | |
'CNN.accounts.clearLivefyre': [{ | |
prop: 'CNN.accounts.clearLivefyre', | |
to: r | |
}], | |
'CNN.accounts.onInitialized': [{ | |
prop: 'CNN.accounts.onInitialized', | |
to: s | |
}], | |
'CNN.accounts.setLivefyreToken': [{ | |
prop: 'CNN.accounts.setLivefyreToken', | |
to: m | |
}], | |
'CNN.accounts.cfg': [{ | |
prop: 'CNN.accounts.cfg', | |
to: v | |
}], | |
'CNN.accounts.user': [{ | |
prop: 'CNN.accounts.user', | |
to: CNN.accounts.user || this | |
}] | |
} | |
const cnn_header_second_min_js = { | |
'CNN.Utils': [{ | |
prop: 'CNN.Utils', | |
to: CNN.Utils || function (e, t, n, i) { | |
"use strict"; | |
function r (e) { | |
var t = null; | |
return "string" == typeof e && Date.parse(e) ? t = e : | |
"number" == typeof e && (t = new Date(Date.now() + e * A) | |
.toGMTString()), t; | |
} | |
function o (e) { | |
var t, n = !0, | |
r = function (e) { | |
return e !== i && null !== e; | |
}; | |
for (t = 0; t < arguments.length; t++) | |
if (!r(arguments[t])) { | |
n = !1; | |
break; | |
} | |
return n; | |
} | |
function a (e) { | |
var t, n = !0, | |
i = function (e) { | |
return "object" == typeof e && null !== e; | |
}; | |
for (t = 0; t < arguments.length; t++) | |
if (!i(arguments[t])) { | |
n = !1; | |
break; | |
} | |
return n; | |
} | |
function s (e) { | |
var t, n = !0, | |
i = function (e) { | |
return "string" == typeof e && e.length > 0; | |
}; | |
for (t = 0; t < arguments.length; t++) | |
if (!i(arguments[t])) { | |
n = !1; | |
break; | |
} | |
return n; | |
} | |
function l () { | |
var e, t, i = {}, | |
r = 0; | |
if (n.cookie) | |
for (e = n.cookie.split("; "); r < e.length; r++) t = e[r].split( | |
"="), i[t[0]] = decodeURIComponent(t[1]) || null; | |
return i; | |
} | |
function u (e) { | |
return null !== c(e); | |
} | |
function c (e) { | |
var t = new RegExp("(^|;)\\\\s*" + e + "\\\\s*=\\\\s*([^;]+)"), | |
i = n.cookie.match(t); | |
return i ? i.pop() : null; | |
} | |
function d (e, t, i, a, s, l) { | |
var u = ""; | |
o(e) && o(t) && (i = r(i), a = o(a) ? a : "/", s = o(s) ? s : | |
"", l = o(l) ? l : !1, u += e + "=" + encodeURIComponent( | |
t), o(i) && (u += ";expires=" + i), a && (u += ";path=" + | |
a), s && (u += ";domain=" + s), l && (u += "; secure"), | |
n.cookie = u); | |
} | |
function f (e, t, n, i) { | |
d(e, t, n, "/", ".cnn.com", i); | |
} | |
function p (e, t, i) { | |
var r = ""; | |
o(e) && (t = o(t) ? t : "/", i = o(i) ? i : "", r += e + | |
"=;expires=" + x, t && (r += ";path=" + t), i && (r += | |
";domain=" + i), n.cookie = r); | |
} | |
function h (e) { | |
p(e, "/", ".cnn.com"); | |
} | |
function g (e, n, i) { | |
var r; | |
if ("string" == typeof e && e.length > 0 && "string" == typeof n) | |
if (S === !1) d(e, n, "session" === i ? null : i, "/", | |
".cnn.com", !1); | |
else try { | |
"session" === i ? t.sessionStorage.setItem(e, n) : (t.localStorage | |
.setItem(e, n), "number" == typeof i ? (r = new Date( | |
Date.now() + i * A), t.localStorage.setItem(e + | |
"__expires", r.getTime() | |
.toString(10))) : "string" == typeof i && | |
"session" !== i && (r = new Date(i), r.getTime() > | |
Date.now() && t.localStorage.setItem(e + | |
"__expires", r.getTime() | |
.toString(10)))); | |
} catch (o) {} | |
} | |
function m (e) { | |
if ("string" == typeof e && e.length > 0) { | |
if (S === !1) return u(e); | |
try { | |
if (o(t.sessionStorage.getItem(e)) || o(t.localStorage.getItem( | |
e + "__expires"))) return !0; | |
} catch (n) {} | |
} | |
return !1; | |
} | |
function v (e) { | |
if ("string" == typeof e && e.length > 0) | |
if (S === !1) p(e); | |
else { | |
try { | |
t.localStorage.removeItem(e), t.localStorage.removeItem( | |
e + "__expires"); | |
} catch (n) {} | |
try { | |
t.sessionStorage.removeItem(e); | |
} catch (n) {} | |
} | |
} | |
function y (e) { | |
var n, i = null; | |
if ("string" == typeof e && e.length > 0) try { | |
S === !1 ? c(e) : null !== (n = t.localStorage.getItem(e + | |
"__expires")) ? parseInt(n, 10) > Date.now() ? i = t.localStorage | |
.getItem(e) : v(e) : (i = t.sessionStorage.getItem(e), | |
o(i) || (i = t.localStorage.getItem(e))); | |
} catch (r) {} | |
return i; | |
} | |
function _ (e) { | |
var n, i, r, o, a, s, l = e; | |
if ("function" == typeof t.btoa) try { | |
n = t.btoa(l); | |
} catch (u) { | |
n = t.btoa(e.replace( | |
/[^\\w\\s\\!\\@\\#\\$\\%\\^\\&\\*\\(\)\\-\\=\\+\\.\\,\\\\\\;\\:\\\\\"\\?]/, | |
"-")); | |
} else { | |
if (i = | |
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" | |
.split(""), r = "", o = "", a = l.length % 3, a > 0) | |
for (; 3 > a; a++) o += "=", l += "\x00"; | |
for (a = 0; a < l.length; a += 3) a > 0 && a / 3 * 4 % 76 === | |
0 && (r += "\r"), s = (l.charCodeAt(a) << 16) + (l.charCodeAt( | |
a + 1) << 8) + l.charCodeAt(a + 2), s = [s >>> 18 & | |
63, s >>> 12 & 63, s >>> 6 & 63, 63 & s | |
], r += i[s[0]] + i[s[1]] + i[s[2]] + i[s[3]]; | |
n = r.substring(0, r.length - o.length) + o; | |
} | |
return n; | |
} | |
function w (e) { | |
var n, i, r, o, a, s, l, u, c = e; | |
if ("function" == typeof t.atob) try { | |
n = t.atob(c); | |
} catch (d) { | |
console.log(d.message, "String to decode: " + c); | |
} else { | |
for (i = | |
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" | |
.split(""), r = {}, u = 0; u < i.length; u++) r[i[u]] = | |
u; | |
for (c = c.replace(new RegExp("[^" + i.join("") + "=]", | |
"g"), ""), a = "=" === c.charAt(c.length - 1) ? "=" === | |
c.charAt(c.length - 2) ? "AA" : "A" : "", o = "", c = c | |
.substr(0, c.length - a.length) + a, s = 0; s < c.length; s += | |
4) l = (r[c.charAt(s)] << 18) + (r[c.charAt(s + 1)] << | |
12) + (r[c.charAt(s + 2)] << 6) + r[c.charAt(s + 3)], | |
o += String.fromCharCode(l >>> 16 & 255, l >>> 8 & 255, | |
255 & l); | |
n = o.substring(0, o.length - a.length); | |
} | |
return n; | |
} | |
function b (e) { | |
return e.replace("#", ""); | |
} | |
function C () { | |
return t.Modernizr.phone; | |
} | |
var S, A = 36e5, | |
x = "Thu, 01 Jan 1970 00:00:00 UTC"; | |
return S = function () { | |
var e = "__test_it"; | |
try { | |
return t.localStorage.setItem(e, e), t.localStorage.removeItem( | |
e), t.sessionStorage.setItem(e, e), t.sessionStorage.removeItem( | |
e), !0; | |
} catch (n) { | |
return !1; | |
} | |
}(), { | |
exists: o, | |
existsObject: a, | |
existsString: s, | |
getCookies: l, | |
getCookie: c, | |
cookieExists: u, | |
setCookie: d, | |
deleteCookie: p, | |
setCNNCookie: f, | |
deleteCNNCookie: h, | |
storeLocalValue: g, | |
hasLocalValue: m, | |
deleteLocalValue: v, | |
getLocalValue: y, | |
b64Encode: _, | |
b64Decode: w, | |
stripHash: b, | |
isPhone: C | |
}; | |
}(jQuery, window, document) | |
}], | |
'CNN.Features': [{ | |
prop: 'CNN.Features', | |
to: CNN.Features || {} | |
}], | |
'CNN.VideoConfig': [{ | |
prop: 'CNN.VideoConfig', | |
to: CNN.VideoConfig || {} | |
}], | |
'CNN.VideoConfig.liveStream': [{ | |
prop: 'CNN.VideoConfig.liveStream', | |
to: CNN.VideoConfig.liveStream || {} | |
}], | |
'CNN.GeoCheck': [{ | |
prop: 'CNN.GeoCheck', | |
to: function (e, t) { | |
"use strict"; | |
function n () { | |
return o; | |
} | |
function i (e) { | |
var t, n, i, r, a, s = !0; | |
if (null !== o && Array.isArray(e) === !0 && e.length > 0) | |
for (i = o.country + ":" + o.region, r = i + ":" + o.city.toLowerCase(), | |
t = 0; t < e.length; t++) a = e[t], "-" === a.charAt(0) ? | |
(a = a.slice(1), n = !1) : n = !0, "*" === a ? s = n : | |
"#" === a.charAt(0) ? o.continent === a.slice(1) && (s = | |
n) : (2 === a.length && o.country === a || 5 === a.length && | |
i === a || a.length > 6 && r === a) && (s = n); | |
return s; | |
} | |
function r () { | |
return CNN._geoCheckReadyEvent; | |
} | |
var o = null; | |
return CNN._geoCheckReadyEvent = !1, e.fn.extend({ | |
onGeoCheckReady: function (n) { | |
"function" == typeof n && (CNN._geoCheckReadyEvent === !0 ? n(e) : e(t) | |
.on("geoCheckReady", { | |
handler: n | |
}, function (t) { | |
t = t || {}, "object" == typeof t.data && | |
null !== t.data && "function" == typeof t.data | |
.handler && t.data.handler(e); | |
})); | |
}, | |
triggerGeoCheckReady: function () { | |
CNN._geoCheckReadyEvent = !0, e(t) | |
.trigger("geoCheckReady"); | |
} | |
}), | |
function () { | |
var n, i; | |
i = CNN.Utils.getCookie("geoData"), null !== i && (n = i.split( | |
"|"), n.length > 4 && (o = { | |
city: n[0], | |
region: n[1], | |
postCode: n[2], | |
country: n[3], | |
continent: n[4] | |
})), e(t) | |
.triggerGeoCheckReady(); | |
}(), { | |
getData: n, | |
inTarget: i, | |
isReady: r | |
}; | |
}(jQuery, document) | |
}], | |
'CNN._geoCheckReadyEvent': [{ | |
prop: 'CNN._geoCheckReadyEvent', | |
to: !1 | |
}, { | |
prop: 'CNN._geoCheckReadyEvent', | |
to: !0 | |
}], | |
CNN: [{ | |
prop: 'CNN', | |
to: window.CNN || {} | |
}, { | |
prop: 'CNN', | |
to: t.find(".media__video--responsive") | |
}], | |
'CNN.AdsConfig': [{ | |
prop: 'CNN.AdsConfig', | |
to: CNN.AdsConfig || {} | |
}], | |
'CNN.AdsConfig.amazon': [{ | |
prop: 'CNN.AdsConfig.amazon', | |
to: CNN.AdsConfig.amazon || {} | |
}], | |
'CNN.contentModel': [{ | |
prop: 'CNN.contentModel', | |
to: CNN.contentModel || {} | |
}], | |
'CNN.CurrentSize': [{ | |
prop: 'CNN.CurrentSize', | |
to: CNN.CurrentSize || {} | |
}], | |
'CNN.CurrentSize.getClientWidth': [{ | |
prop: 'CNN.CurrentSize.getClientWidth', | |
to: CNN.CurrentSize.getClientWidth || jQuery.noop | |
}], | |
'CNN.minWidthForExpandElements': [{ | |
prop: 'CNN.minWidthForExpandElements', | |
to: 480 | |
}], | |
'CNN.showGalleryCaptionWidth': [{ | |
prop: 'CNN.showGalleryCaptionWidth', | |
to: 640 | |
}], | |
'CNN.orientationLandscape': [{ | |
prop: 'CNN.orientationLandscape', | |
to: !1 | |
}], | |
'CNN.adLockingDisableWidth': [{ | |
prop: 'CNN.adLockingDisableWidth', | |
to: 960 | |
}], | |
'CNN.adLockEnable': [{ | |
prop: 'CNN.adLockEnable', | |
to: !!(k(CNN.AdsConfig) && CNN.AdsConfig.enableAdLock === !0 && CNN | |
.CurrentSize.getClientWidth() >= CNN.adLockingDisableWidth && 0 !== | |
jQuery(".pg-rail.pg-rail-tall__rail") | |
.length && 0 !== jQuery(".pg-rail-tall__head") | |
.length) | |
}] | |
} | |
cnn_header_cf68cf54d22d98a1ba38_first_bundle_js = { | |
'CNN.Features': [{ | |
prop: 'CNN.Features', | |
to: CNN.Features || {} | |
}], | |
'CNN.PageParams': [{ | |
prop: 'CNN.PageParams', | |
to: {} | |
}], | |
'CNN.pageVis': [{ | |
prop: 'CNN.pageVis', | |
to: { | |
hiddenEvent: '', | |
hiddenKey: '', | |
isDocumentHidden: function () { | |
return this.hiddenKey.length > 0 && e[this.hiddenKey] === !0; | |
}, | |
isDocumentVisible: function () { | |
return this.hiddenKey.length > 0 && e[this.hiddenKey] === !1; | |
} | |
} | |
}], | |
'CNN._analyticsMetadataEvent': [{ | |
prop: 'CNN._analyticsMetadataEvent', | |
to: !1 | |
}, { | |
prop: 'CNN._analyticsMetadataEvent', | |
to: !0 | |
}], | |
'CNN._corePlayerReady': [{ | |
prop: 'CNN._corePlayerReady', | |
to: !1 | |
}, { | |
prop: 'CNN._corePlayerReady', | |
to: !0 | |
}], | |
'CNN._onCarouselLoaded': [{ | |
prop: 'CNN._onCarouselLoaded', | |
to: !1 | |
}, { | |
prop: 'CNN._onCarouselLoaded', | |
to: !0 | |
}], | |
'CNN._videoContentStarted': [{ | |
prop: 'CNN._videoContentStarted', | |
to: !1 | |
}, { | |
prop: 'CNN._videoContentStarted', | |
to: !0 | |
}], | |
'CNN._zonesRenderedEvent': [{ | |
prop: 'CNN._zonesRenderedEvent', | |
to: !1 | |
}, { | |
prop: 'CNN._zonesRenderedEvent', | |
to: !0 | |
}], | |
'CNN._zonesAndDomReadyEvent': [{ | |
prop: 'CNN._zonesAndDomReadyEvent', | |
to: !1 | |
}, { | |
prop: 'CNN._zonesAndDomReadyEvent', | |
to: !0 | |
}], | |
'CNN._zoneRenderedEvent': [{ | |
prop: 'CNN._zoneRenderedEvent', | |
to: !1 | |
}], | |
'CNN._articleLengthChange': [{ | |
prop: 'CNN._articleLengthChange', | |
to: !1 | |
}, { | |
prop: 'CNN._articleLengthChange', | |
to: !0 | |
}], | |
'CNN.goActiveUntil': [{ | |
prop: 'CNN.goActiveUntil', | |
to: typeof CNN.goActiveUntil === 'number' ? CNN.goActiveUntil : 0 | |
}], | |
'CNN.refreshTimer': [{ | |
prop: 'CNN.refreshTimer', | |
to: { | |
adList: [], | |
forceReset: 0, | |
hiddenResetDelay: 0, | |
hiddenResetThreshold: 0, | |
hiddenTime: 0, | |
intervals: {}, | |
intervalsCount: 0, | |
intervalsId: null, | |
intervalsVis: {}, | |
intervalsVisCount: 0, | |
intervalsVisId: null, | |
startTime: n, | |
visibleTime: 0, | |
visibleTimeAccrued: 0 | |
} | |
}], | |
'CNN.refreshTimer.triggerTimer': [{ | |
prop: 'CNN.refreshTimer.triggerTimer', | |
to: function (t) { | |
var n, o, a; | |
if (typeof t.eventName === 'string' && t.eventName.length > 0 && | |
i(e) | |
.trigger(t.eventName), t.isPage === !0) return void(window.location | |
.href.search(/[\&\?]refresh\=/) >= 0 ? window.location.reload(! | |
0) : (n = window.location.href.indexOf('#'), window.location | |
.href.indexOf('?') >= 0 ? n >= 0 ? window.location.replace( | |
window.location.href.substr(0, n) + '&refresh=1' + | |
window.location.href.substr(n)) : window.location.replace( | |
window.location.href + '&refresh=1') : n >= 0 ? | |
window.location.replace(window.location.href.substr(0, | |
n) + '?refresh=1' + window.location.href.substr(n)) : | |
window.location.replace(window.location.href + | |
'?refresh=1'))); | |
if (typeof AMPTManager === 'object' && typeof AMPTManager.refreshAds === | |
'function' && typeof t.className === 'string' && t.className.length > | |
0 && (o = i(t.className), o !== null && o.length > 0)) { | |
for (n = 0; n < o.length; n++) { | |
a = o.eq(n) | |
.attr('id'), typeof a === 'string' && a.length > 0 && CNN | |
.refreshTimer.adList.push(a); | |
} | |
} | |
} | |
}], | |
'CNN.refreshTimer.intervalAction': [{ | |
prop: 'CNN.refreshTimer.intervalAction', | |
to: function () { | |
var e, t, n, o = CNN.refreshTimer, | |
a = new Date() | |
.getTime(), | |
s = Math.floor((a - o.startTime + 1e4) / 6e4); | |
if (s > 0) { | |
o.adList = []; | |
for (e in o.intervals) { | |
if (o.intervals.hasOwnProperty(e) && (t = parseInt(e, 10)) > | |
0 && s % t === 0 && typeof o.intervals[e] !== 'undefined' && | |
i.isArray(o.intervals[e])) { | |
for (n = 0; n < o.intervals[e].length; n++) o.triggerTimer( | |
o.intervals[e][n]); | |
} | |
} | |
if (o.adList.length > 0) { | |
try { | |
AMPTManager.refreshAds(o.adList); | |
} catch (e) { | |
console.log('Failed to refresh ads (' + o.adList.join(',') + | |
'): ', e); | |
} | |
} | |
} | |
} | |
}], | |
'CNN.refreshTimer.intervalVisAction': [{ | |
prop: 'CNN.refreshTimer.intervalVisAction', | |
to: function () { | |
var e, t, n, o, a, s = CNN.refreshTimer, | |
l = new Date() | |
.getTime(); | |
if (s.visibleTime > 0 && (e = l - s.visibleTime, s.visibleTimeAccrued += | |
e, l >= CNN.goActiveUntil && s.forceReset > 0 && (s.forceReset -= | |
e, s.forceReset <= 0 && s.triggerTimer(CNN.pageTimer)), s | |
.visibleTime = l), CNN.pageVis.isDocumentHidden()) s.handleVisibilityChange(); | |
else if (n = Math.floor((s.visibleTimeAccrued + 1e4) / 6e4), s.intervalsVisId = | |
setTimeout(s.intervalVisAction, 6e4 * (n + 1) - s.visibleTimeAccrued), | |
n > 0) { | |
s.adList = []; | |
for (t in s.intervalsVis) { | |
if (s.intervalsVis.hasOwnProperty(t) && (o = parseInt(t, 10)) > | |
0 && n % o === 0 && typeof s.intervalsVis[t] !== | |
'undefined' && i.isArray(s.intervalsVis[t])) { | |
for (a = 0; a < s.intervalsVis[t].length; a++)(!s.intervalsVis[ | |
t][a].isPage || l >= CNN.goActiveUntil) && s.triggerTimer( | |
s.intervalsVis[t][a]); | |
} | |
} | |
if (s.adList.length > 0) { | |
try { | |
AMPTManager.refreshAds(s.adList); | |
} catch (e) { | |
console.log('Failed to refresh ads (' + s.adList.join(',') + | |
'):', e); | |
} | |
} | |
} | |
} | |
}], | |
'CNN.refreshTimer.handleVisibilityChange': [{ | |
prop: 'CNN.refreshTimer.handleVisibilityChange', | |
to: function () { | |
var e, t, n = CNN.refreshTimer, | |
i = new Date() | |
.getTime(); | |
CNN.pageVis.isDocumentHidden() ? n.intervalsVisId !== null && ( | |
clearTimeout(n.intervalsVisId), n.intervalsVisId = null, n.hiddenTime = | |
i, n.visibleTime > 0 && (n.visibleTimeAccrued += i - n.visibleTime, | |
n.visibleTime = 0)) : n.intervalsVisId === null && (t = | |
6e4 - n.visibleTimeAccrued % 6e4, n.visibleTime = i, n.hiddenResetThreshold > | |
0 && n.hiddenTime > 0 && CNN.goActiveUntil <= i && (e = i - | |
n.hiddenTime, (n.forceReset > 0 || n.hiddenResetThreshold < | |
e && n.hiddenResetDelay < 6e4 * (CNN.pageTimer.interval - | |
1) - n.visibleTimeAccrued) && (n.forceReset > 0 ? n.forceReset -= | |
e : n.forceReset = n.hiddenResetDelay, n.forceReset <= | |
0 && n.triggerTimer(CNN.pageTimer))), n.hiddenTime = 0, | |
n.intervalsVisId = setTimeout(n.intervalVisAction, t)); | |
} | |
}], | |
'CNN.pageTimer.isPage': [{ | |
prop: 'CNN.pageTimer.isPage', | |
to: !0 | |
}], | |
CNN: [{ | |
prop: 'CNN', | |
to: t.length | |
}, { | |
prop: 'CNN', | |
to: C | |
}, { | |
prop: 'CNN', | |
to: ge._data(t) | |
}, { | |
prop: 'CNN', | |
to: s && (Te.boxSizingReliable() || o === e.style[t]) | |
}, { | |
prop: 'CNN', | |
to: t(e[o], o, n) | |
}, { | |
prop: 'CNN', | |
to: !0 | |
}, { | |
prop: 'CNN', | |
to: o.selector + '' | |
}, { | |
prop: 'CNN', | |
to: n.apply(e, i || []) | |
}, { | |
prop: 'CNN', | |
to: function () { | |
return ge; | |
}.apply(t, i) | |
}, { | |
prop: 'CNN', | |
to: new Event('test') | |
}, { | |
prop: 'CNN', | |
to: function (e, t, n) { | |
'use strict'; | |
function o (t, n, i) { | |
this.startTime = null, this.stopTime = null, this.sourceId = | |
n, this.sync = t, this.mode = i, this.latency = null, o.prototype | |
.startTimer = function () { | |
this.startTime = Date.now(); | |
}, o.prototype.stopTimer = function () { | |
this.stopTime = Date.now(); | |
}, o.prototype.stopTimerAndReportLatency = function () { | |
this.stopTimer(), this.calculateLatency(), this.isThrottled() || | |
this.reportLatency(); | |
}, o.prototype.calculateLatency = function () { | |
this.latency = this.stopTime - this.startTime; | |
}, o.prototype.isThrottled = function () { | |
var t, n = parseInt(e.latencySamplingRate, 10); | |
if (!isNaN(n)) { | |
if (n == 0) return !0; | |
if (n == 100) return !1; | |
if (t = 100 * Math.random(), n >= t) return !1; | |
} | |
return !0; | |
}, o.prototype.reportLatency = function () { | |
var t, n; | |
this.latency != null && this.latency > 0 && (t = | |
'/{"c":"dtb","src":"' + this.sourceId + '","' + (this | |
.sync ? 'bls' : 'bla') + '":"' + this.latency + | |
'","m":"' + this.mode + '"}', n = e.protocol + e.host + | |
e.px_svc + 'PH' + t, new Image() | |
.src = n); | |
}; | |
} | |
function a () { | |
this.metrics = {}, this.t0 = Date.now(), this.i = 0, this.addTimer = | |
function (e, t) { | |
t || (t = Date.now()), this.metrics[e] = t - this.t0; | |
}, this.set = function (e, t) { | |
this.metrics[e] = t; | |
}, this.schedule = function (t, n) { | |
var i = this; | |
t || (t = 5e3), n || (n = 'PH'), n += '/', setTimeout( | |
function () { | |
var t, CNN; | |
i.metrics.i = i.i, i.metrics.t0 = i.t0, i.metrics.site = | |
i.getTopDomain(e), t = JSON.stringify(i.metrics), | |
CNN = e.protocol + e.host + e.px_svc + n + | |
encodeURIComponent(t), new Image() | |
.src = CNN, i.metrics = {}, i.t0 = Date.now(), i.i++; | |
}, t); | |
}, this.getTopDomain = function (e) { | |
var t, n = decodeURIComponent(e.getReferrerURL()); | |
return t = n.indexOf('://') > -1 ? n.split('/')[2] : n.split( | |
'/')[0], t = t.split(':')[0]; | |
}; | |
} | |
var s, l, c, u = t.location.protocol === 'https:'; | |
return e.latencyUtil = e.latencyUtil || null, e.protocol = u ? | |
'https://' : 'http://', e.DEFAULT_HOST = | |
'aax.amazon-adsystem.com', e.host = e.DEFAULT_HOST, e.dtb_svc = | |
'/e/dtb/bid', e.pb_svc = '/x/getad', e.px_svc = '/x/px/', e.debug_mode = | |
e.debug_mode || !1, e.MIN_TIMEOUT = 0, e.DEFAULT_TIMEOUT = | |
1e3, e.targetingKey = 'amznslots', e.latencySamplingRate = 1, | |
e.vidKey = 'amzn_vid', e.tasks = e.tasks || [], e.VIEWABILITY_CUTOFF_AREA = | |
e.VIEWABILITY_CUTOFF_AREA || 0.5, e.VIEWABILITY_CUTOFF_DURATION_SEC = | |
e.VIEWABILITY_CUTOFF_DURATION_SEC || 1, e.CSM_JS = | |
'//c.amazon-adsystem.com/aax2/csm.js.gz', e.vads = {}, s = | |
'_d', l = !1, c = new a(), c.addTimer('tlt'), e.ads || (e.ads = {}), | |
e.updateAds = function (t) { | |
var n, i; | |
if (l = !0, e.ads = t.ads, e.ev = t.ev, t.vads) { | |
e.vads = t.vads, e.ads || (e.ads = {}), i = !1; | |
for (n in t.vads) t.vads.hasOwnProperty(n) && n.indexOf(s) != -1 && (e.ads[n] = t.vads[n], e.amzn_vid = t.vads[n], i = ! | |
0); | |
if (!i) { | |
for (n in t.vads) t.vads.hasOwnProperty(n) && (e.ads[n] = | |
t.vads[n], e.amzn_vid = t.vads[n]); | |
} | |
} | |
e.doAllTasks(), e.tasks.push = function (t) { | |
e.doTask(t); | |
}; | |
try { | |
t.lsr && (e.latencySamplingRate = t.lsr), t.rm && (c.addTimer( | |
'br'), c.set('brs', '1'), c.schedule(t.to, t.id)), e.latencyUtil != | |
null && e.latencyUtil.stopTimerAndReportLatency(); | |
} catch (e) {} | |
}, e.aaxPunt = function (e) { | |
try { | |
l = !0, c.addTimer('br'), c.set('brs', '0'), e && e.rm && | |
c.schedule(e.to, e.id); | |
} catch (e) {} | |
}, e.saveAds = function (t) { | |
e.saved_ads = t.ads, e.updateAds(t); | |
}, e.getAdForSlot = function (n, CNN, o) { | |
var a, s, l, c; | |
e.src_id = n, a = a || {}, s = a.u, e.host = n == 3e3 ? | |
'aax-cpm.amazon-adsystem.com' : e.host, s || (s = e.getReferrerURL()), | |
s && s.indexOf('amzn_debug_mode') !== -1 && (e.debug_mode = ! | |
0), l = 'src=' + e.src_id + '&slot_uuid=' + CNN + | |
'&c=100&u=' + s + '&cb=' + Math.round(1e7 * Math.random()), | |
c = e.protocol + e.host + e.pb_svc + '?jsd=1&' + l, o ? e | |
.appendScriptTag(c) : i(t, | |
"<script type='text/javascript' src='" + c + | |
"'></script>"); | |
}, e.getAdsCallback = function (t, n, i, CNN, o) { | |
var a = null; | |
o = o || {}; | |
try { | |
n && typeof n === 'function' && (a = e.handleCallBack(n, | |
i)); | |
} catch (e) {} | |
o.to || (o.to = i), e.doGetAdsAsync(t, CNN, o, a); | |
}, e.getVideoAdsCallback = function (t, n, i, CNN, o) { | |
var o = o || {}; | |
o.mt = 'V', e.getAdsCallback(t, n, i, CNN, o); | |
}, e.getDisplayAdsCallback = function (t, n, i, CNN, o) { | |
var o = o || {}; | |
o.mt = 'D', e.getAdsCallback(t, n, i, CNN, o); | |
}, e.getAdsAsync = function (t, n, i) { | |
e.doGetAdsAsync(t, n, i); | |
}, e.getVideoAdsAsync = function (t, n, i) { | |
var i = i || {}; | |
i.mt = 'V', e.getAdsAsync(t, n, i); | |
}, e.getDisplayAdsAsync = function (t, n, i) { | |
var i = i || {}; | |
i.mt = 'D', e.getAdsAsync(t, n, i); | |
}, e.handleCallBack = function (t, i) { | |
var CNN = !1, | |
o = null, | |
a = function (e) { | |
if (!CNN) { | |
try { | |
t(e), o && clearTimeout(o), e || c.set('to', '1'); | |
} catch (e) {} | |
CNN = !0; | |
} | |
}, | |
s = e.getValidMilliseconds(i); | |
return o = s ? n.setTimeout(a, s) : n.setTimeout(a, e.DEFAULT_TIMEOUT), | |
a; | |
}, e.getValidMilliseconds = function (t) { | |
if (!t) return !1; | |
try { | |
var n = ~~Number(t); | |
if (n > e.MIN_TIMEOUT) return n; | |
} catch (e) { | |
return !1; | |
} | |
return !1; | |
}, e.getAds = function (n, CNN, a, s) { | |
if (l = !1, s) return void e.doGetAdsAsync(n, CNN, a); | |
var u = e.getScriptSource(n, CNN, a); | |
try { | |
e.latencyUtil = new o(!0, n, a && a.mt ? a.mt : 'DV'), e.latencyUtil | |
.startTimer(), c.addTimer('sb'), c.set('src', n); | |
} catch (e) {} | |
u && i(t, "<script type='text/javascript' src='" + u + | |
"'></script>"); | |
}, e.getVideoAds = function (t, n, i, CNN) { | |
var i = i || {}; | |
i.mt = 'V', e.getAds(t, n, i, CNN); | |
}, e.getDisplayAds = function (t, n, i, CNN) { | |
var i = i || {}; | |
i.mt = 'D', e.getAds(t, n, i, CNN); | |
}, e.doGetAdsAsync = function (t, n, i, CNN) { | |
l = !1; | |
var a = e.getScriptSource(t, n, i); | |
try { | |
e.latencyUtil = new o(!1, t, i && i.mt ? i.mt : 'DV'), e.latencyUtil | |
.startTimer(), c.addTimer('ab'), c.set('src', t); | |
} catch (e) {} | |
e.appendScriptTag(a, CNN); | |
}, e.getScriptSource = function (n, i, CNN) { | |
var o, a, s, l, u, d; | |
if (!e.ssb) { | |
if (e.src_id = n, CNN = CNN || {}, o = CNN.u, a = CNN.d, | |
s = CNN.to, l = CNN.mt, o || (o = e.getReferrerURL()), | |
o && o.indexOf('amzn_debug_mode') !== -1 && (e.debug_mode = ! | |
0), CNN.mt && CNN.mt != 'V' && CNN.mt != 'DV' || e.vads && | |
(e.vads = {}, delete e.amzn_vid), e.ads && (e.clearTargetingFromGPTAsync(), | |
e.ads = {}), e.startTime && c.addTimer('st', e.startTime), | |
e.saved_ads && (e.ads = e.saved_ads), a) { | |
try { | |
t.domain = a; | |
} catch (e) {} | |
} | |
return u = 'src=' + n + '&u=' + o + '&cb=' + Math.round( | |
1e7 * Math.random()), i && (u += '&sz=' + i), s && (u += | |
'&t=' + s), l && (u += '&mt=' + l), d = e.protocol + | |
e.host + e.dtb_svc + '?' + u; | |
} | |
e.ssb = !1; | |
}, e.getReferrerURL = function () { | |
var i = encodeURIComponent(t.documentURI); | |
try { | |
i = encodeURIComponent(n.top.location.href), i && i != | |
'undefined' || (i = e.detectIframeAndGetURL()); | |
} catch (t) { | |
i = e.detectIframeAndGetURL(); | |
} | |
return i; | |
}, e.detectIframeAndGetURL = function () { | |
try { | |
if (n.top !== n.self) return encodeURIComponent(t.referrer); | |
} catch (e) { | |
return encodeURIComponent(t.documentURI); | |
} | |
}, e.appendScriptTag = function (e, n) { | |
var i, CNN; | |
if (!e && n && typeof n === 'function') return void n.apply( | |
this, [!0]); | |
i = t.getElementsByTagName('script')[0], CNN = t.createElement( | |
'script'), CNN.type = 'text/javascript', CNN.async = !0, | |
e && (CNN.src = e); | |
try { | |
n && typeof n === 'function' && (CNN.readyState ? CNN.onreadystatechange = | |
function () { | |
(CNN.readyState == 'loaded' || CNN.readyState == | |
'complete') && (CNN.onreadystatechange = null, n(! | |
0)); | |
} : CNN.onload = function () { | |
n(!0); | |
}); | |
} catch (e) {} | |
i.parentNode.insertBefore(CNN, i); | |
}, e.renderAd = function (t, n) { | |
var CNN, o, a, s, l, u; | |
if (e.ads[n]) c.addTimer('imp'), CNN = e.ads[n], e.ev && (o = | |
'amznad' + Math.round(1e6 * Math.random()), CNN = CNN.replace( | |
'window.top.amznads.detectViewability', | |
'window.amzncsm.rmD'), CNN = CNN.replace(/id=[^ ]*/, | |
'id="' + o + '"'), a = | |
"<script type='text/javascript' src='" + e.CSM_JS + | |
"'></script>", e.host != e.DEFAULT_HOST && (a += | |
"<script type='text/javascript'>try{amzncsm.host=window.top.amznads.host;}catch(e){amzncsm.host=amznads.host;}</script>" | |
), CNN = a + CNN), i(t, CNN); | |
else { | |
c.set('kvm', '1'), s = new Object(), s.c = 'dtb', s.src = | |
e.src_id, s.kvmismatch = 1, s.pubReturnedKey = n, s.aaxReturnedKeys = | |
e.getTokens(), s.cb = Math.round(1e7 * Math.random()); | |
try { | |
s.u = encodeURIComponent(location.host + location.pathname), | |
navigator && (s.ua = encodeURIComponent(navigator.userAgent)); | |
} catch (e) {} | |
l = encodeURIComponent(JSON.stringify(s)), u = e.protocol + | |
e.host + '/x/px/p/0/' + l, i(t, "<img src='" + u + | |
"'/>"); | |
} | |
}, e.hasAds = function (t) { | |
var n; | |
if (!t) { | |
try { | |
return Object.keys(e.ads) | |
.length > 0; | |
} catch (t) { | |
for (n in e.ads) { | |
if (e.ads.hasOwnProperty(n)) return !0; | |
} | |
} | |
} | |
for (n in e.ads) { | |
if (e.ads.hasOwnProperty(n) && n.indexOf(t) > 0) return ! | |
0; | |
} | |
return !1; | |
}, e.getTargeting = function (t) { | |
var n = {}, | |
i = 0; | |
e.getTokens() && e.getTokens() | |
.length > 0 ? (i = 1, n[e.targetingKey] = e.getTokens(), | |
e.amzn_vid && (n[e.vidKey] = e.amzn_vid)) : l || (i = 2); | |
try { | |
c.addTimer('gk'), c.set('gks', i); | |
} catch (e) {} | |
return n; | |
}, e.setTargeting = function (t, n) { | |
var i; | |
for (i in e.ads) { | |
if (e.ads.hasOwnProperty(i)) { | |
if (n && i.indexOf(n) < 0) continue; | |
t(i, '1'); | |
} | |
} | |
}, e.setTargetingForGPTAsync = function (t) { | |
var n, i; | |
try { | |
if (t) { | |
e.targetingKey = t, n = e.getTokens(), typeof n !== | |
'undefined' && n.length > 0 && googletag.cmd.push( | |
function () { | |
googletag.pubads() | |
.setTargeting(t, n), e.amzn_vid && googletag.pubads() | |
.setTargeting(e.vidKey, e.amzn_vid); | |
}); | |
} else { | |
for (i in e.ads) { | |
e.ads.hasOwnProperty(i) && !function () { | |
var t = i; | |
googletag.cmd.push(function () { | |
CNN.debug_mode, googletag.pubads() | |
.setTargeting(t, '1'), e.amzn_vid && | |
googletag.pubads() | |
.setTargeting(e.vidKey, e.amzn_vid); | |
}); | |
}(); | |
} | |
} | |
} catch (e) {} | |
}, e.setTargetingForGPTSync = function (t) { | |
var n, i; | |
try { | |
if (t) { | |
e.targetingKey = t, n = e.getTokens(), typeof n !== | |
'undefined' && n.length > 0 && (googletag.pubads() | |
.setTargeting(t, n), e.amzn_vid && googletag.pubads() | |
.setTargeting(e.vidKey, e.amzn_vid)); | |
} else { | |
for (i in e.ads) { | |
e.ads.hasOwnProperty(i) && (googletag.pubads() | |
.setTargeting(i, '1'), e.amzn_vid && googletag.pubads() | |
.setTargeting(e.vidKey, e.amzn_vid)); | |
} | |
} | |
} catch (e) {} | |
}, e.clearTargetingFromGPTAsync = function () { | |
try { | |
googletag && googletag.pubads() && googletag.pubads() | |
.clearTargeting(e.targetingKey), googletag.pubads() | |
.clearTargeting(e.vidKey); | |
} catch (e) {} | |
}, e.appendTargetingToAdServerUrl = function (t) { | |
var n; | |
try { | |
t.indexOf('?') === -1 && (t += '?'); | |
for (n in e.ads) e.ads.hasOwnProperty(n) && (t += '&' + n + | |
'=1'); | |
} catch (e) {} | |
return t; | |
}, e.appendTargetingToQueryString = function (t) { | |
var n; | |
try { | |
for (n in e.ads) e.ads.hasOwnProperty(n) && (t += '&' + n + | |
'=1'); | |
} catch (e) {} | |
return t; | |
}, e.getTokens = function (t) { | |
var n, i = []; | |
try { | |
for (n in e.ads) { | |
if (e.ads.hasOwnProperty(n)) { | |
if (t && n.indexOf(t) < 0) continue; | |
i.push(n); | |
} | |
} | |
} catch (e) {} | |
return i; | |
}, e.getKeys = e.getTokens, e.getVid = function () { | |
return e.amzn_vid; | |
}, e.doAllTasks = function () { | |
for (; e.tasks.length > 0;) { | |
var t = e.tasks.shift(); | |
e.doTask(t); | |
} | |
}, e.doTask = function (e) { | |
try { | |
e.call(); | |
} catch (e) {} | |
}, e.tryGetAdsAsync = function () { | |
e.ssb && e.__ads && e.updateAds(e.__ads), e.asyncParams && | |
(e.startTime = e.asyncParams.startTime, e.getAdsCallback( | |
e.asyncParams.id, e.asyncParams.callbackFn, e.asyncParams | |
.timeout, e.asyncParams.size, e.asyncParams.data)); | |
}, e; | |
}(CNN || {}, document, window) | |
}, { | |
prop: 'CNN', | |
to: CNN || {} | |
}, { | |
prop: 'CNN', | |
to: s.minWidth | |
}, { | |
prop: 'CNN', | |
to: e.runtimeStyle | |
}, { | |
prop: 'CNN', | |
to: window.CNN || {} | |
}, { | |
prop: 'CNN', | |
to: CNN.replace(/id=[^ ]*/, 'id="' + o + '"') | |
}, { | |
prop: 'CNN', | |
to: a + CNN | |
}], | |
'CNN.prototype': [{ | |
prop: 'CNN.prototype', | |
to: { | |
constructor: CNN, | |
measure: function (e, t) { | |
u('measure'); | |
var n = t ? e.bind(t) : e; | |
return this.reads.push(n), o(this), n; | |
}, | |
mutate: function (e, t) { | |
u('mutate'); | |
var n = t ? e.bind(t) : e; | |
return this.writes.push(n), o(this), n; | |
}, | |
clear: function (e) { | |
return u('clear', e), l(this.reads, e) || l(this.writes, e); | |
}, | |
extend: function (e) { | |
if (u('extend', e), typeof e !== 'object') throw new Error( | |
'expected object'); | |
var t = Object.create(this); | |
return c(t, e), t.fastdom = this, t.initialize && t.initialize(), | |
t; | |
}, | |
catch: null | |
} | |
}], | |
'CNN.type': [{ | |
prop: 'CNN.type', | |
to: 'text/javascript' | |
}], | |
'CNN.async': [{ | |
prop: 'CNN.async', | |
to: !0 | |
}], | |
'CNN.onreadystatechange': [{ | |
prop: 'CNN.onreadystatechange', | |
to: null | |
}, { | |
prop: 'CNN.onreadystatechange', | |
to: function () { | |
(CNN.readyState == 'loaded' || CNN.readyState == 'complete') && | |
(CNN.onreadystatechange = null, n(!0)); | |
} | |
}], | |
'CNN.bundleHost': [{ | |
prop: 'CNN.bundleHost', | |
to: CNN.bundleHost || '/' | |
}], | |
'CNN.loaded': [{ | |
prop: 'CNN.loaded', | |
to: !0 | |
}], | |
'CNN.pageVis.hiddenKey': [{ | |
prop: 'CNN.pageVis.hiddenKey', | |
to: 'hidden' | |
}, { | |
prop: 'CNN.pageVis.hiddenKey', | |
to: 'mozHidden' | |
}, { | |
prop: 'CNN.pageVis.hiddenKey', | |
to: 'msHidden' | |
}, { | |
prop: 'CNN.pageVis.hiddenKey', | |
to: 'webkitHidden' | |
}], | |
'CNN.pageVis.hiddenEvent': [{ | |
prop: 'CNN.pageVis.hiddenEvent', | |
to: 'visibilitychange' | |
}, { | |
prop: 'CNN.pageVis.hiddenEvent', | |
to: 'mozvisibilitychange' | |
}, { | |
prop: 'CNN.pageVis.hiddenEvent', | |
to: 'msvisibilitychange' | |
}, { | |
prop: 'CNN.pageVis.hiddenEvent', | |
to: 'webkitvisibilitychange' | |
}], | |
'CNN.PageParams[n[t].substr(0, e)]': [{ | |
prop: 'CNN.PageParams[n[t].substr(0, e)]', | |
to: decodeURIComponent(n[t].substr(e + 1) | |
.replace(/\\+/g, ' ')) | |
}], | |
'CNN.PageParams[n[t]]': [{ | |
prop: 'CNN.PageParams[n[t]]', | |
to: '' | |
}], | |
'CNN.refreshTimer.intervalsVis[CNN.pageTimer.interval]': [{ | |
prop: 'CNN.refreshTimer.intervalsVis[CNN.pageTimer.interval]', | |
to: [CNN.pageTimer] | |
}], | |
'CNN.refreshTimer.hiddenResetThreshold': [{ | |
prop: 'CNN.refreshTimer.hiddenResetThreshold', | |
to: 6e4 * CNN.pageTimer.resetThreshold | |
}], | |
'CNN.refreshTimer.hiddenResetDelay': [{ | |
prop: 'CNN.refreshTimer.hiddenResetDelay', | |
to: 6e4 * (typeof CNN.pageTimer.resetDelay === 'number' ? CNN.pageTimer | |
.resetDelay : 0) | |
}], | |
'CNN.refreshTimer.intervals[CNN.pageTimer.interval]': [{ | |
prop: 'CNN.refreshTimer.intervals[CNN.pageTimer.interval]', | |
to: [CNN.pageTimer] | |
}], | |
'CNN.refreshTimer.intervalsId': [{ | |
prop: 'CNN.refreshTimer.intervalsId', | |
to: setInterval(CNN.refreshTimer.intervalAction, 6e4) | |
}], | |
'CNN.refreshTimer.hiddenTime': [{ | |
prop: 'CNN.refreshTimer.hiddenTime', | |
to: n | |
}], | |
'CNN.refreshTimer.visibleTime': [{ | |
prop: 'CNN.refreshTimer.visibleTime', | |
to: n | |
}], | |
'CNN.refreshTimer.intervalsVisId': [{ | |
prop: 'CNN.refreshTimer.intervalsVisId', | |
to: setTimeout(CNN.refreshTimer.intervalVisAction, 6e4) | |
}], | |
'CNN.guid': [{ | |
prop: 'CNN.guid', | |
to: a.guid || (a.guid = ge.guid++) | |
}], | |
'CNN.left': [{ | |
prop: 'CNN.left', | |
to: e.currentStyle.left | |
}, { | |
prop: 'CNN.left', | |
to: o | |
}], | |
'CNN.isPhoneSized': [{ | |
prop: 'CNN.isPhoneSized', | |
to: function (e) { | |
if (e < 0) return o; | |
var t = window.screen.width, | |
n = window.devicePixelRatio || 1, | |
i = t / n; | |
return i <= e; | |
} | |
}, { | |
prop: 'CNN.isPhoneSized', | |
to: function () {} | |
}], | |
'CNN.CurrentSize': [{ | |
prop: 'CNN.CurrentSize', | |
to: n.extend({}, { | |
lastKnownHeight: -1, | |
lastKnownWidth: -1, | |
lastKnownScrollTop: -1, | |
getClientHeight: function () { | |
return this.lastKnownHeight === -1 && console.warn( | |
'getClientHeight: Requesting the height before this object was initialized!' | |
), this.lastKnownHeight; | |
}, | |
getClientWidth: function () { | |
return this.lastKnownWidth === -1 && console.warn( | |
'getClientWidth: Requesting the width before this object was initialized!' | |
), this.lastKnownWidth; | |
}, | |
getClientScrollTop: function () { | |
return this.lastKnownScrollTop === -1 && console.warn( | |
'getClientScrollTop: Requesting the scrollTop before this object was initialized!' | |
), this.lastKnownScrollTop; | |
}, | |
trackClientSize: function () { | |
var e = n(t) | |
.scrollTop(); | |
this.lastKnownScrollTop = e > 0 ? e : 0, this.lastKnownHeight = | |
n(t) | |
.height(), this.lastKnownWidth = n(t) | |
.width(); | |
}, | |
trackAndStoreClientSize: function () { | |
var e = n(t) | |
.scrollTop(); | |
t.sessionStorage.cnnST = this.lastKnownScrollTop = e > 0 ? | |
e : 0, t.sessionStorage.cnnWd = this.lastKnownWidth = n( | |
t) | |
.width(); | |
}, | |
trackClientScrollTop: function () { | |
var e = n(t) | |
.scrollTop(); | |
this.lastKnownScrollTop = e > 0 ? e : 0; | |
}, | |
trackAndStoreClientScrollTop: function () { | |
var e = n(t) | |
.scrollTop(); | |
t.sessionStorage.cnnST = this.lastKnownScrollTop = e > 0 ? | |
e : 0; | |
}, | |
readySetGo: function () { | |
var e = !1, | |
i = '__testing'; | |
try { | |
t.sessionStorage.setItem(i, i), t.sessionStorage.removeItem( | |
i), e = !0; | |
} catch (e) {} | |
this.lastKnownHeight = n(t) | |
.height(), this.lastKnownWidth = n(t) | |
.width(), e === !1 ? (this.lastKnownScrollTop = n(t) | |
.scrollTop() || 0, n(t) | |
.on('scroll', n.proxy(this.trackClientScrollTop, this)), | |
n(t) | |
.on('resize', n.proxy(this.trackClientSize, this))) : | |
(t.sessionStorage.cnnLP === t.location.pathname && t.sessionStorage | |
.cnnWd === this.lastKnownWidth && t.sessionStorage.cnnLT > | |
Date.now() - 36e5 ? this.lastKnownScrollTop = t.sessionStorage | |
.cnnScrollTop || 0 : (this.lastKnownScrollTop = n(t) | |
.scrollTop() || 0, t.sessionStorage.cnnST = this.lastKnownScrollTop, | |
t.sessionStorage.cnnLP = t.location.pathname), t.sessionStorage | |
.cnnLT = Date.now(), n(t) | |
.on('scroll', n.proxy(this.trackAndStoreClientScrollTop, | |
this)), n(t) | |
.on('resize', n.proxy(this.trackAndStoreClientSize, | |
this))); | |
} | |
}, CNN.CurrentSize) | |
}], | |
'CNN.AdsConfig': [{ | |
prop: 'CNN.AdsConfig', | |
to: CNN.AdsConfig || {} | |
}], | |
'CNN.src': [{ | |
prop: 'CNN.src', | |
to: e | |
}], | |
'CNN.onload': [{ | |
prop: 'CNN.onload', | |
to: function () { | |
n(!0); | |
} | |
}], | |
'CNN.INJECTOR': [{ | |
prop: 'CNN.INJECTOR', | |
to: CNN.INJECTOR || {} | |
}], | |
'CNN.INJECTOR.readyState': [{ | |
prop: 'CNN.INJECTOR.readyState', | |
to: 'loading' | |
}, { | |
prop: 'CNN.INJECTOR.readyState', | |
to: 'ready' | |
}], | |
'CNN.INJECTOR.createDeferredForFeature': [{ | |
prop: 'CNN.INJECTOR.createDeferredForFeature', | |
to: function (e) { | |
return f[e] = t.Deferred(), f[e]; | |
} | |
}], | |
'CNN.INJECTOR.registerEvents': [{ | |
prop: 'CNN.INJECTOR.registerEvents', | |
to: function (e) { | |
for (var n = 0; n < e.length; n++) f.footer ? f.footer.done(t( | |
document)[e[n]](s)) : document.addEventListener(e[n], s); | |
} | |
}], | |
'CNN.INJECTOR.getUrlForFeatureName': [{ | |
prop: 'CNN.INJECTOR.getUrlForFeatureName', | |
to: function (t, n) { | |
var i = '', | |
e = CNN.bundleHost, | |
o = u(t), | |
a = ''; | |
return n = n || {}, n.params && (a = n.params), i = e + o + a; | |
} | |
}], | |
'CNN.INJECTOR.loadFeature': [{ | |
prop: 'CNN.INJECTOR.loadFeature', | |
to: function (CNN) { | |
var o = n(CNN), | |
s = CNB.INJECTOR.getUrlForFeatureName(CNN, {}); | |
return typeof o === 'undefined' && (o = CNN.INJECTOR.createDeferredForFeature( | |
CNN), o.state() !== 'rejected' && l(s) | |
.then(t.proxy(a, null, o), t.proxy(i, null, o))), o.promise(); | |
} | |
}], | |
'CNN.INJECTOR.loadFeatureForSource': [{ | |
prop: 'CNN.INJECTOR.loadFeatureForSource', | |
to: function (CNN, o) { | |
var s = o, | |
c = n(CNN); | |
return typeof c === 'undefined' && (c = CNN.INJECTOR.createDeferredForFeature( | |
CNN), c.state() !== 'rejected' && l(s) | |
.then(t.proxy(a, null, c), t.proxy(i, null, c))), c.promise(); | |
} | |
}], | |
'CNN.INJECTOR.loadFeatureForHost': [{ | |
prop: 'CNN.INJECTOR.loadFeatureForHost', | |
to: function (CNN, o) { | |
var s = o + u(CNN), | |
c = n(CNN); | |
return typeof c === 'undefined' && (c = CNN.INJECTOR.createDeferredForFeature( | |
CNN), c.state() !== 'rejected' && l(s) | |
.then(t.proxy(a, null, c), t.proxy(i, null, c))), c.promise(); | |
} | |
}], | |
'CNN.INJECTOR.executeFeature': [{ | |
prop: 'CNN.INJECTOR.executeFeature', | |
to: function (i, a) { | |
var s = n(i), | |
c = e.INJECTOR.getUrlForFeatureName(i, a); | |
return typeof s === 'undefined' && (s = CNN.INJECTOR.createDeferredForFeature( | |
i, a), s.state() !== 'rejected' && l(c) | |
.then(t.proxy(o, null, s), t.proxy(CNN, null, s))), s.promise(); | |
} | |
}], | |
'CNN.INJECTOR.scriptComplete': [{ | |
prop: 'CNN.INJECTOR.scriptComplete', | |
to: function (e) { | |
f[e].resolve({ | |
isLoaded: !0, | |
exists: !0, | |
executed: !0 | |
}); | |
} | |
}], | |
'CNN.INJECTOR.resetNameSpaceFeature': [{ | |
prop: 'CNN.INJECTOR.resetNameSpaceFeature', | |
to: function (e) { | |
p[e] = t.Deferred(); | |
} | |
}], | |
'CNN.INJECTOR.getNameSpaceFeature': [{ | |
prop: 'CNN.INJECTOR.getNameSpaceFeature', | |
to: function (e) { | |
var n, i, e = e.split('.'), | |
o = window, | |
a = !0; | |
if (p[e]) n = p[e].promise(); | |
else { | |
for (p[e] = t.Deferred(), n = p[e].promise(), i = 0; i < e.length; i++) | |
o = o[e[i]], typeof o === 'undefined' && (a = !1); | |
a ? p[e].resolve({ | |
isLoaded: !0 | |
}) : p[e].reject({ | |
isLoaded: !1 | |
}); | |
} | |
return n; | |
} | |
}] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment