diff options
author | Bartek Przybylski <bart.p.pl@gmail.com> | 2012-06-02 15:25:50 +0200 |
---|---|---|
committer | Bartek Przybylski <bart.p.pl@gmail.com> | 2012-06-06 22:13:48 +0200 |
commit | 6d211155ab505c99dd7a723a011a755c2c038bc8 (patch) | |
tree | d9bd0748cbba75da4869f47fdb049fd2ade3bf77 /apps/gallery/templates | |
parent | c960e42a1723a3ddc1a703724a6863b3a2d5fa8e (diff) | |
download | nextcloud-server-6d211155ab505c99dd7a723a011a755c2c038bc8.tar.gz nextcloud-server-6d211155ab505c99dd7a723a011a755c2c038bc8.zip |
git status
Diffstat (limited to 'apps/gallery/templates')
-rw-r--r-- | apps/gallery/templates/index.php | 111 |
1 files changed, 83 insertions, 28 deletions
diff --git a/apps/gallery/templates/index.php b/apps/gallery/templates/index.php index 99af3bda0a3..55710038c0a 100644 --- a/apps/gallery/templates/index.php +++ b/apps/gallery/templates/index.php @@ -1,31 +1,86 @@ <?php -OCP\Util::addStyle('gallery', 'styles'); -OCP\Util::addscript('gallery', 'albums'); -OCP\Util::addscript('gallery', 'scanner'); -OCP\Util::addscript('gallery', 'album_cover'); -OCP\Util::addStyle('files', 'files'); -OCP\Util::addscript('files_imageviewer', 'jquery.mousewheel-3.0.4.pack'); -OCP\Util::addscript('files_imageviewer', 'jquery.fancybox-1.3.4.pack'); -OCP\Util::addStyle( 'files_imageviewer', 'jquery.fancybox-1.3.4' ); $l = OC_L10N::get('gallery'); ?> -<script type="text/javascript">var gallery_scanning_root='<?php echo OCP\Config::getUserValue(OCP\USER::getUser(), 'gallery', 'root', '/'); ?>'; var gallery_default_order = '<?php echo OCP\Config::getUserValue(OCP\USER::getUser(), 'gallery', 'order', 'ASC'); ?>';</script> -<div id="controls"> - <div id="scan"> - <div id="scanprogressbar"></div> - <input type="button" class="start" value="<?php echo $l->t('Rescan');?>" onclick="javascript:scanForAlbums();" /> - <input type="button" class="stop" style="display:none" value="<?php echo $l->t('Stop');?>" onclick="javascript:Scanner.stop();" /> - <input type="button" id="g-share-button" value="<?php echo $l->t('Share'); ?>" onclick="javascript:shareGallery();" /> - <input type="button" id="g-settings-button" value="<?php echo $l->t('Settings');?>" onclick="javascript:settings();"/> - </div> - <div id="g-album-navigation"> - <div class="crumb last" style="background-image:url('<?php echo OC::$WEBROOT;?>/core/img/breadcrumb.png')"> - <a href="javascript:returnToElement(0);">main</a> - </div> - </div> - <div id="g-album-loading" class="crumb" style="display:none"> - <img src="<?php echo OCP\Util::linkTo('gallery', 'img/loading.gif'); ?>"> - </div> -</div> -<div id="gallery_list"> -</div> +<style> +div.gallery_div {position:relative; display: inline-block; height: 202px; width: 200px; margin: 5px;} +div.miniature_border {position:absolute; height: 200px; -webkit-transition-duration: .2s; background-position: 50%;} +div.line {display:inline-block; border: 0; width: auto; height: 210px} +div.gallery_div img{position:absolute; top: 1; left: 0; -webkit-transition-duration: 0.3s; height:200px; width: auto;} +div.gallery_div img.shrinker {width:80px !important;} +div.title { opacity: 0; text-align: center; vertical-align: middle; font-family: Arial; font-size: 12px; border: 0; position: absolute; text-overflow: ellipsis; bottom: 20px; left:10px; height:auto; padding: 5px; width: 170px; background-color: black; color: white; -webkit-transition: opacity 0.5s; z-index:1000; border-radius: 7px} +div.visible { opacity: 0.8;} +</style> +<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> +<script type="text/javascript"> +function t(element) { + $('div', element).each(function(index, elem) { + if ($(elem).hasClass('title')) { + $(elem).addClass('visible'); + } else { + $(elem).css('margin-top', Math.floor(30-(Math.random()*60)) + 'px') + .css('margin-left', Math.floor(30-(Math.random()*60))+ 'px') + .css('z-index', '999'); + } + }); +} + +function o(element) { + $('div', element).each(function(index, elem) { + if ($(elem).hasClass('title')) { + $(elem).removeClass('visible'); + } else { + $(elem).css('margin-top', Math.floor(5-(Math.random()*10)) + 'px') + .css('margin-left', Math.floor(5-(Math.random()*10))+ 'px') + .css('z-index', '3'); + } + }); +} + +</script> + +<?php + +include('apps/gallery/lib/tiles.php'); +$root = empty($_GET['root'])?'/':$_GET['root']; + +$images = \OC_FileCache::searchByMime('image', null, '/'.\OCP\USER\getUser().'/files'.$root); +sort($images); + +$arr = array(); +$tl = new \OC\Pictures\TilesLine(); +$ts = new \OC\Pictures\TileStack(array(), ''); +$previous_element = $images[0]; +for($i = 0; $i < count($images); $i++) { + $prev_dir_arr = explode('/', $previous_element); + $dir_arr = explode('/', $images[$i]); + + if (count($dir_arr)==1) { + $tl->addTile(new \OC\Pictures\TileSingle($root.$images[$i])); + continue; + } + if (strcmp($prev_dir_arr[0], $dir_arr[0])!=0) { + $tl->addTile(new \OC\Pictures\TileStack($arr, $prev_dir_arr[0])); + $arr = array(); + } + $arr[] = $root.$images[$i]; + $previous_element = $images[$i]; +} + +$dir_arr = explode('/', $previous_element); + +if (count($dir_arr)==0) { + $tl->addTile(new \OC\Pictures\TileSingle($previous_element)); +} else if (count($dir_arr) && $ts->getCount() == 0){ + $ts = new \OC\Pictures\TileStack(array($root.$previous_element), $dir_arr[0]); +} else { + $arr[] = $previous_element; + $ts->addTile($arr); +} + +if ($ts->getCount() != 0) { + $tl->addTile($ts); +} + +echo $tl->get(); + +?> |