Skip to content

Instantly share code, notes, and snippets.

@simevidas simevidas/main.js
Last active Oct 26, 2018

Embed
What would you like to do?
(window.webpackJsonp = window.webpackJsonp || []).push([[0], [, , , , function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var o = n(0);
n(62);
var r = {
top: {
viewBox: "0 0 24 24",
contents: (0,
o.h)("path", {
d: "M8 11h3v10h2V11h3l-4-4-4 4zM4 3v2h16V3H4z"
})
},
bell: {
viewBox: "0 0 512 512",
contents: (0,
o.h)("path", {
d: "M289.7 403c-6.1 0-11.4 4.2-12.7 10.2-1 4.5-2.7 8.2-5 10.9-1.3 1.5-5.1 5.9-16.1 5.9-11 0-14.8-4.5-16.1-5.9-2.3-2.7-4-6.4-5-10.9-1.3-6-6.6-10.2-12.7-10.2-8.4 0-14.5 7.8-12.7 15.9 5 22.3 21 37.1 46.5 37.1s41.5-14.7 46.5-37.1c1.8-8.1-4.4-15.9-12.7-15.9zM412 352.2c-15.4-20.3-45.7-32.2-45.7-123.1 0-93.3-41.2-130.8-79.6-139.8-3.6-.9-6.2-2.1-6.2-5.9v-2.9c0-13.3-10.8-24.6-24-24.6h-.6c-13.2 0-24 11.3-24 24.6v2.9c0 3.7-2.6 5-6.2 5.9-38.5 9.1-79.6 46.5-79.6 139.8 0 90.9-30.3 102.7-45.7 123.1-9.9 13.1-.5 31.8 15.9 31.8h280.1c16.1 0 25.4-18.8 15.6-31.8zm-39 5.8H139.8c-3.8 0-5.8-4.4-3.3-7.3 7-8 14.7-18.5 21-33.4 9.6-22.6 14.3-51.5 14.3-88.2 0-37.3 7-66.5 20.9-86.8 12.4-18.2 27.9-25.1 38.7-27.6 8.4-2 14.4-5.8 18.6-10.5 3.2-3.6 8.7-3.8 11.9-.2 5.1 5.7 12 9.1 18.8 10.7 10.8 2.5 26.3 9.4 38.7 27.6 13.9 20.3 20.9 49.5 20.9 86.8 0 36.7 4.7 65.6 14.3 88.2 6.5 15.2 14.4 25.9 21.5 33.9 2.2 2.7.4 6.8-3.1 6.8z"
})
},
download: {
viewBox: "0 0 384 512",
contents: (0,
o.h)("path", {
d: "M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm64 236c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-64c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-72v8c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm96-114.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"
})
},
discuss: {
viewBox: "0 -256 1850 1850",
contents: (0,
o.h)("path", {
d: "M918.78 31.966q-204 0-381.5 69.5t-282 187.5q-104.5 118-104.5 255 0 112 71.5 213.5t201.5 175.5l87 50-27 96q-24 91-70 172 152-63 275-171l43-38 57 6q69 8 130 8 204 0 381.5-69.5t282-187.5q104.5-118 104.5-255t-104.5-255q-104.5-118-282-187.5t-381.5-69.5zm896 512q0 174-120 321.5t-326 233q-206 85.5-450 85.5-70 0-145-8-198 175-460 242-49 14-114 22h-5q-15 0-27-10.5t-16-27.5v-1q-3-4-.5-12t2-10q-.5-2 4.5-9.5l6-9 7-8.5q7-8.5 8-9 7-8 31-34.5t34.5-38q10.5-11.5 31-39.5t32.5-51q12-23 27-59t26-76q-157-89-247.5-220t-90.5-281q0-174 120-321.5t326-233q206-85.5 450-85.5t450 85.5q206 85.5 326 233t120 321.5z"
})
}
};
t.default = function(e) {
var t = e.name
, n = e.size;
return (0,
o.h)("svg", {
class: "Icon Icon--" + t,
viewBox: r[t].viewBox,
width: n || "1em",
height: n || "1em",
preserveAspectRatio: "xMidYMid meet",
"aria-hidden": "true"
}, r[t].contents)
}
}
, , , , , , , , , , function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var o = function() {
function e(e, t) {
for (var n, o = 0; o < t.length; o++)
(n = t[o]).enumerable = n.enumerable || !1,
n.configurable = !0,
"value"in n && (n.writable = !0),
Object.defineProperty(e, n.key, n)
}
return function(t, n, o) {
return n && e(t.prototype, n),
o && e(t, o),
t
}
}()
, r = n(0);
n(60);
var a = function(e) {
return e && e.__esModule ? e : {
default: e
}
}(n(4));
var i = function(e) {
function t() {
return function(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}(this, t),
function(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
return function(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}),
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, r.Component),
o(t, [{
key: "componentDidMount",
value: function() {
var e = document.querySelector("details");
1260 <= window.innerWidth ? e.setAttribute("open", !0) : e.removeAttribute("open")
}
}, {
key: "render",
value: function(e) {
var t = e.icon
, n = e.size
, o = e.children;
return (0,
r.h)("div", {
class: "Banner"
}, (0,
r.h)("div", {
class: "Banner__icon"
}, (0,
r.h)(a.default, {
name: t,
size: n
})), (0,
r.h)("div", {
class: "Banner__contents"
}, (0,
r.h)("details", null, o)))
}
}]),
t
}();
t.default = i
}
, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var o = n(0)
, r = h(n(64))
, a = h(n(65))
, i = h(n(66))
, u = h(n(67))
, s = h(n(68))
, l = h(n(69))
, c = h(n(70))
, f = h(n(71));
function h(e) {
return e && e.__esModule ? e : {
default: e
}
}
n(72);
var p = {
javascript: s.default,
css: l.default,
html: c.default,
http: f.default
};
Object.keys(p).forEach(function(e) {
return u.default.registerLanguage(e, p[e])
});
var d = {
pre: function(e) {
var t = e.children
, n = function(e, t) {
var n = {};
for (var o in e)
0 <= t.indexOf(o) || Object.prototype.hasOwnProperty.call(e, o) && (n[o] = e[o]);
return n
}(e, ["children"])
, r = t && t[0];
if (r && "code" === r.nodeName) {
var a = r.children[0].replace(/(^\s+|\s+$)/g, "")
, s = (r.attributes && r.attributes.class).match(/lang-([a-z]+)/)[1]
, l = u.default.highlightAuto(a, s ? [s] : null)
, c = l.language;
return (0,
o.h)("pre", {
class: (0,
i.default)("highlight", "highlight-" + c, n.class)
}, (0,
o.h)("code", {
class: "hljs lang-" + c,
dangerouslySetInnerHTML: {
__html: l.value
}
}))
}
return (0,
o.h)("pre", n, t)
}
};
t.default = function(e) {
var t = e.markdown;
return (0,
o.h)(a.default, {
markup: (0,
r.default)(t),
type: "html",
trim: !1,
components: d
})
}
}
, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var o = n(0);
n(74);
var r = function(e) {
return e && e.__esModule ? e : {
default: e
}
}(n(4));
t.default = function() {
return (0,
o.h)("p", {
class: "ToTop"
}, (0,
o.h)("button", {
onClick: function() {
return scrollTo({
top: 0,
behavior: "smooth"
})
}
}, (0,
o.h)(r.default, {
name: "top",
size: "36"
}), (0,
o.h)("br", null), "Back to top"))
}
}
, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var o = function() {
function e(e, t) {
for (var n, o = 0; o < t.length; o++)
(n = t[o]).enumerable = n.enumerable || !1,
n.configurable = !0,
"value"in n && (n.writable = !0),
Object.defineProperty(e, n.key, n)
}
return function(t, n, o) {
return n && e(t.prototype, n),
o && e(t, o),
t
}
}()
, r = n(0)
, a = h(n(2));
n(78);
var i = h(n(15))
, u = h(n(14))
, s = h(n(80))
, l = h(n(16))
, c = h(n(83))
, f = h(n(4));
function h(e) {
return e && e.__esModule ? e : {
default: e
}
}
var p = function(e) {
function t() {
!function(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}(this, t);
var e = function(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
return e.state = {
data: null
},
e
}
return function(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}),
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, r.Component),
o(t, [{
key: "componentDidMount",
value: function() {
this.fetchIssue(this.props.date)
}
}, {
key: "componentDidUpdate",
value: function(e) {
this.props.date !== e.date && (this.fetchIssue(this.props.date),
this.setState({
data: null
}));
var t = document.querySelectorAll(".Issue__body h3");
t[0] && (document.title = t[0].textContent.trim() + " | Web Platform News")
}
}, {
key: "fetchIssue",
value: function(e) {
var t = this;
a.default.get("/ajax/issue/" + e).then(function(e) {
var n = e.data;
return t.setState({
data: n
})
})
}
}, {
key: "render",
value: function(e, t) {
var n = e.date
, o = t.data;
return o ? o.error ? (0,
r.h)(c.default, {
type: o.error
}) : o.source ? (o.source = o.source.replace(/\[(\d{4}-\d{2}-\d{2})(?:(#[^\]]+))?]\(\)/g, function(e, t, n) {
return "➔ [Issue " + t + "](/issues/" + t + (n || "") + ")"
}),
(0,
r.h)("div", null, (0,
r.h)(u.default, {
icon: "bell",
size: "120"
}, (0,
r.h)("summary", null, (0,
r.h)("strong", null, "Never miss an issue."), " Get notified when new content is posted."), (0,
r.h)("ul", null, (0,
r.h)("li", null, (0,
r.h)("p", null, "Subscribe to the ", (0,
r.h)("a", {
href: "/feed.xml"
}, "RSS feed"), ".")), (0,
r.h)("li", null, (0,
r.h)("p", null, "Follow", " ", (0,
r.h)("a", {
href: "https://twitter.com/webplatformnews"
}, "@WebPlatformNews"), " ", "on Twitter.")), (0,
r.h)("li", null, (0,
r.h)(s.default, null)))), (0,
r.h)("article", {
class: "Issue"
}, (0,
r.h)("p", {
class: "Issue__print-link"
}, "Read this issue on the website:", " ", (0,
r.h)("a", {
href: "https://webplatform.news/issues/" + n
}, "https://webplatform.news/issues/", n)), (0,
r.h)("header", {
class: "Issue__header"
}, (0,
r.h)("p", null, (0,
r.h)("a", {
href: "/issues"
}, (0,
r.h)("span", {
"aria-hidden": "true"
}, "←"), " All issues")), (0,
r.h)("h2", null, (0,
r.h)("strong", null, (0,
r.h)("span", null, "Issue"), " № ", o.number), " ", (0,
r.h)("b", null, "/"), function(e) {
var t = /([0-9]{4})-([0-9]{2})-([0-9]{2})/.exec(e);
return ["", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][+t[2]] + " " + +t[3] + ", " + t[1]
}(n))), (0,
r.h)("div", {
class: "Issue__body"
}, (0,
r.h)(i.default, {
markdown: o.source
})), (0,
r.h)("footer", {
class: "Issue__footer"
}, (0,
r.h)("p", {
class: "Issue__thank-you"
}, "Thank you for reading"), (0,
r.h)("div", {
class: "Issue__discuss",
hidden: "2018-10-17" > n
}, (0,
r.h)(f.default, {
name: "discuss",
size: "36"
}), (0,
r.h)("p", null, "You can discuss this issue by replying to the official posts on", " ", (0,
r.h)("a", {
class: "u-no-shadow",
href: "https://twitter.com/search?f=tweets&q=" + encodeURIComponent("from:webplatformnews webplatform.news/issues/" + n)
}, "Twitter"), " ", "and", " ", (0,
r.h)("a", {
class: "u-no-shadow",
href: "https://hn.algolia.com/?query=" + encodeURIComponent("webplatform.news/issues/" + n) + "&sort=byPopularity&prefix&page=0&dateRange=all&type=story"
}, "Hacker News"), ".")))), (0,
r.h)(l.default, null))) : void 0 : (0,
r.h)("p", {
class: "u-loading"
})
}
}]),
t
}();
t.default = p
}
, function(e, t, n) {
e.exports = n(19)
}
, function(e, t, n) {
"use strict";
var o = n(0);
n(20),
n(22);
var r = function(e) {
return e && e.__esModule ? e : {
default: e
}
}(n(23));
(0,
o.render)((0,
o.h)(r.default, null), document.body)
}
, , , , function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var o = function() {
function e(e, t) {
for (var n, o = 0; o < t.length; o++)
(n = t[o]).enumerable = n.enumerable || !1,
n.configurable = !0,
"value"in n && (n.writable = !0),
Object.defineProperty(e, n.key, n)
}
return function(t, n, o) {
return n && e(t.prototype, n),
o && e(t, o),
t
}
}()
, r = n(0)
, a = n(24)
, i = d(n(2))
, u = d(n(44))
, s = d(n(45));
n(54);
var l = d(n(56))
, c = d(n(59))
, f = d(n(17))
, h = d(n(86))
, p = d(n(89));
function d(e) {
return e && e.__esModule ? e : {
default: e
}
}
function b(e) {
if (Array.isArray(e)) {
for (var t = 0, n = Array(e.length); t < e.length; t++)
n[t] = e[t];
return n
}
return Array.from(e)
}
i.default.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest",
u.default.polyfill(),
"serviceWorker"in navigator && "localhost" !== location.hostname && !/^((?!chrome|android).)*safari/i.test(navigator.userAgent) && navigator.serviceWorker.register("/sw.js"),
window.addEventListener("resize", (0,
s.default)(function() {
var e = document.querySelector("details");
e && (1260 <= window.innerWidth ? e.setAttribute("open", !0) : "true" === e.getAttribute("open") && e.removeAttribute("open"))
}, 50));
var y = function(e) {
function t() {
return function(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}(this, t),
function(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this))
}
return function(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}),
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, r.Component),
o(t, [{
key: "componentDidMount",
value: function() {
"/" === location.pathname && (0,
a.route)("/issues" + document.body.dataset.show, !0)
}
}, {
key: "onClick",
value: function(e) {
var t = this
, n = e.target;
"A" === n.tagName && 0 === n.getAttribute("href").indexOf("/about") && ("/about" === location.pathname ? (e.stopPropagation(),
e.preventDefault(),
this.highlight(n)) : (document.body.dataset.backlink = location.pathname,
setTimeout(function() {
return t.highlight(n)
}, 25)))
}
}, {
key: "highlight",
value: function(e) {
var t = document.querySelectorAll(".About li");
[].concat(b(t)).forEach(function(e) {
return e.classList.remove("u-highlight")
}),
setTimeout(function() {
var n = [].concat(b(document.querySelectorAll('.Title__tagline [href="/about"]'))).indexOf(e);
t[n].classList.add("u-highlight")
}, 25)
}
}, {
key: "render",
value: function() {
return (0,
r.h)("div", {
class: "Layout",
onClick: this.onClick.bind(this)
}, (0,
r.h)("div", {
class: "Layout__side-item"
}, (0,
r.h)(l.default, null)), (0,
r.h)("div", {
class: "Layout__main-item"
}, (0,
r.h)("main", null, (0,
r.h)(a.Router, null, (0,
r.h)(c.default, {
path: "/issues"
}), (0,
r.h)(f.default, {
path: "/issues/:date"
}), (0,
r.h)(h.default, {
path: "/about"
}), (0,
r.h)(p.default, {
path: "/generate-pdf/:range"
})))))
}
}]),
t
}();
t.default = y
}
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , function(e, t, n) {}
, , function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var o = function() {
function e(e, t) {
for (var n, o = 0; o < t.length; o++)
(n = t[o]).enumerable = n.enumerable || !1,
n.configurable = !0,
"value"in n && (n.writable = !0),
Object.defineProperty(e, n.key, n)
}
return function(t, n, o) {
return n && e(t.prototype, n),
o && e(t, o),
t
}
}()
, r = n(0);
n(57);
var a = function(e) {
function t() {
return function(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}(this, t),
function(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
return function(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}),
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, r.Component),
o(t, [{
key: "render",
value: function() {
return (0,
r.h)("header", {
class: "Layout__sticky-column"
}, (0,
r.h)("div", {
class: "Title"
}, (0,
r.h)("h1", null, (0,
r.h)("a", {
href: "/issues",
class: "Title__link u-no-outline"
}, (0,
r.h)("span", {
"aria-hidden": "true"
}, (0,
r.h)("svg", {
width: "50",
height: "50",
viewBox: "0 0 640 640"
}, (0,
r.h)("rect", {
height: "81",
width: "443",
y: "119",
x: "159"
}), (0,
r.h)("rect", {
height: "81",
width: "241",
y: "280",
x: "159"
}), (0,
r.h)("rect", {
height: "81",
width: "363",
y: "441",
x: "159"
}), (0,
r.h)("ellipse", {
ry: "41",
rx: "41",
cy: "159",
cx: "79"
}), (0,
r.h)("ellipse", {
ry: "41",
rx: "41",
cy: "320",
cx: "79"
}), (0,
r.h)("ellipse", {
ry: "41",
rx: "41",
cy: "481",
cx: "79"
}))), (0,
r.h)("span", null, "Web Platform News"))), (0,
r.h)("p", {
class: "Title__menu"
}, (0,
r.h)("span", null, (0,
r.h)("a", {
href: "/about"
}, "About →")), (0,
r.h)("span", null, (0,
r.h)("a", {
href: "https://patreon.com/webplatformnews",
class: "u-no-outline"
}, "Become a supporter →")))), (0,
r.h)("p", {
class: "Title__tagline"
}, (0,
r.h)("b", null, "1."), " ", (0,
r.h)("a", {
href: "/about"
}, "free, daily content"), " for web developers", (0,
r.h)("br", null), (0,
r.h)("b", null, "2."), " written by ", (0,
r.h)("a", {
href: "/about"
}, "Å ime Vidas"), (0,
r.h)("br", null), (0,
r.h)("b", null, "3."), " ", (0,
r.h)("a", {
href: "/about"
}, "funded directly"), " by its readers"), (0,
r.h)("div", {
class: "Action"
}, (0,
r.h)("p", null, (0,
r.h)("a", {
class: "Action__button u-no-outline",
href: "https://patreon.com/webplatformnews"
}, "Become the 1. supporter →", (0,
r.h)("br", null), (0,
r.h)("span", null, "~35¢ per issue via Patreon")))))
}
}]),
t
}();
t.default = a
}
, function(e, t, n) {}
, , function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var o = function() {
function e(e, t) {
for (var n, o = 0; o < t.length; o++)
(n = t[o]).enumerable = n.enumerable || !1,
n.configurable = !0,
"value"in n && (n.writable = !0),
Object.defineProperty(e, n.key, n)
}
return function(t, n, o) {
return n && e(t.prototype, n),
o && e(t, o),
t
}
}()
, r = n(0)
, a = l(n(2))
, i = l(n(14))
, u = l(n(15))
, s = l(n(16));
function l(e) {
return e && e.__esModule ? e : {
default: e
}
}
n(76);
var c = function(e) {
function t() {
!function(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}(this, t);
var e = function(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
return e.state = {
list: null
},
e
}
return function(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}),
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, r.Component),
o(t, [{
key: "componentDidMount",
value: function() {
var e = this;
a.default.get("/ajax/issues").then(function(t) {
var n = t.data.list;
return e.setState({
list: n
})
}),
document.title = "All issues | Web Platform News"
}
}, {
key: "componentDidUpdate",
value: function() {
var e = document.querySelector(".Issues__body").querySelector('a[href="/issues/2017-12-19"]').parentNode
, t = e.previousElementSibling;
t && t.matches(".Issues__note") || e.insertAdjacentHTML("beforebegin", '<p class="Issues__note">\n From May to August 2017, daily issues were posted in an <a \n href="https://docs.google.com/document/d/1TD3fwGVKifHtwT7rGtrbYC0ka0aRGbbU9Nu3p3o8suk"\n class="u-no-textshadow">external document</a>. An additional 54 weekly issues are available \n in a <a href="https://github.com/simevidas/webplatformnews-weekly" class="u-no-textshadow">\n public repo</a>.\n </p>'),
scrollTo({
top: document.body.dataset.scrollpos || 0
}),
document.body.dataset.scrollpos = 0
}
}, {
key: "onClick",
value: function(e) {
e.target.closest(".Issues__body a") && (document.body.dataset.scrollpos = document.documentElement.scrollTop)
}
}, {
key: "render",
value: function(e, t) {
var n = t.list;
return n ? (0,
r.h)("div", {
class: "Issues",
onClick: this.onClick
}, (0,
r.h)(i.default, {
icon: "download",
size: "94"
}, (0,
r.h)("summary", null, (0,
r.h)("strong", null, "Get all issues from 2017."), " Catch up on last year’s content."), (0,
r.h)("p", null, "All 106 issues from 2017 in a single PDF document. Convenient for sharing with colleagues and performing full-text searches."), (0,
r.h)("p", null, (0,
r.h)("a", {
href: "/media/2017.pdf"
}, "Open the PDF document (211 pages) →"))), (0,
r.h)("div", {
class: "Issues__header"
}, (0,
r.h)("h2", null, "All ", (0,
r.h)("strong", null, "WPN"), " issues")), (0,
r.h)("div", {
class: "Issues__body"
}, (0,
r.h)(u.default, {
markdown: n
})), (0,
r.h)(s.default, null)) : (0,
r.h)("p", {
class: "u-loading"
})
}
}]),
t
}();
t.default = c
}
, function(e, t, n) {}
, , function(e, t, n) {}
, , , , , , , , , , , , function(e, t, n) {}
, , function(e, t, n) {}
, , function(e, t, n) {}
, , function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}
, r = function() {
function e(e, t) {
for (var n, o = 0; o < t.length; o++)
(n = t[o]).enumerable = n.enumerable || !1,
n.configurable = !0,
"value"in n && (n.writable = !0),
Object.defineProperty(e, n.key, n)
}
return function(t, n, o) {
return n && e(t.prototype, n),
o && e(t, o),
t
}
}()
, a = n(0);
n(81);
var i = function(e) {
function t() {
return function(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}(this, t),
function(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
return function(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}),
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, a.Component),
r(t, [{
key: "componentDidMount",
value: function() {
var e = function(e, t, n) {
var r = function(e, t, n, o) {
var r = new XMLHttpRequest;
return r.open(e, t, !0),
r.onreadystatechange = function() {
if (4 === r.readyState) {
var e;
try {
e = JSON.parse(r.responseText)
} catch (t) {
e = {
error: t.message || t
}
}
200 !== r.status || e.error ? o && o(e) : n && n(e)
}
}
,
r
}("post", e.getAttribute("action"), t, n);
r.setRequestHeader("X-Requested-With", "XMLHttpRequest"),
r.setRequestHeader("Content-type", "application/x-www-form-urlencoded"),
r.send(function(e) {
var t, n = [];
if ("object" === (void 0 === e ? "undefined" : o(e)) && "FORM" === e.nodeName)
for (var r = e.elements.length, a = 0; a < r; a++)
if ((t = e.elements[a]).name && !t.disabled && "file" !== t.type && "reset" !== t.type && "submit" !== t.type && "button" !== t.type)
if ("select-multiple" === t.type)
for (var i = e.elements[a].options.length - 1; 0 <= i; i--)
t.options[i].selected && (n[n.length] = encodeURIComponent(t.name) + "=" + encodeURIComponent(t.options[i].value));
else
("checkbox" !== t.type && "radio" !== t.type || t.checked) && (n[n.length] = encodeURIComponent(t.name) + "=" + encodeURIComponent(t.value));
return n.join("&").replace(/%20/g, "+")
}(e))
};
!function(t, n) {
t.innerHTML = n.html;
var o = t.querySelector(".form")
, r = t.querySelector(".status")
, a = function(e, n) {
var o = t.querySelector('div[data-status-template="' + e + '"]').outerHTML;
o = n ? o.replace("{message}", n) : o,
r.innerHTML = o
};
t.querySelector(".sub-time").value = (new Date).getTime(),
window.moment && window.moment.tz && (t.querySelector(".tz-detect").value = window.moment.tz.guess() || "");
var i = !1;
o.addEventListener("submit", function(n) {
n.preventDefault(),
i || (i = !0,
a("spinner"),
e(o, function() {
i = !1,
a("confirm-notice"),
t.scrollIntoView()
}, function(e) {
i = !1,
a("error", e.error)
}))
})
}(document.body.querySelector("[data-mailtrain-subscription-widget]"), {
title: "Web Platform Weekly",
cid: "BJGSnI-Nf",
html: '\n <div id="mailtrain-subscription-widget-BJGSnI-Nf" class="mailtrain-subscription-widget">\n <form class="form" method="post" \n action="https://weekly.webplatform.news/subscription/BJGSnI-Nf/subscribe">\n <input type="hidden" class="tz-detect" name="tz" value="">\n <input type="hidden" name="address" value="">\n <input type="hidden" class="sub-time" name="sub" value="">\n <div class="form-group email">\n <label for="email" class="u-visually-hidden">Your email address:</label>\n <input type="email" name="email" id="email" placeholder="Your email address" value="" required>\n </div>\n <button type="submit">Subscribe</button>\n </form>\n <div class="status"></div>\n <div class="Subscribe__display-none">\n <div class="spinner" data-status-template="spinner">\n <p>Sending ...</p>\n </div>\n <div class="info" data-status-template="already-subscribed">\n <p>It looks like you are already subscribed to this list.</p>\n </div>\n <div class="success" data-status-template="confirm-notice">\n <h4>Almost Finished</h4>\n <p>\n We need to confirm your email address. To complete the subscription process,\n please click the link in the email we just sent you.\n </p>\n </div>\n <div class="error" data-status-template="error">\n <p>{message}</p>\n </div>\n </div>\n </div>'
})
}
}, {
key: "render",
value: function() {
return (0,
a.h)("div", {
class: "Subscribe"
}, (0,
a.h)("div", {
"data-mailtrain-subscription-widget": !0
}))
}
}]),
t
}();
t.default = i
}
, function(e, t, n) {}
, , function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var o = n(0);
n(84);
var r = {
"no-issue": "Issue not found"
};
t.default = function(e) {
var t = e.type;
return (0,
o.h)("div", {
class: "Error"
}, (0,
o.h)("h3", null, (0,
o.h)("strong", null, "Error"), " ", r[t]), "no-issue" === t && (0,
o.h)("p", null, "No issue was published on this date."), (0,
o.h)("p", {
class: "Error__back-link"
}, (0,
o.h)("a", {
href: "/"
}, "Go back to start page")))
}
}
, function(e, t, n) {}
, , function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var o = function() {
function e(e, t) {
for (var n, o = 0; o < t.length; o++)
(n = t[o]).enumerable = n.enumerable || !1,
n.configurable = !0,
"value"in n && (n.writable = !0),
Object.defineProperty(e, n.key, n)
}
return function(t, n, o) {
return n && e(t.prototype, n),
o && e(t, o),
t
}
}()
, r = n(0);
n(87);
var a = function(e) {
function t() {
return function(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}(this, t),
function(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
return function(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}),
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, r.Component),
o(t, [{
key: "componentDidMount",
value: function() {
document.title = "About | Web Platform News",
scrollTo({
top: 0
})
}
}, {
key: "render",
value: function() {
return (0,
r.h)("div", {
class: "About"
}, (0,
r.h)("div", {
class: "About__header"
}, (0,
r.h)("div", null, (0,
r.h)("a", {
href: document.body.dataset.backlink || "/issues"
}, "← Back")), (0,
r.h)("h2", null, "Manifesto")), (0,
r.h)("ol", null, (0,
r.h)("li", null, "Starting in October 2018, new content for web developers is published on Web Platform News every workday (~20 issues per month), with a focus on presenting relevant, complete information in a concise manner."), (0,
r.h)("li", null, "All content is created by Å ime Vidas who works full-time for web developers, as an independent technical writer. Readers can contact Å ime via a", " ", (0,
r.h)("a", {
href: "https://twitter.com/messages/compose?recipient_id=175727560"
}, "direct message"), " ", "or ", (0,
r.h)("a", {
href: "mailto:sime.vidas@gmail.com"
}, "email"), "."), (0,
r.h)("li", null, "Šime’s work is directly funded by web developers who regularly visit Web Platform News and find its content useful. The initial goal has been set at 500 supporters.")))
}
}]),
t
}();
t.default = a
}
, function(e, t, n) {}
, , function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var o = function() {
function e(e, t) {
for (var n, o = 0; o < t.length; o++)
(n = t[o]).enumerable = n.enumerable || !1,
n.configurable = !0,
"value"in n && (n.writable = !0),
Object.defineProperty(e, n.key, n)
}
return function(t, n, o) {
return n && e(t.prototype, n),
o && e(t, o),
t
}
}()
, r = n(0)
, a = u(n(2));
n(90);
var i = u(n(17));
function u(e) {
return e && e.__esModule ? e : {
default: e
}
}
var s = function(e) {
function t() {
!function(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}(this, t);
var e = function(e, t) {
if (!e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
return e.state = {
dates: []
},
e
}
return function(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}),
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, r.Component),
o(t, [{
key: "componentDidMount",
value: function() {
var e = this;
a.default.get("/ajax/issues").then(function(t) {
var n = t.data.list.match(/issues\/\d{4}-\d{2}-\d{2}/g).map(function(e) {
return e.slice(7)
});
e.setState({
dates: n
}),
setTimeout(function() {
document.querySelectorAll('.Issue__body a:not([href^="http"])').forEach(function(e) {
var t = e.getAttribute("href");
e.setAttribute("href", "https://webplatform.news" + t)
}),
window.alert("Ready for printing.")
}, 2500)
})
}
}, {
key: "render",
value: function(e, t) {
var n = e.range
, o = t.dates
, a = {
year: "numeric"
};
return 4 < n.length && (a.month = "long"),
(0,
r.h)("article", {
class: "Pdf"
}, (0,
r.h)("header", {
class: "Pdf__header"
}, (0,
r.h)("p", null, (0,
r.h)("a", {
href: "https://webplatform.news"
}, "https://webplatform.news")), (0,
r.h)("h2", null, (0,
r.h)("strong", null, "Web Platform News")), (0,
r.h)("p", null, "All issues released in", " ", new Date(n).toLocaleString("en", a))), o.filter(function(e) {
return e.includes(n)
}).map(function(e, t) {
return (0,
r.h)(i.default, {
key: t,
date: e
})
}))
}
}]),
t
}();
t.default = s
}
, function(e, t, n) {}
], [[18, 1]]]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.