Calculate adds sizes

Trim white-spaces for share buttons
Increase header with 1 pixel
This commit is contained in:
Jorit Tijsen
2024-04-19 15:25:00 +02:00
parent e7459cf026
commit 4db20ca296
7 changed files with 22 additions and 7 deletions

View File

@@ -1,3 +1,11 @@
function calculateSize(targetId) {
setTimeout(function(){
$('#' + targetId).height($('#' + targetId).children(":first").height());
$('#' + targetId).width($('#' + targetId).children(":first").width());
}, 500);
$('#' + targetId).css({backgroundColor: 'transparent'});
}
$(document).ready(function(){
$('#changePreferences, .cc_b_cp').click(function(){
$('#title_targeting').parent('li').hide();
@@ -181,7 +189,7 @@ $(function () {
if (type !== undefined) {
var extra = '';
if (type.textOption) {
var text = $('.' + options.excerptClass).text();
var text = $('.' + options.excerptClass).text().trim();
if (text.length + location.href.length > 278) {
text = text.substring(0, 278 - (location.href.length + 3)) + '...';
}

View File

@@ -1,2 +1,2 @@
/*! 2024-04-09 */
$(document).ready(function(){$("#changePreferences, .cc_b_cp").click(function(){$("#title_targeting").parent("li").hide(),$("#content_targeting").hide()})}),function(a){a.fn.loadMoreNews=function(e){var n=!1,o={loadingElementId:"#loading",container:"",url:document.location.pathname,nextPage:2},s=(a.extend(o,e),a(o.loadingElementId,this));s.hide(),this.click(function(e){var t,i;e.preventDefault(),n||(n=1,s.show(),t=a(this).attr("disabled","disabled"),i=a(o.container),a.ajax({url:o.url+(0<=o.url.indexOf("?")?"&":"?")+"pagina="+o.nextPage}).always(function(){n=0,s.hide(),t.removeAttr("disabled")}).done(function(n){n?(i.each(function(){var e=this.toString();a(e).append(a("<div>"+n+"</div>").find(e).length?a("<div>"+n+"</div>").find(e).children():a(n))}),++o.nextPage):t.attr("disabled","disabled").text("Geen nieuws meer.")}))})}}(jQuery),$(function(){$("[data-loadmorenews]").each(function(){$(this).loadMoreNews($(this).data("loadmorenews"))})}),function(o){o.fn.menu=function(e){var n={menuSubmenuClass:"has_submenu"},e=(o.extend(n,e),o(this).children("."+n.menuSubmenuClass)),i=o(this);e.on("mouseenter",function(){var e=o(this),n=(o(".menu-submenu > ul.submenu").slideUp(400,function(){o(this).closest(".menu-submenu").remove()}),o(".hover",i).removeClass("hover"),e.addClass("hover"),o('<div style="width: '+e.outerWidth()+'px"><a href="'+e.find("a").attr("href")+'" style="width: '+e.outerWidth()+'px"></a></div>').append(e.children("ul.submenu").clone())),t=e.offset();n.addClass("menu-submenu").css({top:t.top,left:t.left}),n.on("mouseleave",function(){o(".menu-submenu > ul.submenu").slideUp(400,function(){o(this).closest(".menu-submenu").remove()}),e.removeClass("hover")}),o("body").append(n),n.children("ul.submenu").slideDown(),n.find("ul.submenu").subMenu({}),openPlayerInNewScreen()})},o.fn.subMenu=function(e){var n={menuSubmenuClass:"has_submenu"};o.extend(n,e),o(this).find("li."+n.menuSubmenuClass+" > a").click(function(e){e.preventDefault();e=o(this).closest("li");e.children("ul.submenu").slideToggle(),e.toggleClass("opened")})}}(jQuery),$(function(){$(".menu").menu({}),$(".mobile-menu").subMenu({}),$(".mobile_menu_button a").click(function(){$(".mobile_menu_container").show()}),$(".mobile_close_menu_button a").click(function(){$(".mobile_menu_container").hide()}),$(".mobile_menu_container").click(function(e){!$(e.target).closest("#mobile_menu_nav").length&&$(".mobile_menu_container").is(":visible")&&$(".mobile_menu_container").hide()})}),$(function(){$(".prettyPhoto[rel^='prettyPhoto']").prettyPhoto({show_title:!1,slideshow:3e3,overlay_gallery:!0,social_tools:""})}),$(function(){$(".scroll_top").click(function(e){e.preventDefault(),$("html, body").stop().animate({scrollTop:0},500,"swing")})}),function(o){o.fn.share=function(e){var i={type:"",types:{facebook:{url:"https://www.facebook.com/sharer/sharer.php?u=",textOption:!1},twitter_x:{url:"https://twitter.com/share?url=",textOption:"text="}},excerptClass:"excerpt"};o.extend(i,e),this.click(function(e){e.preventDefault();var n,t,e=i.types[i.type];void 0!==e?(n="",e.textOption&&(278<(t=o("."+i.excerptClass).text()).length+location.href.length&&(t=t.substring(0,278-(location.href.length+3))+"..."),n="&"+e.textOption+encodeURI(t)),window.open(e.url+encodeURI(location.href)+n,"pop","width=600, height=400, scrollbars=no")):console.error(i.type+" is unknown")})}}(jQuery),$(function(){$("[data-share]").each(function(){$(this).share({type:$(this).data("share")})})}),function(u){u.fn.snapTo=function(e){var n={elementClass:"post"},t=(u.extend(n,e),u(this)),i=t.find("."+n.elementClass+":visible"),o=!1,s=null,a=function(){var n;o||(o=!0,n=t.scrollLeft(),i.each(function(){var e=u(this).offset();if(e.left>-window.screen.width/2&&e.left<window.screen.width/2)return t.animate({scrollLeft:Math.round(n+e.left)+"px"},300),!1}),s&&clearTimeout(s),s=setTimeout(function(){o=!1},500))},l=null;t.on("scroll",function(){l&&clearTimeout(l),l=setTimeout(a,300)})}}(jQuery),$(function(){$("[data-snapto]").each(function(){$(this).snapTo($(this).data("snapto"))})}),function(o){o.fn.tabs=function(e){var n={tabClass:"box_header",activeClass:"active",contentClass:"tab_content"},t=(o.extend(n,e),o(this).find("."+n.tabClass)),i=o(this);t.click(function(e){e.preventDefault(),t.removeClass(n.activeClass),i.find("."+n.contentClass).removeClass(n.activeClass),i.find("#"+o(this).data("tab-content-id")).addClass(n.activeClass),o(this).addClass(n.activeClass)})}}(jQuery),$(function(){$("[data-tabs]").each(function(){$(this).tabs($(this).data("tabs")??{})})});
/*! 2024-04-19 */
function calculateSize(e){setTimeout(function(){$("#"+e).height($("#"+e).children(":first").height()),$("#"+e).width($("#"+e).children(":first").width())},500),$("#"+e).css({backgroundColor:"transparent"})}$(document).ready(function(){$("#changePreferences, .cc_b_cp").click(function(){$("#title_targeting").parent("li").hide(),$("#content_targeting").hide()})}),function(a){a.fn.loadMoreNews=function(e){var t=!1,o={loadingElementId:"#loading",container:"",url:document.location.pathname,nextPage:2},s=(a.extend(o,e),a(o.loadingElementId,this));s.hide(),this.click(function(e){var n,i;e.preventDefault(),t||(t=1,s.show(),n=a(this).attr("disabled","disabled"),i=a(o.container),a.ajax({url:o.url+(0<=o.url.indexOf("?")?"&":"?")+"pagina="+o.nextPage}).always(function(){t=0,s.hide(),n.removeAttr("disabled")}).done(function(t){t?(i.each(function(){var e=this.toString();a(e).append(a("<div>"+t+"</div>").find(e).length?a("<div>"+t+"</div>").find(e).children():a(t))}),++o.nextPage):n.attr("disabled","disabled").text("Geen nieuws meer.")}))})}}(jQuery),$(function(){$("[data-loadmorenews]").each(function(){$(this).loadMoreNews($(this).data("loadmorenews"))})}),function(o){o.fn.menu=function(e){var t={menuSubmenuClass:"has_submenu"},e=(o.extend(t,e),o(this).children("."+t.menuSubmenuClass)),i=o(this);e.on("mouseenter",function(){var e=o(this),t=(o(".menu-submenu > ul.submenu").slideUp(400,function(){o(this).closest(".menu-submenu").remove()}),o(".hover",i).removeClass("hover"),e.addClass("hover"),o('<div style="width: '+e.outerWidth()+'px"><a href="'+e.find("a").attr("href")+'" style="width: '+e.outerWidth()+'px"></a></div>').append(e.children("ul.submenu").clone())),n=e.offset();t.addClass("menu-submenu").css({top:n.top,left:n.left}),t.on("mouseleave",function(){o(".menu-submenu > ul.submenu").slideUp(400,function(){o(this).closest(".menu-submenu").remove()}),e.removeClass("hover")}),o("body").append(t),t.children("ul.submenu").slideDown(),t.find("ul.submenu").subMenu({}),openPlayerInNewScreen()})},o.fn.subMenu=function(e){var t={menuSubmenuClass:"has_submenu"};o.extend(t,e),o(this).find("li."+t.menuSubmenuClass+" > a").click(function(e){e.preventDefault();e=o(this).closest("li");e.children("ul.submenu").slideToggle(),e.toggleClass("opened")})}}(jQuery),$(function(){$(".menu").menu({}),$(".mobile-menu").subMenu({}),$(".mobile_menu_button a").click(function(){$(".mobile_menu_container").show()}),$(".mobile_close_menu_button a").click(function(){$(".mobile_menu_container").hide()}),$(".mobile_menu_container").click(function(e){!$(e.target).closest("#mobile_menu_nav").length&&$(".mobile_menu_container").is(":visible")&&$(".mobile_menu_container").hide()})}),$(function(){$(".prettyPhoto[rel^='prettyPhoto']").prettyPhoto({show_title:!1,slideshow:3e3,overlay_gallery:!0,social_tools:""})}),$(function(){$(".scroll_top").click(function(e){e.preventDefault(),$("html, body").stop().animate({scrollTop:0},500,"swing")})}),function(o){o.fn.share=function(e){var i={type:"",types:{facebook:{url:"https://www.facebook.com/sharer/sharer.php?u=",textOption:!1},twitter_x:{url:"https://twitter.com/share?url=",textOption:"text="}},excerptClass:"excerpt"};o.extend(i,e),this.click(function(e){e.preventDefault();var t,n,e=i.types[i.type];void 0!==e?(t="",e.textOption&&(278<(n=o("."+i.excerptClass).text().trim()).length+location.href.length&&(n=n.substring(0,278-(location.href.length+3))+"..."),t="&"+e.textOption+encodeURI(n)),window.open(e.url+encodeURI(location.href)+t,"pop","width=600, height=400, scrollbars=no")):console.error(i.type+" is unknown")})}}(jQuery),$(function(){$("[data-share]").each(function(){$(this).share({type:$(this).data("share")})})}),function(u){u.fn.snapTo=function(e){var t={elementClass:"post"},n=(u.extend(t,e),u(this)),i=n.find("."+t.elementClass+":visible"),o=!1,s=null,a=function(){var t;o||(o=!0,t=n.scrollLeft(),i.each(function(){var e=u(this).offset();if(e.left>-window.screen.width/2&&e.left<window.screen.width/2)return n.animate({scrollLeft:Math.round(t+e.left)+"px"},300),!1}),s&&clearTimeout(s),s=setTimeout(function(){o=!1},500))},l=null;n.on("scroll",function(){l&&clearTimeout(l),l=setTimeout(a,300)})}}(jQuery),$(function(){$("[data-snapto]").each(function(){$(this).snapTo($(this).data("snapto"))})}),function(o){o.fn.tabs=function(e){var t={tabClass:"box_header",activeClass:"active",contentClass:"tab_content"},n=(o.extend(t,e),o(this).find("."+t.tabClass)),i=o(this);n.click(function(e){e.preventDefault(),n.removeClass(t.activeClass),i.find("."+t.contentClass).removeClass(t.activeClass),i.find("#"+o(this).data("tab-content-id")).addClass(t.activeClass),o(this).addClass(t.activeClass)})}}(jQuery),$(function(){$("[data-tabs]").each(function(){$(this).tabs($(this).data("tabs")??{})})});

View File

@@ -0,0 +1,7 @@
function calculateSize(targetId) {
setTimeout(function(){
$('#' + targetId).height($('#' + targetId).children(":first").height());
$('#' + targetId).width($('#' + targetId).children(":first").width());
}, 500);
$('#' + targetId).css({backgroundColor: 'transparent'});
}

View File

@@ -26,7 +26,7 @@
if (type !== undefined) {
var extra = '';
if (type.textOption) {
var text = $('.' + options.excerptClass).text();
var text = $('.' + options.excerptClass).text().trim();
if (text.length + location.href.length > 278) {
text = text.substring(0, 278 - (location.href.length + 3)) + '...';
}

View File

@@ -1,5 +1,5 @@
.header {
height: 110px;
height: 111px;
.logo {
float: left;
margin-top: 18px;

View File

@@ -140,7 +140,7 @@
- Advertentie -
</div>
<div id="nhgooi_homepage_top" class="d-none d-md-block" style="width: 728px; height: 90px;margin: 11px auto 50px auto;background-color: #efefef;"></div>
<script type="text/javascript">ootag.queue.push(function () {ootag.defineSlot({adSlot: "nhgooi_homepage_top",targetId: "nhgooi_homepage_top",filledCallback: (adslot) => { $('#' + adslot.targetId).css({backgroundColor: 'transparent'}); }});});</script>
<script type="text/javascript">ootag.queue.push(function () {ootag.defineSlot({adSlot: "nhgooi_homepage_top",targetId: "nhgooi_homepage_top",adShownCallback: (adslot) => { calculateSize(adslot.targetId); }});});</script>
</div>
<div class="col-12 col-md content_container">
<div class="row">

View File

@@ -3,5 +3,5 @@
- Advertentie -
</div>
<div id="{{$ad_sidebarId}}" style="width: 100%;height: 275px;margin: 11px auto 50px auto;background-color: #efefef;"></div>
<script type="text/javascript">ootag.queue.push(function () {ootag.defineSlot({adSlot: "{{$ad_sidebar}}",targetId: "{{$ad_sidebarId}}",filledCallback: (adslot) => { setTimeout(function(){$('#' + adslot.targetId).height($('#' + adslot.targetId).children(":first").height());}, 500);$('#' + adslot.targetId).css({backgroundColor: 'transparent'}); }});});</script>
<script type="text/javascript">ootag.queue.push(function () {ootag.defineSlot({adSlot: "{{$ad_sidebar}}",targetId: "{{$ad_sidebarId}}",adShownCallback: (adslot) => { calculateSize(adslot.targetId); }});});</script>
@endif