select('systemtag.name', 'systemtag.id', 'systemtag.visibility', 'systemtag.editable', 'systemtag.etag') ->selectAlias($this->createFunction('COUNT(filecache.fileid)'), 'number_files') ->selectAlias($this->createFunction('MAX(filecache.fileid)'), 'ref_file_id') ->from('filecache', 'filecache') ->leftJoin('filecache', 'systemtag_object_mapping', 'systemtagmap', $this->expr()->andX( $this->expr()->eq('filecache.fileid', $this->expr()->castColumn('systemtagmap.objectid', IQueryBuilder::PARAM_INT)), $this->expr()->eq('systemtagmap.objecttype', $this->createNamedParameter('files')) )) ->leftJoin('systemtagmap', 'systemtag', 'systemtag', $this->expr()->andX( $this->expr()->eq('systemtag.id', 'systemtagmap.systemtagid'), $this->expr()->eq('systemtag.visibility', $this->createNamedParameter(true)) )) ->groupBy('systemtag.name', 'systemtag.id', 'systemtag.visibility', 'systemtag.editable'); return $this; } public function selectFileCache(?string $alias = null, bool $joinExtendedCache = true) { $name = $alias ?: 'filecache'; $this->select("$name.fileid", 'storage', 'path', 'path_hash', "$name.parent", "$name.name", 'mimetype', 'mimepart', 'size', 'mtime', 'storage_mtime', 'encrypted', "$name.etag", "$name.permissions", 'checksum', 'unencrypted_size') ->from('filecache', $name); if ($joinExtendedCache) { $this->addSelect('metadata_etag', 'creation_time', 'upload_time'); $this->leftJoin($name, 'filecache_extended', 'fe', $this->expr()->eq("$name.fileid", 'fe.fileid')); } $this->alias = $name; return $this; } public function whereStorageId(int $storageId) { $this->andWhere($this->expr()->eq('storage', $this->createNamedParameter($storageId, IQueryBuilder::PARAM_INT))); return $this; } public function whereFileId(int $fileId) { $alias = $this->alias; if ($alias) { $alias .= '.'; } else { $alias = ''; } $this->andWhere($this->expr()->eq("{$alias}fileid", $this->createNamedParameter($fileId, IQueryBuilder::PARAM_INT))); return $this; } public function wherePath(string $path) { $this->andWhere($this->expr()->eq('path_hash', $this->createNamedParameter(md5($path)))); return $this; } public function whereParent(int $parent) { $alias = $this->alias; if ($alias) { $alias .= '.'; } else { $alias = ''; } $this->andWhere($this->expr()->eq("{$alias}parent", $this->createNamedParameter($parent, IQueryBuilder::PARAM_INT))); return $this; } public function whereParentInParameter(string $parameter) { $alias = $this->alias; if ($alias) { $alias .= '.'; } else { $alias = ''; } $this->andWhere($this->expr()->in("{$alias}parent", $this->createParameter($parameter))); return $this; } /** * join metadata to current query builder and returns an helper * * @return IMetadataQuery */ public function selectMetadata(): IMetadataQuery { $metadataQuery = $this->filesMetadataManager->getMetadataQuery($this, $this->alias, 'fileid'); $metadataQuery->retrieveMetadata(); return $metadataQuery; } } er'>committer
path: root/ui/jquery.effects.clip.js
blob: c859205b42da00345262e5bee9881e57772df087 (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
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * jQuery UI Effects Clip @VERSION
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Clip
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function( $, undefined ) {

$.effects.clip = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this), props = ['position','top','left','height','width'];

		// Set options
		var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
		var direction = o.options.direction || 'vertical'; // Default direction

		// Adjust
		$.effects.save(el, props); el.show(); // Save & Show
		var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
		var animate = el[0].tagName == 'IMG' ? wrapper : el;
		var ref = {
			size: (direction == 'vertical') ? 'height' : 'width',
			position: (direction == 'vertical') ? 'top' : 'left'
		};
		var distance = (direction == 'vertical') ? animate.height() : animate.width();
		if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift

		// Animation
		var animation = {};
		animation[ref.size] = mode == 'show' ? distance : 0;
		animation[ref.position] = mode == 'show' ? 0 : distance / 2;

		// Animate
		animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
			if(mode == 'hide') el.hide(); // Hide
			$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
			if(o.callback) o.callback.apply(el[0], arguments); // Callback
			el.dequeue();
		}});

	});

};

})(jQuery);