<?php
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener(
	'OCA\Files::loadAdditionalScripts',
	function () {
		$policy = new \OC\Security\CSP\ContentSecurityPolicy();
		$policy->setAllowedImageDomains(['*']);
		$frameDomains = $policy->getAllowedFrameDomains();
		$frameDomains[] = 'www.youtube.com';
		$frameDomains[] = 'prezi.com';
		$frameDomains[] = 'player.vimeo.com';
		$frameDomains[] = 'vine.co';
		$policy->setAllowedFrameDomains($frameDomains);
		\OC::$server->getContentSecurityPolicyManager()->addDefaultPolicy($policy);

		//load the required files
		OCP\Util::addscript('files_markdown', '../build/editor');
		OCP\Util::addStyle('files_markdown', '../build/styles');
		OCP\Util::addStyle('files_markdown', 'preview');
	});


$eventDispatcher->addListener(
	'OCA\Files_Sharing::loadAdditionalScripts',
	function () {
		OCP\Util::addScript('files_markdown', '../build/editor');
		OCP\Util::addStyle('files_markdown', 'preview');
	});

<?php
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener(
	'OCA\Files::loadAdditionalScripts',
	function () {
		$policy = new \OC\Security\CSP\ContentSecurityPolicy();
		$policy->setAllowedImageDomains(['*']);
		$frameDomains = $policy->getAllowedFrameDomains();
		$frameDomains[] = 'www.youtube.com';
		$frameDomains[] = 'prezi.com';
		$frameDomains[] = 'player.vimeo.com';
		$frameDomains[] = 'vine.co';
		$policy->setAllowedFrameDomains($frameDomains);
		\OC::$server->getContentSecurityPolicyManager()->addDefaultPolicy($policy);

		//load the required files
		OCP\Util::addscript('files_markdown', '../build/editor');
		OCP\Util::addStyle('files_markdown', '../build/styles');
		OCP\Util::addStyle('files_markdown', 'preview');
	});


$eventDispatcher->addListener(
	'OCA\Files_Sharing::loadAdditionalScripts',
	function () {
		OCP\Util::addScript('files_markdown', '../build/editor');
		OCP\Util::addStyle('files_markdown', '../build/styles');
		OCP\Util::addStyle('files_markdown', 'preview');
	});

Load all stylesheets for public preview
Load all stylesheets for public preview

fixes #88

Signed-off-by: Robin Appelman <474ee9ee179b0ecf0bc27408079a0b15eda4c99d@icewind.nl>
