diff options
author | Frank Karlitschek <frank@owncloud.org> | 2012-08-26 17:30:07 +0200 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2012-08-26 17:30:07 +0200 |
commit | 72e9a2ce57ee88503db83614cec5ccda71f0b58e (patch) | |
tree | 8bc301ca22d9ca08ea54426bcb61f62bd1c1cb75 /apps/gallery | |
parent | 32bad688bdb4fea55eba9d4255fc55f1c60a0aca (diff) | |
download | nextcloud-server-72e9a2ce57ee88503db83614cec5ccda71f0b58e.tar.gz nextcloud-server-72e9a2ce57ee88503db83614cec5ccda71f0b58e.zip |
moved to apps repository
Diffstat (limited to 'apps/gallery')
101 files changed, 0 insertions, 4046 deletions
diff --git a/apps/gallery/ajax/createAlbum.php b/apps/gallery/ajax/createAlbum.php deleted file mode 100644 index 71e7fd1aa5e..00000000000 --- a/apps/gallery/ajax/createAlbum.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** -* ownCloud - gallery application -* -* @author Bartek Przybylski -* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - - -OCP\JSON::checkLoggedIn(); -OCP\JSON::checkAppEnabled('gallery'); -OCP\JSON::callCheck(); - -OC_Gallery_Album::create(OCP\USER::getUser(), $_GET['album_name']); - -OCP\JSON::success(array('name' => $_GET['album_name'])); diff --git a/apps/gallery/ajax/galleryOp.php b/apps/gallery/ajax/galleryOp.php deleted file mode 100644 index ab8c64e28ad..00000000000 --- a/apps/gallery/ajax/galleryOp.php +++ /dev/null @@ -1,188 +0,0 @@ -<?php - -/** -* ownCloud - gallery application -* -* @author Bartek Przybylski -* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - -header('Content-type: text/html; charset=UTF-8') ; - - -OCP\JSON::checkLoggedIn(); -OCP\JSON::checkAppEnabled('gallery'); - -function handleRename($oldname, $newname) { - OC_Gallery_Album::rename($oldname, $newname, OCP\USER::getUser()); - OC_Gallery_Album::changeThumbnailPath($oldname, $newname); -} - -function handleRemove($name) { - $album_id = OC_Gallery_Album::find(OCP\USER::getUser(), $name); - $album_id = $album_id->fetchRow(); - $album_id = $album_id['album_id']; - OC_Gallery_Album::remove(OCP\USER::getUser(), $name); - OC_Gallery_Photo::removeByAlbumId($album_id); -} - -function handleGetThumbnails($albumname) { - OCP\Response::enableCaching(3600 * 24); // 24 hour - $view = OCP\Files::getStorage('gallery'); - $thumbnail = $view->fopen(urldecode($albumname).'.png', 'r'); - header('Content-Type: '.OC_Image::getMimeTypeForFile($thumbnail)); - OCP\Response::sendFile($thumbnail); -} - -function handleGalleryScanning() { - OCP\DB::beginTransaction(); - set_time_limit(0); - OC_Gallery_Album::cleanup(); - $eventSource = new OC_EventSource(); - OC_Gallery_Scanner::scan($eventSource); - $eventSource->close(); - OCP\DB::commit(); -} - -function handleFilescan($cleanup) { - if ($cleanup) OC_Gallery_Album::cleanup(); - $pathlist = OC_Gallery_Scanner::find_paths(); - sort($pathlist); - OCP\JSON::success(array('paths' => $pathlist)); -} - -function handleStoreSettings($root, $order) { - if (!OC_Filesystem::file_exists($root)) { - OCP\JSON::error(array('cause' => 'No such file or directory')); - return; - } - if (!OC_Filesystem::is_dir($root)) { - OCP\JSON::error(array('cause' => $root . ' is not a directory')); - return; - } - - $current_root = OCP\Config::getUserValue(OCP\USER::getUser(),'gallery', 'root', '/'); - $root = trim($root); - $root = rtrim($root, '/').'/'; - $rescan = $current_root==$root?'no':'yes'; - OCP\Config::setUserValue(OCP\USER::getUser(), 'gallery', 'root', $root); - OCP\Config::setUserValue(OCP\USER::getUser(), 'gallery', 'order', $order); - OCP\JSON::success(array('rescan' => $rescan)); -} - -function handleGetGallery($path) { - $a = array(); - $root = OCP\Config::getUserValue(OCP\USER::getUser(),'gallery', 'root', '/'); - $path = utf8_decode(rtrim($root.$path,'/')); - if($path == '') $path = '/'; - $pathLen = strlen($path); - $result = OC_Gallery_Album::find(OCP\USER::getUser(), null, $path); - $album_details = $result->fetchRow(); - - $result = OC_Gallery_Album::find(OCP\USER::getUser(), null, null, $path); - - while ($r = $result->fetchRow()) { - $album_name = $r['album_name']; - $size=OC_Gallery_Album::getAlbumSize($r['album_id']); - // this is a fallback mechanism and seems expensive - if ($size == 0) $size = OC_Gallery_Album::getIntermediateGallerySize($r['album_path']); - - $a[] = array('name' => utf8_encode($album_name), 'numOfItems' => min($size, 10),'path'=>substr($r['album_path'], $pathLen)); - } - - $result = OC_Gallery_Photo::find($album_details['album_id']); - - $p = array(); - - while ($r = $result->fetchRow()) { - $p[] = utf8_encode($r['file_path']); - } - - $r = OC_Gallery_Sharing::getEntryByAlbumId($album_details['album_id']); - $shared = false; - $recursive = false; - $token = ''; - if ($row = $r->fetchRow()) { - $shared = true; - $recursive = ($row['recursive'] == 1)? true : false; - $token = $row['token']; - } - - OCP\JSON::success(array('albums'=>$a, 'photos'=>$p, 'shared' => $shared, 'recursive' => $recursive, 'token' => $token)); -} - -function handleShare($path, $share, $recursive) { - $recursive = $recursive == 'true' ? 1 : 0; - $owner = OCP\USER::getUser(); - $root = OCP\Config::getUserValue(OCP\USER::getUser(),'gallery', 'root', '/'); - $path = utf8_decode(rtrim($root.$path,'/')); - if($path == '') $path = '/'; - $r = OC_Gallery_Album::find($owner, null, $path); - if ($row = $r->fetchRow()) { - $albumId = $row['album_id']; - } else { - OCP\JSON::error(array('cause' => 'Couldn\'t find requested gallery')); - exit; - } - - if ($share == false) { - OC_Gallery_Sharing::remove($albumId); - OCP\JSON::success(array('sharing' => false)); - } else { // share, yeah \o/ - $r = OC_Gallery_Sharing::getEntryByAlbumId($albumId); - if (($row = $r->fetchRow())) { // update entry - OC_Gallery_Sharing::updateSharingByToken($row['token'], $recursive); - OCP\JSON::success(array('sharing' => true, 'token' => $row['token'], 'recursive' => $recursive == 1 ? true : false )); - } else { // and new sharing entry - $date = new DateTime(); - $token = md5($owner . $date->getTimestamp()); - OC_Gallery_Sharing::addShared($token, intval($albumId), $recursive); - OCP\JSON::success(array('sharing' => true, 'token' => $token, 'recursive' => $recursive == 1 ? true : false )); - } - } -} - - -if ($_GET['operation']) { - switch($_GET['operation']) { - case 'rename': - handleRename($_GET['oldname'], $_GET['newname']); - OCP\JSON::success(array('newname' => $_GET['newname'])); - break; - case 'remove': - handleRemove($_GET['name']); - OCP\JSON::success(); - break; - case 'get_covers': - handleGetThumbnails(urldecode($_GET['albumname'])); - break; - case 'scan': - handleGalleryScanning(); - break; - case 'store_settings': - handleStoreSettings($_GET['root'], $_GET['order']); - break; - case 'get_gallery': - handleGetGallery($_GET['path']); - break; - case 'share': - handleShare($_GET['path'], $_GET['share'] == 'true' ? true : false, $_GET['recursive']); - break; - default: - OCP\JSON::error(array('cause' => 'Unknown operation')); - } -} diff --git a/apps/gallery/ajax/sharing.php b/apps/gallery/ajax/sharing.php deleted file mode 100644 index bf8169ef1e2..00000000000 --- a/apps/gallery/ajax/sharing.php +++ /dev/null @@ -1,118 +0,0 @@ -<?php - -/** -* ownCloud - gallery application -* -* @author Bartek Przybylski -* @copyright 2012 Bartek Przybylski bartek@alefzero.eu -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - - -OCP\JSON::callCheck(); - -if (!isset($_GET['token']) || !isset($_GET['operation'])) { - OCP\JSON::error(array('cause' => 'Not enought arguments')); - exit; -} - -$operation = $_GET['operation']; -$token = $_GET['token']; - -if (!OC_Gallery_Sharing::isTokenValid($token)) { - OCP\JSON::error(array('cause' => 'Given token is not valid')); - exit; -} - -function handleGetGallery($token, $path) { - $owner = OC_Gallery_Sharing::getTokenOwner($token); - $apath = OC_Gallery_Sharing::getPath($token); - - if ($path == false) - $root = $apath; - else - $root = rtrim($apath,'/').$path; - - $r = OC_Gallery_Album::find($owner, null, $root); - $albums = array(); - $photos = array(); - $albumId = -1; - if ($row = $r->fetchRow()) { - $albumId = $row['album_id']; - } - if ($albumId != -1) { - - if (OC_Gallery_Sharing::isRecursive($token)) { - $r = OC_Gallery_Album::find($owner, null, null, $root); - while ($row = $r->fetchRow()) - $albums[] = $row['album_name']; - } - - $r = OC_Gallery_Photo::find($albumId); - while ($row = $r->fetchRow()) - $photos[] = $row['file_path']; - } - - OCP\JSON::success(array('albums' => $albums, 'photos' => $photos)); -} - -function handleGetThumbnail($token, $imgpath) { - $owner = OC_Gallery_Sharing::getTokenOwner($token); - $image = OC_Gallery_Photo::getThumbnail($imgpath, $owner); - if ($image) { - OCP\Response::enableCaching(3600 * 24); // 24 hour - $image->show(); - } -} - -function handleGetAlbumThumbnail($token, $albumname) -{ - $owner = OC_Gallery_Sharing::getTokenOwner($token); - $view = OCP\Files::getStorage('gallery'); - $file = $view->fopen($albumname.'.png', 'r'); - $image = new OC_Image($file); - if ($image->valid()) { - $image->centerCrop(); - $image->resize(200); - $image->fixOrientation(); - OCP\Response::enableCaching(3600 * 24); // 24 hour - $image->show(); - } -} - -function handleGetPhoto($token, $photo) { - $owner = OC_Gallery_Sharing::getTokenOwner($token); - $view = OCP\Files::getStorage('files'); - $file = $view->fopen(urldecode($photo), 'r'); - header('Content-Type: '.OC_Image::getMimeTypeForFile($file)); - OCP\Response::sendFile($file); -} - -switch ($operation) { - case 'get_gallery': - handleGetGallery($token, isset($_GET['path'])? $_GET['path'] : false); - break; - case 'get_thumbnail': - handleGetThumbnail($token, urldecode($_GET['img'])); - break; - case 'get_album_thumbnail': - handleGetAlbumThumbnail($token, urldecode($_GET['albumname'])); - break; - case 'get_photo': - handleGetPhoto($token, urldecode($_GET['photo'])); - break; -} - diff --git a/apps/gallery/ajax/thumbnail.php b/apps/gallery/ajax/thumbnail.php deleted file mode 100644 index 5bf1d420dc4..00000000000 --- a/apps/gallery/ajax/thumbnail.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/** -* ownCloud - gallery application -* -* @author Bartek Przybylski -* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - -OCP\JSON::checkLoggedIn(); -OCP\JSON::checkAppEnabled('gallery'); -session_write_close(); -require_once('apps/gallery/lib/managers.php'); - - -$img = $_GET['filepath']; - -$image = \OC\Pictures\ThumbnailsManager::getInstance()->getThumbnail($img); -if ($image) { - OCP\Response::enableCaching(3600 * 24); // 24 hour - $image->show(); -} diff --git a/apps/gallery/ajax/viewImage.php b/apps/gallery/ajax/viewImage.php deleted file mode 100644 index daf0ab741f0..00000000000 --- a/apps/gallery/ajax/viewImage.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/** - * ownCloud - gallery application - * - * @author Ike Devolder - * @copyright 2012 Ike Devolder - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE - * License as published by the Free Software Foundation; either - * version 3 of the License, or any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU AFFERO GENERAL PUBLIC LICENSE for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - * - */ -OCP\JSON::checkLoggedIn(); -OCP\JSON::checkAppEnabled('gallery'); - -$img = $_GET['img']; - -$image = OC_Gallery_Photo::getViewImage($img); -if ($image) { - OCP\Response::enableCaching(3600 * 24); // 24 hour - $image->show(); -} diff --git a/apps/gallery/appinfo/app.php b/apps/gallery/appinfo/app.php deleted file mode 100644 index f26f23466be..00000000000 --- a/apps/gallery/appinfo/app.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/** -* ownCloud - gallery application -* -* @author Bartek Przybylski -* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - -OC::$CLASSPATH['OC_Gallery_Album'] = 'gallery/lib/album.php'; -OC::$CLASSPATH['OC_Gallery_Photo'] = 'gallery/lib/photo.php'; -OC::$CLASSPATH['OC_Gallery_Scanner'] = 'gallery/lib/scanner.php'; -OC::$CLASSPATH['OC_Gallery_Sharing'] = 'gallery/lib/sharing.php'; -OC::$CLASSPATH['OC_Gallery_Hooks_Handlers'] = 'gallery/lib/hooks_handlers.php'; -OC::$CLASSPATH['Pictures_Managers'] = 'gallery/lib/managers.php'; -OC::$CLASSPATH['Pictures_Tiles'] = 'gallery/lib/tiles.php'; -OC::$CLASSPATH['OC_Share_Backend_Photo'] = 'gallery/lib/share.php'; - -// OCP\Share::registerBackend('photo', new OC_Share_Backend_Photo()); - -$l = OC_L10N::get('gallery'); - -OCP\App::addNavigationEntry( array( - 'id' => 'gallery_index', - 'order' => 20, - 'href' => OCP\Util::linkTo('gallery', 'index.php'), - 'icon' => OCP\Util::imagePath('core', 'places/picture.svg'), - 'name' => $l->t('Pictures'))); - -class OC_GallerySearchProvider extends OC_Search_Provider{ - function search($query){ - $stmt = OCP\DB::prepare('SELECT * FROM `*PREFIX*gallery_albums` WHERE `uid_owner` = ? AND `album_name` LIKE ?'); - $result = $stmt->execute(array(OCP\USER::getUser(),'%'.$query.'%')); - $results=array(); - while($row=$result->fetchRow()){ - $results[]=new OC_Search_Result($row['album_name'],'',OCP\Util::linkTo('gallery', 'index.php').'?view='.$row['album_name'],'Galleries'); - } - return $results; - } -} - -//OC_Search::registerProvider('OC_GallerySearchProvider'); - -require_once('gallery/lib/hooks_handlers.php'); diff --git a/apps/gallery/appinfo/database.xml b/apps/gallery/appinfo/database.xml deleted file mode 100644 index 1683e0ca2c7..00000000000 --- a/apps/gallery/appinfo/database.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<database> - <name>*dbname*</name> - <create>true</create> - <overwrite>false</overwrite> - <charset>utf8</charset> - <table> - <name>*dbprefix*pictures_images_cache</name> - <declaration> - <field> - <name>uid_owner</name> - <type>text</type> - <notnull>true</notnull> - <length>64</length> - </field> - <field> - <name>path</name> - <type>text</type> - <notnull>true</notnull> - <length>256</length> - </field> - <field> - <name>width</name> - <type>integer</type> - <notnull>true</notnull> - <length>4</length> - </field> - <field> - <name>height</name> - <type>integer</type> - <notnull>true</notnull> - <length>4</length> - </field> - </declaration> - </table> - <table> - <name>*dbprefix*gallery_sharing</name> - <declaration> - <field> - <name>token</name> - <type>text</type> - <notnull>true</notnull> - <length>64</length> - </field> - <field> - <name>gallery_id</name> - <type>integer</type> - <default>0</default> - <notnull>true</notnull> - <length>4</length> - </field> - <field> - <name>recursive</name> - <type>integer</type> - <notnull>true</notnull> - <length>1</length> - </field> - </declaration> - </table> -</database> diff --git a/apps/gallery/appinfo/info.xml b/apps/gallery/appinfo/info.xml deleted file mode 100644 index 84f6e960990..00000000000 --- a/apps/gallery/appinfo/info.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0"?> -<info> - <id>gallery</id> - <name>Pictures</name> - <licence>AGPL</licence> - <author>Bartek Przybylski</author> - <require>4</require> - <shipped>true</shipped> - <description>Dedicated pictures application</description> - <standalone/> - <default_enable/> - <public> - <gallery>sharing.php</gallery> - </public> -</info> diff --git a/apps/gallery/appinfo/update.php b/apps/gallery/appinfo/update.php deleted file mode 100644 index 65e7734c47f..00000000000 --- a/apps/gallery/appinfo/update.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -$currentVersion=OC_Appconfig::getValue('gallery', 'installed_version'); -if (version_compare($currentVersion, '0.5.0', '<')) { - $stmt = OCP\DB::prepare('DROP TABLE IF EXISTS `*PREFIX*gallery_photos`'); - $stmt->execute(); - $stmt = OCP\DB::prepare('DROP TABLE IF EXISTS `*PREFIX*gallery_albums`'); - $stmt->execute(); - - \OC_DB::createDbFromStructure(OC_App::getAppPath($appid).'/appinfo/database.xml'); -} diff --git a/apps/gallery/appinfo/version b/apps/gallery/appinfo/version deleted file mode 100644 index 4b9fcbec101..00000000000 --- a/apps/gallery/appinfo/version +++ /dev/null @@ -1 +0,0 @@ -0.5.1 diff --git a/apps/gallery/css/sharing.css b/apps/gallery/css/sharing.css deleted file mode 100644 index 4712369cc84..00000000000 --- a/apps/gallery/css/sharing.css +++ /dev/null @@ -1,8 +0,0 @@ -body { background-color: #eee; margin: 0; padding: 0;} -#gallery_list { height: 100%; width: 80%; background-color: white; margin: 0 auto; box-shadow: 0 0 8px #888; } -div.gallery_box { width: 200px; position:relative; text-align: center; border: 0; display: inline-block; margin: 5pt; vertical-align: top; padding: 5px 5px 5px 5px; position: relative; cursor: pointer; -webkit-transition: color 0.5s ease-in-out; -o-transition: color 0.5s ease-in-out; -moz-transition: color 0.5s ease-in-out;color: #BBB;} -div.gallery_box:hover { color: black; } -div.gallery_box h1 {font-size: 17px; font-weight: normal;} -div#breadcrumb { border: 0; width: 70%; margin: 0 auto; padding: 25px 0; font-family: Verdana; text-align: center;} -span.breadcrumbelement { margin: 10px; margin-right: 0; cursor: pointer;} -span.inside { background-image: url('%appswebroot%/gallery/img/breadcrumb.png'); padding-left: 20px; background-position: left; background-repeat: no-repeat;} diff --git a/apps/gallery/css/styles.css b/apps/gallery/css/styles.css deleted file mode 100644 index 63f645662dd..00000000000 --- a/apps/gallery/css/styles.css +++ /dev/null @@ -1,14 +0,0 @@ -#gallerycontent { margin-top: 2.8em; overflow: visible; } -#g-settings {position: absolute; left: 13.5em; top: 0;} -div#controls input[type=button] { -webkit-transition: opacity 0.5s ease-in-out; -moz-transition: opacity 0.5s ease-in-out; -o-transition: opacity 0.5s ease-in-out; opacity: 1; position:absolute; right:13.5em; top:0em; } -input[type=button]:disabled { opacity: 0.5 } -.ui-dialog tr {background-color: #eee;} -.ui-dialog input {width: 90%;} - -div.gallery_div {position:relative; display: inline-block; height: 150px; width: 150px; margin: 5px;} -div.miniature_border {position:absolute; height: 150px; -moz-transition-duration: 0.2s; -o-transition-duration:0.2s; -webkit-transition-duration: .2s; background-position: 50%;} -div.line {display:inline-block; border: 0; width: auto; height: 160px} -div.gallery_div img{position:absolute; top: 1; left: 0; -moz-transition-duration: 0.3s; -o-transition-duration:0.3s; -webkit-transition-duration: 0.3s; height:150px; 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; right:-5px; height:auto; padding: 5px; width: 140px; background-color: black; color: white; -webkit-transition: opacity 0.5s; z-index:1000; border-radius: 7px} -div.visible { opacity: 0.8;} diff --git a/apps/gallery/css/supersized.css b/apps/gallery/css/supersized.css deleted file mode 100644 index 57ee7e23a50..00000000000 --- a/apps/gallery/css/supersized.css +++ /dev/null @@ -1,25 +0,0 @@ -/* - - Supersized - Fullscreen Slideshow jQuery Plugin - Version : 3.2.7 - Site : www.buildinternet.com/project/supersized - - Author : Sam Dunn - Company : One Mighty Roar (www.onemightyroar.com) - License : MIT License / GPL License - -*/ -#supersized-holder #supersized-loader { display:none; position:absolute; top:50%; left:50%; z-index:0; width:60px; height:60px; margin:-30px 0 0 -30px; text-indent:-999em; background:url('%appswebroot%/gallery/img/supersized/progress.gif') no-repeat center center;} - -#supersized-holder #supersized { visibility:hidden; display:block; position:fixed; left:0; top:0; overflow:hidden; z-index:200; height:100%; width:100%; } -#supersized-holder #supersized img { width:auto; height:auto; position:relative; display:none; outline:none; border:none; } -#supersized-holder #supersized.speed img { -ms-interpolation-mode:nearest-neighbor; image-rendering: -moz-crisp-edges; } /*Speed*/ -#supersized-holder #supersized.quality img { -ms-interpolation-mode:bicubic; image-rendering: optimizeQuality; } /*Quality*/ - -#supersized-holder #supersized li { display:block; list-style:none; z-index:150; position:fixed; overflow:hidden; top:0; left:0; width:100%; height:100%; background:#111; } -#supersized-holder #supersized a { width:100%; height:100%; display:block; } -#supersized-holder #supersized li.prevslide { z-index:160; } -#supersized-holder #supersized li.activeslide { z-index:170; } -#supersized-holder #supersized li.image-loading { background:#111 url('%appswebroot%/gallery/img/supersized/progress.gif') no-repeat center center; width:100%; height:100%; } -#supersized-holder #supersized li.image-loading img{ visibility:hidden; } -#supersized-holder #supersized li.prevslide img, #supersized-holder #supersized li.activeslide img{ display:inline; } diff --git a/apps/gallery/css/supersized.shutter.css b/apps/gallery/css/supersized.shutter.css deleted file mode 100644 index 428c254c3b2..00000000000 --- a/apps/gallery/css/supersized.shutter.css +++ /dev/null @@ -1,74 +0,0 @@ -/* - - Supersized - Fullscreen Slideshow jQuery Plugin - Version : 3.2.7 - Site : www.buildinternet.com/project/supersized - - Theme : Shutter 1.2 - Author : Sam Dunn - Company : One Mighty Roar (www.onemightyroar.com) - License : MIT License / GPL License - -*/ - -/* Controls Bar -----------------------------*/ -#slideshow-content #slideshow-controls-wrapper { margin:0 auto; height:42px; width:100%; bottom:0px; left:0; z-index:204; background:url('%appswebroot%/gallery/img/supersized/nav-bg.png') repeat-x; position:fixed; } -#slideshow-content #slideshow-controls { overflow:hidden; height:100%; position:relative; text-align:left; z-index:205; } -#slideshow-content #slidecounter { float:left; color:#999; font:14px "Helvetica Neue", Helvetica, Arial, sans-serif; text-shadow:#000 0 -1px 0; margin:0px 10px 0 15px; line-height:42px; } -#slideshow-content #slidecaption { overflow:hidden; float:left; color:#FFF; font:400 14px "Helvetica Neue", Helvetica, Arial, sans-serif; text-shadow:#000 1px 1px 2px; margin:0 20px 0 0; line-height:42px; } - -/*#navigation { float:right; margin:0px 20px 0 0; }*/ -#slideshow-content #play-button{ float:left; margin-top:1px;border-right:1px solid #333; background:url('%appswebroot%/gallery/img/supersized/bg-hover.png') repeat-x 0 44px; } -#slideshow-content #play-button:hover{ background-position:0 1px; cursor:pointer; } - -#slideshow-content #prevslide, #nextslide{ position:fixed; height:43px; width:43px; top:50%; margin-top:-21px; opacity:0.6; z-index:204; } -#slideshow-content #prevslide{ left:10px; background:url('%appswebroot%/gallery/img/supersized/back.png'); } -#slideshow-content #nextslide{ right:10px; background:url('%appswebroot%/gallery/img/supersized/forward.png'); } -#slideshow-content #prevslide:active, #nextslide:active{ margin-top:-19px; } -#slideshow-content #prevslide:hover, #nextslide:hover{ cursor:pointer; } - -#slideshow-content ul#slide-list{ padding:15px 0; float:left; position:absolute; left:50%; } -#slideshow-content ul#slide-list li{ list-style:none; width:12px; height:12px; float:left; margin:0 5px 0 0; } -#slideshow-content ul#slide-list li.current-slide a, ul#slide-list li.current-slide a:hover{ background-position:0 0px; } -#slideshow-content ul#slide-list li a{ display:block; width:12px; height:12px; background:url('%appswebroot%/gallery/img/supersized/nav-dot.png') no-repeat 0 -24px; } -#slideshow-content ul#slide-list li a:hover{ background-position:0 -12px; cursor:pointer; } - -#slideshow-content #tray-button{ float:right; margin-top:1px; border-left:1px solid #333; background:url('%appswebroot%/gallery/img/supersized/bg-hover.png') repeat-x 0 44px; } -#slideshow-content #tray-button:hover{ background-position:0 1px; cursor:pointer; } - - -/* Progress Bar -----------------------------*/ -#slideshow-content #progress-back{ z-index:205; position:fixed; bottom:42px; left:0; height:8px; width:100%; background:url('%appswebroot%/gallery/img/supersized/progress-back.png') repeat-x; } -#slideshow-content #progress-bar{ position:relative; height:8px; width:100%; background:url('%appswebroot%/gallery/img/supersized/progress-bar.png') repeat-x; } - - -/* Thumbnail Navigation -----------------------------*/ -#slideshow-content #nextthumb, #slideshow-content #prevthumb { z-index:202; display:none; position:fixed; bottom:61px; height:75px; width:100px; overflow:hidden; background:#ddd; border:1px solid #fff; -webkit-box-shadow:0 0 5px #000; } -#slideshow-content #nextthumb { right:12px; } -#slideshow-content #prevthumb { left:12px; } -#slideshow-content #nextthumb img, #slideshow-content #prevthumb img { width:150px; height:auto; } -#slideshow-content #nextthumb:active, #slideshow-content #prevthumb:active { bottom:59px; } -#slideshow-content #nextthumb:hover, #slideshow-content #prevthumb:hover { cursor:pointer; } - - -/* Thumbnail Tray -----------------------------*/ -#slideshow-content #thumb-tray{ position:fixed; z-index:203; bottom:0; left:0; background:url('%appswebroot%/gallery/img/supersized/bg-black.png'); height:150px; width:100%; overflow:hidden; text-align:center; -moz-box-shadow: 0px 0px 4px #000; -webkit-box-shadow: 0px 0px 4px #000; box-shadow: 0px 0px 4px #000; } - -#slideshow-content #thumb-back, #slideshow-content #thumb-forward{ position:absolute; z-index:5; bottom:42px; height:108px; width:40px; } -#slideshow-content #thumb-back{ left:0; background: url('%appswebroot%/gallery/img/supersized/thumb-back.png') no-repeat center center;} -#slideshow-content #thumb-forward{ right:0; background:url('%appswebroot%/gallery/img/supersized/thumb-forward.png') no-repeat center center;} -#slideshow-content #thumb-back:hover, #slideshow-content #thumb-forward:hover{ cursor:pointer; background-color:rgba(256,256,256, 0.1); } -#slideshow-content #thumb-back:hover{ border-right:1px solid rgba(256,256,256, 0.2); } -#slideshow-content #thumb-forward:hover{ border-left:1px solid rgba(256,256,256, 0.2); } - - -#slideshow-content ul#thumb-list{ display:inline-block; list-style:none; position:relative; left:0px; padding:0 0px; } -#slideshow-content ul#thumb-list li{ background:#111; list-style:none; display:inline; width:150px; height:108px; overflow:hidden; float:left; margin:0; } -#slideshow-content ul#thumb-list li img { width:200px; height:auto; opacity:0.5; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; filter:alpha(opacity=60); -webkit-transition: all 100ms ease-in-out; -moz-transition: all 100ms ease-in-out; -o-transition: all 100ms ease-in-out; -ms-transition: all 100ms ease-in-out; transition: all 100ms ease-in-out; } -#slideshow-content ul#thumb-list li.current-thumb img, #slideshow-content ul#thumb-list li:hover img{ opacity:1; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter:alpha(opacity=100); } -#slideshow-content ul#thumb-list li:hover{ cursor:pointer; } - diff --git a/apps/gallery/img/breadcrumb.png b/apps/gallery/img/breadcrumb.png Binary files differdeleted file mode 100644 index adbef1e576d..00000000000 --- a/apps/gallery/img/breadcrumb.png +++ /dev/null diff --git a/apps/gallery/img/delete.png b/apps/gallery/img/delete.png Binary files differdeleted file mode 100644 index fa8e18183ed..00000000000 --- a/apps/gallery/img/delete.png +++ /dev/null diff --git a/apps/gallery/img/loading.gif b/apps/gallery/img/loading.gif Binary files differdeleted file mode 100644 index 5b33f7e54f4..00000000000 --- a/apps/gallery/img/loading.gif +++ /dev/null diff --git a/apps/gallery/img/rename.png b/apps/gallery/img/rename.png Binary files differdeleted file mode 100644 index 3af6840071b..00000000000 --- a/apps/gallery/img/rename.png +++ /dev/null diff --git a/apps/gallery/img/share.png b/apps/gallery/img/share.png Binary files differdeleted file mode 100644 index 099e4d6ab35..00000000000 --- a/apps/gallery/img/share.png +++ /dev/null diff --git a/apps/gallery/img/supersized/back.png b/apps/gallery/img/supersized/back.png Binary files differdeleted file mode 100644 index f0e809ece09..00000000000 --- a/apps/gallery/img/supersized/back.png +++ /dev/null diff --git a/apps/gallery/img/supersized/bg-black.png b/apps/gallery/img/supersized/bg-black.png Binary files differdeleted file mode 100644 index e7ce54412b8..00000000000 --- a/apps/gallery/img/supersized/bg-black.png +++ /dev/null diff --git a/apps/gallery/img/supersized/bg-hover.png b/apps/gallery/img/supersized/bg-hover.png Binary files differdeleted file mode 100644 index 1ca2022e106..00000000000 --- a/apps/gallery/img/supersized/bg-hover.png +++ /dev/null diff --git a/apps/gallery/img/supersized/button-tray-down.png b/apps/gallery/img/supersized/button-tray-down.png Binary files differdeleted file mode 100644 index 15645ae34ef..00000000000 --- a/apps/gallery/img/supersized/button-tray-down.png +++ /dev/null diff --git a/apps/gallery/img/supersized/button-tray-up.png b/apps/gallery/img/supersized/button-tray-up.png Binary files differdeleted file mode 100644 index 0ee91d25ba0..00000000000 --- a/apps/gallery/img/supersized/button-tray-up.png +++ /dev/null diff --git a/apps/gallery/img/supersized/forward.png b/apps/gallery/img/supersized/forward.png Binary files differdeleted file mode 100644 index a6408f75118..00000000000 --- a/apps/gallery/img/supersized/forward.png +++ /dev/null diff --git a/apps/gallery/img/supersized/nav-bg.png b/apps/gallery/img/supersized/nav-bg.png Binary files differdeleted file mode 100644 index c1a9fc170f4..00000000000 --- a/apps/gallery/img/supersized/nav-bg.png +++ /dev/null diff --git a/apps/gallery/img/supersized/nav-dot.png b/apps/gallery/img/supersized/nav-dot.png Binary files differdeleted file mode 100644 index 4319ed04213..00000000000 --- a/apps/gallery/img/supersized/nav-dot.png +++ /dev/null diff --git a/apps/gallery/img/supersized/pause.png b/apps/gallery/img/supersized/pause.png Binary files differdeleted file mode 100644 index 1e81d1856b6..00000000000 --- a/apps/gallery/img/supersized/pause.png +++ /dev/null diff --git a/apps/gallery/img/supersized/play.png b/apps/gallery/img/supersized/play.png Binary files differdeleted file mode 100644 index df94a034986..00000000000 --- a/apps/gallery/img/supersized/play.png +++ /dev/null diff --git a/apps/gallery/img/supersized/progress-back.png b/apps/gallery/img/supersized/progress-back.png Binary files differdeleted file mode 100644 index 95992f1410c..00000000000 --- a/apps/gallery/img/supersized/progress-back.png +++ /dev/null diff --git a/apps/gallery/img/supersized/progress-bar.png b/apps/gallery/img/supersized/progress-bar.png Binary files differdeleted file mode 100644 index 9758d178831..00000000000 --- a/apps/gallery/img/supersized/progress-bar.png +++ /dev/null diff --git a/apps/gallery/img/supersized/progress.gif b/apps/gallery/img/supersized/progress.gif Binary files differdeleted file mode 100644 index f3e45e0569c..00000000000 --- a/apps/gallery/img/supersized/progress.gif +++ /dev/null diff --git a/apps/gallery/img/supersized/supersized-logo.png b/apps/gallery/img/supersized/supersized-logo.png Binary files differdeleted file mode 100644 index cc106293292..00000000000 --- a/apps/gallery/img/supersized/supersized-logo.png +++ /dev/null diff --git a/apps/gallery/img/supersized/thumb-back.png b/apps/gallery/img/supersized/thumb-back.png Binary files differdeleted file mode 100644 index b86a9110ee4..00000000000 --- a/apps/gallery/img/supersized/thumb-back.png +++ /dev/null diff --git a/apps/gallery/img/supersized/thumb-forward.png b/apps/gallery/img/supersized/thumb-forward.png Binary files differdeleted file mode 100644 index bff5ec1108a..00000000000 --- a/apps/gallery/img/supersized/thumb-forward.png +++ /dev/null diff --git a/apps/gallery/index.php b/apps/gallery/index.php deleted file mode 100644 index ce79f8f8782..00000000000 --- a/apps/gallery/index.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php - -/** -* ownCloud - gallery application -* -* @author Bartek Przybylski -* @copyright 2012 Bartek Przybylski bartek@alefzero.eu -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - - - -OCP\User::checkLoggedIn(); -OCP\App::checkAppEnabled('gallery'); -OCP\App::setActiveNavigationEntry( 'gallery_index' ); - -OCP\Util::addStyle('files', 'files'); -OCP\Util::addStyle('gallery', 'styles'); -OCP\Util::addScript('gallery', 'pictures'); -OCP\Util::addStyle( 'gallery', 'supersized' ); -OCP\Util::addStyle( 'gallery', 'supersized.shutter' ); -OCP\Util::addScript('gallery', 'slideshow'); -OCP\Util::addScript('gallery', 'jquery.easing.min'); -OCP\Util::addScript('gallery', 'supersized.3.2.7.min'); -OCP\Util::addScript('gallery', 'supersized.shutter.min'); - -include 'gallery/lib/tiles.php'; - -$root = !empty($_GET['root']) ? $_GET['root'] : '/'; -$images = \OC_FileCache::searchByMime('image', null, '/'.\OCP\USER::getUser().'/files'.$root); -sort($images); - -$tl = new \OC\Pictures\TilesLine(); -$ts = new \OC\Pictures\TileStack(array(), ''); -$previous_element = @$images[0]; - -$root_images = array(); -$second_level_images = array(); - -$fallback_images = array(); // if the folder only cotains subfolders with images -> these are taken for the stack preview - -for($i = 0; $i < count($images); $i++) { - $prev_dir_arr = explode('/', $previous_element); - $dir_arr = explode('/', $images[$i]); - - if(count($dir_arr) == 1) { // getting the images in this directory - $root_images[] = $root.$images[$i]; - } else { - if(strcmp($prev_dir_arr[0], $dir_arr[0]) != 0) { // if we entered a new directory - if(count($second_level_images) == 0) { // if we don't have images in this directory - if(count($fallback_images) != 0) { // but have fallback_images - $tl->addTile(new \OC\Pictures\TileStack($fallback_images, $prev_dir_arr[0])); - $fallback_images = array(); - } - } else { // if we collected images for this directory - $tl->addTile(new \OC\Pictures\TileStack($second_level_images, $prev_dir_arr[0])); - $fallback_images = array(); - $second_level_images = array(); - } - } - if (count($dir_arr) == 2) { // These are the pics in our current subdir - $second_level_images[] = $root.$images[$i]; - $fallback_images = array(); - } else { // These are images from the deeper directories - if(count($second_level_images) == 0) { - $fallback_images[] = $root.$images[$i]; - } - } - // have us a little something to compare against - $previous_element = $images[$i]; - } -} - -// if last element in the directory was a directory we don't want to miss it :) -if(count($second_level_images)>0) { - $tl->addTile(new \OC\Pictures\TileStack($second_level_images, $prev_dir_arr[0])); -} - -// if last element in the directory was a directory with no second_level_images we also don't want to miss it ... -if(count($fallback_images)>0) { - $tl->addTile(new \OC\Pictures\TileStack($fallback_images, $prev_dir_arr[0])); -} - -// and finally our images actually stored in the root folder -for($i = 0; $i<count($root_images); $i++) { - $tl->addTile(new \OC\Pictures\TileSingle($root_images[$i])); -} - -$tmpl = new OCP\Template( 'gallery', 'index', 'user' ); -$tmpl->assign('root', $root, false); -$tmpl->assign('tl', $tl, false); -$tmpl->printPage(); diff --git a/apps/gallery/js/albums.js b/apps/gallery/js/albums.js deleted file mode 100644 index 62d3f783ece..00000000000 --- a/apps/gallery/js/albums.js +++ /dev/null @@ -1,101 +0,0 @@ -Albums={ - // album item in this array should look as follow - // {name: string, - // numOfCovers: int} - // - // previews array should be an array of base64 decoded images - // to display to user as preview picture when scrolling throught - // the album cover - albums:new Array(), - photos:new Array(), - shared: false, - recursive: false, - token: '', - // add simply adds new album to internal structure - // however albums names must be unique so other - // album with the same name wont be insered, - // and false will be returned - // true on success - add: function(album_name, num, path) { - if (Albums.albums[album_name] != undefined) return false; - Albums.albums[album_name] = {name: album_name, numOfCovers: num, path:path}; - return true; - }, - // remove element with given name - // returns remove element or undefined if no such element was present - remove: function(name) { - var i = -1, tmp = 0; - for (var a in Albums.albums) { - if (a.name == name) { - i = tmp; - break; - } - tmp++; - } - if (i != -1) { - return Albums.albums.splice(i,1); - } - return undefined; - }, - // return element which match given name - // of undefined if such element do not exist - find: function(name) { - return Albums.albums[name]; - }, - // displays gallery in linear representation - // on given element, and apply default styles for gallery - display: function(element) { - var displayTemplate = '<div class="gallery_box album"><div class="dummy"></div><a class="view"><div class="gallery_album_cover"></div></a><h1></h1></div>'; - for (var i in Albums.albums) { - var a = Albums.albums[i]; - var local=$(displayTemplate); - local.attr('title', a.name); - local.attr('data-path', a.path); - local.attr('data-album',a.name); - $(".gallery_album_decoration a.rename", local).bind('click', {name: a.name},function(name,event){ - event.preventDefault(); - event.stopPropagation(); - galleryRename(name); - }.bind(null,a.name)); - $(".gallery_album_decoration a.remove", local).bind('click', {name: a.name},function(name,event){ - event.preventDefault(); - event.stopPropagation(); - galleryRemove(name); - }.bind(null,a.name)); - $('h1',local).text(decodeURIComponent(escape(a.name))); - $(".gallery_album_cover", local).attr('title',decodeURIComponent(escape(a.name))); - $(".gallery_album_cover", local).css('background-repeat', 'no-repeat'); - $(".gallery_album_cover", local).css('background-position', '0'); - $(".gallery_album_cover", local).css('background-image','url("'+OC.filePath('gallery','ajax','galleryOp.php')+'&operation=get_covers&albumname='+escape(a.name)+'")'); - $(".gallery_album_cover", local).mousemove(function(event) { - var albumMetadata = Albums.find(this.title); - if (albumMetadata == undefined) { - return; - } - var x = Math.floor(event.offsetX/(this.offsetWidth/albumMetadata.numOfCovers)); - x *= this.offsetWidth; - if (x < 0 || isNaN(x)) x=0; - $(this).css('background-position', -x+'px 0'); - }); - element.append(local); - } - var photoDisplayTemplate = '<div class="gallery_box"><div class="dummy"></div><div><a rel="images" href="'+OC.linkTo('gallery/ajax','viewImage.php')+'?img=URLPATH"><img src="'+OC.filePath('gallery','ajax','thumbnail.php')+'?img=IMGPATH"></a></div></div>'; - for (var i in Albums.photos) { - element.append(photoDisplayTemplate.replace("IMGPATH", escape(Albums.photos[i])).replace("URLPATH", escape(Albums.photos[i]))); - } - $("a[rel=images]").fancybox({ - 'titlePosition': 'inside' - }); - }, - rename: function(element, new_name) { - if (new_name) { - $(element).attr("data-album", new_name); - $("a.view", element).attr("href", "?view="+new_name); - $("h1", element).text(new_name); - } - }, - clear: function(element) { - Albums.albums = new Array(); - element.innerHTML = ''; - } -} diff --git a/apps/gallery/js/jquery.easing.min.js b/apps/gallery/js/jquery.easing.min.js deleted file mode 100644 index bbf8410391a..00000000000 --- a/apps/gallery/js/jquery.easing.min.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ - * - * Uses the built in easing capabilities added In jQuery 1.1 - * to offer multiple easing options - * - * TERMS OF USE - jQuery Easing - * - * Open source under the BSD License. - * - * Copyright å© 2008 George McGinley Smith - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * Neither the name of the author nor the names of contributors may be used to endorse - * or promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * -*/ - -jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}}); - -/* - * - * TERMS OF USE - EASING EQUATIONS - * - * Open source under the BSD License. - * - * Copyright å© 2001 Robert Penner - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * Neither the name of the author nor the names of contributors may be used to endorse - * or promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - */
\ No newline at end of file diff --git a/apps/gallery/js/pictures.js b/apps/gallery/js/pictures.js deleted file mode 100644 index 47f727e0dee..00000000000 --- a/apps/gallery/js/pictures.js +++ /dev/null @@ -1,68 +0,0 @@ -function constructSharingPath() { - return document.location.protocol + '//' + document.location.host + OC.linkTo('', 'public.php') + '?service=gallery&token=' + Albums.token; -} - -function shareGallery() { - var existing_token = ''; - //if (Albums.token) - // existing_token = constructSharingPath(); - var form_fields = [{text: 'Share', name: 'share', type: 'checkbox', value: false}, - {text: 'Share recursive', name: 'recursive', type: 'checkbox', value: false}, - {text: 'Shared gallery address', name: 'address', type: 'text', value: ''}]; - OC.dialogs.form(form_fields, t('gallery', 'Share gallery'), function(values){ - var p = ''; - for (var i in paths) p += paths[i]+'/'; - if (p == '') p = '/'; - alert(p); - $.getJSON(OC.filePath('gallery', 'ajax', 'galleryOp.php'), {operation: 'share', path: p, share: values[0].value, recursive: values[1].value}, function(r) { - if (r.status == 'success') { - Albums.shared = r.sharing; - if (Albums.shared) { - Albums.token = r.token; - Albums.recursive = r.recursive; - } else { - Albums.token = ''; - Albums.recursive = false; - } - var actual_addr = ''; - if (Albums.token) - actual_addr = constructSharingPath(); - $('input[name="address"]').val(actual_addr); - } else { - OC.dialogs.alert(t('gallery', 'Error: ') + r.cause, t('gallery', 'Internal error')); - } - }); - }); -} - -function explode(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 deplode(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'); - } - }); -} - -function openNewGal(album_name) { - root = root + decodeURIComponent(album_name) + "/"; - var url = window.location.protocol+"//"+window.location.hostname+OC.linkTo('gallery', 'index.php'); - url = url + "?root="+encodeURIComponent(root); - - window.location = url; -} diff --git a/apps/gallery/js/scanner.js b/apps/gallery/js/scanner.js deleted file mode 100644 index 804ee9d229b..00000000000 --- a/apps/gallery/js/scanner.js +++ /dev/null @@ -1,34 +0,0 @@ -Scanner={ - albumsFound:0, - eventSource:null, - albumsScanned:0, - scanAlbums:function(callback){ - $('#scanprogressbar').progressbar({value:0}); - $('#scanprogressbar').fadeIn(); - $('#scan input.start').hide(); - $('#scan input.stop').show(); - Scanner.albumsScanned=0; - Scanner.eventSource=new OC.EventSource(OC.linkTo('gallery', 'ajax/galleryOp.php'),{operation:'scan'}); - Scanner.eventSource.listen('count', function(total){Scanner.albumsFound=total;}); - Scanner.eventSource.listen('scanned', function(data) { - Scanner.albumsScanned++; - var progress=(Scanner.albumsScanned/Scanner.albumsFound)*100; - $('#scanprogressbar').progressbar('value',progress); - }); - Scanner.eventSource.listen('done', function(count){ - $('#scan input.start').show(); - $('#scan input.stop').hide(); - $('#scanprogressbar').fadeOut(); - returnToElement(0); - }); - if (callback) - callback(); - }, - stop:function() { - Scanner.eventSource.close(); - $('#scan input.start').show(); - $('#scan input.stop').hide(); - $('#scanprogressbar').fadeOut(); - } -} - diff --git a/apps/gallery/js/sharing.js b/apps/gallery/js/sharing.js deleted file mode 100644 index 679e39578aa..00000000000 --- a/apps/gallery/js/sharing.js +++ /dev/null @@ -1,57 +0,0 @@ -$(document).ready(function() { - $.getJSON(OC.filePath('gallery', 'ajax', 'sharing.php'), {operation: 'get_gallery', token: TOKEN}, albumClickHandler); -}); - -var paths = []; -var counter = 0; - -function returnTo(num) { - while (num != counter) { - paths.pop(); - $('.breadcrumbelement:last').remove(); - counter--; - } - path = ''; - for (var e in paths) path += '/' + paths[e]; - $.getJSON(OC.filePath('gallery', 'ajax', 'sharing.php'), {operation: 'get_gallery', token: TOKEN, path: path}, function(r) { - albumClickHandler(r); - }); -} - -function albumClickHandler(r) { - var element = $('div#gallery_list'); - element.html(''); - var album_template = '<div class="gallery_box"><div><a rel="images"><img src="' + OC.filePath('gallery', 'ajax', 'sharing.php') + '?token='+TOKEN+'&operation=get_album_thumbnail&albumname=IMGPATH"></a></div><h1></h1></div>'; - - for (var i in r.albums) { - var a = r.albums[i]; - var local = $(album_template.replace('IMGPATH', encodeURIComponent(a))); - local.attr('title', a); - $('h1', local).html(a); - element.append(local); - } - - $('div.gallery_box').each(function(i, element) { - $(element).click(function() { - paths.push($(this).attr('title')); - path = ''; - for (var e in paths) path += '/' + paths[e]; - $.getJSON(OC.filePath('gallery', 'ajax', 'sharing.php'), {operation: 'get_gallery', token: TOKEN, path: path}, function(r) { - var name = paths[paths.length-1]; - counter++; - var d = '<span class="breadcrumbelement" onclick="javascript:returnTo('+counter+');return false;">'+name+'</span>'; - d = $(d).addClass('inside'); - $('#breadcrumb').append(d); - albumClickHandler(r); - }); - }); - }); - - var pat = ''; - for (var a in paths) pat += '/'+paths[a]; - var photo_template = '<div class="gallery_box"><div><a rel="images" href="*HREF*" target="_blank"><img src="' + OC.filePath('gallery', 'ajax', 'sharing.php') + '?token='+TOKEN+'&operation=get_thumbnail&img=IMGPATH"></a></div></div>'; - for (var a in r.photos) { - var local = photo_template.replace('IMGPATH', encodeURIComponent(r.photos[a])).replace('*HREF*', OC.filePath('gallery', 'ajax', 'sharing.php') + '?token='+TOKEN+'&operation=get_photo&photo='+encodeURIComponent(r.photos[a])); - element.append(local); - } -} diff --git a/apps/gallery/js/slideshow.js b/apps/gallery/js/slideshow.js deleted file mode 100644 index cc5dfc44a26..00000000000 --- a/apps/gallery/js/slideshow.js +++ /dev/null @@ -1,58 +0,0 @@ -$(document).ready(function(){ - - $.endSlideshow = function () { - if($.supersized.vars.slideshow_interval){ - clearInterval($.supersized.vars.slideshow_interval); - }; - - $('#supersized-holder').remove(); - $('#slideshow-content').hide(); - $('#thumb-list').remove(); - } - - // add slideshow in holder div - $('#slideshow input.start').click(function(){ - - var images=[]; - $('#gallerycontent div a').each(function(i,a){ - images.push({image : a.href, title : a.title.replace(/</, '<').replace(/>/, '>'), thumb : a.children[0].src, url : 'javascript:$.endSlideshow()'}); - }); - - if (images.length <= 0) { - return; - } - - $('body').append("<div id='supersized-holder'></div>"); - $('#supersized-loader').remove(); - $('#supersized').remove(); - $('#supersized-holder').append("<div id='supersized-loader'></div><ul id='supersized'></ul>"); - $('#supersized').show(); - $('#slideshow-content').show(); - - - jQuery(function($){ - - $.supersized({ - - // Functionality - slide_interval : 3000, // Length between transitions - transition : 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left - transition_speed : 700, // Speed of transition - - // Components - slide_links : 'blank', // Individual links for each slide (Options: false, 'num', 'name', 'blank') - slides : images // Slideshow Images - - }); - }); - - }); - - //close slideshow on esc and remove holder - $(document).keyup(function(e) { - if (e.keyCode == 27) { // esc - $.endSlideshow(); - } - }); - -}); diff --git a/apps/gallery/js/supersized.3.2.7.js b/apps/gallery/js/supersized.3.2.7.js deleted file mode 100644 index f5a1c0bbc2d..00000000000 --- a/apps/gallery/js/supersized.3.2.7.js +++ /dev/null @@ -1,930 +0,0 @@ -/* - - Supersized - Fullscreen Slideshow jQuery Plugin - Version : 3.2.7 - Site : www.buildinternet.com/project/supersized - - Author : Sam Dunn - Company : One Mighty Roar (www.onemightyroar.com) - License : MIT License / GPL License - -*/ - -(function($){ - - /* Place Supersized Elements - ----------------------------*/ - $(document).ready(function() { - $('body').append('<div id="supersized-loader"></div><ul id="supersized"></ul>'); - }); - - - $.supersized = function(options){ - - /* Variables - ----------------------------*/ - var el = '#supersized', - base = this; - // Access to jQuery and DOM versions of element - base.$el = $(el); - base.el = el; - vars = $.supersized.vars; - // Add a reverse reference to the DOM object - base.$el.data("supersized", base); - api = base.$el.data('supersized'); - - base.init = function(){ - // Combine options and vars - $.supersized.vars = $.extend($.supersized.vars, $.supersized.themeVars); - $.supersized.vars.options = $.extend({},$.supersized.defaultOptions, $.supersized.themeOptions, options); - base.options = $.supersized.vars.options; - - base._build(); - }; - - - /* Build Elements - ----------------------------*/ - base._build = function(){ - // Add in slide markers - var thisSlide = 0, - slideSet = '', - markers = '', - markerContent, - thumbMarkers = '', - thumbImage; - - while(thisSlide <= base.options.slides.length-1){ - //Determine slide link content - switch(base.options.slide_links){ - case 'num': - markerContent = thisSlide; - break; - case 'name': - markerContent = base.options.slides[thisSlide].title; - break; - case 'blank': - markerContent = ''; - break; - } - - slideSet = slideSet+'<li class="slide-'+thisSlide+'"></li>'; - - if(thisSlide == base.options.start_slide-1){ - // Slide links - if (base.options.slide_links)markers = markers+'<li class="slide-link-'+thisSlide+' current-slide"><a>'+markerContent+'</a></li>'; - // Slide Thumbnail Links - if (base.options.thumb_links){ - base.options.slides[thisSlide].thumb ? thumbImage = base.options.slides[thisSlide].thumb : thumbImage = base.options.slides[thisSlide].image; - thumbMarkers = thumbMarkers+'<li class="thumb'+thisSlide+' current-thumb"><img src="'+thumbImage+'"/></li>'; - }; - }else{ - // Slide links - if (base.options.slide_links) markers = markers+'<li class="slide-link-'+thisSlide+'" ><a>'+markerContent+'</a></li>'; - // Slide Thumbnail Links - if (base.options.thumb_links){ - base.options.slides[thisSlide].thumb ? thumbImage = base.options.slides[thisSlide].thumb : thumbImage = base.options.slides[thisSlide].image; - thumbMarkers = thumbMarkers+'<li class="thumb'+thisSlide+'"><img src="'+thumbImage+'"/></li>'; - }; - } - thisSlide++; - } - - if (base.options.slide_links) $(vars.slide_list).html(markers); - if (base.options.thumb_links && vars.thumb_tray.length){ - $(vars.thumb_tray).append('<ul id="'+vars.thumb_list.replace('#','')+'">'+thumbMarkers+'</ul>'); - } - - $(base.el).append(slideSet); - - // Add in thumbnails - if (base.options.thumbnail_navigation){ - // Load previous thumbnail - vars.current_slide - 1 < 0 ? prevThumb = base.options.slides.length - 1 : prevThumb = vars.current_slide - 1; - $(vars.prev_thumb).show().html($("<img/>").attr("src", base.options.slides[prevThumb].image)); - - // Load next thumbnail - vars.current_slide == base.options.slides.length - 1 ? nextThumb = 0 : nextThumb = vars.current_slide + 1; - $(vars.next_thumb).show().html($("<img/>").attr("src", base.options.slides[nextThumb].image)); - } - - base._start(); // Get things started - }; - - - /* Initialize - ----------------------------*/ - base._start = function(){ - - // Determine if starting slide random - if (base.options.start_slide){ - vars.current_slide = base.options.start_slide - 1; - }else{ - vars.current_slide = Math.floor(Math.random()*base.options.slides.length); // Generate random slide number - } - - // If links should open in new window - var linkTarget = base.options.new_window ? ' target="_blank"' : ''; - - // Set slideshow quality (Supported only in FF and IE, no Webkit) - if (base.options.performance == 3){ - base.$el.addClass('speed'); // Faster transitions - } else if ((base.options.performance == 1) || (base.options.performance == 2)){ - base.$el.addClass('quality'); // Higher image quality - } - - // Shuffle slide order if needed - if (base.options.random){ - arr = base.options.slides; - for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x); // Fisher-Yates shuffle algorithm (jsfromhell.com/array/shuffle) - base.options.slides = arr; - } - - /*-----Load initial set of images-----*/ - - if (base.options.slides.length > 1){ - if(base.options.slides.length > 2){ - // Set previous image - vars.current_slide - 1 < 0 ? loadPrev = base.options.slides.length - 1 : loadPrev = vars.current_slide - 1; // If slide is 1, load last slide as previous - var imageLink = (base.options.slides[loadPrev].url) ? "href='" + base.options.slides[loadPrev].url + "'" : ""; - - var imgPrev = $('<img src="'+base.options.slides[loadPrev].image+'"/>'); - var slidePrev = base.el+' li:eq('+loadPrev+')'; - imgPrev.appendTo(slidePrev).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading prevslide'); - - imgPrev.load(function(){ - $(this).data('origWidth', $(this).width()).data('origHeight', $(this).height()); - base.resizeNow(); // Resize background image - }); // End Load - } - } else { - // Slideshow turned off if there is only one slide - base.options.slideshow = 0; - } - - // Set current image - imageLink = (api.getField('url')) ? "href='" + api.getField('url') + "'" : ""; - var img = $('<img src="'+api.getField('image')+'"/>'); - - var slideCurrent= base.el+' li:eq('+vars.current_slide+')'; - img.appendTo(slideCurrent).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading activeslide'); - - img.load(function(){ - base._origDim($(this)); - base.resizeNow(); // Resize background image - base.launch(); - if( typeof theme != 'undefined' && typeof theme._init == "function" ) theme._init(); // Load Theme - }); - - if (base.options.slides.length > 1){ - // Set next image - vars.current_slide == base.options.slides.length - 1 ? loadNext = 0 : loadNext = vars.current_slide + 1; // If slide is last, load first slide as next - imageLink = (base.options.slides[loadNext].url) ? "href='" + base.options.slides[loadNext].url + "'" : ""; - - var imgNext = $('<img src="'+base.options.slides[loadNext].image+'"/>'); - var slideNext = base.el+' li:eq('+loadNext+')'; - imgNext.appendTo(slideNext).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading'); - - imgNext.load(function(){ - $(this).data('origWidth', $(this).width()).data('origHeight', $(this).height()); - base.resizeNow(); // Resize background image - }); // End Load - } - /*-----End load initial images-----*/ - - // Hide elements to be faded in - base.$el.css('visibility','hidden'); - $('.load-item').hide(); - - }; - - - /* Launch Supersized - ----------------------------*/ - base.launch = function(){ - - base.$el.css('visibility','visible'); - $('#supersized-loader').remove(); //Hide loading animation - - // Call theme function for before slide transition - if( typeof theme != 'undefined' && typeof theme.beforeAnimation == "function" ) theme.beforeAnimation('next'); - $('.load-item').show(); - - // Keyboard Navigation - if (base.options.keyboard_nav){ - $(document.documentElement).keyup(function (event) { - - if(vars.in_animation) return false; // Abort if currently animating - - // Left Arrow or Down Arrow - if ((event.keyCode == 37) || (event.keyCode == 40)) { - clearInterval(vars.slideshow_interval); // Stop slideshow, prevent buildup - base.prevSlide(); - - // Right Arrow or Up Arrow - } else if ((event.keyCode == 39) || (event.keyCode == 38)) { - clearInterval(vars.slideshow_interval); // Stop slideshow, prevent buildup - base.nextSlide(); - - // Spacebar - } else if (event.keyCode == 32 && !vars.hover_pause) { - clearInterval(vars.slideshow_interval); // Stop slideshow, prevent buildup - base.playToggle(); - } - - }); - } - - // Pause when hover on image - if (base.options.slideshow && base.options.pause_hover){ - $(base.el).hover(function() { - if(vars.in_animation) return false; // Abort if currently animating - vars.hover_pause = true; // Mark slideshow paused from hover - if(!vars.is_paused){ - vars.hover_pause = 'resume'; // It needs to resume afterwards - base.playToggle(); - } - }, function() { - if(vars.hover_pause == 'resume'){ - base.playToggle(); - vars.hover_pause = false; - } - }); - } - - if (base.options.slide_links){ - // Slide marker clicked - $(vars.slide_list+'> li').click(function(){ - - index = $(vars.slide_list+'> li').index(this); - targetSlide = index + 1; - - base.goTo(targetSlide); - return false; - - }); - } - - // Thumb marker clicked - if (base.options.thumb_links){ - $(vars.thumb_list+'> li').click(function(){ - - index = $(vars.thumb_list+'> li').index(this); - targetSlide = index + 1; - - api.goTo(targetSlide); - return false; - - }); - } - - // Start slideshow if enabled - if (base.options.slideshow && base.options.slides.length > 1){ - - // Start slideshow if autoplay enabled - if (base.options.autoplay && base.options.slides.length > 1){ - vars.slideshow_interval = setInterval(base.nextSlide, base.options.slide_interval); // Initiate slide interval - }else{ - vars.is_paused = true; // Mark as paused - } - - //Prevent navigation items from being dragged - $('.load-item img').bind("contextmenu mousedown",function(){ - return false; - }); - - } - - // Adjust image when browser is resized - $(window).resize(function(){ - base.resizeNow(); - }); - - }; - - - /* Resize Images - ----------------------------*/ - base.resizeNow = function(){ - - return base.$el.each(function() { - // Resize each image seperately - $('img', base.el).each(function(){ - - thisSlide = $(this); - var ratio = (thisSlide.data('origHeight')/thisSlide.data('origWidth')).toFixed(2); // Define image ratio - - // Gather browser size - var browserwidth = base.$el.width(), - browserheight = base.$el.height(), - offset; - - /*-----Resize Image-----*/ - if (base.options.fit_always){ // Fit always is enabled - if ((browserheight/browserwidth) > ratio){ - resizeWidth(); - } else { - resizeHeight(); - } - }else{ // Normal Resize - if ((browserheight <= base.options.min_height) && (browserwidth <= base.options.min_width)){ // If window smaller than minimum width and height - - if ((browserheight/browserwidth) > ratio){ - base.options.fit_landscape && ratio < 1 ? resizeWidth(true) : resizeHeight(true); // If landscapes are set to fit - } else { - base.options.fit_portrait && ratio >= 1 ? resizeHeight(true) : resizeWidth(true); // If portraits are set to fit - } - - } else if (browserwidth <= base.options.min_width){ // If window only smaller than minimum width - - if ((browserheight/browserwidth) > ratio){ - base.options.fit_landscape && ratio < 1 ? resizeWidth(true) : resizeHeight(); // If landscapes are set to fit - } else { - base.options.fit_portrait && ratio >= 1 ? resizeHeight() : resizeWidth(true); // If portraits are set to fit - } - - } else if (browserheight <= base.options.min_height){ // If window only smaller than minimum height - - if ((browserheight/browserwidth) > ratio){ - base.options.fit_landscape && ratio < 1 ? resizeWidth() : resizeHeight(true); // If landscapes are set to fit - } else { - base.options.fit_portrait && ratio >= 1 ? resizeHeight(true) : resizeWidth(); // If portraits are set to fit - } - - } else { // If larger than minimums - - if ((browserheight/browserwidth) > ratio){ - base.options.fit_landscape && ratio < 1 ? resizeWidth() : resizeHeight(); // If landscapes are set to fit - } else { - base.options.fit_portrait && ratio >= 1 ? resizeHeight() : resizeWidth(); // If portraits are set to fit - } - - } - } - /*-----End Image Resize-----*/ - - - /*-----Resize Functions-----*/ - - function resizeWidth(minimum){ - if (minimum){ // If minimum height needs to be considered - if(thisSlide.width() < browserwidth || thisSlide.width() < base.options.min_width ){ - if (thisSlide.width() * ratio >= base.options.min_height){ - thisSlide.width(base.options.min_width); - thisSlide.height(thisSlide.width() * ratio); - }else{ - resizeHeight(); - } - } - }else{ - if (base.options.min_height >= browserheight && !base.options.fit_landscape){ // If minimum height needs to be considered - if (browserwidth * ratio >= base.options.min_height || (browserwidth * ratio >= base.options.min_height && ratio <= 1)){ // If resizing would push below minimum height or image is a landscape - thisSlide.width(browserwidth); - thisSlide.height(browserwidth * ratio); - } else if (ratio > 1){ // Else the image is portrait - thisSlide.height(base.options.min_height); - thisSlide.width(thisSlide.height() / ratio); - } else if (thisSlide.width() < browserwidth) { - thisSlide.width(browserwidth); - thisSlide.height(thisSlide.width() * ratio); - } - }else{ // Otherwise, resize as normal - thisSlide.width(browserwidth); - thisSlide.height(browserwidth * ratio); - } - } - }; - - function resizeHeight(minimum){ - if (minimum){ // If minimum height needs to be considered - if(thisSlide.height() < browserheight){ - if (thisSlide.height() / ratio >= base.options.min_width){ - thisSlide.height(base.options.min_height); - thisSlide.width(thisSlide.height() / ratio); - }else{ - resizeWidth(true); - } - } - }else{ // Otherwise, resized as normal - if (base.options.min_width >= browserwidth){ // If minimum width needs to be considered - if (browserheight / ratio >= base.options.min_width || ratio > 1){ // If resizing would push below minimum width or image is a portrait - thisSlide.height(browserheight); - thisSlide.width(browserheight / ratio); - } else if (ratio <= 1){ // Else the image is landscape - thisSlide.width(base.options.min_width); - thisSlide.height(thisSlide.width() * ratio); - } - }else{ // Otherwise, resize as normal - thisSlide.height(browserheight); - thisSlide.width(browserheight / ratio); - } - } - }; - - /*-----End Resize Functions-----*/ - - if (thisSlide.parents('li').hasClass('image-loading')){ - $('.image-loading').removeClass('image-loading'); - } - - // Horizontally Center - if (base.options.horizontal_center){ - $(this).css('left', (browserwidth - $(this).width())/2); - } - - // Vertically Center - if (base.options.vertical_center){ - $(this).css('top', (browserheight - $(this).height())/2); - } - - }); - - // Basic image drag and right click protection - if (base.options.image_protect){ - - $('img', base.el).bind("contextmenu mousedown",function(){ - return false; - }); - - } - - return false; - - }); - - }; - - - /* Next Slide - ----------------------------*/ - base.nextSlide = function(){ - - if(vars.in_animation || !api.options.slideshow) return false; // Abort if currently animating - else vars.in_animation = true; // Otherwise set animation marker - - clearInterval(vars.slideshow_interval); // Stop slideshow - - var slides = base.options.slides, // Pull in slides array - liveslide = base.$el.find('.activeslide'); // Find active slide - $('.prevslide').removeClass('prevslide'); - liveslide.removeClass('activeslide').addClass('prevslide'); // Remove active class & update previous slide - - // Get the slide number of new slide - vars.current_slide + 1 == base.options.slides.length ? vars.current_slide = 0 : vars.current_slide++; - - var nextslide = $(base.el+' li:eq('+vars.current_slide+')'), - prevslide = base.$el.find('.prevslide'); - - // If hybrid mode is on drop quality for transition - if (base.options.performance == 1) base.$el.removeClass('quality').addClass('speed'); - - - /*-----Load Image-----*/ - - loadSlide = false; - - vars.current_slide == base.options.slides.length - 1 ? loadSlide = 0 : loadSlide = vars.current_slide + 1; // Determine next slide - - var targetList = base.el+' li:eq('+loadSlide+')'; - if (!$(targetList).html()){ - - // If links should open in new window - var linkTarget = base.options.new_window ? ' target="_blank"' : ''; - - imageLink = (base.options.slides[loadSlide].url) ? "href='" + base.options.slides[loadSlide].url + "'" : ""; // If link exists, build it - var img = $('<img src="'+base.options.slides[loadSlide].image+'"/>'); - - img.appendTo(targetList).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading').css('visibility','hidden'); - - img.load(function(){ - base._origDim($(this)); - base.resizeNow(); - }); // End Load - }; - - // Update thumbnails (if enabled) - if (base.options.thumbnail_navigation == 1){ - - // Load previous thumbnail - vars.current_slide - 1 < 0 ? prevThumb = base.options.slides.length - 1 : prevThumb = vars.current_slide - 1; - $(vars.prev_thumb).html($("<img/>").attr("src", base.options.slides[prevThumb].image)); - - // Load next thumbnail - nextThumb = loadSlide; - $(vars.next_thumb).html($("<img/>").attr("src", base.options.slides[nextThumb].image)); - - } - - - - /*-----End Load Image-----*/ - - - // Call theme function for before slide transition - if( typeof theme != 'undefined' && typeof theme.beforeAnimation == "function" ) theme.beforeAnimation('next'); - - //Update slide markers - if (base.options.slide_links){ - $('.current-slide').removeClass('current-slide'); - $(vars.slide_list +'> li' ).eq(vars.current_slide).addClass('current-slide'); - } - - nextslide.css('visibility','hidden').addClass('activeslide'); // Update active slide - - switch(base.options.transition){ - case 0: case 'none': // No transition - nextslide.css('visibility','visible'); vars.in_animation = false; base.afterAnimation(); - break; - case 1: case 'fade': // Fade - nextslide.animate({opacity : 0},0).css('visibility','visible').animate({opacity : 1, avoidTransforms : false}, base.options.transition_speed, function(){ base.afterAnimation(); }); - break; - case 2: case 'slideTop': // Slide Top - nextslide.animate({top : -base.$el.height()}, 0 ).css('visibility','visible').animate({ top:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); }); - break; - case 3: case 'slideRight': // Slide Right - nextslide.animate({left : base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); }); - break; - case 4: case 'slideBottom': // Slide Bottom - nextslide.animate({top : base.$el.height()}, 0 ).css('visibility','visible').animate({ top:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); }); - break; - case 5: case 'slideLeft': // Slide Left - nextslide.animate({left : -base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); }); - break; - case 6: case 'carouselRight': // Carousel Right - nextslide.animate({left : base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); }); - liveslide.animate({ left: -base.$el.width(), avoidTransforms : false }, base.options.transition_speed ); - break; - case 7: case 'carouselLeft': // Carousel Left - nextslide.animate({left : -base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); }); - liveslide.animate({ left: base.$el.width(), avoidTransforms : false }, base.options.transition_speed ); - break; - } - return false; - }; - - - /* Previous Slide - ----------------------------*/ - base.prevSlide = function(){ - - if(vars.in_animation || !api.options.slideshow) return false; // Abort if currently animating - else vars.in_animation = true; // Otherwise set animation marker - - clearInterval(vars.slideshow_interval); // Stop slideshow - - var slides = base.options.slides, // Pull in slides array - liveslide = base.$el.find('.activeslide'); // Find active slide - $('.prevslide').removeClass('prevslide'); - liveslide.removeClass('activeslide').addClass('prevslide'); // Remove active class & update previous slide - - // Get current slide number - vars.current_slide == 0 ? vars.current_slide = base.options.slides.length - 1 : vars.current_slide-- ; - - var nextslide = $(base.el+' li:eq('+vars.current_slide+')'), - prevslide = base.$el.find('.prevslide'); - - // If hybrid mode is on drop quality for transition - if (base.options.performance == 1) base.$el.removeClass('quality').addClass('speed'); - - - /*-----Load Image-----*/ - - loadSlide = vars.current_slide; - - var targetList = base.el+' li:eq('+loadSlide+')'; - if (!$(targetList).html()){ - // If links should open in new window - var linkTarget = base.options.new_window ? ' target="_blank"' : ''; - imageLink = (base.options.slides[loadSlide].url) ? "href='" + base.options.slides[loadSlide].url + "'" : ""; // If link exists, build it - var img = $('<img src="'+base.options.slides[loadSlide].image+'"/>'); - - img.appendTo(targetList).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading').css('visibility','hidden'); - - img.load(function(){ - base._origDim($(this)); - base.resizeNow(); - }); // End Load - }; - - // Update thumbnails (if enabled) - if (base.options.thumbnail_navigation == 1){ - - // Load previous thumbnail - //prevThumb = loadSlide; - loadSlide == 0 ? prevThumb = base.options.slides.length - 1 : prevThumb = loadSlide - 1; - $(vars.prev_thumb).html($("<img/>").attr("src", base.options.slides[prevThumb].image)); - - // Load next thumbnail - vars.current_slide == base.options.slides.length - 1 ? nextThumb = 0 : nextThumb = vars.current_slide + 1; - $(vars.next_thumb).html($("<img/>").attr("src", base.options.slides[nextThumb].image)); - } - - /*-----End Load Image-----*/ - - - // Call theme function for before slide transition - if( typeof theme != 'undefined' && typeof theme.beforeAnimation == "function" ) theme.beforeAnimation('prev'); - - //Update slide markers - if (base.options.slide_links){ - $('.current-slide').removeClass('current-slide'); - $(vars.slide_list +'> li' ).eq(vars.current_slide).addClass('current-slide'); - } - - nextslide.css('visibility','hidden').addClass('activeslide'); // Update active slide - - switch(base.options.transition){ - case 0: case 'none': // No transition - nextslide.css('visibility','visible'); vars.in_animation = false; base.afterAnimation(); - break; - case 1: case 'fade': // Fade - nextslide.animate({opacity : 0},0).css('visibility','visible').animate({opacity : 1, avoidTransforms : false}, base.options.transition_speed, function(){ base.afterAnimation(); }); - break; - case 2: case 'slideTop': // Slide Top (reverse) - nextslide.animate({top : base.$el.height()}, 0 ).css('visibility','visible').animate({ top:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); }); - break; - case 3: case 'slideRight': // Slide Right (reverse) - nextslide.animate({left : -base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); }); - break; - case 4: case 'slideBottom': // Slide Bottom (reverse) - nextslide.animate({top : -base.$el.height()}, 0 ).css('visibility','visible').animate({ top:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); }); - break; - case 5: case 'slideLeft': // Slide Left (reverse) - nextslide.animate({left : base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); }); - break; - case 6: case 'carouselRight': // Carousel Right (reverse) - nextslide.animate({left : -base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); }); - liveslide.animate({left : 0}, 0 ).animate({ left: base.$el.width(), avoidTransforms : false}, base.options.transition_speed ); - break; - case 7: case 'carouselLeft': // Carousel Left (reverse) - nextslide.animate({left : base.$el.width()}, 0 ).css('visibility','visible').animate({ left:0, avoidTransforms : false }, base.options.transition_speed, function(){ base.afterAnimation(); }); - liveslide.animate({left : 0}, 0 ).animate({ left: -base.$el.width(), avoidTransforms : false }, base.options.transition_speed ); - break; - } - return false; - }; - - - /* Play/Pause Toggle - ----------------------------*/ - base.playToggle = function(){ - - if (vars.in_animation || !api.options.slideshow) return false; // Abort if currently animating - - if (vars.is_paused){ - - vars.is_paused = false; - - // Call theme function for play - if( typeof theme != 'undefined' && typeof theme.playToggle == "function" ) theme.playToggle('play'); - - // Resume slideshow - vars.slideshow_interval = setInterval(base.nextSlide, base.options.slide_interval); - - }else{ - - vars.is_paused = true; - - // Call theme function for pause - if( typeof theme != 'undefined' && typeof theme.playToggle == "function" ) theme.playToggle('pause'); - - // Stop slideshow - clearInterval(vars.slideshow_interval); - - } - - return false; - - }; - - - /* Go to specific slide - ----------------------------*/ - base.goTo = function(targetSlide){ - if (vars.in_animation || !api.options.slideshow) return false; // Abort if currently animating - - var totalSlides = base.options.slides.length; - - // If target outside range - if(targetSlide < 0){ - targetSlide = totalSlides; - }else if(targetSlide > totalSlides){ - targetSlide = 1; - } - targetSlide = totalSlides - targetSlide + 1; - - clearInterval(vars.slideshow_interval); // Stop slideshow, prevent buildup - - // Call theme function for goTo trigger - if (typeof theme != 'undefined' && typeof theme.goTo == "function" ) theme.goTo(); - - if (vars.current_slide == totalSlides - targetSlide){ - if(!(vars.is_paused)){ - vars.slideshow_interval = setInterval(base.nextSlide, base.options.slide_interval); - } - return false; - } - - // If ahead of current position - if(totalSlides - targetSlide > vars.current_slide ){ - - // Adjust for new next slide - vars.current_slide = totalSlides-targetSlide-1; - vars.update_images = 'next'; - base._placeSlide(vars.update_images); - - //Otherwise it's before current position - }else if(totalSlides - targetSlide < vars.current_slide){ - - // Adjust for new prev slide - vars.current_slide = totalSlides-targetSlide+1; - vars.update_images = 'prev'; - base._placeSlide(vars.update_images); - - } - - // set active markers - if (base.options.slide_links){ - $(vars.slide_list +'> .current-slide').removeClass('current-slide'); - $(vars.slide_list +'> li').eq((totalSlides-targetSlide)).addClass('current-slide'); - } - - if (base.options.thumb_links){ - $(vars.thumb_list +'> .current-thumb').removeClass('current-thumb'); - $(vars.thumb_list +'> li').eq((totalSlides-targetSlide)).addClass('current-thumb'); - } - - }; - - - /* Place Slide - ----------------------------*/ - base._placeSlide = function(place){ - - // If links should open in new window - var linkTarget = base.options.new_window ? ' target="_blank"' : ''; - - loadSlide = false; - - if (place == 'next'){ - - vars.current_slide == base.options.slides.length - 1 ? loadSlide = 0 : loadSlide = vars.current_slide + 1; // Determine next slide - - var targetList = base.el+' li:eq('+loadSlide+')'; - - if (!$(targetList).html()){ - // If links should open in new window - var linkTarget = base.options.new_window ? ' target="_blank"' : ''; - - imageLink = (base.options.slides[loadSlide].url) ? "href='" + base.options.slides[loadSlide].url + "'" : ""; // If link exists, build it - var img = $('<img src="'+base.options.slides[loadSlide].image+'"/>'); - - img.appendTo(targetList).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading').css('visibility','hidden'); - - img.load(function(){ - base._origDim($(this)); - base.resizeNow(); - }); // End Load - }; - - base.nextSlide(); - - }else if (place == 'prev'){ - - vars.current_slide - 1 < 0 ? loadSlide = base.options.slides.length - 1 : loadSlide = vars.current_slide - 1; // Determine next slide - - var targetList = base.el+' li:eq('+loadSlide+')'; - - if (!$(targetList).html()){ - // If links should open in new window - var linkTarget = base.options.new_window ? ' target="_blank"' : ''; - - imageLink = (base.options.slides[loadSlide].url) ? "href='" + base.options.slides[loadSlide].url + "'" : ""; // If link exists, build it - var img = $('<img src="'+base.options.slides[loadSlide].image+'"/>'); - - img.appendTo(targetList).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading').css('visibility','hidden'); - - img.load(function(){ - base._origDim($(this)); - base.resizeNow(); - }); // End Load - }; - base.prevSlide(); - } - - }; - - - /* Get Original Dimensions - ----------------------------*/ - base._origDim = function(targetSlide){ - targetSlide.data('origWidth', targetSlide.width()).data('origHeight', targetSlide.height()); - }; - - - /* After Slide Animation - ----------------------------*/ - base.afterAnimation = function(){ - - // If hybrid mode is on swap back to higher image quality - if (base.options.performance == 1){ - base.$el.removeClass('speed').addClass('quality'); - } - - // Update previous slide - if (vars.update_images){ - vars.current_slide - 1 < 0 ? setPrev = base.options.slides.length - 1 : setPrev = vars.current_slide-1; - vars.update_images = false; - $('.prevslide').removeClass('prevslide'); - $(base.el+' li:eq('+setPrev+')').addClass('prevslide'); - } - - vars.in_animation = false; - - // Resume slideshow - if (!vars.is_paused && base.options.slideshow){ - vars.slideshow_interval = setInterval(base.nextSlide, base.options.slide_interval); - if (base.options.stop_loop && vars.current_slide == base.options.slides.length - 1 ) base.playToggle(); - } - - // Call theme function for after slide transition - if (typeof theme != 'undefined' && typeof theme.afterAnimation == "function" ) theme.afterAnimation(); - - return false; - - }; - - base.getField = function(field){ - return base.options.slides[vars.current_slide][field]; - }; - - // Make it go! - base.init(); - }; - - - /* Global Variables - ----------------------------*/ - $.supersized.vars = { - - // Elements - thumb_tray : '#thumb-tray', // Thumbnail tray - thumb_list : '#thumb-list', // Thumbnail list - slide_list : '#slide-list', // Slide link list - - // Internal variables - current_slide : 0, // Current slide number - in_animation : false, // Prevents animations from stacking - is_paused : false, // Tracks paused on/off - hover_pause : false, // If slideshow is paused from hover - slideshow_interval : false, // Stores slideshow timer - update_images : false, // Trigger to update images after slide jump - options : {} // Stores assembled options list - - }; - - - /* Default Options - ----------------------------*/ - $.supersized.defaultOptions = { - - // Functionality - slideshow : 1, // Slideshow on/off - autoplay : 1, // Slideshow starts playing automatically - start_slide : 1, // Start slide (0 is random) - stop_loop : 0, // Stops slideshow on last slide - random : 0, // Randomize slide order (Ignores start slide) - slide_interval : 5000, // Length between transitions - transition : 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left - transition_speed : 750, // Speed of transition - new_window : 1, // Image links open in new window/tab - pause_hover : 0, // Pause slideshow on hover - keyboard_nav : 1, // Keyboard navigation on/off - performance : 1, // 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit) - image_protect : 1, // Disables image dragging and right click with Javascript - - // Size & Position - fit_always : 0, // Image will never exceed browser width or height (Ignores min. dimensions) - fit_landscape : 0, // Landscape images will not exceed browser width - fit_portrait : 1, // Portrait images will not exceed browser height - min_width : 0, // Min width allowed (in pixels) - min_height : 0, // Min height allowed (in pixels) - horizontal_center : 1, // Horizontally center background - vertical_center : 1, // Vertically center background - - - // Components - slide_links : 1, // Individual links for each slide (Options: false, 'num', 'name', 'blank') - thumb_links : 1, // Individual thumb links for each slide - thumbnail_navigation : 0 // Thumbnail navigation - - }; - - $.fn.supersized = function(options){ - return this.each(function(){ - (new $.supersized(options)); - }); - }; - -})(jQuery); - diff --git a/apps/gallery/js/supersized.3.2.7.min.js b/apps/gallery/js/supersized.3.2.7.min.js deleted file mode 100644 index b9cea9cee1c..00000000000 --- a/apps/gallery/js/supersized.3.2.7.min.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - - Supersized - Fullscreen Slideshow jQuery Plugin - Version : 3.2.7 - Site : www.buildinternet.com/project/supersized - - Author : Sam Dunn - Company : One Mighty Roar (www.onemightyroar.com) - License : MIT License / GPL License - -*/ - -(function(a){a(document).ready(function(){a("body").append('<div id="supersized-loader"></div><ul id="supersized"></ul>')});a.supersized=function(b){var c="#supersized",d=this;d.$el=a(c);d.el=c;vars=a.supersized.vars;d.$el.data("supersized",d);api=d.$el.data("supersized");d.init=function(){a.supersized.vars=a.extend(a.supersized.vars,a.supersized.themeVars);a.supersized.vars.options=a.extend({},a.supersized.defaultOptions,a.supersized.themeOptions,b);d.options=a.supersized.vars.options;d._build()};d._build=function(){var g=0,e="",j="",h,f="",i;while(g<=d.options.slides.length-1){switch(d.options.slide_links){case"num":h=g;break;case"name":h=d.options.slides[g].title;break;case"blank":h="";break}e=e+'<li class="slide-'+g+'"></li>';if(g==d.options.start_slide-1){if(d.options.slide_links){j=j+'<li class="slide-link-'+g+' current-slide"><a>'+h+"</a></li>"}if(d.options.thumb_links){d.options.slides[g].thumb?i=d.options.slides[g].thumb:i=d.options.slides[g].image;f=f+'<li class="thumb'+g+' current-thumb"><img src="'+i+'"/></li>'}}else{if(d.options.slide_links){j=j+'<li class="slide-link-'+g+'" ><a>'+h+"</a></li>"}if(d.options.thumb_links){d.options.slides[g].thumb?i=d.options.slides[g].thumb:i=d.options.slides[g].image;f=f+'<li class="thumb'+g+'"><img src="'+i+'"/></li>'}}g++}if(d.options.slide_links){a(vars.slide_list).html(j)}if(d.options.thumb_links&&vars.thumb_tray.length){a(vars.thumb_tray).append('<ul id="'+vars.thumb_list.replace("#","")+'">'+f+"</ul>")}a(d.el).append(e);if(d.options.thumbnail_navigation){vars.current_slide-1<0?prevThumb=d.options.slides.length-1:prevThumb=vars.current_slide-1;a(vars.prev_thumb).show().html(a("<img/>").attr("src",d.options.slides[prevThumb].image));vars.current_slide==d.options.slides.length-1?nextThumb=0:nextThumb=vars.current_slide+1;a(vars.next_thumb).show().html(a("<img/>").attr("src",d.options.slides[nextThumb].image))}d._start()};d._start=function(){if(d.options.start_slide){vars.current_slide=d.options.start_slide-1}else{vars.current_slide=Math.floor(Math.random()*d.options.slides.length)}var o=d.options.new_window?' target="_blank"':"";if(d.options.performance==3){d.$el.addClass("speed")}else{if((d.options.performance==1)||(d.options.performance==2)){d.$el.addClass("quality")}}if(d.options.random){arr=d.options.slides;for(var h,m,k=arr.length;k;h=parseInt(Math.random()*k),m=arr[--k],arr[k]=arr[h],arr[h]=m){}d.options.slides=arr}if(d.options.slides.length>1){if(d.options.slides.length>2){vars.current_slide-1<0?loadPrev=d.options.slides.length-1:loadPrev=vars.current_slide-1;var g=(d.options.slides[loadPrev].url)?"href='"+d.options.slides[loadPrev].url+"'":"";var q=a('<img src="'+d.options.slides[loadPrev].image+'"/>');var n=d.el+" li:eq("+loadPrev+")";q.appendTo(n).wrap("<a "+g+o+"></a>").parent().parent().addClass("image-loading prevslide");q.load(function(){a(this).data("origWidth",a(this).width()).data("origHeight",a(this).height());d.resizeNow()})}}else{d.options.slideshow=0}g=(api.getField("url"))?"href='"+api.getField("url")+"'":"";var l=a('<img src="'+api.getField("image")+'"/>');var f=d.el+" li:eq("+vars.current_slide+")";l.appendTo(f).wrap("<a "+g+o+"></a>").parent().parent().addClass("image-loading activeslide");l.load(function(){d._origDim(a(this));d.resizeNow();d.launch();if(typeof theme!="undefined"&&typeof theme._init=="function"){theme._init()}});if(d.options.slides.length>1){vars.current_slide==d.options.slides.length-1?loadNext=0:loadNext=vars.current_slide+1;g=(d.options.slides[loadNext].url)?"href='"+d.options.slides[loadNext].url+"'":"";var e=a('<img src="'+d.options.slides[loadNext].image+'"/>');var p=d.el+" li:eq("+loadNext+")";e.appendTo(p).wrap("<a "+g+o+"></a>").parent().parent().addClass("image-loading");e.load(function(){a(this).data("origWidth",a(this).width()).data("origHeight",a(this).height());d.resizeNow()})}d.$el.css("visibility","hidden");a(".load-item").hide()};d.launch=function(){d.$el.css("visibility","visible");a("#supersized-loader").remove();if(typeof theme!="undefined"&&typeof theme.beforeAnimation=="function"){theme.beforeAnimation("next")}a(".load-item").show();if(d.options.keyboard_nav){a(document.documentElement).keyup(function(e){if(vars.in_animation){return false}if((e.keyCode==37)||(e.keyCode==40)){clearInterval(vars.slideshow_interval);d.prevSlide()}else{if((e.keyCode==39)||(e.keyCode==38)){clearInterval(vars.slideshow_interval);d.nextSlide()}else{if(e.keyCode==32&&!vars.hover_pause){clearInterval(vars.slideshow_interval);d.playToggle()}}}})}if(d.options.slideshow&&d.options.pause_hover){a(d.el).hover(function(){if(vars.in_animation){return false}vars.hover_pause=true;if(!vars.is_paused){vars.hover_pause="resume";d.playToggle()}},function(){if(vars.hover_pause=="resume"){d.playToggle();vars.hover_pause=false}})}if(d.options.slide_links){a(vars.slide_list+"> li").click(function(){index=a(vars.slide_list+"> li").index(this);targetSlide=index+1;d.goTo(targetSlide);return false})}if(d.options.thumb_links){a(vars.thumb_list+"> li").click(function(){index=a(vars.thumb_list+"> li").index(this);targetSlide=index+1;api.goTo(targetSlide);return false})}if(d.options.slideshow&&d.options.slides.length>1){if(d.options.autoplay&&d.options.slides.length>1){vars.slideshow_interval=setInterval(d.nextSlide,d.options.slide_interval)}else{vars.is_paused=true}a(".load-item img").bind("contextmenu mousedown",function(){return false})}a(window).resize(function(){d.resizeNow()})};d.resizeNow=function(){return d.$el.each(function(){a("img",d.el).each(function(){thisSlide=a(this);var f=(thisSlide.data("origHeight")/thisSlide.data("origWidth")).toFixed(2);var e=d.$el.width(),h=d.$el.height(),i;if(d.options.fit_always){if((h/e)>f){g()}else{j()}}else{if((h<=d.options.min_height)&&(e<=d.options.min_width)){if((h/e)>f){d.options.fit_landscape&&f<1?g(true):j(true)}else{d.options.fit_portrait&&f>=1?j(true):g(true)}}else{if(e<=d.options.min_width){if((h/e)>f){d.options.fit_landscape&&f<1?g(true):j()}else{d.options.fit_portrait&&f>=1?j():g(true)}}else{if(h<=d.options.min_height){if((h/e)>f){d.options.fit_landscape&&f<1?g():j(true)}else{d.options.fit_portrait&&f>=1?j(true):g()}}else{if((h/e)>f){d.options.fit_landscape&&f<1?g():j()}else{d.options.fit_portrait&&f>=1?j():g()}}}}}function g(k){if(k){if(thisSlide.width()<e||thisSlide.width()<d.options.min_width){if(thisSlide.width()*f>=d.options.min_height){thisSlide.width(d.options.min_width);thisSlide.height(thisSlide.width()*f)}else{j()}}}else{if(d.options.min_height>=h&&!d.options.fit_landscape){if(e*f>=d.options.min_height||(e*f>=d.options.min_height&&f<=1)){thisSlide.width(e);thisSlide.height(e*f)}else{if(f>1){thisSlide.height(d.options.min_height);thisSlide.width(thisSlide.height()/f)}else{if(thisSlide.width()<e){thisSlide.width(e);thisSlide.height(thisSlide.width()*f)}}}}else{thisSlide.width(e);thisSlide.height(e*f)}}}function j(k){if(k){if(thisSlide.height()<h){if(thisSlide.height()/f>=d.options.min_width){thisSlide.height(d.options.min_height);thisSlide.width(thisSlide.height()/f)}else{g(true)}}}else{if(d.options.min_width>=e){if(h/f>=d.options.min_width||f>1){thisSlide.height(h);thisSlide.width(h/f)}else{if(f<=1){thisSlide.width(d.options.min_width);thisSlide.height(thisSlide.width()*f)}}}else{thisSlide.height(h);thisSlide.width(h/f)}}}if(thisSlide.parents("li").hasClass("image-loading")){a(".image-loading").removeClass("image-loading")}if(d.options.horizontal_center){a(this).css("left",(e-a(this).width())/2)}if(d.options.vertical_center){a(this).css("top",(h-a(this).height())/2)}});if(d.options.image_protect){a("img",d.el).bind("contextmenu mousedown",function(){return false})}return false})};d.nextSlide=function(){if(vars.in_animation||!api.options.slideshow){return false}else{vars.in_animation=true}clearInterval(vars.slideshow_interval);var h=d.options.slides,e=d.$el.find(".activeslide");a(".prevslide").removeClass("prevslide");e.removeClass("activeslide").addClass("prevslide");vars.current_slide+1==d.options.slides.length?vars.current_slide=0:vars.current_slide++;var g=a(d.el+" li:eq("+vars.current_slide+")"),i=d.$el.find(".prevslide");if(d.options.performance==1){d.$el.removeClass("quality").addClass("speed")}loadSlide=false;vars.current_slide==d.options.slides.length-1?loadSlide=0:loadSlide=vars.current_slide+1;var k=d.el+" li:eq("+loadSlide+")";if(!a(k).html()){var j=d.options.new_window?' target="_blank"':"";imageLink=(d.options.slides[loadSlide].url)?"href='"+d.options.slides[loadSlide].url+"'":"";var f=a('<img src="'+d.options.slides[loadSlide].image+'"/>');f.appendTo(k).wrap("<a "+imageLink+j+"></a>").parent().parent().addClass("image-loading").css("visibility","hidden");f.load(function(){d._origDim(a(this));d.resizeNow()})}if(d.options.thumbnail_navigation==1){vars.current_slide-1<0?prevThumb=d.options.slides.length-1:prevThumb=vars.current_slide-1;a(vars.prev_thumb).html(a("<img/>").attr("src",d.options.slides[prevThumb].image));nextThumb=loadSlide;a(vars.next_thumb).html(a("<img/>").attr("src",d.options.slides[nextThumb].image))}if(typeof theme!="undefined"&&typeof theme.beforeAnimation=="function"){theme.beforeAnimation("next")}if(d.options.slide_links){a(".current-slide").removeClass("current-slide");a(vars.slide_list+"> li").eq(vars.current_slide).addClass("current-slide")}g.css("visibility","hidden").addClass("activeslide");switch(d.options.transition){case 0:case"none":g.css("visibility","visible");vars.in_animation=false;d.afterAnimation();break;case 1:case"fade":g.animate({opacity:0},0).css("visibility","visible").animate({opacity:1,avoidTransforms:false},d.options.transition_speed,function(){d.afterAnimation()});break;case 2:case"slideTop":g.animate({top:-d.$el.height()},0).css("visibility","visible").animate({top:0,avoidTransforms:false},d.options.transition_speed,function(){d.afterAnimation()});break;case 3:case"slideRight":g.animate({left:d.$el.width()},0).css("visibility","visible").animate({left:0,avoidTransforms:false},d.options.transition_speed,function(){d.afterAnimation()});break;case 4:case"slideBottom":g.animate({top:d.$el.height()},0).css("visibility","visible").animate({top:0,avoidTransforms:false},d.options.transition_speed,function(){d.afterAnimation()});break;case 5:case"slideLeft":g.animate({left:-d.$el.width()},0).css("visibility","visible").animate({left:0,avoidTransforms:false},d.options.transition_speed,function(){d.afterAnimation()});break;case 6:case"carouselRight":g.animate({left:d.$el.width()},0).css("visibility","visible").animate({left:0,avoidTransforms:false},d.options.transition_speed,function(){d.afterAnimation()});e.animate({left:-d.$el.width(),avoidTransforms:false},d.options.transition_speed);break;case 7:case"carouselLeft":g.animate({left:-d.$el.width()},0).css("visibility","visible").animate({left:0,avoidTransforms:false},d.options.transition_speed,function(){d.afterAnimation()});e.animate({left:d.$el.width(),avoidTransforms:false},d.options.transition_speed);break}return false};d.prevSlide=function(){if(vars.in_animation||!api.options.slideshow){return false}else{vars.in_animation=true}clearInterval(vars.slideshow_interval);var h=d.options.slides,e=d.$el.find(".activeslide");a(".prevslide").removeClass("prevslide");e.removeClass("activeslide").addClass("prevslide");vars.current_slide==0?vars.current_slide=d.options.slides.length-1:vars.current_slide--;var g=a(d.el+" li:eq("+vars.current_slide+")"),i=d.$el.find(".prevslide");if(d.options.performance==1){d.$el.removeClass("quality").addClass("speed")}loadSlide=vars.current_slide;var k=d.el+" li:eq("+loadSlide+")";if(!a(k).html()){var j=d.options.new_window?' target="_blank"':"";imageLink=(d.options.slides[loadSlide].url)?"href='"+d.options.slides[loadSlide].url+"'":"";var f=a('<img src="'+d.options.slides[loadSlide].image+'"/>');f.appendTo(k).wrap("<a "+imageLink+j+"></a>").parent().parent().addClass("image-loading").css("visibility","hidden");f.load(function(){d._origDim(a(this));d.resizeNow()})}if(d.options.thumbnail_navigation==1){loadSlide==0?prevThumb=d.options.slides.length-1:prevThumb=loadSlide-1;a(vars.prev_thumb).html(a("<img/>").attr("src",d.options.slides[prevThumb].image));vars.current_slide==d.options.slides.length-1?nextThumb=0:nextThumb=vars.current_slide+1;a(vars.next_thumb).html(a("<img/>").attr("src",d.options.slides[nextThumb].image))}if(typeof theme!="undefined"&&typeof theme.beforeAnimation=="function"){theme.beforeAnimation("prev")}if(d.options.slide_links){a(".current-slide").removeClass("current-slide");a(vars.slide_list+"> li").eq(vars.current_slide).addClass("current-slide")}g.css("visibility","hidden").addClass("activeslide");switch(d.options.transition){case 0:case"none":g.css("visibility","visible");vars.in_animation=false;d.afterAnimation();break;case 1:case"fade":g.animate({opacity:0},0).css("visibility","visible").animate({opacity:1,avoidTransforms:false},d.options.transition_speed,function(){d.afterAnimation()});break;case 2:case"slideTop":g.animate({top:d.$el.height()},0).css("visibility","visible").animate({top:0,avoidTransforms:false},d.options.transition_speed,function(){d.afterAnimation()});break;case 3:case"slideRight":g.animate({left:-d.$el.width()},0).css("visibility","visible").animate({left:0,avoidTransforms:false},d.options.transition_speed,function(){d.afterAnimation()});break;case 4:case"slideBottom":g.animate({top:-d.$el.height()},0).css("visibility","visible").animate({top:0,avoidTransforms:false},d.options.transition_speed,function(){d.afterAnimation()});break;case 5:case"slideLeft":g.animate({left:d.$el.width()},0).css("visibility","visible").animate({left:0,avoidTransforms:false},d.options.transition_speed,function(){d.afterAnimation()});break;case 6:case"carouselRight":g.animate({left:-d.$el.width()},0).css("visibility","visible").animate({left:0,avoidTransforms:false},d.options.transition_speed,function(){d.afterAnimation()});e.animate({left:0},0).animate({left:d.$el.width(),avoidTransforms:false},d.options.transition_speed);break;case 7:case"carouselLeft":g.animate({left:d.$el.width()},0).css("visibility","visible").animate({left:0,avoidTransforms:false},d.options.transition_speed,function(){d.afterAnimation()});e.animate({left:0},0).animate({left:-d.$el.width(),avoidTransforms:false},d.options.transition_speed);break}return false};d.playToggle=function(){if(vars.in_animation||!api.options.slideshow){return false}if(vars.is_paused){vars.is_paused=false;if(typeof theme!="undefined"&&typeof theme.playToggle=="function"){theme.playToggle("play")}vars.slideshow_interval=setInterval(d.nextSlide,d.options.slide_interval)}else{vars.is_paused=true;if(typeof theme!="undefined"&&typeof theme.playToggle=="function"){theme.playToggle("pause")}clearInterval(vars.slideshow_interval)}return false};d.goTo=function(f){if(vars.in_animation||!api.options.slideshow){return false}var e=d.options.slides.length;if(f<0){f=e}else{if(f>e){f=1}}f=e-f+1;clearInterval(vars.slideshow_interval);if(typeof theme!="undefined"&&typeof theme.goTo=="function"){theme.goTo()}if(vars.current_slide==e-f){if(!(vars.is_paused)){vars.slideshow_interval=setInterval(d.nextSlide,d.options.slide_interval)}return false}if(e-f>vars.current_slide){vars.current_slide=e-f-1;vars.update_images="next";d._placeSlide(vars.update_images)}else{if(e-f<vars.current_slide){vars.current_slide=e-f+1;vars.update_images="prev";d._placeSlide(vars.update_images)}}if(d.options.slide_links){a(vars.slide_list+"> .current-slide").removeClass("current-slide");a(vars.slide_list+"> li").eq((e-f)).addClass("current-slide")}if(d.options.thumb_links){a(vars.thumb_list+"> .current-thumb").removeClass("current-thumb");a(vars.thumb_list+"> li").eq((e-f)).addClass("current-thumb")}};d._placeSlide=function(e){var h=d.options.new_window?' target="_blank"':"";loadSlide=false;if(e=="next"){vars.current_slide==d.options.slides.length-1?loadSlide=0:loadSlide=vars.current_slide+1;var g=d.el+" li:eq("+loadSlide+")";if(!a(g).html()){var h=d.options.new_window?' target="_blank"':"";imageLink=(d.options.slides[loadSlide].url)?"href='"+d.options.slides[loadSlide].url+"'":"";var f=a('<img src="'+d.options.slides[loadSlide].image+'"/>');f.appendTo(g).wrap("<a "+imageLink+h+"></a>").parent().parent().addClass("image-loading").css("visibility","hidden");f.load(function(){d._origDim(a(this));d.resizeNow()})}d.nextSlide()}else{if(e=="prev"){vars.current_slide-1<0?loadSlide=d.options.slides.length-1:loadSlide=vars.current_slide-1;var g=d.el+" li:eq("+loadSlide+")";if(!a(g).html()){var h=d.options.new_window?' target="_blank"':"";imageLink=(d.options.slides[loadSlide].url)?"href='"+d.options.slides[loadSlide].url+"'":"";var f=a('<img src="'+d.options.slides[loadSlide].image+'"/>');f.appendTo(g).wrap("<a "+imageLink+h+"></a>").parent().parent().addClass("image-loading").css("visibility","hidden");f.load(function(){d._origDim(a(this));d.resizeNow()})}d.prevSlide()}}};d._origDim=function(e){e.data("origWidth",e.width()).data("origHeight",e.height())};d.afterAnimation=function(){if(d.options.performance==1){d.$el.removeClass("speed").addClass("quality")}if(vars.update_images){vars.current_slide-1<0?setPrev=d.options.slides.length-1:setPrev=vars.current_slide-1;vars.update_images=false;a(".prevslide").removeClass("prevslide");a(d.el+" li:eq("+setPrev+")").addClass("prevslide")}vars.in_animation=false;if(!vars.is_paused&&d.options.slideshow){vars.slideshow_interval=setInterval(d.nextSlide,d.options.slide_interval);if(d.options.stop_loop&&vars.current_slide==d.options.slides.length-1){d.playToggle()}}if(typeof theme!="undefined"&&typeof theme.afterAnimation=="function"){theme.afterAnimation()}return false};d.getField=function(e){return d.options.slides[vars.current_slide][e]};d.init()};a.supersized.vars={thumb_tray:"#thumb-tray",thumb_list:"#thumb-list",slide_list:"#slide-list",current_slide:0,in_animation:false,is_paused:false,hover_pause:false,slideshow_interval:false,update_images:false,options:{}};a.supersized.defaultOptions={slideshow:1,autoplay:1,start_slide:1,stop_loop:0,random:0,slide_interval:5000,transition:1,transition_speed:750,new_window:1,pause_hover:0,keyboard_nav:1,performance:1,image_protect:1,fit_always:0,fit_landscape:0,fit_portrait:1,min_width:0,min_height:0,horizontal_center:1,vertical_center:1,slide_links:1,thumb_links:1,thumbnail_navigation:0};a.fn.supersized=function(b){return this.each(function(){(new a.supersized(b))})}})(jQuery);
\ No newline at end of file diff --git a/apps/gallery/js/supersized.shutter.js b/apps/gallery/js/supersized.shutter.js deleted file mode 100644 index cc3025a94a3..00000000000 --- a/apps/gallery/js/supersized.shutter.js +++ /dev/null @@ -1,337 +0,0 @@ -/* - - Supersized - Fullscreen Slideshow jQuery Plugin - Version : 3.2.7 - Theme : Shutter 1.1 - - Site : www.buildinternet.com/project/supersized - Author : Sam Dunn - Company : One Mighty Roar (www.onemightyroar.com) - License : MIT License / GPL License - -*/ - -(function($){ - - theme = { - - - /* Initial Placement - ----------------------------*/ - _init : function(){ - - // Center Slide Links - if (api.options.slide_links) $(vars.slide_list).css('margin-left', -$(vars.slide_list).width()/2); - - // Start progressbar if autoplay enabled - if (api.options.autoplay){ - if (api.options.progress_bar) theme.progressBar(); - }else{ - if ($(vars.play_button).attr('src')) $(vars.play_button).attr("src", vars.image_path + "play.png"); // If pause play button is image, swap src - if (api.options.progress_bar) $(vars.progress_bar).stop().animate({left : -$(window).width()}, 0 ); // Place progress bar - } - - - /* Thumbnail Tray - ----------------------------*/ - // Hide tray off screen - $(vars.thumb_tray).animate({bottom : -$(vars.thumb_tray).height()}, 0 ); - - // Thumbnail Tray Toggle - $(vars.tray_button).toggle(function(){ - $(vars.thumb_tray).stop().animate({bottom : 0, avoidTransforms : true}, 300 ); - if ($(vars.tray_arrow).attr('src')) $(vars.tray_arrow).attr("src", vars.image_path + "button-tray-down.png"); - return false; - }, function() { - $(vars.thumb_tray).stop().animate({bottom : -$(vars.thumb_tray).height(), avoidTransforms : true}, 300 ); - if ($(vars.tray_arrow).attr('src')) $(vars.tray_arrow).attr("src", vars.image_path + "button-tray-up.png"); - return false; - }); - - // Make thumb tray proper size - $(vars.thumb_list).width($('> li', vars.thumb_list).length * $('> li', vars.thumb_list).outerWidth(true)); //Adjust to true width of thumb markers - - // Display total slides - if ($(vars.slide_total).length){ - $(vars.slide_total).html(api.options.slides.length); - } - - - /* Thumbnail Tray Navigation - ----------------------------*/ - if (api.options.thumb_links){ - //Hide thumb arrows if not needed - if ($(vars.thumb_list).width() <= $(vars.thumb_tray).width()){ - $(vars.thumb_back +','+vars.thumb_forward).fadeOut(0); - } - - // Thumb Intervals - vars.thumb_interval = Math.floor($(vars.thumb_tray).width() / $('> li', vars.thumb_list).outerWidth(true)) * $('> li', vars.thumb_list).outerWidth(true); - vars.thumb_page = 0; - - // Cycle thumbs forward - $(vars.thumb_forward).click(function(){ - if (vars.thumb_page - vars.thumb_interval <= -$(vars.thumb_list).width()){ - vars.thumb_page = 0; - $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); - }else{ - vars.thumb_page = vars.thumb_page - vars.thumb_interval; - $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); - } - }); - - // Cycle thumbs backwards - $(vars.thumb_back).click(function(){ - if (vars.thumb_page + vars.thumb_interval > 0){ - vars.thumb_page = Math.floor($(vars.thumb_list).width() / vars.thumb_interval) * -vars.thumb_interval; - if ($(vars.thumb_list).width() <= -vars.thumb_page) vars.thumb_page = vars.thumb_page + vars.thumb_interval; - $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); - }else{ - vars.thumb_page = vars.thumb_page + vars.thumb_interval; - $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); - } - }); - - } - - - /* Navigation Items - ----------------------------*/ - $(vars.next_slide).click(function() { - api.nextSlide(); - }); - - $(vars.prev_slide).click(function() { - api.prevSlide(); - }); - - // Full Opacity on Hover - if(jQuery.support.opacity){ - $(vars.prev_slide +','+vars.next_slide).mouseover(function() { - $(this).stop().animate({opacity:1},100); - }).mouseout(function(){ - $(this).stop().animate({opacity:0.6},100); - }); - } - - if (api.options.thumbnail_navigation){ - // Next thumbnail clicked - $(vars.next_thumb).click(function() { - api.nextSlide(); - }); - // Previous thumbnail clicked - $(vars.prev_thumb).click(function() { - api.prevSlide(); - }); - } - - $(vars.play_button).click(function() { - api.playToggle(); - }); - - - /* Thumbnail Mouse Scrub - ----------------------------*/ - if (api.options.mouse_scrub){ - $(vars.thumb_tray).mousemove(function(e) { - var containerWidth = $(vars.thumb_tray).width(), - listWidth = $(vars.thumb_list).width(); - if (listWidth > containerWidth){ - var mousePos = 1, - diff = e.pageX - mousePos; - if (diff > 10 || diff < -10) { - mousePos = e.pageX; - newX = (containerWidth - listWidth) * (e.pageX/containerWidth); - diff = parseInt(Math.abs(parseInt($(vars.thumb_list).css('left'))-newX )).toFixed(0); - $(vars.thumb_list).stop().animate({'left':newX}, {duration:diff*3, easing:'easeOutExpo'}); - } - } - }); - } - - - /* Window Resize - ----------------------------*/ - $(window).resize(function(){ - - // Delay progress bar on resize - if (api.options.progress_bar && !vars.in_animation){ - if (vars.slideshow_interval) clearInterval(vars.slideshow_interval); - if (api.options.slides.length - 1 > 0) clearInterval(vars.slideshow_interval); - - $(vars.progress_bar).stop().animate({left : -$(window).width()}, 0 ); - - if (!vars.progressDelay && api.options.slideshow){ - // Delay slideshow from resuming so Chrome can refocus images - vars.progressDelay = setTimeout(function() { - if (!vars.is_paused){ - theme.progressBar(); - vars.slideshow_interval = setInterval(api.nextSlide, api.options.slide_interval); - } - vars.progressDelay = false; - }, 1000); - } - } - - // Thumb Links - if (api.options.thumb_links && vars.thumb_tray.length){ - // Update Thumb Interval & Page - vars.thumb_page = 0; - vars.thumb_interval = Math.floor($(vars.thumb_tray).width() / $('> li', vars.thumb_list).outerWidth(true)) * $('> li', vars.thumb_list).outerWidth(true); - - // Adjust thumbnail markers - if ($(vars.thumb_list).width() > $(vars.thumb_tray).width()){ - $(vars.thumb_back +','+vars.thumb_forward).fadeIn('fast'); - $(vars.thumb_list).stop().animate({'left':0}, 200); - }else{ - $(vars.thumb_back +','+vars.thumb_forward).fadeOut('fast'); - } - - } - }); - - - }, - - - /* Go To Slide - ----------------------------*/ - goTo : function(){ - if (api.options.progress_bar && !vars.is_paused){ - $(vars.progress_bar).stop().animate({left : -$(window).width()}, 0 ); - theme.progressBar(); - } - }, - - /* Play & Pause Toggle - ----------------------------*/ - playToggle : function(state){ - - if (state =='play'){ - // If image, swap to pause - if ($(vars.play_button).attr('src')) $(vars.play_button).attr("src", vars.image_path + "pause.png"); - if (api.options.progress_bar && !vars.is_paused) theme.progressBar(); - }else if (state == 'pause'){ - // If image, swap to play - if ($(vars.play_button).attr('src')) $(vars.play_button).attr("src", vars.image_path + "play.png"); - if (api.options.progress_bar && vars.is_paused)$(vars.progress_bar).stop().animate({left : -$(window).width()}, 0 ); - } - - }, - - - /* Before Slide Transition - ----------------------------*/ - beforeAnimation : function(direction){ - if (api.options.progress_bar && !vars.is_paused) $(vars.progress_bar).stop().animate({left : -$(window).width()}, 0 ); - - /* Update Fields - ----------------------------*/ - // Update slide caption - if ($(vars.slide_caption).length){ - (api.getField('title')) ? $(vars.slide_caption).html(api.getField('title')) : $(vars.slide_caption).html(''); - } - // Update slide number - if (vars.slide_current.length){ - $(vars.slide_current).html(vars.current_slide + 1); - } - - - // Highlight current thumbnail and adjust row position - if (api.options.thumb_links){ - - $('.current-thumb').removeClass('current-thumb'); - $('li', vars.thumb_list).eq(vars.current_slide).addClass('current-thumb'); - - // If thumb out of view - if ($(vars.thumb_list).width() > $(vars.thumb_tray).width()){ - // If next slide direction - if (direction == 'next'){ - if (vars.current_slide == 0){ - vars.thumb_page = 0; - $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); - } else if ($('.current-thumb').offset().left - $(vars.thumb_tray).offset().left >= vars.thumb_interval){ - vars.thumb_page = vars.thumb_page - vars.thumb_interval; - $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); - } - // If previous slide direction - }else if(direction == 'prev'){ - if (vars.current_slide == api.options.slides.length - 1){ - vars.thumb_page = Math.floor($(vars.thumb_list).width() / vars.thumb_interval) * -vars.thumb_interval; - if ($(vars.thumb_list).width() <= -vars.thumb_page) vars.thumb_page = vars.thumb_page + vars.thumb_interval; - $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); - } else if ($('.current-thumb').offset().left - $(vars.thumb_tray).offset().left < 0){ - if (vars.thumb_page + vars.thumb_interval > 0) return false; - vars.thumb_page = vars.thumb_page + vars.thumb_interval; - $(vars.thumb_list).stop().animate({'left': vars.thumb_page}, {duration:500, easing:'easeOutExpo'}); - } - } - } - - - } - - }, - - - /* After Slide Transition - ----------------------------*/ - afterAnimation : function(){ - if (api.options.progress_bar && !vars.is_paused) theme.progressBar(); // Start progress bar - }, - - - /* Progress Bar - ----------------------------*/ - progressBar : function(){ - $(vars.progress_bar).stop().animate({left : -$(window).width()}, 0 ).animate({left:0}, api.options.slide_interval); - } - - - }; - - - /* Theme Specific Variables - ----------------------------*/ - $.supersized.themeVars = { - - // Internal Variables - progress_delay : false, // Delay after resize before resuming slideshow - thumb_page : false, // Thumbnail page - thumb_interval : false, // Thumbnail interval - image_path : OC.webroot+"/apps/gallery/img/supersized/", // Default image path - - // General Elements - play_button : '#pauseplay', // Play/Pause button - next_slide : '#nextslide', // Next slide button - prev_slide : '#prevslide', // Prev slide button - next_thumb : '#nextthumb', // Next slide thumb button - prev_thumb : '#prevthumb', // Prev slide thumb button - - slide_caption : '#slidecaption', // Slide caption - slide_current : '.slidenumber', // Current slide number - slide_total : '.totalslides', // Total Slides - slide_list : '#slide-list', // Slide jump list - - thumb_tray : '#thumb-tray', // Thumbnail tray - thumb_list : '#thumb-list', // Thumbnail list - thumb_forward : '#thumb-forward', // Cycles forward through thumbnail list - thumb_back : '#thumb-back', // Cycles backwards through thumbnail list - tray_arrow : '#tray-arrow', // Thumbnail tray button arrow - tray_button : '#tray-button', // Thumbnail tray button - - progress_bar : '#progress-bar' // Progress bar - - }; - - /* Theme Specific Options - ----------------------------*/ - $.supersized.themeOptions = { - - progress_bar : 1, // Timer for each slide - mouse_scrub : 0 // Thumbnails move with mouse - - }; - - -})(jQuery); diff --git a/apps/gallery/js/supersized.shutter.min.js b/apps/gallery/js/supersized.shutter.min.js deleted file mode 100644 index 52ea4a3384a..00000000000 --- a/apps/gallery/js/supersized.shutter.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - - Supersized - Fullscreen Slideshow jQuery Plugin - Version : 3.2.7 - Theme : Shutter 1.1 - - Site : www.buildinternet.com/project/supersized - Author : Sam Dunn - Company : One Mighty Roar (www.onemightyroar.com) - License : MIT License / GPL License - -*/ - -(function(a){theme={_init:function(){if(api.options.slide_links){a(vars.slide_list).css("margin-left",-a(vars.slide_list).width()/2)}if(api.options.autoplay){if(api.options.progress_bar){theme.progressBar()}}else{if(a(vars.play_button).attr("src")){a(vars.play_button).attr("src",vars.image_path+"play.png")}if(api.options.progress_bar){a(vars.progress_bar).stop().animate({left:-a(window).width()},0)}}a(vars.thumb_tray).animate({bottom:-a(vars.thumb_tray).height()},0);a(vars.tray_button).toggle(function(){a(vars.thumb_tray).stop().animate({bottom:0,avoidTransforms:true},300);if(a(vars.tray_arrow).attr("src")){a(vars.tray_arrow).attr("src",vars.image_path+"button-tray-down.png")}return false},function(){a(vars.thumb_tray).stop().animate({bottom:-a(vars.thumb_tray).height(),avoidTransforms:true},300);if(a(vars.tray_arrow).attr("src")){a(vars.tray_arrow).attr("src",vars.image_path+"button-tray-up.png")}return false});a(vars.thumb_list).width(a("> li",vars.thumb_list).length*a("> li",vars.thumb_list).outerWidth(true));if(a(vars.slide_total).length){a(vars.slide_total).html(api.options.slides.length)}if(api.options.thumb_links){if(a(vars.thumb_list).width()<=a(vars.thumb_tray).width()){a(vars.thumb_back+","+vars.thumb_forward).fadeOut(0)}vars.thumb_interval=Math.floor(a(vars.thumb_tray).width()/a("> li",vars.thumb_list).outerWidth(true))*a("> li",vars.thumb_list).outerWidth(true);vars.thumb_page=0;a(vars.thumb_forward).click(function(){if(vars.thumb_page-vars.thumb_interval<=-a(vars.thumb_list).width()){vars.thumb_page=0;a(vars.thumb_list).stop().animate({left:vars.thumb_page},{duration:500,easing:"easeOutExpo"})}else{vars.thumb_page=vars.thumb_page-vars.thumb_interval;a(vars.thumb_list).stop().animate({left:vars.thumb_page},{duration:500,easing:"easeOutExpo"})}});a(vars.thumb_back).click(function(){if(vars.thumb_page+vars.thumb_interval>0){vars.thumb_page=Math.floor(a(vars.thumb_list).width()/vars.thumb_interval)*-vars.thumb_interval;if(a(vars.thumb_list).width()<=-vars.thumb_page){vars.thumb_page=vars.thumb_page+vars.thumb_interval}a(vars.thumb_list).stop().animate({left:vars.thumb_page},{duration:500,easing:"easeOutExpo"})}else{vars.thumb_page=vars.thumb_page+vars.thumb_interval;a(vars.thumb_list).stop().animate({left:vars.thumb_page},{duration:500,easing:"easeOutExpo"})}})}a(vars.next_slide).click(function(){api.nextSlide()});a(vars.prev_slide).click(function(){api.prevSlide()});if(jQuery.support.opacity){a(vars.prev_slide+","+vars.next_slide).mouseover(function(){a(this).stop().animate({opacity:1},100)}).mouseout(function(){a(this).stop().animate({opacity:0.6},100)})}if(api.options.thumbnail_navigation){a(vars.next_thumb).click(function(){api.nextSlide()});a(vars.prev_thumb).click(function(){api.prevSlide()})}a(vars.play_button).click(function(){api.playToggle()});if(api.options.mouse_scrub){a(vars.thumb_tray).mousemove(function(f){var c=a(vars.thumb_tray).width(),g=a(vars.thumb_list).width();if(g>c){var b=1,d=f.pageX-b;if(d>10||d<-10){b=f.pageX;newX=(c-g)*(f.pageX/c);d=parseInt(Math.abs(parseInt(a(vars.thumb_list).css("left"))-newX)).toFixed(0);a(vars.thumb_list).stop().animate({left:newX},{duration:d*3,easing:"easeOutExpo"})}}})}a(window).resize(function(){if(api.options.progress_bar&&!vars.in_animation){if(vars.slideshow_interval){clearInterval(vars.slideshow_interval)}if(api.options.slides.length-1>0){clearInterval(vars.slideshow_interval)}a(vars.progress_bar).stop().animate({left:-a(window).width()},0);if(!vars.progressDelay&&api.options.slideshow){vars.progressDelay=setTimeout(function(){if(!vars.is_paused){theme.progressBar();vars.slideshow_interval=setInterval(api.nextSlide,api.options.slide_interval)}vars.progressDelay=false},1000)}}if(api.options.thumb_links&&vars.thumb_tray.length){vars.thumb_page=0;vars.thumb_interval=Math.floor(a(vars.thumb_tray).width()/a("> li",vars.thumb_list).outerWidth(true))*a("> li",vars.thumb_list).outerWidth(true);if(a(vars.thumb_list).width()>a(vars.thumb_tray).width()){a(vars.thumb_back+","+vars.thumb_forward).fadeIn("fast");a(vars.thumb_list).stop().animate({left:0},200)}else{a(vars.thumb_back+","+vars.thumb_forward).fadeOut("fast")}}})},goTo:function(b){if(api.options.progress_bar&&!vars.is_paused){a(vars.progress_bar).stop().animate({left:-a(window).width()},0);theme.progressBar()}},playToggle:function(b){if(b=="play"){if(a(vars.play_button).attr("src")){a(vars.play_button).attr("src",vars.image_path+"pause.png")}if(api.options.progress_bar&&!vars.is_paused){theme.progressBar()}}else{if(b=="pause"){if(a(vars.play_button).attr("src")){a(vars.play_button).attr("src",vars.image_path+"play.png")}if(api.options.progress_bar&&vars.is_paused){a(vars.progress_bar).stop().animate({left:-a(window).width()},0)}}}},beforeAnimation:function(b){if(api.options.progress_bar&&!vars.is_paused){a(vars.progress_bar).stop().animate({left:-a(window).width()},0)}if(a(vars.slide_caption).length){(api.getField("title"))?a(vars.slide_caption).html(api.getField("title")):a(vars.slide_caption).html("")}if(vars.slide_current.length){a(vars.slide_current).html(vars.current_slide+1)}if(api.options.thumb_links){a(".current-thumb").removeClass("current-thumb");a("li",vars.thumb_list).eq(vars.current_slide).addClass("current-thumb");if(a(vars.thumb_list).width()>a(vars.thumb_tray).width()){if(b=="next"){if(vars.current_slide==0){vars.thumb_page=0;a(vars.thumb_list).stop().animate({left:vars.thumb_page},{duration:500,easing:"easeOutExpo"})}else{if(a(".current-thumb").offset().left-a(vars.thumb_tray).offset().left>=vars.thumb_interval){vars.thumb_page=vars.thumb_page-vars.thumb_interval;a(vars.thumb_list).stop().animate({left:vars.thumb_page},{duration:500,easing:"easeOutExpo"})}}}else{if(b=="prev"){if(vars.current_slide==api.options.slides.length-1){vars.thumb_page=Math.floor(a(vars.thumb_list).width()/vars.thumb_interval)*-vars.thumb_interval;if(a(vars.thumb_list).width()<=-vars.thumb_page){vars.thumb_page=vars.thumb_page+vars.thumb_interval}a(vars.thumb_list).stop().animate({left:vars.thumb_page},{duration:500,easing:"easeOutExpo"})}else{if(a(".current-thumb").offset().left-a(vars.thumb_tray).offset().left<0){if(vars.thumb_page+vars.thumb_interval>0){return false}vars.thumb_page=vars.thumb_page+vars.thumb_interval;a(vars.thumb_list).stop().animate({left:vars.thumb_page},{duration:500,easing:"easeOutExpo"})}}}}}}},afterAnimation:function(){if(api.options.progress_bar&&!vars.is_paused){theme.progressBar()}},progressBar:function(){a(vars.progress_bar).stop().animate({left:-a(window).width()},0).animate({left:0},api.options.slide_interval)}};a.supersized.themeVars={progress_delay:false,thumb_page:false,thumb_interval:false,image_path:OC.webroot+"/apps/gallery/img/supersized/",play_button:"#pauseplay",next_slide:"#nextslide",prev_slide:"#prevslide",next_thumb:"#nextthumb",prev_thumb:"#prevthumb",slide_caption:"#slidecaption",slide_current:".slidenumber",slide_total:".totalslides",slide_list:"#slide-list",thumb_tray:"#thumb-tray",thumb_list:"#thumb-list",thumb_forward:"#thumb-forward",thumb_back:"#thumb-back",tray_arrow:"#tray-arrow",tray_button:"#tray-button",progress_bar:"#progress-bar"};a.supersized.themeOptions={progress_bar:1,mouse_scrub:0}})(jQuery); diff --git a/apps/gallery/l10n/ar.php b/apps/gallery/l10n/ar.php deleted file mode 100644 index 7ed0e1f57c5..00000000000 --- a/apps/gallery/l10n/ar.php +++ /dev/null @@ -1,4 +0,0 @@ -<?php $TRANSLATIONS = array( -"Rescan" => "اعادة البØØ«", -"Back" => "رجوع" -); diff --git a/apps/gallery/l10n/ca.php b/apps/gallery/l10n/ca.php deleted file mode 100644 index 1c5848cee28..00000000000 --- a/apps/gallery/l10n/ca.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Fotos", -"Share gallery" => "Comperteix la galeria", -"Error: " => "Error: ", -"Internal error" => "Error intern", -"Slideshow" => "Passi de diapositives", -"Back" => "Enrera", -"Remove confirmation" => "Elimina la confirmació", -"Do you want to remove album" => "Voleu eliminar l'à lbum", -"Change album name" => "Canvia el nom de l'à lbum", -"New album name" => "Nom nou de l'à lbum" -); diff --git a/apps/gallery/l10n/cs_CZ.php b/apps/gallery/l10n/cs_CZ.php deleted file mode 100644 index 02d1c02d6e9..00000000000 --- a/apps/gallery/l10n/cs_CZ.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Obrázky", -"Share gallery" => "SdÃlet galerii", -"Error: " => "Chyba: ", -"Internal error" => "VnitÅ™nà chyba", -"Slideshow" => "PÅ™ehrávánÃ" -); diff --git a/apps/gallery/l10n/da.php b/apps/gallery/l10n/da.php deleted file mode 100644 index 172f3c95e8c..00000000000 --- a/apps/gallery/l10n/da.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Billeder", -"Settings" => "Indstillinger", -"Rescan" => "Genindlæs", -"Stop" => "Stop", -"Share" => "Del", -"Back" => "Tilbage", -"Remove confirmation" => "Fjern bekræftelse", -"Do you want to remove album" => "Ønsker du at fjerne albummet", -"Change album name" => "Ændre albummets navn", -"New album name" => "Nyt album navn" -); diff --git a/apps/gallery/l10n/de.php b/apps/gallery/l10n/de.php deleted file mode 100644 index cd580cf303c..00000000000 --- a/apps/gallery/l10n/de.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Bilder", -"Share gallery" => "Galerie teilen", -"Error: " => "Fehler:", -"Internal error" => "Interner Fehler", -"Slideshow" => "Slideshow", -"Back" => "Zurück", -"Remove confirmation" => "Bestätigung entfernen", -"Do you want to remove album" => "Soll das Album entfernt werden", -"Change album name" => "Albumname ändern", -"New album name" => "Neuer Albumname" -); diff --git a/apps/gallery/l10n/el.php b/apps/gallery/l10n/el.php deleted file mode 100644 index 47bc3af2bb6..00000000000 --- a/apps/gallery/l10n/el.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Εικόνες", -"Share gallery" => "Κοινοποίηση συλλογής", -"Error: " => "Σφάλμα: ", -"Internal error" => "ΕσωτεÏικό σφάλμα", -"Slideshow" => "Î Ïοβολή Διαφανειών", -"Back" => "ΕπιστÏοφή", -"Remove confirmation" => "ΑφαίÏεση επιβεβαίωσης", -"Do you want to remove album" => "ΘÎλετε να αφαιÏÎσετε το άλμπουμ", -"Change album name" => "Αλλάξτε το όνομα του άλμπουμ", -"New album name" => "ÎÎο όνομα άλμπουμ" -); diff --git a/apps/gallery/l10n/eo.php b/apps/gallery/l10n/eo.php deleted file mode 100644 index 254010b788c..00000000000 --- a/apps/gallery/l10n/eo.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Bildoj", -"Settings" => "Agordo", -"Rescan" => "Reskani", -"Stop" => "Halti", -"Share" => "Kunhavigi", -"Back" => "AntaÅen", -"Remove confirmation" => "Forigi konfirmadon", -"Do you want to remove album" => "Ĉu vi volas forigi la albumon?", -"Change album name" => "ÅœanÄi albumnomon", -"New album name" => "Nova albumnomo" -); diff --git a/apps/gallery/l10n/es.php b/apps/gallery/l10n/es.php deleted file mode 100644 index aa425a0bd04..00000000000 --- a/apps/gallery/l10n/es.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Imágenes", -"Share gallery" => "Compartir galerÃa", -"Error: " => "Fallo ", -"Internal error" => "Fallo interno", -"Slideshow" => "Presentación", -"Back" => "Atrás", -"Remove confirmation" => "Borrar confirmación", -"Do you want to remove album" => "¿Quieres eliminar el álbum", -"Change album name" => "Cambiar nombre al álbum", -"New album name" => "Nuevo nombre de álbum" -); diff --git a/apps/gallery/l10n/et_EE.php b/apps/gallery/l10n/et_EE.php deleted file mode 100644 index 06bd3a5b8fe..00000000000 --- a/apps/gallery/l10n/et_EE.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Pildid", -"Settings" => "Seaded", -"Rescan" => "Skänni uuesti", -"Stop" => "Peata", -"Share" => "Jaga", -"Back" => "Tagasi", -"Remove confirmation" => "Eemaldamise kinnitus", -"Do you want to remove album" => "Kas sa soovid albumit eemaldada", -"Change album name" => "Muuda albumi nime", -"New album name" => "Uue albumi nimi" -); diff --git a/apps/gallery/l10n/eu.php b/apps/gallery/l10n/eu.php deleted file mode 100644 index f406730a8e1..00000000000 --- a/apps/gallery/l10n/eu.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Argazkiak", -"Settings" => "Ezarpenak", -"Rescan" => "Bireskaneatu", -"Stop" => "Gelditu", -"Share" => "Elkarbanatu", -"Back" => "Atzera", -"Remove confirmation" => "Ezabatu konfirmazioa", -"Do you want to remove album" => "Albuma ezabatu nahi al duzu", -"Change album name" => "Aldatu albumaren izena", -"New album name" => "Album berriaren izena" -); diff --git a/apps/gallery/l10n/fa.php b/apps/gallery/l10n/fa.php deleted file mode 100644 index 97d47047ebf..00000000000 --- a/apps/gallery/l10n/fa.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "تصاویر", -"Settings" => "تنظیمات", -"Rescan" => "بازرسی دوباره", -"Stop" => "توقÙ", -"Share" => "به اشتراک گذاری", -"Back" => "بازگشت", -"Remove confirmation" => "پاک کردن تصدیق", -"Do you want to remove album" => "آیا مایل به پاک کردن آلبوم هستید؟", -"Change album name" => "تغییر نام آلبوم", -"New album name" => "نام آلبوم جدید" -); diff --git a/apps/gallery/l10n/fi_FI.php b/apps/gallery/l10n/fi_FI.php deleted file mode 100644 index 659289ae41f..00000000000 --- a/apps/gallery/l10n/fi_FI.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Kuvat", -"Share gallery" => "Jaa galleria", -"Error: " => "Virhe: ", -"Internal error" => "Sisäinen virhe", -"Slideshow" => "Diaesitys", -"Back" => "Takaisin", -"Remove confirmation" => "Poiston vahvistus", -"Do you want to remove album" => "Tahdotko poistaa albumin", -"Change album name" => "Muuta albumin nimeä", -"New album name" => "Uuden albumin nimi" -); diff --git a/apps/gallery/l10n/fr.php b/apps/gallery/l10n/fr.php deleted file mode 100644 index 04421236e10..00000000000 --- a/apps/gallery/l10n/fr.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Images", -"Share gallery" => "Partager la galerie", -"Error: " => "Erreur :", -"Internal error" => "Erreur interne", -"Slideshow" => "Diaporama", -"Back" => "Retour", -"Remove confirmation" => "Enlever la confirmation", -"Do you want to remove album" => "Voulez-vous supprimer l'album", -"Change album name" => "Modifier le nom de l'album", -"New album name" => "Nouveau nom de l'album" -); diff --git a/apps/gallery/l10n/gl.php b/apps/gallery/l10n/gl.php deleted file mode 100644 index b7993ff5c89..00000000000 --- a/apps/gallery/l10n/gl.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "FotografÃas", -"Settings" => "Configuración", -"Rescan" => "Analizar de novo", -"Stop" => "Parar", -"Share" => "Compartir", -"Back" => "Atrás", -"Remove confirmation" => "Eliminar confirmación", -"Do you want to remove album" => "Quere eliminar o album", -"Change album name" => "Trocar o nome do album", -"New album name" => "Novo nome do album" -); diff --git a/apps/gallery/l10n/hr.php b/apps/gallery/l10n/hr.php deleted file mode 100644 index edc11ebd9d6..00000000000 --- a/apps/gallery/l10n/hr.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Slike", -"Settings" => "Postavke", -"Rescan" => "Ponovo oÄitaj", -"Stop" => "Zaustavi", -"Share" => "Podijeli", -"Back" => "Natrag", -"Remove confirmation" => "Ukloni potvrdu", -"Do you want to remove album" => "Želite li ukloniti album", -"Change album name" => "Promijeni ime albuma", -"New album name" => "Novo ime albuma" -); diff --git a/apps/gallery/l10n/hu_HU.php b/apps/gallery/l10n/hu_HU.php deleted file mode 100644 index 34adf7719ce..00000000000 --- a/apps/gallery/l10n/hu_HU.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Képek", -"Settings" => "BeállÃtások", -"Rescan" => "Újravizsgálás", -"Stop" => "Ãllj", -"Share" => "Megosztás", -"Back" => "Vissza", -"Remove confirmation" => "MegerÅ‘sÃtés eltávolÃtása", -"Do you want to remove album" => "El akarja távolÃtani az albumot?", -"Change album name" => "Albumnév megváltoztatása", -"New album name" => "Új albumnév" -); diff --git a/apps/gallery/l10n/ia.php b/apps/gallery/l10n/ia.php deleted file mode 100644 index 7ab06c3b435..00000000000 --- a/apps/gallery/l10n/ia.php +++ /dev/null @@ -1,4 +0,0 @@ -<?php $TRANSLATIONS = array( -"Rescan" => "Rescannar", -"Back" => "Retro" -); diff --git a/apps/gallery/l10n/id.php b/apps/gallery/l10n/id.php deleted file mode 100644 index 7a977b3c9aa..00000000000 --- a/apps/gallery/l10n/id.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Gambar", -"Settings" => "Setting", -"Rescan" => "Scan ulang", -"Stop" => "Berhenti", -"Share" => "Bagikan", -"Back" => "Kembali", -"Remove confirmation" => "Hapus konfirmasi", -"Do you want to remove album" => "Apakah anda ingin menghapus album", -"Change album name" => "Ubah nama album", -"New album name" => "Nama album baru" -); diff --git a/apps/gallery/l10n/it.php b/apps/gallery/l10n/it.php deleted file mode 100644 index ef8d596e7eb..00000000000 --- a/apps/gallery/l10n/it.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Immagini", -"Share gallery" => "Condividi la galleria", -"Error: " => "Errore: ", -"Internal error" => "Errore interno", -"Slideshow" => "Presentazione", -"Back" => "Indietro", -"Remove confirmation" => "Rimuovi conferma", -"Do you want to remove album" => "Vuoi rimuovere l'album", -"Change album name" => "Cambia il nome dell'album", -"New album name" => "Nuovo nome dell'album" -); diff --git a/apps/gallery/l10n/ja_JP.php b/apps/gallery/l10n/ja_JP.php deleted file mode 100644 index 4ef4510baba..00000000000 --- a/apps/gallery/l10n/ja_JP.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "写真", -"Settings" => "è¨å®š", -"Rescan" => "å†ã‚¹ã‚ャン", -"Stop" => "åœæ¢", -"Share" => "共有", -"Back" => "戻る", -"Remove confirmation" => "承èªã‚’å–ã‚Šã‚„ã‚", -"Do you want to remove album" => "アルãƒãƒ を削除ã—ã¾ã™ã‹ï¼Ÿ", -"Change album name" => "アルãƒãƒ åを変更ã™ã‚‹", -"New album name" => "æ–°ã—ã„アルãƒãƒ å" -); diff --git a/apps/gallery/l10n/ko.php b/apps/gallery/l10n/ko.php deleted file mode 100644 index 1900049f879..00000000000 --- a/apps/gallery/l10n/ko.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "사진", -"Settings" => "세팅", -"Rescan" => "재검색", -"Stop" => "ì •ì§€", -"Share" => "ê³µìœ ", -"Back" => "뒤로", -"Remove confirmation" => "ì‚ì œ 승ì¸", -"Do you want to remove album" => "ì•¨ë²”ì„ ì‚ì œí•˜ì‹œê² ìŠµë‹ˆê¹Œ", -"Change album name" => "앨범 ì´ë¦„ 변경", -"New album name" => "새로운 앨범 ì´ë¦„" -); diff --git a/apps/gallery/l10n/lb.php b/apps/gallery/l10n/lb.php deleted file mode 100644 index 136acedc653..00000000000 --- a/apps/gallery/l10n/lb.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Fotoen", -"Settings" => "Astellungen", -"Rescan" => "Nei scannen", -"Stop" => "Stop", -"Share" => "Deelen", -"Back" => "Zeréck", -"Remove confirmation" => "Konfirmatioun läschen", -"Do you want to remove album" => "Wëlls de den Album läschen", -"Change album name" => "Album Numm änneren", -"New album name" => "Neien Numm fir den Album" -); diff --git a/apps/gallery/l10n/lt_LT.php b/apps/gallery/l10n/lt_LT.php deleted file mode 100644 index 89c1a92d0cc..00000000000 --- a/apps/gallery/l10n/lt_LT.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Nuotraukos", -"Settings" => "Nustatymai", -"Rescan" => "Atnaujinti", -"Stop" => "Sustabdyti", -"Share" => "Dalintis", -"Back" => "Atgal", -"Remove confirmation" => "IÅ¡jungti patvirtinimÄ…", -"Do you want to remove album" => "Ar tikrai norite paÅ¡alinti albumÄ…", -"Change album name" => "Keisti albumo pavadinimÄ…", -"New album name" => "Naujo albumo pavadinimas" -); diff --git a/apps/gallery/l10n/mk.php b/apps/gallery/l10n/mk.php deleted file mode 100644 index 97f85de7ab2..00000000000 --- a/apps/gallery/l10n/mk.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Слики", -"Settings" => "Параметри", -"Rescan" => "РеÑкенирај", -"Stop" => "Стоп", -"Share" => "Сподели", -"Back" => "Ðазад", -"Remove confirmation" => "Тргни потврда", -"Do you want to remove album" => "Дали Ñакате да го отÑтраните албумот", -"Change album name" => "Измени име на албумот", -"New album name" => "Ðово има на албумот" -); diff --git a/apps/gallery/l10n/ms_MY.php b/apps/gallery/l10n/ms_MY.php deleted file mode 100644 index a865a20a2d5..00000000000 --- a/apps/gallery/l10n/ms_MY.php +++ /dev/null @@ -1,4 +0,0 @@ -<?php $TRANSLATIONS = array( -"Rescan" => "Imbas semula", -"Back" => "Kembali" -); diff --git a/apps/gallery/l10n/nb_NO.php b/apps/gallery/l10n/nb_NO.php deleted file mode 100644 index 532062937fd..00000000000 --- a/apps/gallery/l10n/nb_NO.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Bilder", -"Share gallery" => "Del galleri", -"Error: " => "Feil:", -"Internal error" => "Intern feil", -"Slideshow" => "Lysbildefremvisning" -); diff --git a/apps/gallery/l10n/nl.php b/apps/gallery/l10n/nl.php deleted file mode 100644 index df8fcaf72da..00000000000 --- a/apps/gallery/l10n/nl.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Plaatjes", -"Share gallery" => "Deel gallerie", -"Error: " => "Fout:", -"Internal error" => "Interne fout", -"Slideshow" => "Diashow" -); diff --git a/apps/gallery/l10n/nn_NO.php b/apps/gallery/l10n/nn_NO.php deleted file mode 100644 index 9caeff33067..00000000000 --- a/apps/gallery/l10n/nn_NO.php +++ /dev/null @@ -1,4 +0,0 @@ -<?php $TRANSLATIONS = array( -"Rescan" => "Søk pÃ¥ nytt", -"Back" => "Tilbake" -); diff --git a/apps/gallery/l10n/pl.php b/apps/gallery/l10n/pl.php deleted file mode 100644 index 8c0bd0cb98d..00000000000 --- a/apps/gallery/l10n/pl.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "ZdjÄ™cia", -"Share gallery" => "UdostÄ™pnij galeriÄ™", -"Error: " => "BÅ‚Ä…d: ", -"Internal error" => "BÅ‚Ä…d wewnÄ™trzny", -"Slideshow" => "Pokaz slajdów", -"Back" => "Wróć", -"Remove confirmation" => "UsuÅ„ potwierdzenie", -"Do you want to remove album" => "Czy chcesz usunąć album", -"Change album name" => "ZmieÅ„ nazwÄ™ albumu", -"New album name" => "Nowa nazwa albumu" -); diff --git a/apps/gallery/l10n/pt_BR.php b/apps/gallery/l10n/pt_BR.php deleted file mode 100644 index 7b45df444e9..00000000000 --- a/apps/gallery/l10n/pt_BR.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Fotos", -"Settings" => "Configuração", -"Rescan" => "Atualizar", -"Stop" => "Parar", -"Share" => "Compartilhar", -"Back" => "Voltar", -"Remove confirmation" => "Confirmar apagar", -"Do you want to remove album" => "Voçe dezeja remover o album", -"Change album name" => "Mudar nome do album", -"New album name" => "Nome do novo album" -); diff --git a/apps/gallery/l10n/pt_PT.php b/apps/gallery/l10n/pt_PT.php deleted file mode 100644 index 8b7aa2a23bc..00000000000 --- a/apps/gallery/l10n/pt_PT.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Imagens", -"Share gallery" => "Partilhar a galeria", -"Error: " => "Erro: ", -"Internal error" => "Erro interno", -"Slideshow" => "Slideshow" -); diff --git a/apps/gallery/l10n/ro.php b/apps/gallery/l10n/ro.php deleted file mode 100644 index 3537c68b173..00000000000 --- a/apps/gallery/l10n/ro.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Imagini", -"Settings" => "Setări", -"Rescan" => "Re-scanează", -"Stop" => "Stop", -"Share" => "Partajează", -"Back" => "ÃŽnapoi", -"Remove confirmation" => "Șterge confirmarea", -"Do you want to remove album" => "Vrei să È™tergi albumul", -"Change album name" => "Schimbă numele albumului", -"New album name" => "Nume nou album" -); diff --git a/apps/gallery/l10n/ru.php b/apps/gallery/l10n/ru.php deleted file mode 100644 index d6e33e4b017..00000000000 --- a/apps/gallery/l10n/ru.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "РиÑунки", -"Share gallery" => "Опубликовать", -"Error: " => "Ошибка", -"Internal error" => "ВнутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ°", -"Slideshow" => "Слайдшоу" -); diff --git a/apps/gallery/l10n/sk_SK.php b/apps/gallery/l10n/sk_SK.php deleted file mode 100644 index e3e3be7881c..00000000000 --- a/apps/gallery/l10n/sk_SK.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Obrázky", -"Settings" => "nastavenia", -"Rescan" => "Znovu oskenovaÅ¥", -"Stop" => "ZastaviÅ¥", -"Share" => "ZdielaÅ¥", -"Back" => "Späť", -"Remove confirmation" => "Potvrdenie odstránenia", -"Do you want to remove album" => "Chcete odstrániÅ¥ album?", -"Change album name" => "ZmeniÅ¥ meno albumu", -"New album name" => "Nové meno albumu" -); diff --git a/apps/gallery/l10n/sl.php b/apps/gallery/l10n/sl.php deleted file mode 100644 index 8d3bb9f5887..00000000000 --- a/apps/gallery/l10n/sl.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Slike", -"Share gallery" => "Daj galerijo v souporabo", -"Error: " => "Napaka: ", -"Internal error" => "Notranja napaka", -"Slideshow" => "predstavitev", -"Back" => "Nazaj", -"Remove confirmation" => "Odstrani potrditev", -"Do you want to remove album" => "Ali želite odstraniti album", -"Change album name" => "Spremeni ime albuma", -"New album name" => "Novo ime albuma" -); diff --git a/apps/gallery/l10n/sr.php b/apps/gallery/l10n/sr.php deleted file mode 100644 index e3b82defa97..00000000000 --- a/apps/gallery/l10n/sr.php +++ /dev/null @@ -1,4 +0,0 @@ -<?php $TRANSLATIONS = array( -"Rescan" => "Претражи поново", -"Back" => "Ðазад" -); diff --git a/apps/gallery/l10n/sv.php b/apps/gallery/l10n/sv.php deleted file mode 100644 index b63a89d90fc..00000000000 --- a/apps/gallery/l10n/sv.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Bilder", -"Share gallery" => "Dela galleri", -"Error: " => "Fel:", -"Internal error" => "Internt fel", -"Slideshow" => "Bildspel", -"Back" => "Tillbaka", -"Remove confirmation" => "Vill du säkert ta bort", -"Do you want to remove album" => "Vill du ta bort albumet", -"Change album name" => "Ändra albumnamnet", -"New album name" => "Albumnamn" -); diff --git a/apps/gallery/l10n/th_TH.php b/apps/gallery/l10n/th_TH.php deleted file mode 100644 index 9bb699e2644..00000000000 --- a/apps/gallery/l10n/th_TH.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "รูปภาพ", -"Share gallery" => "à¹à¸Šà¸£à¹Œà¸‚้à¸à¸¡à¸¹à¸¥à¹à¸à¸¥à¸à¸£à¸µà¹ˆ", -"Error: " => "พบข้à¸à¸œà¸´à¸”พลาด: ", -"Internal error" => "เà¸à¸´à¸”ข้à¸à¸œà¸´à¸”พลาดภายในระบบ", -"Slideshow" => "ภาพสไลด์โชว์" -); diff --git a/apps/gallery/l10n/tr.php b/apps/gallery/l10n/tr.php deleted file mode 100644 index 7d007fa66e1..00000000000 --- a/apps/gallery/l10n/tr.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Resimler", -"Share gallery" => "Galeriyi paylaÅŸ", -"Error: " => "Hata: ", -"Internal error" => "İç hata", -"Slideshow" => "Slide Gösterim", -"Back" => "Geri", -"Remove confirmation" => "DoÄŸrulamayı kaldır", -"Do you want to remove album" => "Albümü silmek istiyor musunuz", -"Change album name" => "Albüm adını deÄŸiÅŸtir", -"New album name" => "Yeni albüm adı" -); diff --git a/apps/gallery/l10n/uk.php b/apps/gallery/l10n/uk.php deleted file mode 100644 index 2544158d452..00000000000 --- a/apps/gallery/l10n/uk.php +++ /dev/null @@ -1,4 +0,0 @@ -<?php $TRANSLATIONS = array( -"Rescan" => "Оновити", -"Back" => "Ðазад" -); diff --git a/apps/gallery/l10n/vi.php b/apps/gallery/l10n/vi.php deleted file mode 100644 index d1d7fc64fca..00000000000 --- a/apps/gallery/l10n/vi.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "Hình ảnh", -"Share gallery" => "Chia sẻ gallery", -"Error: " => "Lá»—i :", -"Internal error" => "Lá»—i ná»™i bá»™", -"Back" => "Trở lại", -"Remove confirmation" => "Xóa xác nháºn", -"Do you want to remove album" => "Bạn muốn xóa album nà y ", -"Change album name" => "Äổi tên album", -"New album name" => "Tên album má»›i" -); diff --git a/apps/gallery/l10n/zh_CN.php b/apps/gallery/l10n/zh_CN.php deleted file mode 100644 index 6aa4fc7f353..00000000000 --- a/apps/gallery/l10n/zh_CN.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "图片", -"Share gallery" => "分享图库", -"Error: " => "错误:", -"Internal error" => "内部错误", -"Slideshow" => "å¹»ç¯ç‰‡" -); diff --git a/apps/gallery/l10n/zh_TW.php b/apps/gallery/l10n/zh_TW.php deleted file mode 100644 index eb4577affce..00000000000 --- a/apps/gallery/l10n/zh_TW.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php $TRANSLATIONS = array( -"Pictures" => "圖片", -"Settings" => "è¨å®š", -"Rescan" => "é‡æ–°æŽƒæ", -"Stop" => "åœæ¢", -"Share" => "分享", -"Back" => "返回", -"Remove confirmation" => "移除確èª", -"Do you want to remove album" => "ä½ ç¢ºå®šè¦ç§»é™¤ç›¸ç°¿å—Ž", -"Change album name" => "變更相簿å稱", -"New album name" => "新相簿å稱" -); diff --git a/apps/gallery/lib/album.php b/apps/gallery/lib/album.php deleted file mode 100644 index d1b29a59928..00000000000 --- a/apps/gallery/lib/album.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php - -/** -* ownCloud - gallery application -* -* @author Bartek Przybylski -* @copyright 2012 Bartek Przybylski <bartek@alefzero.eu> -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - -class OC_Gallery_Album { - public static function create($owner, $name, $path){ - $stmt = OCP\DB::prepare('INSERT INTO `*PREFIX*gallery_albums` (`uid_owner`, `album_name`, `album_path`, `parent_path`) ALUES (?, ?, ?, ?)'); - $stmt->execute(array($owner, $name, $path, self::getParentPath($path))); - } - - public static function cleanup() { - $albums = self::find(OCP\USER::getUser()); - while ($r = $albums->fetchRow()) { - OC_Gallery_Photo::removeByAlbumId($r['album_id']); - self::remove(OCP\USER::getUser(), $r['album_name']); - } - } - - public static function getParentPath($path) { - return $path === '/' ? '' : dirname($path); - } - - public static function remove($owner, $name=null, $path=null, $parent=null) { - $sql = 'DELETE FROM `*PREFIX*gallery_albums` WHERE `uid_owner` LIKE ?'; - $args = array($owner); - if (!is_null($name)){ - $sql .= ' AND `album_name` LIKE ?'; - $args[] = $name; - } - if (!is_null($path)){ - $sql .= ' AND `album_path` LIKE ?'; - $args[] = $path; - } - if (!is_null($parent)){ - $sql .= ' AND `parent_path` LIKE ?'; - $args[] = $parent; - } - $stmt = OCP\DB::prepare($sql); - return $stmt->execute($args); - } - - public static function removeByName($owner, $name) { self::remove($ownmer, $name); } - public static function removeByPath($owner, $path) { self::remove($owner, null, $path); } - public static function removeByParentPath($owner, $parent) { self::remove($owner, null, null, $parent); } - - public static function find($owner, $name=null, $path=null, $parent=null){ - $sql = 'SELECT * FROM `*PREFIX*gallery_albums` WHERE `uid_owner` = ?'; - $args = array($owner); - if (!is_null($name)){ - $sql .= ' AND `album_name` = ?'; - $args[] = $name; - } - if (!is_null($path)){ - $sql .= ' AND `album_path` = ?'; - $args[] = $path; - } - if (!is_null($parent)){ - $sql .= ' AND `parent_path` = ?'; - $args[] = $parent; - } - $order = OCP\Config::getUserValue($owner, 'gallery', 'order', 'ASC'); - $sql .= ' ORDER BY `album_name` ' . $order; - - $stmt = OCP\DB::prepare($sql); - return $stmt->execute($args); - } - - public static function changePath($oldname, $newname, $owner) { - $stmt = OCP\DB::prepare('UPDATE `*PREFIX*gallery_albums` SET `album_path`=? WHERE `uid_owner`=? AND `album_path`=?'); - $stmt->execute(array($newname, $owner, $oldname)); - } - - public static function changeThumbnailPath($oldname, $newname) { - $view = OCP\Files::getStorage('gallery'); - $view->rename($oldname.'.png', $newname.'.png'); - } - - public static function getAlbumSize($id){ - $sql = 'SELECT COUNT(*) AS `size` FROM `*PREFIX*gallery_photos` WHERE `album_id` = ?'; - $stmt = OCP\DB::prepare($sql); - $result=$stmt->execute(array($id))->fetchRow(); - return $result['size']; - } - - public static function getIntermediateGallerySize($path) { - $path .= '%'; - $sql = 'SELECT COUNT(*) AS `size` FROM `*PREFIX*gallery_photos` AS `photos`, `*PREFIX*gallery_albums` AS `albums` WHERE `photos`.`album_id` = `albums`.`album_id` AND `uid_owner` = ? AND `file_path` LIKE ?'; - $stmt = OCP\DB::prepare($sql); - $result = $stmt->execute(array(OCP\USER::getUser(), $path))->fetchRow(); - return $result['size']; - } -} diff --git a/apps/gallery/lib/hooks_handlers.php b/apps/gallery/lib/hooks_handlers.php deleted file mode 100644 index 3bafdb5cf4d..00000000000 --- a/apps/gallery/lib/hooks_handlers.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -/** -* ownCloud - gallery application -* -* @author Bartek Przybylski -* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - -OCP\Util::connectHook('OC_Filesystem', 'delete', "OC_Gallery_Hooks_Handlers", "removePhoto"); -//OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_rename, "OC_Gallery_Hooks_Handlers", "renamePhoto"); - -require_once(OC::$CLASSPATH['Pictures_Managers']); - -class OC_Gallery_Hooks_Handlers { - - public static function removePhoto($params) { - \OC\Pictures\ThumbnailsManager::getInstance()->delete($params[OC_Filesystem::signal_param_path]); - } - - public static function renamePhoto($params) { - $oldpath = $params[OC_Filesystem::signal_param_oldpath]; - $newpath = $params[OC_Filesystem::signal_param_newpath]; - //TODO: implement this - } -} diff --git a/apps/gallery/lib/images_utils.php b/apps/gallery/lib/images_utils.php deleted file mode 100644 index f5e37cf1dee..00000000000 --- a/apps/gallery/lib/images_utils.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -/** -* ownCloud - gallery application -* -* @author Bartek Przybylski -* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - -OCP\JSON::checkLoggedIn(); -OCP\JSON::checkAppEnabled('gallery'); - -function CroppedThumbnail($imgSrc,$thumbnail_width,$thumbnail_height, $tgtImg, $shift) { - //getting the image dimensions - list($width_orig, $height_orig) = getimagesize($imgSrc); - switch (strtolower(substr($imgSrc, strrpos($imgSrc, '.')+1))) { - case "jpeg": - case "jpg": - case "tiff": - $myImage = imagecreatefromjpeg($imgSrc); - break; - case "png": - $myImage = imagecreatefrompng($imgSrc); - break; - default: - exit(); - } - $ratio_orig = $width_orig/$height_orig; - - if ($thumbnail_width/$thumbnail_height > $ratio_orig) { - $new_height = $thumbnail_width/$ratio_orig; - $new_width = $thumbnail_width; - } else { - $new_width = $thumbnail_height*$ratio_orig; - $new_height = $thumbnail_height; - } - - $x_mid = $new_width/2; //horizontal middle - $y_mid = $new_height/2; //vertical middle - - $process = imagecreatetruecolor(round($new_width), round($new_height)); - - imagecopyresampled($process, $myImage, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig); - imagecopyresampled($tgtImg, $process, $shift, 0, ($x_mid-($thumbnail_width/2)), ($y_mid-($thumbnail_height/2)), $thumbnail_width, $thumbnail_height, $thumbnail_width, $thumbnail_height); - - imagedestroy($process); - imagedestroy($myImage); -} diff --git a/apps/gallery/lib/managers.php b/apps/gallery/lib/managers.php deleted file mode 100644 index 666c6d68931..00000000000 --- a/apps/gallery/lib/managers.php +++ /dev/null @@ -1,133 +0,0 @@ -<?php - -namespace OC\Pictures; - -class DatabaseManager { - private static $instance = null; - protected $cache = array(); - const TAG = 'DatabaseManager'; - - public static function getInstance() { - if (self::$instance === null) - self::$instance = new DatabaseManager(); - return self::$instance; - } - - protected function getPathData($path) { - $stmt = \OCP\DB::prepare('SELECT * FROM `*PREFIX*pictures_images_cache` - WHERE `uid_owner` LIKE ? AND `path` LIKE ? AND `path` NOT LIKE ?'); - $path_match = $path.'/%'; - $path_notmatch = $path.'/%/%'; - $result = $stmt->execute(array(\OCP\USER::getUser(), $path_match, $path_notmatch)); - $this->cache[$path] = array(); - while (($row = $result->fetchRow()) != false) { - $this->cache[$path][$row['path']] = $row; - } - } - - public function setFileData($path, $width, $height) { - $stmt = \OCP\DB::prepare('INSERT INTO `*PREFIX*pictures_images_cache` (`uid_owner`, `path`, `width`, `height`) VALUES (?, ?, ?, ?)'); - $stmt->execute(array(\OCP\USER::getUser(), $path, $width, $height)); - $ret = array('path' => $path, 'width' => $width, 'height' => $height); - $dir = dirname($path); - $this->cache[$dir][$path] = $ret; - return $ret; - } - - public function getFileData($path) { - $gallery_path = \OCP\Config::getSystemValue( 'datadirectory' ).'/'.\OC_User::getUser().'/gallery'; - $path = $gallery_path.$path; - $dir = dirname($path); - if (!isset($this->cache[$dir])) { - $this->getPathData($dir); - } - if (isset($this->cache[$dir][$path])) { - return $this->cache[$dir][$path]; - } - $image = new \OC_Image(); - if (!$image->loadFromFile($path)) { - return false; - } - $ret = $this->setFileData($path, $image->width(), $image->height()); - unset($image); - $this->cache[$dir][$path] = $ret; - return $ret; - } - - private function __construct() {} -} - -class ThumbnailsManager { - - private static $instance = null; - const TAG = 'ThumbnailManager'; - const THUMBNAIL_HEIGHT = 150; - - public static function getInstance() { - if (self::$instance === null) - self::$instance = new ThumbnailsManager(); - return self::$instance; - } - - public function getThumbnail($path) { - $gallery_storage = \OCP\Files::getStorage('gallery'); - if ($gallery_storage->file_exists($path)) { - return new \OC_Image($gallery_storage->getLocalFile($path)); - } - if (!\OC_Filesystem::file_exists($path)) { - \OC_Log::write(self::TAG, 'File '.$path.' don\'t exists', \OC_Log::WARN); - return false; - } - $image = new \OC_Image(); - $image->loadFromFile(\OC_Filesystem::getLocalFile($path)); - if (!$image->valid()) return false; - - $image->fixOrientation(); - - $ret = $image->preciseResize( floor((self::THUMBNAIL_HEIGHT*$image->width())/$image->height()), self::THUMBNAIL_HEIGHT ); - - if (!$ret) { - \OC_Log::write(self::TAG, 'Couldn\'t resize image', \OC_Log::ERROR); - unset($image); - return false; - } - $l = $gallery_storage->getLocalFile($path); - - $image->save($l); - return $image; - } - - public function getThumbnailWidth($image) { - return floor((self::THUMBNAIL_HEIGHT*$image->widthTopLeft())/$image->heightTopLeft()); - } - - public function getThumbnailInfo($path) { - $arr = DatabaseManager::getInstance()->getFileData($path); - if (!$arr) { - if (!\OC_Filesystem::file_exists($path)) { - \OC_Log::write(self::TAG, 'File '.$path.' don\'t exists', \OC_Log::WARN); - return false; - } - $image = new \OC_Image(); - $image->loadFromFile(\OC_Filesystem::getLocalFile($path)); - if (!$image->valid()) { - return false; - } - $arr = DatabaseManager::getInstance()->setFileData($path, $this->getThumbnailWidth($image), self::THUMBNAIL_HEIGHT); - } - $ret = array('filepath' => $arr['path'], - 'width' => $arr['width'], - 'height' => $arr['height']); - return $ret; - } - - public function delete($path) { - $thumbnail_storage = \OCP\Files::getStorage('gallery'); - if ($thumbnail_storage->file_exists($path)) { - $thumbnail_storage->unlink($path); - } - } - - private function __construct() {} - -} diff --git a/apps/gallery/lib/photo.php b/apps/gallery/lib/photo.php deleted file mode 100644 index 1d304ce4357..00000000000 --- a/apps/gallery/lib/photo.php +++ /dev/null @@ -1,136 +0,0 @@ -<?php - -/** - * ownCloud - gallery application - * - * @author Bartek Przybylski - * @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE - * License as published by the Free Software Foundation; either - * version 3 of the License, or any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU AFFERO GENERAL PUBLIC LICENSE for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - * - */ -class OC_Gallery_Photo { - public static function create($albumId, $img){ - $stmt = OCP\DB::prepare('INSERT INTO `*PREFIX*gallery_photos` (`album_id`, `file_path`) VALUES (?, ?)'); - $stmt->execute(array($albumId, $img)); - } - public static function find($albumId, $img=null){ - $sql = 'SELECT * FROM `*PREFIX*gallery_photos` WHERE `album_id` = ?'; - $args = array($albumId); - if (!is_null($img)){ - $sql .= ' AND `file_path` = ?'; - $args[] = $img; - } - $stmt = OCP\DB::prepare($sql); - return $stmt->execute($args); - } - - public static function findForAlbum($owner, $album_name) { - $stmt = OCP\DB::prepare('SELECT *' - .' FROM `*PREFIX*gallery_photos photos`,' - .' `*PREFIX*gallery_albums albums`' - .' WHERE `albums`.`uid_owner` = ?' - .' AND `albums`.`album_name` = ?' - .' AND `photos`.`album_id` = `albums`.`album_id`'); - return $stmt->execute(array($owner, $album_name)); - } - - public static function removeByPath($path, $album_id) { - $stmt = OCP\DB::prepare('DELETE FROM `*PREFIX*gallery_photos` WHERE `file_path` LIKE ? AND `album_id` = ?'); - $stmt->execute(array($path, $album_id)); - } - - public static function removeById($id) { - $stmt = OCP\DB::prepare('DELETE FROM `*PREFIX*gallery_photos` WHERE `photo_id` = ?'); - $stmt->execute(array($id)); - } - - public static function removeByAlbumId($albumid) { - $stmt = OCP\DB::prepare('DELETE FROM `*PREFIX*gallery_photos` WHERE `album_id` = ?'); - $stmt->execute(array($albumid)); - } - - public static function changePath($oldAlbumId, $newAlbumId, $oldpath, $newpath) { - $stmt = OCP\DB::prepare('UPDATE `*PREFIX*gallery_photos` SET `file_path` = ?, `album_id` = ? WHERE `album_id` = ? AND `file_path` = ?'); - $stmt->execute(array($newpath, $newAlbumId, $oldAlbumId, $oldpath)); - } - - public static function getThumbnail($image_name, $owner = null) { - if (!$owner) - $owner = OCP\USER::getUser(); - $view = OCP\Files::getStorage('gallery'); - $save_dir = dirname($image_name); - if (!$view->is_dir($save_dir)) { - $view->mkdir($save_dir); - } - $view->chroot($view->getRoot() . '/' . $save_dir); - $thumb_file = basename($image_name); - if ($view->file_exists($thumb_file)) { - $image = new OC_Image($view->fopen($thumb_file, 'r')); - } else { - $image_path = OC_Filesystem::getLocalFile($image_name); - if (!file_exists($image_path)) { - return null; - } - $image = new OC_Image($image_path); - if ($image->valid()) { - $image->centerCrop(200); - $image->fixOrientation(); - $image->save($view->getLocalFile($thumb_file)); - } - } - if ($image->valid()) { - return $image; - } else { - $image->destroy(); - } - return null; - } - - public static function getViewImage($image_name, $owner = null) { - if (!$owner) $owner = OCP\USER::getUser(); - $save_dir = OCP\Config::getSystemValue("datadirectory") . '/' . $owner . '/gallery'; - $save_dir .= dirname($image_name) . '/view/'; - $image_path = $image_name; - $view_file = $save_dir . basename($image_name); - if (!is_dir($save_dir)) { - mkdir($save_dir, 0777, true); - } - if (file_exists($view_file)) { - $image = new OC_Image($view_file); - } else { - $image_path = OC_Filesystem::getLocalFile($image_path); - if (!file_exists($image_path)) { - return null; - } - $image = new OC_Image($image_path); - if ($image->valid()) { - $image->resize(1200); - $image->fixOrientation(); - $image->save($view_file); - } - } - if ($image->valid()) { - return $image; - } else { - $image->destroy(); - } - return null; - } - - public static function getGalleryRoot() { - return OCP\Config::getUserValue(OCP\USER::getUser(), 'gallery', 'root', ''); - } - -} diff --git a/apps/gallery/lib/scanner.php b/apps/gallery/lib/scanner.php deleted file mode 100644 index 79b8ad4923e..00000000000 --- a/apps/gallery/lib/scanner.php +++ /dev/null @@ -1,150 +0,0 @@ -<?php - -/** -* ownCloud - gallery application -* -* @author Bartek Przybylski -* @copyright 2012 Bartek Przybylski <bartek@alefzero.eu> -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - -class OC_Gallery_Scanner { - - public static function getGalleryRoot() { - return OCP\Config::getUserValue(OCP\USER::getUser(), 'gallery', 'root', '/'); - } - public static function getScanningRoot() { - return OC_Filesystem::getRoot().self::getGalleryRoot(); - } - - public static function cleanUp() { - OC_Gallery_Album::cleanup(); - } - - public static function createName($name) { - $name = basename($name); - return $name == '.' ? '' : $name; - } - - // Scan single dir relative to gallery root - public static function scan($eventSource) { - $paths = self::findPaths(); - $eventSource->send('count', count($paths)+1); - $owner = OCP\USER::getUser(); - foreach ($paths as $path) { - $name = self::createName($path); - $images = self::findFiles($path); - - $result = OC_Gallery_Album::find($owner, null, $path); - // don't duplicate galleries with same path - if (!($albumId = $result->fetchRow())) { - OC_Gallery_Album::create($owner, $name, $path); - $result = OC_Gallery_Album::find($owner, $name, $path); - $albumId = $result->fetchRow(); - } - $albumId = $albumId['album_id']; - foreach ($images as $img) { - $result = OC_Gallery_Photo::find($albumId, $img); - if (!$result->fetchRow()) - OC_Gallery_Photo::create($albumId, $img); - } - if (count($images)) - self::createThumbnails($name, $images); - $eventSource->send('scanned', ''); - } - self::createIntermediateAlbums(); - $eventSource->send('scanned', ''); - $eventSource->send('done', 1); - } - - public static function createThumbnails($albumName, $files) { - // create gallery thumbnail - $file_count = min(count($files), 10); - $thumbnail = imagecreatetruecolor($file_count*200, 200); - for ($i = 0; $i < $file_count; $i++) { - $image = OC_Gallery_Photo::getThumbnail($files[$i]); - if ($image && $image->valid()) { - imagecopyresampled($thumbnail, $image->resource(), $i*200, 0, 0, 0, 200, 200, 200, 200); - $image->destroy(); - } - } - $view = OCP\Files::getStorage('gallery'); - imagepng($thumbnail, $view->getLocalFile($albumName.'.png')); - imagedestroy($thumbnail); - } - - public static function createIntermediateAlbums() { - $paths = self::findPaths(); - for ($i = 1; $i < count($paths); $i++) { - $prevLen = strlen($paths[$i-1]); - if (strncmp($paths[$i-1], $paths[$i], $prevLen)==0) { - $s = substr($paths[$i], $prevLen); - if (strrpos($s, '/') != 0) { - $a = explode('/', trim($s, '/')); - $p = $paths[$i-1]; - foreach ($a as $e) { - $p .= ($p == '/'?'':'/').$e; - OC_Gallery_Album::create(OCP\USER::getUser(), $e, $p); - $arr = OC_FileCache::searchByMime('image','', OC_Filesystem::getRoot().$p); - $step = floor(count($arr)/10); - if ($step == 0) $step = 1; - $na = array(); - for ($j = 0; $j < count($arr); $j+=$step) { - $na[] = $p.$arr[$j]; - } - if (count($na)) - self::createThumbnails($e, $na); - } - } - } - } - } - - public static function isPhoto($filename) { - $ext = strtolower(substr($filename, strrpos($filename, '.')+1)); - return $ext=='png' || $ext=='jpeg' || $ext=='jpg' || $ext=='gif'; - } - - public static function findFiles($path) { - $images = OC_FileCache::searchByMime('image','', OC_Filesystem::getRoot().$path); - $new = array(); - foreach ($images as $i) - if (strpos($i, '/',1) === FALSE) - $new[] = $path.$i; - return $new; - } - - public static function findPaths() {
- $images=OC_FileCache::searchByMime('image','', self::getScanningRoot());
- $paths=array();
- foreach($images as $image){
- $path=dirname($image);
- $path = self::getGalleryRoot().($path=='.'?'':$path);
- if ($path !== '/') $path=rtrim($path,'/');
- if(array_search($path,$paths)===false){
- $paths[]=$path;
- }
- // add sub path also if they don't contain images
- while ( ($path = dirname($path)) != '/') {
- if(array_search($path,$paths)===false){
- $paths[]=$path;
- }
- }
- }
- sort($paths);
- return $paths;
- } -} diff --git a/apps/gallery/lib/share.php b/apps/gallery/lib/share.php deleted file mode 100644 index d6c5f40d492..00000000000 --- a/apps/gallery/lib/share.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** -* ownCloud -* -* @author Michael Gapczynski -* @copyright 2012 Michael Gapczynski mtgap@owncloud.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Affero General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -*/ - -abstract class OC_Share_Photo_Backend implements OCP\Share_Backend { - - public $dependsOn = 'file'; - public $supportedFileExtensions = array('jpg', 'png', 'gif'); - - public function getSource($item, $uid) { - return array('item' => 'blah.jpg', 'file' => $item); - } - - public function generateTarget($item, $uid, $exclude = null) { - // TODO Make sure target path doesn't exist already - return $item; - } - - public function formatItems($items, $format, $parameters = null) { - - } - -} - -?>
\ No newline at end of file diff --git a/apps/gallery/lib/sharing.php b/apps/gallery/lib/sharing.php deleted file mode 100644 index e79692392a8..00000000000 --- a/apps/gallery/lib/sharing.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php - -/** -* ownCloud - gallery application -* -* @author Bartek Przybylski -* @copyright 2012 Bartek Przybylski bartek@alefzero.eu -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - -class OC_Gallery_Sharing { - private static function getEntries($token) { - $sql = 'SELECT * FROM `*PREFIX*gallery_sharing` WHERE `token` = ?'; - $stmt = OCP\DB::prepare($sql); - return $stmt->execute(array($token)); - } - - public static function isTokenValid($token) { - $r = self::getEntries($token); - $row = $r->fetchRow(); - return $row != null; - } - - public static function isRecursive($token) { - $r = self::getEntries($token); - if ($row = $r->fetchRow()) return $row['recursive'] == 1; - return false; - } - - public static function getTokenOwner($token) { - $r = self::getEntries($token); - if ($row = $r->fetchRow()) { - $galleryId = $row['gallery_id']; - $sql = 'SELECT * FROM `*PREFIX*gallery_albums` WHERE `album_id` = ?'; - $stmt = OCP\DB::prepare($sql); - $r = $stmt->execute(array($galleryId)); - if ($row = $r->fetchRow()) - return $row['uid_owner']; - } - return false; - } - - public static function getPath($token) { - $r = self::getEntries($token); - if ($row = $r->fetchRow()) { - $galleryId = $row['gallery_id']; - $sql = 'SELECT * FROM `*PREFIX*gallery_albums` WHERE `album_id` = ?'; - $stmt = OCP\DB::prepare($sql); - $r = $stmt->execute(array($galleryId)); - if ($row = $r->fetchRow()) - return $row['album_path']; - } - } - - public static function updateSharingByToken($token, $recursive) { - $stmt = OCP\DB::prepare('UPDATE `*PREFIX*gallery_sharing` SET `recursive` = ? WHERE `token` = ?'); - $stmt->execute(array($recursive, $token)); - } - - public static function getEntryByAlbumId($album_id) { - $stmt = OCP\DB::prepare('SELECT * FROM `*PREFIX*gallery_sharing` WHERE `gallery_id` = ?'); - return $stmt->execute(array($album_id)); - } - - public static function addShared($token, $albumId, $recursive) { - $sql = 'INSERT INTO `*PREFIX*gallery_sharing` (`token`, `gallery_id`, `recursive`) VALUES (?, ?, ?)'; - $stmt = OCP\DB::prepare($sql); - $stmt->execute(array($token, $albumId, $recursive)); - } - - public static function remove($albumId) { - $stmt = OCP\DB::prepare('DELETE FROM `*PREFIX*gallery_sharing` WHERE `gallery_id` = ?'); - $stmt->execute(array($albumId)); - } -} - diff --git a/apps/gallery/lib/tiles.php b/apps/gallery/lib/tiles.php deleted file mode 100644 index e36d26d3191..00000000000 --- a/apps/gallery/lib/tiles.php +++ /dev/null @@ -1,176 +0,0 @@ -<?php - -namespace OC\Pictures; - -require_once('lib/base.php'); -require_once('managers.php'); - -const TAG = 'Pictures'; -const IMAGE_WIDTH = 150; - -class TileBase { - public function getWidth() { return false; } - - public function getHeight() { return IMAGE_WIDTH; } - - public function getOnHoverAction() { return false; } - - public function getOnOutAction() { return false; } - - public function getOnClickAction() { return false; } - - public function getDisplayedLayer() { return false; } - - public function getTileProportion() { return false; } - - public function get() { return false; } -} - -class TilesLine { - - public function __construct() { - $this->tiles_array = array(); - } - - public function setAvailableSpace($space) { - $this->available_space = $space; - } - - public function getTilesCount() { - return count($this->tiles_array); - } - - public function addTile($tile) { - array_push($this->tiles_array, $tile); - } - - public function getLeftSpace() { - $occupied_space = 0; - for ($i = 0; $i < count($this->tiles_array); $i++) { - $occupied_space += $this->tiles_array[$i]->getWidth(); - } - return $this->available_space - $occupied_space; - } - - public function tileWillFit($tile) { - return $this->getLeftSpace() > $tile->getWidth(); - } - - public function get() { - $r = '<div class="line gallery_div">'; - - for ($i = 0; $i < count($this->tiles_array); $i++) { - $img_w = $this->tiles_array[$i]->getWidth(); - $extra = ''; - if ($img_w != IMAGE_WIDTH) $extra = ' style="width:'.$img_w.'px"'; - $r .= '<div class="gallery_div" '.$extra.' onmouseover="'.$this->tiles_array[$i]->getOnHoverAction().'" onmouseout="'.$this->tiles_array[$i]->getOnOutAction().'" onclick="'.$this->tiles_array[$i]->getOnClickAction().'" style="background-color:#ddd">'.$this->tiles_array[$i]->get().'</div>'; - } - - $r .= '</div>'; - return $r; - } - - private $tiles_array; - private $available_space; -} - -class TileSingle extends TileBase { - - public function __construct($path) { - \OC_Log::write(TAG, 'Loading file from path '.$path, \OC_Log::DEBUG); - $this->file_path = $path; -/* $this->image = new \OC_Image(); - if (!$this->image->loadFromFile($this->file_path)) { - \OC_Log::write(TAG, 'Loading file filed', \OC_Log::ERROR); - return; - } - $this->image->fixOrientation();*/ - } - - public function getWidth() { - $a = ThumbnailsManager::getInstance()->getThumbnailInfo($this->file_path); - return $a['width']; - } - - public function get($extra = '') { - // !HACK! file path needs to be encoded twice because files app decode twice url, so any special chars like + or & in filename - // !HACK! will result in failing of opening them - return '<a rel="images" title="'.htmlentities(basename($this->getPath())).'" href="'.\OCP\Util::linkTo('gallery','ajax/viewImage.php').'?img='.urlencode(urlencode($this->getPath())).'"><img rel="images" src="'.\OCP\Util::linkTo('gallery', 'ajax/thumbnail.php').'&filepath='.urlencode($this->getPath()).'" '.$extra.'></a>'; - } - - public function getMiniatureSrc() { - return \OCP\Util::linkTo('gallery', 'ajax/thumbnail.php').'&filepath='.urlencode($this->getPath()); - } - - public function getPath() { - return $this->file_path; - } - - public function getOnClickAction() { - return '';//'javascript:openFile(\''.$this->file_path.'\');'; - } - - private $file_path; - private $image; -} - -class TileStack extends TileBase { - - const STACK_REPRESENTATIVES = 3; - - public function __construct($path_array, $stack_name) { - $this->tiles_array = array(); - $this->stack_name = $stack_name; - for ($i = 0; $i < count($path_array) && $i < self::STACK_REPRESENTATIVES; $i++) { - $tile = new TileSingle($path_array[$i]); - array_push($this->tiles_array, $tile); - } - } - - public function forceSize($width_must_fit=false) { - for ($i = 0; $i < count($this->tiles_array); $i++) - $this->tiles_array[$i]->forceSize(true); - } - - public function getWidth() { - $max = 0; - for ($i = 0; $i < count($this->tiles_array); $i++) { - $max = max($max, $this->tiles_array[$i]->getWidth()); - } - return min(IMAGE_WIDTH, $max); - } - - public function get() { - $r = '<div class="title gallery_div">'. \OCP\Util::sanitizeHTML($this->stack_name).'</div>'; - for ($i = 0; $i < count($this->tiles_array); $i++) { - $top = rand(-5, 5); - $left = rand(-5, 5); - $img_w = $this->tiles_array[$i]->getWidth(); - $extra = ''; - if ($img_w < IMAGE_WIDTH) { - $extra = 'width:'.$img_w.'px;'; - } - $r .= '<div class="miniature_border gallery_div" style="background-image:url(\''.$this->tiles_array[$i]->getMiniatureSrc().'\');margin-top:'.$top.'px; margin-left:'.$left.'px;'.$extra.'"></div>'; - } - return $r; - } - - public function getOnHoverAction() { - return 'javascript:explode(this);return false;'; - } - - public function getOnOutAction() { - return 'javascript:deplode(this);return false;'; - } - - public function getCount() { - return count($this->tiles_array); - } - - public function getOnClickAction() { - return 'javascript:openNewGal(\''.rawurlencode($this->stack_name).'\');'; - } - - private $tiles_array; - private $stack_name; -} diff --git a/apps/gallery/lib/tiles_test.php b/apps/gallery/lib/tiles_test.php deleted file mode 100644 index 02d567c628d..00000000000 --- a/apps/gallery/lib/tiles_test.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php -$l = OC_L10N::get('gallery'); -?> -<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, '/bartek/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++) { - error_log($images[$i]); - $prev_dir_arr = explode('/', $previous_element); - $dir_arr = explode('/', $images[$i]); - - if (count($dir_arr)==1) { - $tl->addTile(new \OC\Pictures\TileSingle($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($previous_element), $dir_arr[0]); -} else { - $arr[] = $previous_element; - $ts->addTile($arr); -} - -if ($ts->getCount() != 0) { - $tl->addTile($ts); -} - -echo $tl->get(); diff --git a/apps/gallery/sharing.php b/apps/gallery/sharing.php deleted file mode 100644 index af3e553e454..00000000000 --- a/apps/gallery/sharing.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -/** -* ownCloud - gallery application -* -* @author Bartek Przybylski -* @copyright 2012 Bartek Przybylski bartek@alefzero.eu -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - -if (!isset($_GET['token']) || empty($_GET['token'])) { - exit; -} - - - -OCP\App::checkAppEnabled('gallery'); - -?> -<!doctype html> -<html> - <head> - <link rel="stylesheet" href="css/sharing.css" type="text/css"/> - <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> - <script src="js/sharing.js" type="text/javascript"></script> - <script> - var TOKEN = '<?php echo htmlentities($_GET['token']); ?>'; - </script> - </head> - <body> - <div id="breadcrumb"><span class="breadcrumbelement" onclick="javascript:returnTo(0);return false;">Shared gallery</span></div> - <div id="gallery_list"></div> - </body> -</html> diff --git a/apps/gallery/templates/index.php b/apps/gallery/templates/index.php deleted file mode 100644 index b2efd5342ff..00000000000 --- a/apps/gallery/templates/index.php +++ /dev/null @@ -1,84 +0,0 @@ -<script type="text/javascript"> - -var root = "<?php echo $_['root']; ?>"; - -$(document).ready(function() { - $("a[rel=images]").fancybox({ - 'titlePosition': 'inside' - }); -}); - -</script> - -<div id="controls"><?php - $sr = trim($_['root'], '/'); - if (!empty($sr)) { - $paths = explode('/', $sr); - $path = '/'; - for ($i = 0; $i < count($paths); $i++) { - $path .= urlencode($paths[$i]).'/'; - $classess = 'crumb'.($i == count($paths)-1?' last':''); - echo '<div class="'.$classess.'" style="background-image:url(\''.\OCP\image_path('core','breadcrumb.png').'\')"><a href="'.\OCP\Util::linkTo('gallery', 'index.php').'&root='.$path.'">'.OCP\Util::sanitizeHTML($paths[$i]).'</a></div>'; - } - } - -?> - <div id="slideshow"> - <input type="button" class="start" value="<?php echo $l->t('Slideshow')?>" /> - </div> -</div> -<div id="gallerycontent"> -<?php -session_write_close(); - -echo $_['tl']->get(); - -?> -</div> - -<!-- start supersized block --> -<div id="slideshow-content" style="display:none;"> - - <!--Thumbnail Navigation--> - <div id="prevthumb"></div> - <div id="nextthumb"></div> - - <!--Arrow Navigation--> - <a id="prevslide" class="load-item"></a> - <a id="nextslide" class="load-item"></a> - - <div id="thumb-tray" class="load-item"> - <div id="thumb-back"></div> - <div id="thumb-forward"></div> - </div> - - <!--Time Bar--> - <div id="progress-back" class="load-item"> - <div id="progress-bar"></div> - </div> - - <!--Control Bar--> - <div id="slideshow-controls-wrapper" class="load-item"> - <div id="slideshow-controls"> - - <a id="play-button"><img id="pauseplay" src="<?php echo OCP\image_path('gallery', 'supersized/pause.png'); ?>"/></a> - - <!--Slide counter--> - <div id="slidecounter"> - <span class="slidenumber"></span> / <span class="totalslides"></span> - </div> - - <!--Slide captions displayed here--> - <div id="slidecaption"></div> - - <!--Thumb Tray button--> - <a id="tray-button"><img id="tray-arrow" src="<?php echo OCP\image_path('gallery', 'supersized/button-tray-up.png'); ?>"/></a> - - <!--Navigation--> - <!-- - <ul id="slide-list"></ul> - --> - </div> - </div> - -</div><!-- end supersized block --> |