server = $server; //priority 90 to make sure the plugin is called before //Sabre\DAV\CorePlugin::httpGet $this->server->on('method:GET', [$this, 'checkViewOnly'], 90); $this->server->on('method:COPY', [$this, 'checkViewOnly'], 90); $this->server->on('method:MOVE', [$this, 'checkViewOnly'], 90); } /** * Disallow download via DAV Api in case file being received share * and having special permission * * @throws Forbidden * @throws NotFoundException */ public function checkViewOnly(RequestInterface $request): bool { $path = $request->getPath(); try { assert($this->server !== null); $davNode = $this->server->tree->getNodeForPath($path); if ($davNode instanceof DavFile) { // Restrict view-only to nodes which are shared $node = $davNode->getNode(); } elseif ($davNode instanceof VersionFile) { $node = $davNode->getVersion()->getSourceFile(); $currentUserId = $this->userFolder?->getOwner()?->getUID(); // The version source file is relative to the owner storage. // But we need the node from the current user perspective. if ($node->getOwner()->getUID() !== $currentUserId) { $nodes = $this->userFolder->getById($node->getId()); $node = array_pop($nodes); if (!$node) { throw new NotFoundException('Version file not accessible by current user'); } } } else { return true; } $storage = $node->getStorage(); if (!$storage->instanceOfStorage(ISharedStorage::class)) { return true; } // Extract extra permissions /** @var ISharedStorage $storage */ $share = $storage->getShare(); $attributes = $share->getAttributes(); if ($attributes === null) { return true; } // Check if read-only and on whether permission can download is both set and disabled. $canDownload = $attributes->getAttribute('permissions', 'download'); if ($canDownload !== null && !$canDownload) { throw new Forbidden('Access to this shared resource has been denied because its download permission is disabled.'); } } catch (NotFound $e) { // File not found } return true; } } /github_actions/github-actions-f50e11107c'>summaryrefslogtreecommitdiffstats
path: root/demos/effect/addClass.html
blob: 45b6f5f4cc23500e7895fe9639d48b600036a26a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>jQuery UI Effects - addClass demo</title>
	<link rel="stylesheet" href="../../themes/base/all.css">
	<link rel="stylesheet" href="../demos.css">
	<style>
		.toggler { width: 500px; height: 200px; position: relative; }
		#button { padding: .5em 1em; text-decoration: none; }
		#effect { width: 240px;  padding: 1em; border: 1px solid #000; background: #eee; color: #333; }
		.newClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 120px; padding: 30px; margin: 10px; font-size: 1.1em; }
	</style>
	<script src="../../external/requirejs/require.js"></script>
	<script src="../bootstrap.js">
		$( "#button" ).on( "click", function() {
			$( "#effect" ).addClass( "newClass", 1000, callback );
		});

		function callback() {
			setTimeout(function() {
				$( "#effect" ).removeClass( "newClass" );
			}, 1500 );
		}
	</script>
</head>
<body>

<div class="toggler">
	<div id="effect" class="ui-corner-all">
			Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede.
	</div>
</div>

<button id="button" class="ui-state-default ui-corner-all">Run Effect</button>

<div class="demo-description">
<p>This demo adds a class which animates: text-indent, letter-spacing, width, height, padding, margin, and font-size.</p>
</div>
</body>
</html>