"); } }); } }); function get_hostname(url) { var m = url.match(/^https:\/\/[^/]+/); return m ? m[0] : null; } $(document).ready(function() { $('.detail-box .editor-box').find('img').each(function() { var imageWidth = jQuery(this).width(); if (imageWidth < 20000) { jQuery(this).parent(".image").width(jQuery(this).width()); } $('.detail-box .editor-box').find('iframe').each(function() { var host = get_hostname(jQuery(this).attr('src')); if (host == 'https://drive.google.com') { jQuery(this).parent().removeClass('embed-responsive'); jQuery(this).parent().removeClass('embed-responsive-16by9'); jQuery(this).attr("style", "height: " + jQuery(this).attr('height') + "px !important;"); } if (host == 'https://datawrapper.dwcdn.net') { jQuery(this).attr("style", "height: " + jQuery(this).attr('height') + "px !important;"); if ($(window).width() <= 767) { className = jQuery(this).attr('class'); let height = className.substr(className.indexOf("-") + 1); jQuery(this).attr("style", "height: " + height + "px !important;"); } } }); function get_hostname(url) { var m = url.match(/^https:\/\/[^/]+/); return m ? m[0] : null; } }); });