All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.view.jsp Maven / Gradle / Ivy

There is a newer version: 5.0.19
Show newest version
<%--
/**
 * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
 * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
 */
--%>

<%@ include file="/init.jsp" %>


	
		
			
				
					<liferay-ui:message escapeAttribute=" key="youtube-video" />" height="<%= youTubeDisplayContext.getHeight() %>" src="<%= youTubeDisplayContext.getImageURL() %>" width="<%= youTubeDisplayContext.getWidth() %>" />
				
			
			
				
			
		
	
	
		
	



	function resizeIFrame() {
		var iframe = document.getElementById('iframe');

		if (iframe != null) {
			var displayContextWidth = <%= youTubeDisplayContext.getWidth() %>;

			var parentWidth = iframe.parentElement.offsetWidth;

			if (displayContextWidth > parentWidth) {
				displayContextWidth = parentWidth;
			}

			iframe.setAttribute('height', <%= youTubeDisplayContext.getHeight() %>);
			iframe.setAttribute('width', displayContextWidth);
		}
	}

	Liferay.provide(
		window,
		'addDragAndDropListener',
		function () {
			if (!Liferay.Layout) {
				setTimeout(function () {
					addDragAndDropListener();
				}, 5000);
			}
			else {
				Liferay.Layout.on(['drag:end', 'drag:start'], function () {
					AUI().debounce(resizeIFrame(), 500);
				});
			}
		},
		['aui-debounce']
	);

	Liferay.on('allPortletsReady', function () {
		addDragAndDropListener();
	});

	Liferay.on('portletReady', function () {
		resizeIFrame();
	});



	A.on('windowresize', function () {
		resizeIFrame();
	});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy