From 9eea877c777b8711f64db8a288f28969c4829b3f Mon Sep 17 00:00:00 2001
From: philscott-rg ');
- }
- };
-
- /*
- * Updates headers numeration.
- */
- function updateNumeration(headers, header) {
- $.each(headers, function(i, val) {
- if (i === header) {
- ++headers[i];
- } else if (i > header) {
- headers[i] = 0;
- }
- });
- };
-
- /*
- * Generate an anchor id from a string by replacing unwanted characters.
- */
- function generateId(text) {
- return text.replace(/[ <>#\/\\?&\n]/g, '_');
- };
-
- /*
- * Prepends the numeration to a heading.
- */
- function addNumeration(headers, header, text) {
- var numeration = '';
-
- $.each(headers, function(i, val) {
- if (i <= header && headers[i] > 0) {
- numeration += headers[i] + '.';
- }
- });
-
- return numeration + ' ' + text;
- };
-
- /*
- * Appends a new node to the TOC.
- */
- var previousIndex = 0;
- var markup = '';
- function appendToTOC(toc, index, id, text) {
- text = stripBrackets(text);
-
- if(index < previousIndex) {
-
- // End a list.
- markup += '';
- }
-
- if(index > previousIndex) {
-
- // Start a list.
- markup += '
';
- }
-
- if(id === '') {
- markup += '
ul
element. If not, a new one is created.
+ * @private
+ * @param {Number} header The heading counter.
+ * @param {Object} toc The container element.
+ */
+ function checkContainer(header, toc) {
+ if (header === 0 && toc.getElementsByTagName('li').length > 0 &&
+ !toc.getElementsByTagName('li')[toc.getElementsByTagName('li').length - 1].lastChild.nodeName.match(new RegExp('ul', 'i'))) {
+ toc.getElementsByTagName('li')[toc.getElementsByTagName('li').length - 1].appendChild(document.createElement('ul'));
+ }
+ }
+
+ /**
+ * Updates headers numeration.
+ *
+ * @private
+ * @param {Object} headers The heading counters associative array.
+ * @param {String} header The heading element node name.
+ */
+ function updateNumeration(headers, header) {
+ for (var i = 1; i <= samaxesJS.size(headers); i++) {
+ if ('h' + i === header) {
+ ++headers['h' + i];
+ } else if ('h' + i > header) {
+ headers['h' + i] = 0;
+ }
+ }
+ }
+
+ /**
+ * Generate an anchor id from a string by replacing unwanted characters.
+ *
+ * @private
+ * @param {String} text The original string.
+ * @return {String} The string without any unwanted characters.
+ */
+ function generateId(text) {
+ return text.replace(/[ <>#\/\\?&\n]/g, '_');
+ }
+
+ /**
+ * Prepends the numeration to a heading.
+ *
+ * @private
+ * @param {Object} headers The heading counters associative array.
+ * @param {String} header The heading element node name.
+ * @param {String} innerHTML The node text.
+ * @return {String} The heading element with section heading prepended.
+ */
+ function addNumeration(headers, header, text) {
+ var numeration = '';
+
+ for (var i = 1; i <= samaxesJS.size(headers); i++) {
+ if ('h' + i <= header && headers['h' + i] > 0) {
+ numeration += headers['h' + i] + '.';
+ }
+ }
+
+ return numeration + ' ' + text;
+ }
+
+ /**
+ * Appends a new node to the TOC.
+ *
+ * @private
+ * @param {Object} toc The container element.
+ * @param {Number} index The heading element index.
+ * @param {String} id The node id attribute.
+ * @param {String} text The node text.
+ */
+ function appendToTOC(toc, index, id, text) {
+ var parent = toc;
+
+ for (var i = 1; i < index; i++) {
+ if (samaxesJS.getChildrenByTagName(parent, 'li').length === 0) {
+ parent.appendChild(document.createElement('li')).appendChild(document.createElement('ul'));
+ }
+ parent = samaxesJS.getChildrenByTagName(samaxesJS.getChildrenByTagName(parent, 'li')[samaxesJS.getChildrenByTagName(parent, 'li').length - 1], 'ul')[0];
+ }
+
+ if (id == null) {
+ parent.appendChild(document.createElement('li')).innerHTML = text;
+ } else {
+ parent.appendChild(document.createElement('li')).appendChild(createLink(id, text));
+ }
+ }
+
+ return function(options) {
+ samaxesJS.bindReady(function() {
+ var exclude = (!options || options.exclude === undefined) ? 'h1, h5, h6' : options.exclude;
+ var context = (options && options.context) ? document.getElementById(options.context) : document.body;
+ var autoId = options && options.autoId;
+ var numerate = (!options || options.numerate === undefined) ? true : options.numerate;
+ var headers = [];
+ var nodes = context.getElementsByTagName('*');
+ for (var node in nodes) {
+ if (/h\d/i.test(nodes[node].nodeName) && !exclude.match(new RegExp(nodes[node].nodeName, 'i'))) {
+ headers.push(nodes[node]);
+ }
+ }
+
+ if (headers.length > 0) {
+ var toc = document.getElementById((options && options.container) || 'toc').appendChild(document.createElement('ul'));
+
+ var index = 0;
+ var headersNumber = {h1: 0, h2: 0, h3: 0, h4: 0, h5: 0, h6: 0};
+ var indexes = {h1: 0, h2: 0, h3: 0, h4: 0, h5: 0, h6: 0};
+ for (var i = 1; i <= 6; i++) {
+ indexes['h' + i] = (exclude.match(new RegExp('h' + i, 'i')) === null && document.getElementsByTagName('h' + i).length > 0) ? ++index : 0;
+ }
+
+ for (var header in headers) {
+ for (var i = 6; i >= 1; i--) {
+ if (headers[header].nodeName.match(new RegExp('h' + i, 'i'))) {
+ if (numerate) {
+ checkContainer(headersNumber['h' + i], toc);
+ updateNumeration(headersNumber, 'h' + i);
+ if (autoId && !headers[header].getAttribute('id')) {
+ headers[header].setAttribute('id', generateId(headers[header].innerHTML));
+ }
+ headers[header].innerHTML = addNumeration(headersNumber, 'h' + i, headers[header].innerHTML);
+ }
+ appendToTOC(toc, indexes['h' + i], headers[header].getAttribute('id'), headers[header].innerHTML);
+ }
+ }
+ }
+ }
+ });
+ };
+}();
diff --git a/dist/honeycomb.js b/dist/honeycomb.js
index 00275b15..e61191bd 100644
--- a/dist/honeycomb.js
+++ b/dist/honeycomb.js
@@ -157,7 +157,9 @@ var initAccount = function initAccount(accountId) {
window.gtag('js', new Date());
// Add account IDs.
- var configOptions = {};
+ var configOptions = {
+ allow_enhanced_conversions: true
+ };
if (isExcludedEnvironment()) {
configOptions['debug_mode'] = true;
}
@@ -411,9 +413,10 @@ function _interopRequireDefault(obj) {
"default": obj
};
}
+var paginationClassName = 'carousel__pagination';
var rearrangeNav = function rearrangeNav(carousel) {
// selectors
- var nav = carousel.querySelector('ul');
+ var nav = carousel.querySelector("ul.".concat(paginationClassName));
var leftButton = carousel.querySelector('.slick-prev');
var rightButton = carousel.querySelector('.slick-next');
@@ -431,7 +434,7 @@ var rearrangeNav = function rearrangeNav(carousel) {
// the left button can't be the first element in the , otherwise it messes up the navigation, which counts
child elements to map the slides to the links - adding a new first-child pushes the links off by one
// so we need to add it to the end of the list, and translate its position by working out the width of the nav, plus the width of the arrow
- var navWidth = (carousel.querySelectorAll('ul li').length - 1) * 30 + 130;
+ var navWidth = (nav.querySelectorAll('li').length - 1) * 30 + 130;
leftButton.style.transform = "translate(-".concat(navWidth, "px, 0px)");
} else if (!nav && leftButton && rightButton) {
// No pagination dots (nav)
@@ -468,7 +471,7 @@ var init = function init() {
var carousel = carousels[i];
var options = {
autoplaySpeed: 4000,
- dotsClass: 'slick-dots carousel__pagination',
+ dotsClass: "slick-dots ".concat(paginationClassName),
adaptiveHeight: false,
dots: true
};
diff --git a/dist/honeycomb.min.js b/dist/honeycomb.min.js
index 9a92f1c6..ad31c10e 100644
--- a/dist/honeycomb.min.js
+++ b/dist/honeycomb.min.js
@@ -1 +1 @@
-!function a(i,n,r){function l(e,t){if(!n[e]){if(!i[e]){var o="function"==typeof require&&require;if(!t&&o)return o(e,!0);if(c)return c(e,!0);throw(t=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",t}o=n[e]={exports:{}},i[e][0].call(o.exports,function(t){return l(i[e][1][t]||t)},o,o.exports,a,i,n,r)}return n[e].exports}for(var c="function"==typeof require&&require,t=0;t
Blocking some types of cookies may affect your experience of our site and what we can offer you.",n.appendChild(r),document.createElement("button")),l=(r.setAttribute("class","button button--primary button--small spaced-bottom--tight spaced-right--tight"),r.innerHTML="Accept all",r.addEventListener("click",function(t){t.preventDefault(),i(null)}),n.appendChild(r),document.createElement("button")),l=(l.setAttribute("class","button button--small spaced-bottom--tight"),l.innerHTML="Reject all",l.addEventListener("click",function(t){t.preventDefault();var e,o={};for(e in a)o[e]=0;i(o)}),n.appendChild(l),document.createElement("h2")),l=(l.setAttribute("class","gamma text--redgate"),l.innerHTML="Manage cookie groups",n.appendChild(l),document.createElement("p")),c=(l.innerHTML="Performance cookies include Google Analytics and similar platforms that help us see how people are using our site. Targeting cookies let us deliver content and ads relevant to your interests on our sites and third-party ones.",n.appendChild(l),document.createElement("ul"));for(o in c.setAttribute("class","cookie-dialog__groups"),a){var s=document.createElement("li"),d=document.createElement("input"),p=(d.setAttribute("type","checkbox"),d.setAttribute("name","groups[]"),d.setAttribute("id","group-".concat(o)),d.setAttribute("value",o),1==a[o]&&d.setAttribute("checked","checked"),document.createElement("label"));p.setAttribute("for","group-".concat(o)),p.innerHTML=o,s.appendChild(d),s.appendChild(p),c.appendChild(s)}n.appendChild(c);var l=document.createElement("div"),u=(l.setAttribute("class","cookie-dialog__controls"),document.createElement("button")),u=(u.setAttribute("class","button button--primary button--small"),u.innerHTML="Save settings",u.addEventListener("click",function(t){t.preventDefault();for(var e=m.querySelectorAll('input[type="checkbox"]'),o={},a=0;a
These cookies are used to improve your website \n experience and provide more personalized services \n to you, both on this website and through other media.
\nTo find out more about the cookies we use, see our \n Privacy Policy
\n',w=[],f=function(){return p},r=function(){return u},g=function(){return m},y=function(){return h},v=function(){return b},k=function(){return w},M=function(){var t=JSON.parse(c.default.get(f()));return"object"!==n(t)||null===t?null:t},_=function(){var e=0"+e.formatted_address.replace(/,/gi,",
")+"
'+t.content+"
We could not reach youtube.com
\nyoutube.com may currently be down, or may be blocked by your network.
\nThese cookies are used to improve your website \n experience and provide more personalized services \n to you, both on this website and through other media.
\nTo find out more about the cookies we use, see our \n Privacy Policy
\n',w=[],f=function(){return p},r=function(){return u},g=function(){return m},y=function(){return h},v=function(){return b},k=function(){return w},M=function(){var t=JSON.parse(c.default.get(f()));return"object"!==n(t)||null===t?null:t},_=function(){var e=0"+e.formatted_address.replace(/,/gi,",
")+"
'+t.content+"
We could not reach youtube.com
\nyoutube.com may currently be down, or may be blocked by your network.
\n