From 361c12be462a3a81a17969e7e371f5ce0a156a8c Mon Sep 17 00:00:00 2001 From: Quentin Bramas Date: Wed, 4 Nov 2015 23:00:57 +0100 Subject: [PATCH 01/30] Check if a user is logged in before displaying log or seeing system information\n This resolve electerious/Lychee#420 --- plugins/check/index.php | 12 ++++++++++++ plugins/displaylog/index.php | 15 +++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/plugins/check/index.php b/plugins/check/index.php index b21b087..915e7fd 100644 --- a/plugins/check/index.php +++ b/plugins/check/index.php @@ -93,6 +93,18 @@ if ($database->server_version<50500) echo('Warning: Lychee uses the GBK charset if ($error==='') echo('No critical problems found. Lychee should work without problems!' . PHP_EOL); else echo $error; +# Don't go further if the user is not connected +session_start(); +$isAdmin = ((isset($_SESSION['login'])&&$_SESSION['login']===true)&& + (isset($_SESSION['identifier'])&&$_SESSION['identifier']===$settings['identifier'])); + +if(!$isAdmin) +{ + echo(PHP_EOL . PHP_EOL . 'You have to be logged in to see more information.'); + exit(); +} + + # Show separator echo(PHP_EOL . PHP_EOL . 'System Information' . PHP_EOL); echo('------------------' . PHP_EOL); diff --git a/plugins/displaylog/index.php b/plugins/displaylog/index.php index 0b6ca83..48107ff 100644 --- a/plugins/displaylog/index.php +++ b/plugins/displaylog/index.php @@ -37,6 +37,21 @@ if (mysqli_connect_errno()!=0) { exit(); } +# Load settings +$settings = new Settings($database); +$settings = $settings->get(); + +# Check if the user is connected +session_start(); +$isAdmin = ((isset($_SESSION['login'])&&$_SESSION['login']===true)&& + (isset($_SESSION['identifier'])&&$_SESSION['identifier']===$settings['identifier'])); + +if(!$isAdmin) +{ + exit('You have to be logged in to see the log.'); +} + + # Result $query = Database::prepare($database, "SELECT FROM_UNIXTIME(time), type, function, line, text FROM ?", array(LYCHEE_TABLE_LOG)); $result = $database->query($query); From db4f3d65fb9fb8ad0ebe8f34bc47b684b8702b6a Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Mon, 21 Dec 2015 15:01:19 +0100 Subject: [PATCH 02/30] User Album::prepareData to prepare an Album, even for single albums --- php/modules/Album.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/php/modules/Album.php b/php/modules/Album.php index 708dab1..1b8d1c5 100644 --- a/php/modules/Album.php +++ b/php/modules/Album.php @@ -69,14 +69,20 @@ class Album extends Module { $album['title'] = $data['title']; $album['public'] = $data['public']; + # Additional attributes + # Only part of $album when available + if (isset($data['description'])) $album['description'] = $data['description']; + if (isset($data['visible'])) $album['visible'] = $data['visible']; + if (isset($data['downloadable'])) $album['downloadable'] = $data['downloadable']; + # Parse date $album['sysdate'] = date('F Y', $data['sysstamp']); # Parse password $album['password'] = ($data['password']=='' ? '0' : '1'); - # Set placeholder for thumbs - $album['thumbs'] = array(); + # Parse thumbs or set default value + $album['thumbs'] = (isset($data['thumbs']) ? explode(',', $data['thumbs']) : array()); return $album; @@ -112,8 +118,7 @@ class Album extends Module { default: $query = Database::prepare($this->database, "SELECT * FROM ? WHERE id = '?' LIMIT 1", array(LYCHEE_TABLE_ALBUMS, $this->albumIDs)); $albums = $this->database->query($query); $return = $albums->fetch_assoc(); - $return['sysdate'] = date('d M. Y', $return['sysstamp']); - $return['password'] = ($return['password']=='' ? '0' : '1'); + $return = Album::prepareData($return); $query = Database::prepare($this->database, "SELECT id, title, tags, public, star, album, thumbUrl, takestamp, url FROM ? WHERE album = '?' " . $this->settings['sortingPhotos'], array(LYCHEE_TABLE_PHOTOS, $this->albumIDs)); break; From f87701b1c002673304a68762b97190a67af98dd3 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Mon, 21 Dec 2015 15:09:05 +0100 Subject: [PATCH 03/30] Improved loading performance by combining multiple queries #372 #241 --- php/modules/Album.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/php/modules/Album.php b/php/modules/Album.php index 1b8d1c5..d7adf97 100644 --- a/php/modules/Album.php +++ b/php/modules/Album.php @@ -194,8 +194,8 @@ class Album extends Module { if ($public===false) $return['smartalbums'] = $this->getSmartInfo(); # Albums query - if ($public===false) $query = Database::prepare($this->database, 'SELECT id, title, public, sysstamp, password FROM ? ' . $this->settings['sortingAlbums'], array(LYCHEE_TABLE_ALBUMS)); - else $query = Database::prepare($this->database, 'SELECT id, title, public, sysstamp, password FROM ? WHERE public = 1 AND visible <> 0 ' . $this->settings['sortingAlbums'], array(LYCHEE_TABLE_ALBUMS)); + if ($public===false) $query = Database::prepare($this->database, 'SELECT a.id, a.title, a.public, a.sysstamp, a.password, p.thumbs FROM (SELECT album, substring_index(GROUP_CONCAT(thumbUrl ORDER BY star DESC, ' . substr($this->settings['sortingPhotos'], 9) . '), ",", 3) AS thumbs FROM ? GROUP BY album) AS p RIGHT JOIN ? a ON p.album = a.id ' . $this->settings['sortingAlbums'], array(LYCHEE_TABLE_PHOTOS, LYCHEE_TABLE_ALBUMS)); + else $query = Database::prepare($this->database, 'SELECT a.id, a.title, a.public, a.sysstamp, a.password, p.thumbs FROM (SELECT album, substring_index(GROUP_CONCAT(thumbUrl ORDER BY star DESC, ' . substr($this->settings['sortingPhotos'], 9) . '), ",", 3) AS thumbs FROM ? GROUP BY album) AS p RIGHT JOIN ? a ON p.album = a.id WHERE public = 1 AND visible <> 0 ' . $this->settings['sortingAlbums'], array(LYCHEE_TABLE_PHOTOS, LYCHEE_TABLE_ALBUMS)); # Execute query $albums = $this->database->query($query); @@ -214,14 +214,10 @@ class Album extends Module { if (($public===true&&$album['password']==='0')|| ($public===false)) { - # Execute query - $query = Database::prepare($this->database, "SELECT thumbUrl FROM ? WHERE album = '?' ORDER BY star DESC, " . substr($this->settings['sortingPhotos'], 9) . " LIMIT 3", array(LYCHEE_TABLE_PHOTOS, $album['id'])); - $thumbs = $this->database->query($query); - - # For each thumb $k = 0; - while ($thumb = $thumbs->fetch_object()) { - $album['thumbs'][$k] = LYCHEE_URL_UPLOADS_THUMB . $thumb->thumbUrl; + + foreach ($album['thumbs'] as $thumb) { + $album['thumbs'][$k] = LYCHEE_URL_UPLOADS_THUMB . $thumb; $k++; } From 6547229a3ba3662117dd6d343a3e7ae99df3b50f Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Mon, 21 Dec 2015 16:07:45 +0100 Subject: [PATCH 04/30] Added fallback sorting --- php/modules/Settings.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/php/modules/Settings.php b/php/modules/Settings.php index f0f57f4..db3e111 100755 --- a/php/modules/Settings.php +++ b/php/modules/Settings.php @@ -179,6 +179,12 @@ class Settings extends Module { } + $sorting .= ' '; + + # Append fallback sorting + # Necessary to get a consistent sorting when multiple photos have same values + $sorting .= ', id DESC'; + # Execute query # Do not prepare $sorting because it is a true statement # Preparing (escaping) the sorting would destroy it @@ -235,6 +241,12 @@ class Settings extends Module { } + $sorting .= ' '; + + # Append fallback sorting + # Necessary to get a consistent sorting when multiple albums have same values + $sorting .= ', id DESC'; + # Execute query # Do not prepare $sorting because it is a true statement # Preparing (escaping) the sorting would destroy it From 312db57f713a5b7afb25730df187bce57e7d08a6 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Tue, 29 Dec 2015 12:06:44 +0100 Subject: [PATCH 05/30] Reverted query optimization as I failed to fix the incorrect sorting cased by this http://stackoverflow.com/questions/34399798/similar-mysql-queries-returning-with-different-sorting --- php/modules/Album.php | 14 +++++++++----- php/modules/Settings.php | 12 ------------ 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/php/modules/Album.php b/php/modules/Album.php index d7adf97..1b8d1c5 100644 --- a/php/modules/Album.php +++ b/php/modules/Album.php @@ -194,8 +194,8 @@ class Album extends Module { if ($public===false) $return['smartalbums'] = $this->getSmartInfo(); # Albums query - if ($public===false) $query = Database::prepare($this->database, 'SELECT a.id, a.title, a.public, a.sysstamp, a.password, p.thumbs FROM (SELECT album, substring_index(GROUP_CONCAT(thumbUrl ORDER BY star DESC, ' . substr($this->settings['sortingPhotos'], 9) . '), ",", 3) AS thumbs FROM ? GROUP BY album) AS p RIGHT JOIN ? a ON p.album = a.id ' . $this->settings['sortingAlbums'], array(LYCHEE_TABLE_PHOTOS, LYCHEE_TABLE_ALBUMS)); - else $query = Database::prepare($this->database, 'SELECT a.id, a.title, a.public, a.sysstamp, a.password, p.thumbs FROM (SELECT album, substring_index(GROUP_CONCAT(thumbUrl ORDER BY star DESC, ' . substr($this->settings['sortingPhotos'], 9) . '), ",", 3) AS thumbs FROM ? GROUP BY album) AS p RIGHT JOIN ? a ON p.album = a.id WHERE public = 1 AND visible <> 0 ' . $this->settings['sortingAlbums'], array(LYCHEE_TABLE_PHOTOS, LYCHEE_TABLE_ALBUMS)); + if ($public===false) $query = Database::prepare($this->database, 'SELECT id, title, public, sysstamp, password FROM ? ' . $this->settings['sortingAlbums'], array(LYCHEE_TABLE_ALBUMS)); + else $query = Database::prepare($this->database, 'SELECT id, title, public, sysstamp, password FROM ? WHERE public = 1 AND visible <> 0 ' . $this->settings['sortingAlbums'], array(LYCHEE_TABLE_ALBUMS)); # Execute query $albums = $this->database->query($query); @@ -214,10 +214,14 @@ class Album extends Module { if (($public===true&&$album['password']==='0')|| ($public===false)) { - $k = 0; + # Execute query + $query = Database::prepare($this->database, "SELECT thumbUrl FROM ? WHERE album = '?' ORDER BY star DESC, " . substr($this->settings['sortingPhotos'], 9) . " LIMIT 3", array(LYCHEE_TABLE_PHOTOS, $album['id'])); + $thumbs = $this->database->query($query); - foreach ($album['thumbs'] as $thumb) { - $album['thumbs'][$k] = LYCHEE_URL_UPLOADS_THUMB . $thumb; + # For each thumb + $k = 0; + while ($thumb = $thumbs->fetch_object()) { + $album['thumbs'][$k] = LYCHEE_URL_UPLOADS_THUMB . $thumb->thumbUrl; $k++; } diff --git a/php/modules/Settings.php b/php/modules/Settings.php index db3e111..f0f57f4 100755 --- a/php/modules/Settings.php +++ b/php/modules/Settings.php @@ -179,12 +179,6 @@ class Settings extends Module { } - $sorting .= ' '; - - # Append fallback sorting - # Necessary to get a consistent sorting when multiple photos have same values - $sorting .= ', id DESC'; - # Execute query # Do not prepare $sorting because it is a true statement # Preparing (escaping) the sorting would destroy it @@ -241,12 +235,6 @@ class Settings extends Module { } - $sorting .= ' '; - - # Append fallback sorting - # Necessary to get a consistent sorting when multiple albums have same values - $sorting .= ', id DESC'; - # Execute query # Do not prepare $sorting because it is a true statement # Preparing (escaping) the sorting would destroy it From 212bb23eaa59148ec155b4e4d2dd943f805dbd0d Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Tue, 29 Dec 2015 12:10:40 +0100 Subject: [PATCH 06/30] Fixed a typo --- docs/Installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Installation.md b/docs/Installation.md index 045b0fb..58d0175 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -25,7 +25,7 @@ You can also use the [direct download](https://github.com/electerious/Lychee/arc ### 3. Permissions -Change the permissions of `uploads/`, `data/` and all their subfolders. Sufficient read/write privileges are reqiured. +Change the permissions of `uploads/`, `data/` and all their subfolders. Sufficient read/write privileges are required. chmod -R 777 uploads/ data/ From 3c278ece9687c9903e667c5fea57da5854260c6f Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Tue, 29 Dec 2015 12:11:08 +0100 Subject: [PATCH 07/30] Moved LICENSE to separated file --- LICENSE | 21 +++++++++++++++++++++ README.md | 20 +------------------- 2 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9edea7a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Tobias Reich (http://electerious.com/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index 9268148..f698d80 100644 --- a/README.md +++ b/README.md @@ -69,24 +69,6 @@ Here's a list of all available Plugins and Extensions: Take a look at the [FAQ](docs/FAQ.md) if you have problems. Discovered a bug? Please create an issue here on GitHub! -## Developer -| Version | Name | -|:-----------|:------------| -| 1.2, 1.3, 2.x, 3.x | [Tobias Reich](http://electerious.com)| -| 1.0, 1.1 | [Tobias Reich](http://electerious.com)
[Philipp Maurer](http://phinal.net) | - ## Donate -I am working hard on continuously developing and maintaining Lychee. Please consider making a donation via [Flattr](https://flattr.com/submit/auto?user_id=electerious&url=http%3A%2F%2Flychee.electerious.com&title=Lychee&category=software) or PayPal (from [our site](http://lychee.electerious.com/)) to keep the project going strong and me motivated. - -## License - -(MIT License) - -Copyright (C) 2015 [Tobias Reich](http://electerious.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +I am working hard on continuously developing and maintaining Lychee. Please consider making a donation via [Flattr](https://flattr.com/submit/auto?user_id=electerious&url=http%3A%2F%2Flychee.electerious.com&title=Lychee&category=software) or PayPal (from [our site](http://lychee.electerious.com/)) to keep the project going strong and me motivated. \ No newline at end of file From 7f627a88c3fb6932e73b99c06e81b3ea45e90bc5 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 3 Jan 2016 12:50:12 +0100 Subject: [PATCH 08/30] (c) 2016 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 9edea7a..6629516 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Tobias Reich (http://electerious.com/) +Copyright (c) 2016 Tobias Reich (http://electerious.com/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 23e78edc39e24cfaeb7243fe7ba8f2793312c6fd Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Mon, 4 Jan 2016 21:56:37 +0100 Subject: [PATCH 09/30] Replaced window.devicePixelRatio with srcset --- src/scripts/build.js | 8 ++++---- src/scripts/lychee.js | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/scripts/build.js b/src/scripts/build.js index 3e25391..2da005a 100644 --- a/src/scripts/build.js +++ b/src/scripts/build.js @@ -45,13 +45,13 @@ build.album = function(data) { let html = '' - let { path: thumbPath, hasRetina: thumbRetina } = lychee.retinize(data.thumbs[0]) + let { path: retinaThumbUrl, isPhoto } = lychee.retinize(data.thumbs[0]) html += lychee.html`
thumb thumb - thumb + thumb

$${ data.title }

$${ data.sysdate } @@ -82,11 +82,11 @@ build.photo = function(data) { let html = '' - let { path: thumbPath, hasRetina: thumbRetina } = lychee.retinize(data.thumbUrl) + let { path: retinaThumbUrl } = lychee.retinize(data.thumbUrl) html += lychee.html`
- thumb + thumb

$${ data.title }

` diff --git a/src/scripts/lychee.js b/src/scripts/lychee.js index 018aeb0..0e8bd55 100644 --- a/src/scripts/lychee.js +++ b/src/scripts/lychee.js @@ -310,11 +310,10 @@ lychee.animate = function(obj, animation) { lychee.retinize = function(path = '') { - let pixelRatio = window.devicePixelRatio, - extention = path.split('.').pop(), - hasRetina = extention!=='svg' + let extention = path.split('.').pop(), + isPhoto = extention!=='svg' - if ((pixelRatio!=null && pixelRatio>1) && hasRetina===true) { + if (isPhoto===true) { path = path.replace(/\.[^/.]+$/, '') path = path + '@2x' + '.' + extention @@ -323,7 +322,7 @@ lychee.retinize = function(path = '') { return { path, - hasRetina + isPhoto } } From 14e808020aca3136a6bd028dffb5ec0c7729e15a Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Mon, 4 Jan 2016 21:56:52 +0100 Subject: [PATCH 10/30] Rebuild --- dist/main.js | Bin 191608 -> 191650 bytes dist/view.js | Bin 106018 -> 106103 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/dist/main.js b/dist/main.js index f83908edfedfc935d4caa01713d84ef24e5a6a16..52601881503f2563175948f1be454958b5792e8d 100644 GIT binary patch delta 677 zcmexygL~0U?hRYH8G|NophK8o5PSECR z9$T@=8ma=DPbeiYP2Qm-Fxf)Y7O1sMHI*@F^Bq-9ejvqW%EZLzwwcrX417Df@bST!|`OxtvgOrW8OYHEs!K$#MIZ)TwK15Ogm;%>G|#hF!A zIjKt8hFW>40_Ke{oV{l{^>g1jGu6*+748;ml=!XzDbO&aNXR~`zJDb zVXE2=ROJ!Eo>?4_kzbNOo&Pzb8&|4cNk(aIQgO7w_TcA?*BGY@JZDs!9{rM$A0`!A zl(RkaC1WQSBiHm#pBXc!fBeTNwY}^MqoLpQgHBAsB6+~rEK65Xw6!gVHhu_VJPRR?ORRo-?RXQsEhK(jOpnXI;_7BUG}0{~>0;BNo` delta 671 zcmY*WO-$546wWJ%umvSZ@F!8&>ULXQR?wibWJCoU6~%P|gs>1T+kqWz+J!C4uc$Yp zL?UyjCk|dUps7-Cc+jXP6XQV={&W4v%M(Sx&KNI1RseQ)M_-|x6Fl#72vJI1{K^#4qQdBjfdE>>Xf+?X=@4a+QV6UW7b|QrM*KCM@ z=6wyR+j%Ld69m9s(eb~)OF{i?ej)Cem{6Pq_MV~_P>y?KS)r(3p1F~2~QDl=(j%KzUw{ zJmA(axa$6yf<5m13|v^_e9lR2MJYXli9;>jom_#idwUrw{U^)t8AL0(X?DzCT!Fg* z_uMK_2>8!ep{4cmFtrSOnBP20lO#?@h>3NF+7SzpXeMn^N0FkE8co}2MUB|}Oxb=Z zh>+DVNSvWTtI8TO%^-4Q**RG&%eK3}NvNr?)W~>RcTzDD*>DiE{r)E5XLTT*vK{+; ZbBx?{ANC1hS6qZ5p&{T;4+uNP{{dXb;>!R4 diff --git a/dist/view.js b/dist/view.js index 83fc08cafc8952492c2450a832a7c37f3f3a22d8..04a7826ddaa730ab391f58af60823d9643eecde3 100644 GIT binary patch delta 411 zcmZ3qhwb|wwhajaj4GQG1?(6Zv!*W;W)$AMS#YfyW7g(Gi&$P}6`icj2VGaIPEN28 z+1!v_%f+ZN`CsW`?kw99z2elI)Z`M|$rrziZ$4aR!UQztN5w&XZk1G9{kZJZN`0W- zBP;$2%VeeMm82GzXk=>Imt*eN`7N>gT=VupNscgQxM@pARMI%+GM5jozRud?~ z{OS`EW7gzvZAY@9^-5#sjL!+d0@lx@>5d%5_3~E)zlPK zwlfv1Td;FV^^Uz zJwAjne){!b#uOY1wgVMJ@UmwX2V~@z{kZJZN`0W- zBP;$2%c!L4m82GzXk=>Imt*eN`7N>gT=VupNWo^E@M@p9`OCwdMM5jozRud?~ z{OS`EqsruOZ5d%5_3~E)zlQT zwlf Date: Tue, 5 Jan 2016 11:33:01 +0100 Subject: [PATCH 11/30] Simplified view.photo.photo and only call and save photo.getID() once --- src/scripts/view.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/scripts/view.js b/src/scripts/view.js index 17d4120..099295a 100644 --- a/src/scripts/view.js +++ b/src/scripts/view.js @@ -406,27 +406,28 @@ view.photo = { photo: function() { - lychee.imageview.html(build.imageview(photo.json, photo.getSize(), visible.header())) + lychee.imageview.html(build.imageview(photo.json, visible.header())) let $nextArrow = lychee.imageview.find('a#next'), $previousArrow = lychee.imageview.find('a#previous'), - hasNext = album.json && album.json.content && album.json.content[photo.getID()] && album.json.content[photo.getID()].nextPhoto==='', - hasPrevious = album.json && album.json.content && album.json.content[photo.getID()] && album.json.content[photo.getID()].previousPhoto==='' + photoID = photo.getID(), + hasNext = album.json && album.json.content && album.json.content[photoID] && album.json.content[photoID].nextPhoto!=='', + hasPrevious = album.json && album.json.content && album.json.content[photoID] && album.json.content[photoID].previousPhoto!=='' - if (hasNext || lychee.viewMode) { $nextArrow.hide() } + if (hasNext===false || lychee.viewMode===true) { $nextArrow.hide() } else { - let nextPhotoID = album.json.content[photo.getID()].nextPhoto, + let nextPhotoID = album.json.content[photoID].nextPhoto, nextPhoto = album.json.content[nextPhotoID] $nextArrow.css('background-image', lychee.html`linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("$${ nextPhoto.thumbUrl }")`) } - if (hasPrevious || lychee.viewMode) { $previousArrow.hide() } + if (hasPrevious===false || lychee.viewMode===true) { $previousArrow.hide() } else { - let previousPhotoID = album.json.content[photo.getID()].previousPhoto, + let previousPhotoID = album.json.content[photoID].previousPhoto, previousPhoto = album.json.content[previousPhotoID] $previousArrow.css('background-image', lychee.html`linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("$${ previousPhoto.thumbUrl }")`) From 51d237dcd28a302bfdfcb10200d740efd3264835 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Tue, 5 Jan 2016 11:58:03 +0100 Subject: [PATCH 12/30] Use for the main photo #361 #185 - Let the browser decide which photo to load - Removed photo.getSize - Automacialy center photos, without adding extra css from small images --- src/scripts/build.js | 20 ++++++---------- src/scripts/header.js | 12 ---------- src/scripts/photo.js | 36 ---------------------------- src/scripts/view/main.js | 40 +------------------------------ src/styles/_imageview.scss | 49 ++++++++++++++++++++++---------------- 5 files changed, 37 insertions(+), 120 deletions(-) diff --git a/src/scripts/build.js b/src/scripts/build.js index 2da005a..3ebccf6 100644 --- a/src/scripts/build.js +++ b/src/scripts/build.js @@ -113,24 +113,18 @@ build.photo = function(data) { } -build.imageview = function(data, size, visibleControls) { +build.imageview = function(data, visibleControls) { - let html = '' + let html = '', + hasMedium = data.medium!=='' - if (size==='big') { + if (hasMedium===false) { - if (visibleControls===true) html += lychee.html`
` - else html += lychee.html`
` + html += lychee.html`
` - } else if (size==='medium') { + } else { - if (visibleControls===true) html += lychee.html`
` - else html += lychee.html`
` - - } else if (size==='small') { - - if (visibleControls===true) html += lychee.html`
` - else html += lychee.html`
` + html += lychee.html`
` } diff --git a/src/scripts/header.js b/src/scripts/header.js index ef77d2e..bced47a 100644 --- a/src/scripts/header.js +++ b/src/scripts/header.js @@ -67,17 +67,11 @@ header.bind = function() { header.show = function() { - let newMargin = (-1 * ($('#imageview #image').height()/2) + 20) - clearTimeout($(window).data('timeout')) lychee.imageview.removeClass('full') header.dom().removeClass('header--hidden') - // Adjust position or size of photo - if ($('#imageview #image.small').length>0) $('#imageview #image').css('margin-top', newMargin) - else $('#imageview #image').removeClass('full') - return true } @@ -90,15 +84,9 @@ header.hide = function(e, delay = 500) { $(window).data('timeout', setTimeout(function() { - let newMargin = (-1 * ($('#imageview #image').height()/2)) - lychee.imageview.addClass('full') header.dom().addClass('header--hidden') - // Adjust position or size of photo - if ($('#imageview #image.small').length>0) $('#imageview #image').css('margin-top', newMargin) - else $('#imageview #image').addClass('full') - }, delay)) return true diff --git a/src/scripts/photo.js b/src/scripts/photo.js index 7bb4985..76ad97f 100644 --- a/src/scripts/photo.js +++ b/src/scripts/photo.js @@ -625,42 +625,6 @@ photo.share = function(photoID, service) { } -photo.getSize = function() { - - // Size can be 'big', 'medium' or 'small' - // Default is big - // Small is centered in the middle of the screen - let size = 'big', - scaled = false, - hasMedium = photo.json.medium!=='', - pixelRatio = window.devicePixelRatio, - view = { - width : $(window).width() - 60, - height : $(window).height() - 100 - } - - // Detect if the photo will be shown scaled, - // because the screen size is smaller than the photo - if (photo.json.width>view.width || photo.json.height>view.height) scaled = true - - // Calculate pixel ratio of screen - if (pixelRatio!=null && pixelRatio>1) { - view.width = view.width * pixelRatio - view.height = view.height * pixelRatio - } - - // Medium available and - // Medium still bigger than screen - if (hasMedium===true && (1920>view.width && 1080>view.height)) size = 'medium' - - // Photo not scaled - // Photo smaller then screen - if (scaled===false && (photo.json.widthview.width || photo.height>view.height) scaled = true - - // Calculate pixel ratio of screen - if (pixelRatio!=null && pixelRatio>1) { - view.width = view.width * pixelRatio - view.height = view.height * pixelRatio - } - - // Medium available and - // Medium still bigger than screen - if (hasMedium===true && (1920>view.width && 1080>view.height)) size = 'medium' - - // Photo not scaled - // Photo smaller then screen - if (scaled===false && (photo.width div { + width: 0; + height: 0; + } + + #image img { + max-width: calc(100vw - 60px); + max-height: calc(100vh - 90px); + width: auto; + height: auto; + transform: translate(-50%, -50%); + transition: max-width .3s, max-height .3s; + } + + &.full #image img { + max-width: 100vw; + max-height: 100vh; } // Previous/Next Buttons -------------------------------------------------------------- // From a2eff94ca75975c79d1a7f07254f9e684bf69c1e Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Tue, 5 Jan 2016 11:58:25 +0100 Subject: [PATCH 13/30] Treat all dist/* files like binaries --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..967a087 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +dist/* binary \ No newline at end of file From 31cef316725f52dd068ef7f1645427f72f8a018c Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Tue, 5 Jan 2016 11:58:33 +0100 Subject: [PATCH 14/30] Rebuild --- dist/main.css | Bin 31807 -> 31770 bytes dist/main.js | Bin 191650 -> 190325 bytes dist/view.js | Bin 106103 -> 104850 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/dist/main.css b/dist/main.css index 5865e08980b3fdc5c3ef7594231d4854e4c470d4..62b0820ec4e5bf1f02d04a1d4534bba2c3e52b71 100755 GIT binary patch delta 423 zcmdo0gK^dm#tpUJlV5w6%NQFJR9F{fre~B`8CWOfmz3n^0vS1}X+ZwuMqlB{`hMb* ze=6HeUdrh_`Jj`_gb=hdf`=Hw_SXXYlR zr&gEb7g!n8LO5laspU{{yOhkb>hjE#k_@0V8L1G9F_kG~=B8KYCRXS|lqM(UBx@KN z7?hPO=qi{2ovdjMl7#Aq$tsp*0HrO#(hz-#r6u_=TR`l|6XS#@PYC1W($F3kQZS(T1MCH4r-KAC Rkn}3(B^DKJzVDx)0{~X~l#>7e delta 579 zcmbRBgK_^4#tpUJlaKgTPVVr|sW&qysIV@|OwTB>G6pe|@=Hqcb0O@U)HJAQNl{{6 zab`(oex6lHeu09Xaj_0q510kf0%n4AfEl@oMd_J&x-iB01&PU-C6x+#M#Vb1<*7;8 znI*blGbi8AWt-d=Dm#gX#n+mewoH}})1Z~1lP~6qKpj2#exO)@by8w-c6w2MXtqKtnaMJ~ z+>>p6+v}Axa}(23%Q92T6(CH#;@rfXoN8bYTY=1i#9?A-Nj@wN!EA6G0_AHl^{16W cwHrV+8^ClLScA10AZeN$8^FK$h<}(40JCq-uK)l5 diff --git a/dist/main.js b/dist/main.js index 52601881503f2563175948f1be454958b5792e8d..d74b94320991ad01e75061dbf1740ba09db944e5 100644 GIT binary patch delta 2194 zcmah~dr(y86`%7hun7x@(TF_6-7A5;@O5E9c`ROu1f48l*-deg%Bw3}U}4#%ckhDW zG6|V6(~PDw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?>)lt7qs!Ny>A5W{=E*G4P@q$Cx;fPi zSMGoy-w}ZxC^a(?c*?V-#9SI34mCYbGfIU@DCc0aEe3mFU53d~lHvn#IKC#uq!hQ} za1k=iiCr*+r^GMqhJQk;d1()Lgkp`&m8l$_QgSmklUlx4ttbVW@Yjv97!-&gg$EAw z<<-W3FiFOR18Dixyc~A2!v0%^^FJPiO*}dRI~V^uCK>kU%1W&!ho|f1^8eVt#}`}c zY{%`#KMGs9{(0EI|2z!0FV-pwmb-;bCH=E%o)r^*o1yB7q`yejLXq9@D~eH2wO*!I z6aLiFB@L7Ig2)TG{6#DteQ5fcz$B>_Q zM&U)C9Y^aIWAF`r+O}rKAy?{=ybj1saBz1! zI5&V$hdl?0FaF00CS$wY68Lov5l8p*NL4Xv^svUnl}KN_Hy)K%68qv#tplHEfmLX{ z)COOghAq5n8oHZ5qfqp~ZY~z#JnU)yst5^y{$^VVKHU**D2AWPy|ErKC<;5A%hpiw zr|6o3)M{Cj`r^{gcr?j3F<1=UEH~nkAw|kmE3o1K^8T48VO#QsLIwQwByI-9G6t>a z4SKJA8AZXqjDkcun%`ou33@+Ck4b*14u`|!W@Y|Ehr4gBLnWVI)gE82!xHS}=Ns@8 z4=ljO=8;+0(FOZ>?Fo2X)hc^83C;N2)}V z12JNtfCI8jBd)TDD$lA~UZ0KRX+zD?ta^f$A5ieGLv(rGeG!79n`PR63qldUU)sH+EM!BlMC-O3XjNDpaDgtar8dG& zlIAl{0*AYjwoaJ5nrD$pNq+Ac2ms@`Gce-OWd574LHA~yz#eOAo=zzSiciZ^L)7^4 M84$tXU1wqLUuQ{hKmY&$ From e5734dec139b11de8bbfaaf2dce9e30a3a4052c9 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Wed, 6 Jan 2016 11:08:43 +0100 Subject: [PATCH 15/30] Improved centering on mobile devices --- src/styles/_imageview.scss | 34 +++++++++++++++++++++------------- src/styles/_mediaquery.scss | 7 ------- src/styles/main.scss | 3 +-- 3 files changed, 22 insertions(+), 22 deletions(-) delete mode 100644 src/styles/_mediaquery.scss diff --git a/src/styles/_imageview.scss b/src/styles/_imageview.scss index 459ed68..b376386 100644 --- a/src/styles/_imageview.scss +++ b/src/styles/_imageview.scss @@ -17,11 +17,11 @@ // ImageView -------------------------------------------------------------- // #image { position: absolute; - top: 30px; - right: 0; - bottom: 0; - left: 0; - transition: top .3s; + top: 60px; + right: 30px; + bottom: 30px; + left: 30px; + transition: top .3s, right .3s, bottom .3s, left .3s; will-change: transform; display: flex; @@ -31,10 +31,19 @@ animation-name: zoomIn; animation-duration: .3s; animation-timing-function: $timingBounce; + + @media (max-width: 640px) { + right: 20px; + bottom: 20px; + left: 20px; + } } &.full #image { top: 0; + right: 0; + bottom: 0; + left: 0; } #image > div { @@ -43,17 +52,12 @@ } #image img { - max-width: calc(100vw - 60px); - max-height: calc(100vh - 90px); + position: absolute; + max-width: 100%; + max-height: 100%; width: auto; height: auto; transform: translate(-50%, -50%); - transition: max-width .3s, max-height .3s; - } - - &.full #image img { - max-width: 100vw; - max-height: 100vh; } // Previous/Next Buttons -------------------------------------------------------------- // @@ -67,6 +71,10 @@ &--next { right: 0; } + @media (max-width: 640px) { + display: none; + } + a { position: fixed; top: 50%; diff --git a/src/styles/_mediaquery.scss b/src/styles/_mediaquery.scss deleted file mode 100644 index 365eccf..0000000 --- a/src/styles/_mediaquery.scss +++ /dev/null @@ -1,7 +0,0 @@ -@media only screen and (max-width: 640px) { - - #imageview .arrow_wrapper { - display: none !important; - } - -} \ No newline at end of file diff --git a/src/styles/main.scss b/src/styles/main.scss index 250dca6..e4b9751 100755 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -77,5 +77,4 @@ input { @import 'sidebar'; @import 'loading'; @import 'message'; -@import 'multiselect'; -@import 'mediaquery'; \ No newline at end of file +@import 'multiselect'; \ No newline at end of file From fc0570be3429e22aa45c630271c30631ac328725 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Wed, 6 Jan 2016 11:12:24 +0100 Subject: [PATCH 16/30] Rebuild --- dist/main.css | Bin 31770 -> 31748 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/dist/main.css b/dist/main.css index 62b0820ec4e5bf1f02d04a1d4534bba2c3e52b71..1baba642b572f7260520746f13f1ec08073b060e 100755 GIT binary patch delta 280 zcmbRBgR$iY=1^W`jpM1=(VRB25)Z`=n{gaRQR!n{sEU-B@AV?bk DOK@h+ delta 281 zcmZqq!8q#&*>}O|{n^>V+o|#gTVU?VildNHAU{F@BpsQd8G*{Ca zB$<&4HXSaT0hF}_$xdeUZ_q%t18$Upo^i1bLNACrInGa9RUtDsy&A5{3Tzj$9Uy^> z$&LOiCpY;^Zr&IWtS#n{o0^iDsF0tRQ>jp#T$Gxcr;wPJGWnyg++?>PzR3Z8ygZ7T Oxdr(}C5d?@wY31;DP+q4 From d1bd819db906528e4fa143613c087b32b0d96ff5 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Wed, 6 Jan 2016 16:24:09 +0100 Subject: [PATCH 17/30] Updated deps --- src/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/package.json b/src/package.json index 95ce163..1fe76dd 100644 --- a/src/package.json +++ b/src/package.json @@ -12,14 +12,14 @@ "devDependencies": { "babel-preset-es2015": "^6.3.13", "basiccontext": "^3.5.0", - "basicmodal": "^3.3.0", + "basicmodal": "^3.3.2", "gulp": "^3.9.0", "gulp-autoprefixer": "3.1.0", "gulp-babel": "^6.1.1", "gulp-concat": "^2.6.0", "gulp-inject": "^3.0.0", - "gulp-load-plugins": "^1.1.0", - "gulp-minify-css": "^1.2.2", + "gulp-load-plugins": "^1.2.0", + "gulp-minify-css": "^1.2.3", "gulp-rimraf": "^0.2.0", "gulp-sass": "^2.1.1", "gulp-uglify": "^1.5.1", From dce837171b5f3bdfad293688953f6317108f31a4 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Wed, 6 Jan 2016 17:19:23 +0100 Subject: [PATCH 18/30] Fixed the swipe animation --- dist/main.css | Bin 31748 -> 31954 bytes dist/main.js | Bin 190325 -> 190385 bytes src/scripts/init.js | 4 ++-- src/scripts/photo.js | 4 ++-- src/scripts/swipe.js | 17 ++++++++++++++--- src/styles/_imageview.scss | 2 +- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/dist/main.css b/dist/main.css index 1baba642b572f7260520746f13f1ec08073b060e..14a0941ec8d28d550a3a27e27969462920eb230b 100755 GIT binary patch delta 92 zcmZqq!FcH>;|4DuZk_ys#N^D9N(DWm$?;O6lWpSpCae0W@*;^B>r6I`mjsDQqKK9h VCFT{U& diff --git a/dist/main.js b/dist/main.js index d74b94320991ad01e75061dbf1740ba09db944e5..cffcfc97aa8c0999af7bc10a55575c012e4efb24 100644 GIT binary patch delta 137 zcmex*j(g*I?uHh|ElfMrSj#d~%N3??R%1F2VQw!`XHqqV3cJTKX>H#d!!&^rDhU+W z5-@p!AunHXd1gVXUVc)Ry`rI&#`NFon9MohV$=QOn3SgHuV)GpEz8eL(SS;%r4^@^ P*cxbRZa=@CX_+|yb@MTv delta 106 zcmdmZp8M-L?uHh|ElfMrrXNvbI=Fp;I+MKV_FXYdTNtMUNtNmQ;+QzLFO6er3YhM+ zp2=J&uQVq|(bl%OJhLEGFFz?uO>KJqIwtMu_t!JAPG7m6$(Ii*m6leVT4HOkoqGe* GGIIdNFDRG* diff --git a/src/scripts/init.js b/src/scripts/init.js index f7e69c0..474064d 100755 --- a/src/scripts/init.js +++ b/src/scripts/init.js @@ -78,7 +78,7 @@ $(document).ready(function() { $(document) // Fullscreen on mobile - .on('touchend', '#image', function(e) { + .on('touchend', '#imageview #image', function(e) { if (swipe.obj==null || (swipe.offset>=-5&&swipe.offset<=5)) { if (visible.header()) header.hide(e, 0) else header.show() @@ -86,7 +86,7 @@ $(document).ready(function() { }) // Swipe on mobile - .swipe().on('swipeStart', function() { if (visible.photo()) swipe.start($('#image')) }) + .swipe().on('swipeStart', function() { if (visible.photo()) swipe.start($('#imageview #image')) }) .swipe().on('swipeMove', function(e) { if (visible.photo()) swipe.move(e.swipe) }) .swipe().on('swipeEnd', function(e) { if (visible.photo()) swipe.stop(e.swipe, photo.previous, photo.next) }) diff --git a/src/scripts/photo.js b/src/scripts/photo.js index 76ad97f..c486313 100644 --- a/src/scripts/photo.js +++ b/src/scripts/photo.js @@ -100,7 +100,7 @@ photo.previous = function(animate) { delay = 200 - $('#image').css({ + $('#imageview #image').css({ WebkitTransform : 'translateX(100%)', MozTransform : 'translateX(100%)', transform : 'translateX(100%)', @@ -131,7 +131,7 @@ photo.next = function(animate) { delay = 200 - $('#image').css({ + $('#imageview #image').css({ WebkitTransform : 'translateX(-100%)', MozTransform : 'translateX(-100%)', transform : 'translateX(-100%)', diff --git a/src/scripts/swipe.js b/src/scripts/swipe.js index 7060c35..16bd54e 100644 --- a/src/scripts/swipe.js +++ b/src/scripts/swipe.js @@ -36,14 +36,25 @@ swipe.move = function(e) { swipe.stop = function(e, left, right) { - if (e.x<=-swipe.tolerance) left(true) - else if (e.x>=swipe.tolerance) right(true) - else if (swipe.obj!==null) { + // Only execute once + if (swipe.obj==null) return false + + if (e.x<=-swipe.tolerance) { + + left(true) + + } else if (e.x>=swipe.tolerance) { + + right(true) + + } else { + swipe.obj.css({ WebkitTransform : 'translateX(0px)', MozTransform : 'translateX(0px)', transform : 'translateX(0px)' }) + } swipe.obj = null diff --git a/src/styles/_imageview.scss b/src/styles/_imageview.scss index b376386..31ccd57 100644 --- a/src/styles/_imageview.scss +++ b/src/styles/_imageview.scss @@ -21,7 +21,7 @@ right: 30px; bottom: 30px; left: 30px; - transition: top .3s, right .3s, bottom .3s, left .3s; + transition: top .3s, right .3s, bottom .3s, left .3s, opacity .2s, transform .2s; will-change: transform; display: flex; From 83fe4a2596f5b6f61411e4e2f2c4cf55c9106b54 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Wed, 6 Jan 2016 17:29:49 +0100 Subject: [PATCH 19/30] Disabled dragging for images --- src/scripts/build.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/scripts/build.js b/src/scripts/build.js index 3ebccf6..75cc311 100644 --- a/src/scripts/build.js +++ b/src/scripts/build.js @@ -49,9 +49,9 @@ build.album = function(data) { html += lychee.html`
- thumb - thumb - thumb + Photo thumbnail + Photo thumbnail + Photo thumbnail

$${ data.title }

$${ data.sysdate } @@ -86,7 +86,7 @@ build.photo = function(data) { html += lychee.html`
- thumb + Photo thumbnail

$${ data.title }

` @@ -120,11 +120,11 @@ build.imageview = function(data, visibleControls) { if (hasMedium===false) { - html += lychee.html`
` + html += lychee.html`
` } else { - html += lychee.html`
` + html += lychee.html`
` } From c8ab2b6e90ab1f68f08908d7ab7cbc0517fc06d4 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Wed, 6 Jan 2016 17:29:56 +0100 Subject: [PATCH 20/30] Rebuild --- dist/main.js | Bin 190385 -> 190680 bytes dist/view.js | Bin 104850 -> 105146 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/dist/main.js b/dist/main.js index cffcfc97aa8c0999af7bc10a55575c012e4efb24..89faa9444e2db1f46fac1f52f3ae1b18c031b787 100644 GIT binary patch delta 1003 zcmcgoO-K}B80Oud#9cC5+lAc}v^mTn0*|4Uh!=nQA%YGCVJH%Gu-8LBqz6x3o`?7O-tT>%_nDe= zF3vkA-xUFGyf0dDfoMGQglr(_8|5ERTRf_}QA?c~1iPSVKEc?iUM#VTtibZdLb#_G zAHxmPfVAiGl*KC6sQN_pK^HAEp+Y7R^Bx~yd9LLeE9f7ue#Wt{BlU=$Xaiz0dJ^$| zG=#VmeTq2TSckaKcm{EA(~6r9X7jl?P5C&ARb*y>VFgamea&U1LNJ+0q-jc{7zQ`+ zTO#_cZoX%8i<-s<0(?-Fb1I!?G))Ku1mja{2invxwy|iow{5iqDc)^&Af=u|gpyK0(&UbAiOF>+iL6?gzzD1_vvv>+b-sQp ziRtBWz^dg<>JU~h)|;(JzV8Emw?G$EhLw`i^@t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zexA%=+uk4Ef*=|O9Bs!UCW0rC6rhpz{`1wOX_y*@poxA}Py2%+v0wJjqP=8vmkWJe ziET&lDAwvi{pZ2^2o{DOcvjpc24wqea(>mSy<5Mq0#xig)^FpgGozJ-lcrAQ(U>!m ze&IqFZJ9a*(ahZ=IMut@h>JQGzlId8$x5-rm^G1-R%+ccMXXrdQZogLjaU{d6vLLW zsvD*$hQj53Qlskfi=?DD(@!tDN)>H@Vw8&0@LVWG`{ea(5fJC&+tz}wx_4cBYluKF zfLIe9rKgW-jOk`#JSehYJK@=Fkgrq(Rh$$}Og=8jxp*x!i$M5X4|D*@E%iW)dk0Bc z%<{41#HqMRb)&(jQbrrCv^HkYjMOkfjd2ahF`7uwxS{dGArQDP1a<3qd3@uVb$m&I z&7R-KZ{_#G(97S1p^W$T!KL*q`o9)M?ukHkE;4S=lkwCzk41(tX(i_ z?|!d$5Se3${-gd35WTmd1Bj7p7;%H3zipid-bi>8fW2kkv6Lx zo3XtpUc|a=m|sggMX@~mtgcFzjuZV-W@!^uKd4-(3JIN;$|GELajen$()@TC!Hm(u zdmB=87dQtVq){2^AvC@*NRJ2;!sH$pKky5jp zxs;gKFj(<3vM5zvWH{cq`sTXL$;)vOPstmBRmO?<^ zY9bkEl|)T!Qw#EBRxHx5gTT;hgW&m>8{N`q3d1gXfxsMH8Gwl`BmXhk#K|A+jtVaw zCvcX&9)M>0I|Q?TH`fWc%(XDwv(fueI7S08@X`ZO$XYUGqTJo0^X2U(nFbd?9nBYE UfR4<9gKnIM9hJ&loq=E8Kba5_k^lez From f337ea19baf51084eb5e14d5c75fd8e8cb55e1fb Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Thu, 7 Jan 2016 15:30:55 +0100 Subject: [PATCH 21/30] Updated basicContext --- dist/main.css | Bin 31954 -> 31994 bytes src/package.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 dist/main.css diff --git a/dist/main.css b/dist/main.css old mode 100755 new mode 100644 index 14a0941ec8d28d550a3a27e27969462920eb230b..63c0582915a29247aa0cf0cd7c98eb4bf278166f GIT binary patch delta 55 zcmccglkwM2#tn-ZHLP{ZQ Date: Thu, 7 Jan 2016 15:46:49 +0100 Subject: [PATCH 22/30] Updated version --- src/package.json | 2 +- src/scripts/lychee.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/package.json b/src/package.json index 568486e..2de6f1e 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "Lychee", - "version": "3.0.8", + "version": "3.0.9", "description": "Self-hosted photo-management done right.", "authors": "Tobias Reich ", "license": "MIT", diff --git a/src/scripts/lychee.js b/src/scripts/lychee.js index 0e8bd55..03d1c1f 100644 --- a/src/scripts/lychee.js +++ b/src/scripts/lychee.js @@ -6,8 +6,8 @@ lychee = { title : document.title, - version : '3.0.8', - version_code : '030008', + version : '3.0.9', + version_code : '030009', update_path : '//update.electerious.com/index.json', updateURL : 'https://github.com/electerious/Lychee', From 1bfdae67593b2d7b443fd9a0fa5fa2e46b6887ee Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Thu, 7 Jan 2016 15:52:31 +0100 Subject: [PATCH 23/30] Rebuild --- dist/main.js | Bin 190680 -> 190680 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/dist/main.js b/dist/main.js index 89faa9444e2db1f46fac1f52f3ae1b18c031b787..cb570890acad884cf55aa08c1a8e1ecaf10578bb 100644 GIT binary patch delta 28 kcmca{k^9C)?uHh|ElhESjF!{m4Vgq4Ew`5%G9_;Z0HN^--T(jq delta 28 kcmca{k^9C)?uHh|ElhESj26@54Vgq4Ew+~$G9_;Z0HNFo+yDRo From b8dde7fbae58176386dbd4e22457990517ec0f69 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Thu, 7 Jan 2016 15:54:33 +0100 Subject: [PATCH 24/30] Added v3.0.9 to the changelog --- docs/Changelog.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/Changelog.md b/docs/Changelog.md index 5f8f698..5af8444 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,3 +1,12 @@ +## v3.0.9 + +Released January ?, 2016 + +- `Improved` Disabled dragging for thumbnails +- `Improved` Avoided unnecessary devicePixelRatio checks by using srcset for all thumbnails +- `Improved` Avoided devicePixelRatio check by using srcset for the imageview image +- `Fixed` Swipe-gestures on mobile devices + ## v3.0.8 Released December 20, 2015 From b6f295ea806719da4fcd608170ec5066a361fa53 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Thu, 7 Jan 2016 16:22:09 +0100 Subject: [PATCH 25/30] Treat dist files like binaries --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 967a087..7fb6b12 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -dist/* binary \ No newline at end of file +dist/**/* binary \ No newline at end of file From 478271886efa3785bafbd7dc8bfafa8461f152c1 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Fri, 8 Jan 2016 10:11:45 +0100 Subject: [PATCH 26/30] Added lychee-webroot to the plugin/extension list #391 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f698d80..388ed11 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ Here's a list of all available Plugins and Extensions: | lychee-watermark | Adds a second watermarked photo when uploading images | [More »](https://github.com/electerious/lychee-watermark) | | lychee-rss | Creates a RSS-Feed out of your photos | [More »](https://github.com/cternes/Lychee-RSS) | | lychee-FlashAir | Import from a Toshiba FlashAir WiFi SD card | [More »](https://github.com/mhp/Lychee-FlashAir) | +| lychee-webroot | Controls photos accessibility and keeps Lychee files hidden | [More »](https://github.com/Bramas/lychee-webroot) | ## Troubleshooting From 2a0212e33a6e4dbd55630a40e225f6ebe656fcb6 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 10 Jan 2016 13:07:21 +0100 Subject: [PATCH 27/30] Updated #421 syntax --- plugins/check/index.php | 66 +++++++++++++++++++----------------- plugins/displaylog/index.php | 47 +++++++++++++------------ 2 files changed, 59 insertions(+), 54 deletions(-) diff --git a/plugins/check/index.php b/plugins/check/index.php index 0d2a303..b44519e 100644 --- a/plugins/check/index.php +++ b/plugins/check/index.php @@ -99,43 +99,45 @@ if (!$gdVersion['GIF Read Support'] || !$gdVersion['GIF Create Support']) $error if ($error==='') echo('No critical problems found. Lychee should work without problems!' . PHP_EOL); else echo $error; -# Don't go further if the user is not connected -session_start(); -$isAdmin = ((isset($_SESSION['login'])&&$_SESSION['login']===true)&& - (isset($_SESSION['identifier'])&&$_SESSION['identifier']===$settings['identifier'])); - -if(!$isAdmin) -{ - echo(PHP_EOL . PHP_EOL . 'You have to be logged in to see more information.'); - exit(); -} - - # Show separator echo(PHP_EOL . PHP_EOL . 'System Information' . PHP_EOL); echo('------------------' . PHP_EOL); -# Load json -$json = file_get_contents(LYCHEE_SRC . 'package.json'); -$json = json_decode($json, true); +# Ensure that user is logged in +session_start(); -# About imagick -$imagick = extension_loaded('imagick'); -if ($imagick===true) $imagickVersion = @Imagick::getVersion(); -else $imagick = '-'; -if (!isset($imagickVersion, $imagickVersion['versionNumber'])||$imagickVersion==='') $imagickVersion = '-'; -else $imagickVersion = $imagickVersion['versionNumber']; +if ((isset($_SESSION['login'])&&$_SESSION['login']===true)&& + (isset($_SESSION['identifier'])&&$_SESSION['identifier']===$settings['identifier'])) { -# Output system information -echo('Lychee Version: ' . $json['version'] . PHP_EOL); -echo('DB Version: ' . $settings['version'] . PHP_EOL); -echo('System: ' . PHP_OS . PHP_EOL); -echo('PHP Version: ' . floatval(phpversion()) . PHP_EOL); -echo('MySQL Version: ' . $database->server_version . PHP_EOL); -echo('Imagick: ' . $imagick . PHP_EOL); -echo('Imagick Active: ' . $settings['imagick'] . PHP_EOL); -echo('Imagick Version: ' . $imagickVersion . PHP_EOL); -echo('GD Version: ' . $gdVersion['GD Version'] . PHP_EOL); -echo('Plugins: ' . $settings['plugins'] . PHP_EOL); + # Load json + $json = file_get_contents(LYCHEE_SRC . 'package.json'); + $json = json_decode($json, true); + + # About imagick + $imagick = extension_loaded('imagick'); + if ($imagick===true) $imagickVersion = @Imagick::getVersion(); + else $imagick = '-'; + if (!isset($imagickVersion, $imagickVersion['versionNumber'])||$imagickVersion==='') $imagickVersion = '-'; + else $imagickVersion = $imagickVersion['versionNumber']; + + # Output system information + echo('Lychee Version: ' . $json['version'] . PHP_EOL); + echo('DB Version: ' . $settings['version'] . PHP_EOL); + echo('System: ' . PHP_OS . PHP_EOL); + echo('PHP Version: ' . floatval(phpversion()) . PHP_EOL); + echo('MySQL Version: ' . $database->server_version . PHP_EOL); + echo('Imagick: ' . $imagick . PHP_EOL); + echo('Imagick Active: ' . $settings['imagick'] . PHP_EOL); + echo('Imagick Version: ' . $imagickVersion . PHP_EOL); + echo('GD Version: ' . $gdVersion['GD Version'] . PHP_EOL); + echo('Plugins: ' . $settings['plugins'] . PHP_EOL); + +} else { + + # Don't go further if the user is not logged in + echo('You have to be logged in to see more information.'); + exit(); + +} ?> diff --git a/plugins/displaylog/index.php b/plugins/displaylog/index.php index 48107ff..e6e690b 100644 --- a/plugins/displaylog/index.php +++ b/plugins/displaylog/index.php @@ -41,37 +41,40 @@ if (mysqli_connect_errno()!=0) { $settings = new Settings($database); $settings = $settings->get(); -# Check if the user is connected +# Ensure that user is logged in session_start(); -$isAdmin = ((isset($_SESSION['login'])&&$_SESSION['login']===true)&& - (isset($_SESSION['identifier'])&&$_SESSION['identifier']===$settings['identifier'])); -if(!$isAdmin) -{ - exit('You have to be logged in to see the log.'); -} +if ((isset($_SESSION['login'])&&$_SESSION['login']===true)&& + (isset($_SESSION['identifier'])&&$_SESSION['identifier']===$settings['identifier'])) { + # Result + $query = Database::prepare($database, "SELECT FROM_UNIXTIME(time), type, function, line, text FROM ?", array(LYCHEE_TABLE_LOG)); + $result = $database->query($query); -# Result -$query = Database::prepare($database, "SELECT FROM_UNIXTIME(time), type, function, line, text FROM ?", array(LYCHEE_TABLE_LOG)); -$result = $database->query($query); + # Output + if ($result->num_rows===0) { -# Output -if ($result->num_rows===0) { + echo('Everything looks fine, Lychee has not reported any problems!'); - echo('Everything looks fine, Lychee has not reported any problems!' . PHP_EOL . PHP_EOL); + } else { + + while($row = $result->fetch_row()) { + + # Encode result before printing + $row = array_map('htmlentities', $row); + + # Format: time TZ - type - function(line) - text + printf ("%s - %s - %s (%s) \t- %s\n", $row[0], $row[1], $row[2], $row[3], $row[4]); + + } + + } } else { - while($row = $result->fetch_row()) { - - # Encode result before printing - $row = array_map("htmlentities", $row); - - # Format: time TZ - type - function(line) - text - printf ("%s %s - %s - %s (%s) \t- %s\n", $row[0], date_default_timezone_get(), $row[1], $row[2], $row[3], $row[4]); - - } + # Don't go further if the user is not logged in + echo('You have to be logged in to see the log.'); + exit(); } From 92d3fe920f00e250bbb5db560469134b8d7d58f2 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 10 Jan 2016 13:24:34 +0100 Subject: [PATCH 28/30] Added #421 to the log --- docs/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Changelog.md b/docs/Changelog.md index 5af8444..a23a3ec 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -5,6 +5,7 @@ Released January ?, 2016 - `Improved` Disabled dragging for thumbnails - `Improved` Avoided unnecessary devicePixelRatio checks by using srcset for all thumbnails - `Improved` Avoided devicePixelRatio check by using srcset for the imageview image +- `Improved` Don't show log and system information when logged out (Thanks @Bramas, #421) - `Fixed` Swipe-gestures on mobile devices ## v3.0.8 From 0b7322961674ea6170951a58aa8cb108931c8920 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 10 Jan 2016 13:31:10 +0100 Subject: [PATCH 29/30] Rebuild --- dist/main.css | Bin 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 dist/main.css diff --git a/dist/main.css b/dist/main.css old mode 100644 new mode 100755 From 7a7ae24512a160150dfc7d841151f96b3e93f9b6 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 10 Jan 2016 13:31:37 +0100 Subject: [PATCH 30/30] Added date to the changelog --- docs/Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Changelog.md b/docs/Changelog.md index a23a3ec..2ad8e32 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,6 +1,6 @@ ## v3.0.9 -Released January ?, 2016 +Released January 10, 2016 - `Improved` Disabled dragging for thumbnails - `Improved` Avoided unnecessary devicePixelRatio checks by using srcset for all thumbnails