PageSourceSearch

https://www.rbcwealthmanagement.com/en-us/_static/??-eJydjVEOwiAQB…/eMfX5TEO1/vtOQ7zFwdATwU=

js rbcwealthmanagement.com collected 2026-09-24 15:26:07 UTC 4,213 bytes, 83 lines download raw bytes

1/**
2 * Use a document ready function with a jQuery no-conflict wrapper
3 * to ensure the code runs safely without conflicts with other libraries.
4 */
5(function($) {
6    // Function to handle the dimension updates
7    function updateVideoJsDimensions() {
8        // Find all elements with the tag name 'video-js'
9        // exclude elements that have id named podcastPlayer
10        var videoElements = $('video-js').not('#podcastPlayer');
11
12        // Check if any 'video-js' elements were found on the page
13        if (videoElements.length > 0) {
14            // Loop through each found element using the .each() method
15            videoElements.each(function(index) {
16                // Get the jQuery object for the current element in the loop
17                var currentElement = $(this);
18                
19                // Get the width of the current element
20                var elementWidth = currentElement.width();
21                
22                // Get the inline height from the element's style attribute
23                // .get(0) gets the native DOM element from the jQuery object
24                var inlineHeight = currentElement.get(0).style.height;
25
26                // Get the element two levels up (the grandparent)
27                var grandparentElement = currentElement.parent().parent();
28                
29                // Get the 'max-width' CSS property of the grandparent element
30                var grandparentMaxWidth = grandparentElement.css('max-width');
31                
32                var ratio = 'N/A'; // Default value for the ratio
33                var parsedGrandparentMaxWidth = parseFloat(grandparentMaxWidth);
34
35                // do not process inlineHeight if the value in percentage
36                if(inlineHeight.includes('%')){
37                    inlineHeight = 'N/A';
38                }
39                
40                // Parse the inline height to a float for calculation
41                var parsedInlineHeight = parseFloat(inlineHeight);
42                
43                // Calculate the ratio if both values are valid, non-zero numbers, skip if data-aspect-ratio attribute exists
44                if (currentElement.attr('data-aspect-ratio')) {
45                    ratio = currentElement.attr('data-aspect-ratio');
46                } else if (!isNaN(parsedGrandparentMaxWidth) && parsedGrandparentMaxWidth > 0 && !isNaN(parsedInlineHeight) && parsedInlineHeight > 0) {
47                    ratio = (parsedInlineHeight / parsedGrandparentMaxWidth).toFixed(2);
48                }else{
49                    // Default to 16:9 ratio if values are not valid
50                    ratio = 0.5625;
51                }
52                
53                // Calculate new height and apply it if a valid ratio exists
54                if (ratio !== 'N/A') {
55
56                    //add data variable to element for the ratio
57                    currentElement.attr('data-aspect-ratio', ratio);
58
59                    var newHeight = elementWidth * parseFloat(ratio);
60                    currentElement.css('height', newHeight + 'px');
61
62                    // change currentElement children with tag name 'video' height attribute
63                    currentElement.find('video').css('height', newHeight + 'px');
64
65                    // change parent div padding top attribute
66                    currentElement.parent().css('padding-top', newHeight + 'px');
67                }
68            });
69        }
70    }
71
72    $(document).ready(function() {
73        // Run the function on initial page load
74        updateVideoJsDimensions();
75
76        // Run the function every time the window is resized
77        $(window).resize(function() {
78            updateVideoJsDimensions();
79        });
80    });
81})(jQuery);
82;
83document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll("a[data-rbcwm-analytics], button[data-rbcwm-analytics]").forEach(function(t){t.addEventListener("click",function(){var e=t.getAttribute("data-rbcwm-location-id")||void 0,n=(t.innerText||t.textContent||"").trim()||void 0,a="A"===t.tagName&&t.getAttribute("href")||void 0;window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"click",event_type:"button",link_text:n,link_url:a,location_id:e})})})});;

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.