PageSourceSearch

https://www.oks.dk/scripts/dbuclubcms.js?dbu_v41

js oks.dk collected 2026-10-02 22:23:29 UTC 38,006 bytes, 1,063 lines download raw bytes

1var nologoImagePath = "/content/img/nologo.png";
2var noProfilePicPath = "/content/img/noProfilePic.png";
3$(function () {
4
5    $("body").animate({
6        opacity: 1
7    }, 200, function () {
8
9    });
10
11    if ($("#headerWrap").hasClass("width100") == false) {
12        if ($(".widthSet").length) {
13            $(".theme_BigMenu_wrap").addClass("contentWidth_" + $(".widthSet").data("setwidth"));
14            $(".theme_MegaMenu_wrap > .container-12").addClass("contentWidth_" + $(".widthSet").data("setwidth"));
15        }
16    }
17
18    $(".module-border-controller").each(function () {
19        if ($(this).hasClass("module-no-border")) {
20            $(this).find(".theme_macro").addClass("theme-no-border");
21        }
22        $(this).children().insertAfter($(this));
23        $(this).remove();
24    })
25
26    CalcGridWidth();
27
28    $(".nocontent").remove();
29
30    $('#theme_search_input').bind("enterKey", function (e) {
31        $('.theme_search_button')[0].onclick();
32    });
33    $('#theme_search_input').keyup(function (e) {
34        if (e.keyCode == 13) {
35            $(this).trigger("enterKey");
36        }
37    });
38
39    if ($(".theme_search_options li.selected").length == 0) {
40        $(".theme_search_options li").addClass("selected");
41    }
42
43    $(".theme_search_select span").html($(".theme_search_options li.selected").data("text"));
44
45    $(".theme_search_select").click(function (event) {
46        event.stopPropagation();
47        if ($('.theme_search_options').is(":visible") == false) {
48            var width = $(this).width();
49            $(".theme_search_options").detach().appendTo("body");
50            $(".theme_search_options").css("min-width", width);
51
52            $('.theme_search_options').css({
53                left: $(this).offset().left + 1 + 'px',
54                top: ($(this).offset().top + 1 + $(this).height()) + 'px',
55                display: 'inline-block'
56            });
57        } else {
58            $(".theme_search_options").hide();
59        }
60    });
61
62    $(".theme_search_options li").click(function () {
63
64        var value = $(this).data("value");
65        $(".theme_search_options li").removeClass("selected");
66        $(this).addClass("selected");
67        $(".theme_search_select span").html($(this).data("text"));
68        $(".theme_search_options").hide();
69    });
70
71    $(".mp_gallery_imgs").each(function () {
72        $(this).magnificPopup({
73            delegate: 'a', // child items selector, by clicking on it popup will open
74            type: 'image',
75            gallery: {
76                enabled: true,
77                navigateByImgClick: true,
78                preload: [0, 1] // Will preload 0 - before current, and 1 after the current image
79            },
80            image: {
81                tError: 'Billedet kunne ikke vises.',
82                titleSrc: function (item) {
83                    return item.el.attr('title');
84                }
85            }
86
87        });
88    });
89
90    if ($(".contentGrid-bottom .packeryBox").length && $(".contentGrid-bottom .packeryBox").html().trim() == "") {
91        $(".contentGrid-bottom").remove();
92    }
93
94    if ($(".breadcrumbWrap").length && $(".breadcrumbWrap").html().trim() == "") {
95        $(".breadcrumbWrap").remove();
96    }
97
98    if ($(".pbox-content").length && $(".pbox-content").html().trim() == "") {
99        $(".pbox-content").remove();
100    }
101
102    $(".personGroup").each(function () {
103        if ($(this).closest(".contentGrid-content").length > 0) {
104            $(this).addClass("grid-8");
105        }
106        if ($(this).closest(".contentGrid-right").length > 0) {
107            $(this).addClass("grid-4");
108        }
109        if ($(this).closest(".contentGrid-bottom").length > 0) {
110            $(this).addClass("grid-12");
111        }
112    });
113
114
115
116    $(".personGroup_person.tooltip").each(function () {
117        if ($(this).attr("title") == "") {
118            $(this).removeClass("tooltip");
119        }
120    });
121
122    $(".theme_ClubFixtures .paging_forward").on("click", function () {
123        var module = $(this).parent().parent().parent();
124        if (!$(this).hasClass("disabled")) {
125            $(module).data("currentpage", $(module).data("currentpage") + 1);
126            ClubFixturesSetPaging(module);
127
128
129            //$('body').scrollTop($(module).offset().top);
130        }
131    });
132
133    $(".theme_ClubFixtures .paging_back").on("click", function () {
134        var module = $(this).parent().parent().parent();
135        if (!$(this).hasClass("disabled")) {
136            $(module).data("currentpage", $(module).data("currentpage") - 1);
137            ClubFixturesSetPaging(module);
138            //$('body').scrollTop($(module).offset().top);
139        }
140    });
141
142    $(".theme_ClubFixtures").each(function () {
143
144        if ($(this).find($(".match.isPlayed")).length > 0) {
145
146            var matches = $(this).find($(".match"));
147
148            var matchToStart;
149
150            matches.each(function () {
151                if ($(this).hasClass("upcoming")) {
152                    matchToStart = $(this).data("matchno");
153                    return false;
154                }
155            })
156
157            var pagingCount = $(this).data("pagingcount");
158
159            var startMatchNo = matchToStart;
160
161            if (startMatchNo == null) {
162                startMatchNo = matches.length;
163            }
164            else {
165                startMatchNo = startMatchNo + 1;
166            }
167            var startPageNo = Math.ceil(startMatchNo / pagingCount);
168
169            $(this).data("currentpage", startPageNo);
170        } else {
171
172            $(this).data("currentpage", 1);
173
174        }
175        ClubFixturesSetPaging($(this));
176    });
177
178    $(".theme_ClubFixtures .match a").on("click", function (e) {
179
180        e.stopPropagation();
181
182    });
183
184
185    $(".theme_ClubFixtures .match").on("click", function (e) {
186
187
188        var win = window.open($(this).data("url"), '_parent');
189        if (win) {
190            win.focus();
191        }
192
193    });
194
195    $(".activities-list-macro .paging_forward").on("click", function () {
196        var module = $(this).closest(".activities-list-macro");
197        if (!$(this).hasClass("disabled")) {
198            $(module).find(".activities-list").data("currentpage", $(module).find(".activities-list").data("currentpage") + 1);
199            ActivitiesListSetPaging($(module).find(".activities-list"));
200            //$('body').scrollTop($(module).offset().top);
201        }
202    });
203
204    $(".activities-list-macro .paging_back").on("click", function () {
205        var module = $(this).closest(".activities-list-macro");
206        if (!$(this).hasClass("disabled")) {
207            $(module).find(".activities-list").data("currentpage", $(module).find(".activities-list").data("currentpage") - 1);
208            ActivitiesListSetPaging($(module).find(".activities-list"));
209            //$('body').scrollTop($(module).offset().top);
210        }
211    });
212
213    $(".activities-list").each(function () {
214        ActivitiesListSetPaging($(this));
215    });
216
217    //$("img").each(function () {
218    //    var src = $(this).attr("src");
219    //    if (src != undefined) {
220    //        var newSrc = src.replace("https", "http");
221    //        $(this).attr("src", newSrc);
222    //    }
223    //});
224
225    //$(".theme_macro.personGroup").each(function () {
226    //    var newHeight = 0;
227    //    $(this).find(".personGroup_person").each(function () {
228    //        if ($(this).height() > newHeight) {
229    //            newHeight = $(this).height();
230    //        }
231    //    });
232    //    $(this).find(".personGroup_person").height(newHeight);
233    //});
234
235
236    initToolTips();
237
238
239    window.onresize = function (event) {
240        setTimeout(function () {
241            CalcGridWidth();
242        });
243        if ($("#theme_search_input").is(":focus")) {
244            // input is in focus, don't do nothing or input loses focus and keyboard dissapears
245        } else {
246            MoveSearchBar();
247            $("#loginBox").center(false);
248
249            if ($(document).width() <= 960) {
250                $(".userInfoWrap").stop().animate({ bottom: "-65px" });
251                $(".userInfoWrap").find("p").stop().delay(2000).slideUp();
252            } else {
253                $(".userInfoWrap").stop().animate({ bottom: "0" });
254                $(".userInfoWrap").find("p").show();
255            }
256        }
257
258        //RunPackery();
259        ResizeContent();
260        loadImages();
261        setNewsListItemWidth();
262    };
263
264    setNewsListItemWidth()
265    MoveSearchBar();
266
267    $("#loginBox").center(false);
268
269    if ($(document).width() <= 960) {
270        $(".userInfoWrap").stop().animate({ bottom: "-65px" });
271        $(".userInfoWrap").find("p").stop().delay(2000).slideUp();
272    } else {
273        $(".userInfoWrap").stop().animate({ bottom: "0" });
274        $(".userInfoWrap").find("p").show();
275    }
276
277    $('input').click(function () {
278        getFocus(this);
279    });
280
281    window.onorientationchange = function () {
282        MoveSearchBar();
283    };
284
285    jQuery("time.timeago").timeago();
286
287
288
289
290    //var bodyCss = $("body").data("bodycss");
291    //var bodyStyle = $("body").attr("style");
292    //var newBodyStyle = bodyStyle + bodyCss;
293    //$("body").attr("style", newBodyStyle);
294
295    if ($(".tableSort").length) {
296        $(".tableSort").each(function () {
297            var pagerToUse = $(this).next(".pager");
298            $(this).tablesorter({
299                sortInitialOrder: 'desc', sortList: [[2, 1], [3, 1]]
300            }
301            );
302            $(this).tablesorterPager({ container: $(pagerToUse), size: 5 });
303
304        });
305
306    }
307
308    if ($.cookie("acceptcookies") == "true") {
309
310    }
311    else {
312        $(".cookieNotice").slideDown();
313    }
314
315    $(".centerInParent").flexVerticalCenter({ cssAttribute: 'margin-top', parentSelector: '.parent' });
316
317    if ($("._activityCalendar").length) {
318
319        $("._activityCalendar").each(function () {
320
321            var types = $(this).data("types");
322            //string start, string end, string teamId, bool showPB, bool showSB, bool showMatches, bool showKK
323            var apiurl = '';
324            if ($(this).data("teampage") == "True") {
325
326                apiurl = '/umbraco/DBU/DBUFrontApi/GetActivityCalendarEvents?';
327                apiurl += 'activityTypes=' + types;
328                apiurl += '&showPB=' + $(this).data("showpb");
329                apiurl += '&showSB=' + $(this).data("showsb");
330                apiurl += '&showMatches=' + $(this).data("showm");
331                apiurl += '&showKK=' + $(this).data("showkk");
332                apiurl += '&teamId=' + $(this).data("teamid");
333                apiurl += '&poolId=' + $(this).data("poolid");
334            }
335            else {
336                apiurl = '/umbraco/DBU/DBUFrontApi/GetActivityCalendarEvents?';
337                apiurl += 'activityTypes=' + types
338            }
339
340            $(this).fullCalendar({
341
342                editable: false, // Don't allow editing of events
343                handleWindowResize: true,
344                displayEventTime: true, // Display event time
345                weekNumbers: true,
346                defaultView: $(this).data("startview"),
347                header: {
348                    left: 'title',
349                    center: '',
350                    right: 'today prev,next agendaDay,agendaWeek, month, listMonth'
351                },
352                events: {
353                    url: apiurl,
354                    type: 'GET',
355                    success: function () {
356                        console.log("Got calendar-events");
357                    },
358                    error: function () {
359                        console.log("Error getting calendar-events");
360                    }
361                },
362                eventRender: function (event, element, view) {
363                    var signupUrl = "";
364                    if (event.signupUrl != null && event.signupUrl != "") {
365                        signupUrl = "<div class='signupurl'><a href='" + event.signupUrl + "' target='_blank'>GÃ¥ til tilmelding</a></div>";
366                    }
367                    var eventUrl = "";
368
369                    if (event.link != null && event.link != "") {
370                        eventUrl = "<div class='url'><a href='" + event.link + "' target='_blank'>GÃ¥ til aktiviteten</a></div>";
371                    }
372
373                    var eventObj = $('<div class="fc-day-grid-event fc-h-event fc-event fc-start fc-end type_' + event.KOType + ' category_' + event.type + ' " data-url="' + event.link
374                        + '"><div class="fc-content"><div class="infowrap"><span class="fc-time ' + (event.allDay == true ? "hideTime" : "") + '"><i class="fa fa-clock-o" aria-hidden="true"></i> '
375                        + moment(event.start).format('HH:mm') + '<span class="endtime"> - ' + moment(event.end).format('HH:mm') + '</span>' + '</span><span class="fc-type">'
376                        + (event.KOTypeName != undefined ? event.KOTypeName : event.typeName) + '</span></div><div class="titlewrap"><span class="fc-title">'
377                        + event.title + '</span><div class="descriptionPlaceholder">Klik for mere...</div><div class="fc-description">' + event.description
378                        + (signupUrl != "" ? signupUrl : "")
379                        + (eventUrl != "" ? eventUrl : "")
380                        + '</div><div class="fc-venue">' + (event.venue != null ? event.venue : "") + '</div></div></div><div class="close-btn"><i class="fa fa-close"/></div></div>');
381                    return eventObj;
382                }
383
384            });
385        });
386
387
388
389    }
390
391    $(document).delegate(".activityCalendar .fc-event", "click", function (e) {
392        e.stopPropagation();
393        var relativeX = (e.pageX),
394            relativeY = (e.pageY);
395        var offset = $(e.currentTarget).position();
396        //var parentOffset = $(".fc-scroller").offset();
397        var uid = $(e.target).closest(".activityCalendar").data("unique");
398        $(".calendarPopup.u_" + uid).detach().appendTo($("body"));
399        $(".calendarPopup.u_" + uid).css({ left: relativeX });
400        $(".calendarPopup.u_" + uid).css({ top: relativeY });
401        var clone = $(e.currentTarget).clone();
402        clone.css("top", "0").css("left", "0");
403        $(".calendarPopup.u_" + uid).html(clone);
404        $(".calendarPopup.u_" + uid).show();
405    });
406
407    $(document).delegate(".calendarPopup .fc-event", "click", function (e) {
408        // e.stopPropagation();
409        //var url =$(e.target).closest(".fc-event").data("url");
410        //if (url != null && url != undefined) {
411        //    window.open(url, '_blank');
412        //}
413    });
414
415    $(document).delegate(".activityCalendar", "click", function (e) {
416        $(".calendarPopup").hide();
417    });
418
419    $(document).delegate(".calendarPopup .close-btn", "click", function (e) {
420        $(".calendarPopup").hide();
421    });
422
423
424    $(".modulewrap, .pagebody").each(function () {
425        if ($(this).html().trim() == "") {
426            $(this).remove();
427        }
428    })
429
430    $(".gridv2 .gridrow .col + .col").each(function () {
431        if (!$(this).prev(".col").hasClass("needSpace")) {
432            $(this).prev(".col").addClass("needSpace");
433        }
434        if (!$(this).hasClass("needSpace")) {
435            $(this).addClass("needSpace");
436        }
437    });
438
439
440    loadImages();
441
442    /********************************************
443            copy from old theme
444    ********************************************/
445
446    calcNewsBlockSizes();
447    $(window).resize(function (e) {
448        e.stopPropagation();
449        calcNewsBlockSizes();
450    });
451
452    $(".theme_NMB_bigGoto").addClass("fa fa-chevron-circle-right");
453    $(".theme_NMB_tinyGoto").addClass("fa fa-chevron-circle-right");
454    $(".theme_matchProgram_goto_icon").addClass("fa fa-chevron-circle-right");
455    $(".theme_nextMatch_goto_icon").addClass("fa fa-chevron-circle-right");
456    $(".theme_clubresultpage_backButton_icon").addClass("fa fa-chevron-circle-left");
457    $(".theme_gallerySection_headerIcon").addClass("fa fa-camera-retro");
458    $(".theme_gallerySection_seeAll_icon").addClass("fa fa-camera-retro");
459    $(".theme_teamActivities_goto_icon").addClass("fa fa-chevron-circle-right");
460
461    $(".paging_but.paging_back").addClass("fa fa-chevron-circle-left");
462    $(".paging_but.paging_forward").addClass("fa fa-chevron-circle-right");
463
464    $(".divider").html("<icon class='fa fa-caret-right'></icon>");
465
466
467
468    $(".img_nologo").attr("src", nologoImagePath);
469
470
471
472    $(".img_noProfilePic").attr("src", noProfilePicPath);
473
474    if ($(".tableSort").length) {
475        $('.tableSort').bind("DOMSubtreeModified", function () {
476            loadImages();
477            $(".img_noProfilePic").attr("src", noProfilePicPath);
478        });
479
480    }
481
482    $(".theme_matchProgram_content").each(function (index) {
483
484        var el_offset = $(this).find(".upcoming").first().offset();
485        var parent_offset = $(this).find(".upcoming").first().parent().offset();
486        if (el_offset != null && parent_offset != null) {
487            var scroll = el_offset.top - parent_offset.top - 60;
488            $(this).find(".upcoming").first().parent().animate({ scrollTop: scroll }, 200);
489        }
490    });
491
492    //if ($(".theme_newsItem_imageText").length) {
493    //    var height = $(".theme_newsItem_imageText").height() + 10;
494    //    $(".theme_newsItem_imageText").css("margin-top", "-" + height + "px");
495    //}
496
497});
498
499function calcNewsBlockSizes() {
500    $(".theme_NMB_tinyWrap").each(function () {
501        if ($(window).width() >= 960) {
502            //$(this).width(parseInt(($(this).closest(".theme_NMB_tinyNews").parent().width() - 30 - 40) / 4));
503        }
504        else {
505
506            //$(this).width(parseInt(($(this).closest(".theme_NMB_tinyNews").parent().width() - 10 - 20) / 2));
507        }
508        $(this).find(".theme_NMB_tinyImg").height((Math.floor($(this).width() / 1.95)));
509    });
510
511    $(".theme_NMB_bigNews").each(function () {
512
513        //$(this).width($(this).parent().width());
514        var bigNewsHeight = (Math.floor(($(this).width()) / 1.95));
515        $(this).height(bigNewsHeight);
516
517    });
518
519    $(".theme_NMB_tinyNews").each(function () {
520        //$(this).width($(this).parent().width());
521    });
522    $(".theme_NMB_bigWrap").each(function () {
523        var oldWidth = $(this).width();
524        var newWidth = parseInt($(this).closest(".theme_NMB_bigNews").width());
525        $(this).width(newWidth);
526        $(this).height(parseInt(Math.floor((newWidth / 1.95))));
527        if (oldWidth != $(this).width()) {
528            //change image resolution
529            var oldImgUrl = $(this).data("src");
530            var u = new Url(oldImgUrl);
531            var width = parseInt(newWidth);
532            u.query.width = width;
533            u.query.height = parseInt(Math.floor((newWidth / 1.95)));
534            //$(img).attr("data-src", u.toString());
535            $(this).css("background-image", "url(" + u.toString() + ")");
536        }
537    });
538
539    var heighestTiny = 0;
540
541    setTimeout(function () {
542        $(".theme_NMB_tinyTextWrap").each(function () {
543            var tinyText = $(this).find(".theme_NMB_tinyText");
544            if (tinyText.height() > heighestTiny) {
545                heighestTiny = tinyText.height();
546            }
547            setTimeout(function () {
548                tinyText.height(heighestTiny);
549            });
550        });
551    }, 300);
552}
553
554function CalcGridWidth() {
555    if ($(window).width() > 959) {
556
557        var pagepadding = $("body").data("pagepadding");
558        if (pagepadding == null) {
559            pagepadding = 0;
560        }
561        pagepadding = pagepadding * 2;
562
563        $(".contentWidth_100").each(function () {
564            var nw = $(window).width();
565            if ($(this).parent("#contentWrap").length) {
566                $(this).width(nw - pagepadding);
567            }
568            else {
569                $(this).width("100%");
570            }
571
572        });
573        $(".contentWidth_90").each(function () {
574            var nw = $(window).width() * 0.9;
575            var cnw = Math.floor(nw / 16) * 16;
576            if ($(this).parent("#contentWrap").length) {
577                $(this).width(cnw);
578            }
579            else {
580                $(this).width(cnw + pagepadding);
581            }
582
583        });
584        $(".contentWidth_80").each(function () {
585            var nw = $(window).width() * 0.8;
586            var cnw = Math.floor(nw / 16) * 16;
587            if ($(this).parent("#contentWrap").length) {
588                $(this).width(cnw);
589            }
590            else {
591                $(this).width(cnw + pagepadding);
592            }
593        });
594        $(".contentWidth_70").each(function () {
595            var nw = $(window).width() * 0.7;
596            var cnw = Math.floor(nw / 16) * 16;
597            if ($(this).parent("#contentWrap").length) {
598                $(this).width(cnw);
599            }
600            else {
601                $(this).width(cnw + pagepadding);
602            }
603        });
604        $(".contentWidth_60").each(function () {
605            var nw = $(window).width() * 0.6;
606            var cnw = Math.floor(nw / 16) * 16;
607            if ($(this).parent("#contentWrap").length) {
608                $(this).width(cnw);
609            }
610            else {
611                $(this).width(cnw + pagepadding);
612            }
613        });
614    } else {
615        $(this).width("100%");
616    }
617}
618
619function AcceptCookies() {
620    $.cookie("acceptcookies", "true", { expires: 30 });
621    $(".cookieNotice").slideUp();
622}
623
624function MoveSearchBar() {
625    if ($(document).width() < 960) {
626        $(".theme_headerControls_wrap").detach().prependTo("#content");
627    } else {
628        $(".theme_headerControls_wrap").detach().appendTo("#header");
629    }
630}
631
632function initToolTips() {
633    var isRight = false;
634
635    $(document).on("click", ".tooltip",function () {
636        //var offset = $(this).offset();
637        var text = $(this).data("tooltip");
638
639        if (text != null && text != "") {
640            var overlay = $("body").find(".tooltip-overlay");
641            overlay.find(".tooltip-holder").html(text);
642            overlay.addClass("show");
643        }
644        //if ($(window).width() > 1024) {
645        //    isRight = $(this).hasClass("right");
646        //    $(".tmpToolTip").css("width", "auto").css("max-width", "375px");
647        //}
648    });
649
650
651    $(document).on("click", ".tooltip-wrap .theme_button_small", function () {
652        var overlay = $("body").find(".tooltip-overlay");
653        overlay.find(".tooltip-holder").html();
654        overlay.removeClass("show");
655    });
656    //}, function () {
657    //    $(".tmpToolTip").remove();
658    //}).mousemove(function (e) {
659
660    //    var mousex = e.pageX - 190; //Get X coordinates
661    //    if (isRight) {
662    //        mousex = e.pageX;
663    //    }
664    //    var mousey = e.pageY; //Get Y coordinates
665    //    $('.tmpToolTip').css({ top: mousey, left: mousex })
666    //});
667
668    
669
670}
671
672
673function loadImages() {
674
675    $(".img-postload").each(function () {
676        var src = $(this).data("src");
677        var img = $(this);
678        //$(img).attr("src", src);
679        //var imgLoad = $("<img src=" + src + ">");
680        //imgLoad.load(function () {
681        //    $(img).attr("src", src);
682        //});
683        $(img).attr("src", src);
684        $(img).removeClass("img-postload");
685    });
686
687    $(".lazyLoad").each(function () {
688        var containerWidth = $(this).parent().width();
689        var item = $(this);
690        setTimeout(function () {
691            var url = $(item).attr("src", $(item).attr("data-src") + "?quality=100&width=" + (containerWidth + 100));
692        }, 200);
693    });
694
695    $(".lazyload-wrhr").each(function () {
696        if (!$(this).hasClass("loaded")) {
697            var containerWidth = $(this).closest(".theme_macro").width() + 100;
698            var item = $(this);
699            setTimeout(function () {
700                var datasrc = $(item).attr("data-src");
701                var anchor = $(item).attr("data-anchor");
702                if (datasrc != null && datasrc != "") {
703                    var url = new URL(datasrc);
704                    var ratio = containerWidth / $(item).attr("data-wr");
705                    var newHeight = ratio * $(item).attr("data-hr");
706                    url.searchParams.set("width", containerWidth);
707                    url.searchParams.set("height", Math.round(newHeight));
708                    url.searchParams.set("mode", "crop");
709                    if (anchor != "") {
710                        url.searchParams.set("anchor", anchor);
711                    }
712                    $(item).attr("src", url);
713                    $(item).addClass("loaded");
714                }
715            }, 200);
716        }
717    });
718    $(".lazyload-wrhr-bg").each(function () {
719        if (!$(this).hasClass("loaded")) {
720            var containerWidth = $(this).closest(".theme_macro").width() + 100;
721            var item = $(this);
722            setTimeout(function () {
723                var datasrc = $(item).attr("data-src");
724                if (datasrc != null && datasrc != "") {
725                    var url = new URL(datasrc);
726                    var ratio = containerWidth / $(item).attr("data-wr");
727                    var newHeight = ratio * $(item).attr("data-hr");
728                    url.searchParams.set("width", containerWidth);
729                    url.searchParams.set("height", Math.ceil(newHeight));
730                    $(item).css("background-image", "url(" + url + ")");
731                    $(item).addClass("loaded");
732                }
733            }, 200);
734        }
735    });
736}
737
738function loadGoogleFont(family, variant) {
739    console.log("Loader font: " + family + " " + variant);
740    WebFont.load({
741        google: {
742            families: [family + ":" + variant]
743        },
744        loading: function () {
745            //console.log('loading');
746        },
747        active: function () {
748
749            //RunPackery();
750
751        },
752        inactive: function () {
753            //console.log('inactive');
754        },
755        fontloading: function (familyName, fvd) {
756            //console.log('fontloading: ' + familyName);
757        },
758        fontactive: function (familyName, fvd) {
759            //console.log('fontactive: ' + familyName);
760        },
761        fontinactive: function (familyName, fvd) {
762            //console.log('fontinactive: ' + familyName);
763            //alert('Unable to load font "' + familyName + '" Please try again.');
764        }
765    });
766}
767
768function RunPackery() {
769    //var gutter = 10;
770    //if ($("#siteWrap").data("theme") == "square") {
771    //    gutter = 20;
772    //}
773    //$('.packeryBox').packery({
774    //    itemSelector: '.theme_macro',
775    //    gutter: gutter,
776    //    transitionDuration: "0.2s"
777    //});
778
779}
780
781
782function OpenFacebookShareDialog(url) {
783    var fbpopup = window.open("https://www.facebook.com/sharer/sharer.php?u=" + url, "pop", "width=600, height=400, scrollbars=no");
784}
785
786function ClubFixturesOrderRows(module) {
787    $(module).find(".monthRow").show().each(function () {
788        if ($(this).nextAll(":visible:first").hasClass("monthRow") || $(this).nextAll(":visible:first").length == 0) {
789            $(this).hide();
790        }
791        if ($(this).prevAll(":visible:first").hasClass("match")) {
792            $(this).prevAll(":visible:first").css("border-bottom", 0);
793        }
794    });
795    //RunPackery();
796}
797
798function ClubFixturesSetPaging(module) {
799
800
801    var pagingCount = $(module).data("pagingcount");
802    var currentPage = $(module).data("currentpage");
803
804    var matchCount = $(module).find(".match").length;
805
806    var matches = $(module).find(".match");
807
808    matches.each(function () {
809
810        if ($(this).data("matchno") < (pagingCount * (currentPage - 1)) || $(this).data("matchno") >= (pagingCount * currentPage)) {
811            $(this).hide();
812        }
813        else {
814            $(this).show();
815        }
816    });
817
818    $(module).find(".paging_lbl").html("Viser " + currentPage + " ud af " + Math.ceil(matches.length / pagingCount));
819
820    ClubFixturesOrderRows(module);
821
822    if (currentPage == 1) {
823        $(module).find(".paging_back").addClass("disabled");
824    }
825    else {
826        $(module).find(".paging_back").removeClass("disabled");
827    }
828
829    if (matches.length <= (pagingCount * currentPage)) {
830        $(module).find(".paging_forward").addClass("disabled");
831    } else {
832        $(module).find(".paging_forward").removeClass("disabled");
833    }
834
835    $(module).find(".match:visible:last td").css("border-bottom", "0");
836
837}
838
839function ActivitiesListSetPaging(module) {
840
841
842
843    var pagingCount = $(module).data("pagingcount");
844    var currentPage = $(module).data("currentpage");
845
846    //var matchCount = $(module).find(".match").length;
847
848    var activites = $(module).find(".activities-list-item");
849
850
851    activites.each(function () {
852
853        if ($(this).data("number") <= (pagingCount * (currentPage - 1)) || $(this).data("number") > (pagingCount * currentPage)) {
854            $(this).removeClass("show");
855        }
856        else {
857            $(this).addClass("show");
858        }
859
860        var wrapWidth = $(this).find(".description").width();
861        var descriptionWidth = $(this).find(".description-inner").width();
862        if (wrapWidth < descriptionWidth) {
863            var pct = Math.round((descriptionWidth / wrapWidth * 100) - 100);
864            var ele = $(this).find(".description-inner").addClass("is-overflown");
865            $(this)[0].style.setProperty('--translateX', "translateX(-" + pct + "%)");
866        }
867
868    });
869
870    $(module).closest(".activities-list-macro").find(".paging_lbl").html("Viser " + currentPage + " ud af " + Math.ceil(activites.length / pagingCount));
871
872    if (currentPage == 1) {
873        $(module).closest(".activities-list-macro").find(".paging_back").addClass("disabled");
874    }
875    else {
876        $(module).closest(".activities-list-macro").find(".paging_back").removeClass("disabled");
877    }
878
879    if (activites.length <= (pagingCount * currentPage)) {
880        $(module).closest(".activities-list-macro").find(".paging_forward").addClass("disabled");
881    } else {
882        $(module).closest(".activities-list-macro").find(".paging_forward").removeClass("disabled");
883    }
884
885    $(module).find(".activities-list-item:visible:last td").css("border-bottom", "0");
886
887    var daterows = $(module).find(".activities-list-item-date");
888    $.each(daterows, function () {
889        if ($(this).next().hasClass("show")) {
890            $(this).addClass("show");
891        }
892        else {
893            $(this).removeClass("show");
894        }
895    });
896
897}
898
899function ActivitiesListGoToMatch(item) {
900    if ($(item).data("poolrow") != "") {
901        var pool = $(item).data("poolrow");
902        var match = $(item).data("matchid")
903        var url = "kampvisning?poolrowid=" + pool + "&matchid=" + match;
904        window.location = "/" + url;
905    }
906}
907
908
909
910function getFocus(campo) {
911    $(window).bind('resize', function () {
912        if ($(window).width() <= 760) {
913            $(campo).click();
914            //$.setTimeout(200, function () { $(campo).click() });
915        }
916    });
917
918}
919
920$(window).load(function (e) {
921    var tid = setTimeout(repeat, 300);
922    function repeat() {
923        //RunPackery();
924        tid = setTimeout(repeat, 2000);
925    }
926    ResizeContent();
927})
928
929function ResizeContent() {
930
931    var headerHeight = $("#headerWrap").outerHeight();
932    var navHeight = $(".navWrap").outerHeight();
933    var footerHeight = $("#footerWrap").outerHeight();
934    var windowHeight = $(window).height();
935    var minHeight = windowHeight - headerHeight - navHeight - footerHeight - 11;
936    $("#content").css("min-height", minHeight + "px");
937
938
939    if ($(window).width() > 959) {
940
941        //$(".contentGrid-content .personsWrap").each(function () {
942        //    var newWidth = Math.floor(($(this).parent().innerWidth() - 20) / 4);
943        //    //var newWidth = (Math.floor($(this).parent().innerWidth() / 4) % 200) * 200;
944        //    $(this).find(".personGroup_person").width(newWidth);
945        //    $(this).width(newWidth * 4);
946        //});
947        //$(".contentGrid-right .personsWrap").each(function () {
948        //    var newWidth = Math.floor(($(this).parent().innerWidth() - 20) / 2);
949        //    //var newWidth = (Math.floor($(this).parent().innerWidth() / 4) % 200) * 200;
950        //    $(this).find(".personGroup_person").width(newWidth);
951        //    $(this).width(newWidth * 2);
952        //});
953        //$(".contentGrid-bottom .personsWrap").each(function () {
954        //    var newWidth = Math.floor(($(this).parent().innerWidth() - 20) / 6);
955        //    //var newWidth = (Math.floor($(this).parent().innerWidth() / 4) % 200) * 200;
956        //    $(this).find(".personGroup_person").width(newWidth);
957        //    $(this).width(newWidth * 6);
958        //});
959    }
960    else {
961        //$(".personsWrap").each(function () {
962        //    var newWidth = (Math.floor($(this).parent().innerWidth() / 200) % 200) * 200;
963        //    $(this).width(newWidth);
964        //    $(this).find(".personGroup_person").width(200);
965        //});
966    }
967    //$(".gridv2 .personsWrap").each(function () {
968    //    var newWidth = (Math.floor($(this).parent().innerWidth() / 200) % 200) * 200;
969    //    $(this).width(newWidth);
970    //    $(this).find(".personGroup_person").width(200);
971    //});
972
973    if ($(".navWrap").hasClass("fitPagePadding")) {
974        $(".theme_MegaMenu_wrap").each(function () {
975            $(this).find(".container-12").width($(".navWrap").width());
976        })
977    }
978
979}
980
981function setupGalleries() {
982    $(".mp_gallery_imgs").each(function () {
983        $(this).magnificPopup({
984            delegate: 'a', // child items selector, by clicking on it popup will open
985            type: 'image',
986            gallery: {
987                enabled: true,
988                navigateByImgClick: true,
989                preload: [0, 1] // Will preload 0 - before current, and 1 after the current image
990            },
991            image: {
992                tError: 'Billedet kunne ikke vises.',
993                titleSrc: function (item) {
994                    return item.el.attr('title');
995                }
996            }
997
998        });
999    });
1000}
1001
1002function SignUpNewsletter() {
1003    $(".theme_newsletter_error").hide();
1004    if (isValidEmailAddress($("#tb_newletterSignUp_email").val())) {
1005
1006        var email = $("#tb_newletterSignUp_email").val();
1007        jQuery.ajax({
1008            url: '/umbraco/DBU/DBUFrontApi/SignUpNewsletter?Email=' + email,
1009            type: "POST",
1010            dataType: 'json',
1011            contentType: "application/json",
1012            success: function (result) {
1013                if (result.IsSuccess == true) {
1014                    $(".theme_newsletter_msgAdded").find("span").html("Tak for din tilmelding!");
1015                    $(".theme_newsletter_msgAdded").show();
1016                }
1017                if (result.IsSuccess == false) {
1018                    $(".theme_newsletter_msgAdded").find("span").html("<p>Du er allerede tilmeldt til nyhedsbrevet!</p><div><a href='/unsubscribe.html'>Afmeld</a></div>");
1019                    $(".theme_newsletter_msgAdded").show();
1020                }
1021                $(".theme_newsletter_wrap").hide();
1022                $("#tb_newletterSignUp_email").val("");
1023                setTimeout(function () {
1024                    $(".theme_newsletter_msgAdded").slideUp();
1025                    $(".theme_newsletter_wrap").slideDown();
1026                }, 6000);
1027            },
1028            async: true
1029        });
1030
1031    } else {
1032        $(".theme_newsletter_validation").html("Du har ikke indtastet en korrekt email-adresse");
1033    }
1034}
1035
1036function isValidEmailAddress(emailAddress) {
1037    var pattern = /^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i;
1038    return pattern.test(emailAddress);
1039};
1040
1041$.fn.centerOnParent = function () {
1042    this.css("position", "absolute");
1043    this.css("top", ($(this).parent().height() / 2) - (this.height() / 2) + "px");
1044    this.css("left", ($(this).parent().width() / 2) - (this.width() / 2) + "px");
1045    return this;
1046}
1047
1048function setNewsListItemWidth() {
1049    $(".theme_newsListItem_small").each(function () {
1050        var totalwidth = $(this).width();
1051        var imgWidth = $(this).find(".theme_thumbImgWrap").outerWidth();
1052        var newTextWidth = totalwidth - imgWidth - 20;
1053        $(this).find(".theme_newsListItem_small_textWrap").css("max-width", newTextWidth + "px");
1054    });
1055}
1056
1057function ToggleAccordion(item) {
1058    $(item).next('.accordion--body').slideToggle(200);
1059    $(item).parent().toggleClass('closed');
1060    setTimeout(function () {
1061        //RunPackery();
1062    }, 200)
1063}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.