'use strict'; var community_data = JSON.parse(document.getElementById('community_data').innerHTML); String.prototype.supplant = function (o) { return this.replace(/{([^{}]*)}/g, function (a, b) { var r = o[b]; return typeof r === 'string' || typeof r === 'number' ? r : a; }); }; function hide_youtube_replies(event) { var target = event.target; sub_text = target.getAttribute('data-inner-text'); inner_text = target.getAttribute('data-sub-text'); body = target.parentNode.parentNode.children[1]; body.style.display = 'none'; target.innerHTML = sub_text; target.onclick = show_youtube_replies; target.setAttribute('data-inner-text', inner_text); target.setAttribute('data-sub-text', sub_text); } function show_youtube_replies(event) { var target = event.target; sub_text = target.getAttribute('data-inner-text'); inner_text = target.getAttribute('data-sub-text'); body = target.parentNode.parentNode.children[1]; body.style.display = ''; target.innerHTML = sub_text; target.onclick = hide_youtube_replies; target.setAttribute('data-inner-text', inner_text); target.setAttribute('data-sub-text', sub_text); } function number_with_separator(val) { while (/(\d+)(\d{3})/.test(val.toString())) { val = val.toString().replace(/(\d+)(\d{3})/, '$1' + ',' + '$2'); } return val; } function get_youtube_replies(target, load_more) { var continuation = target.getAttribute('data-continuation'); var body = target.parentNode.parentNode; var fallback = body.innerHTML; body.innerHTML = '