pull/754/merge
globalchangemedia 6 years ago committed by GitHub
commit 2bd300e156
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at lychee@electerious.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

@ -2,8 +2,10 @@
#### A great looking and easy-to-use photo-management-system.
![Lychee](http://l.electerious.com/uploads/big/c4b58cb87d95aeaed78fdca581cc908c.jpg)
![Lychee](http://l.electerious.com/uploads/big/075ac5de5b5d6c593acbb700f0e1d739.jpg)
*Since the 1st of April 2018 this project has moved to it's own Organisation (https://github.com/LycheeOrg) where people are able to submit their fixes to it. We, the Organisation owners, want to thank electerious (Tobias Reich) for the opportunity to make this project live on.*
![Lychee](https://s.electerious.com/images/lychee/1.jpeg)
![Lychee](https://s.electerious.com/images/lychee/2.jpeg)
Lychee is a free photo-management tool, which runs on your server or web-space. Installing is a matter of seconds. Upload, manage and share photos like from a native application. Lychee comes with everything you need and all your photos are stored securely. Try the [Live Demo](http://ld.electerious.com) or read more on our [Website](http://lychee.electerious.com).
@ -17,7 +19,7 @@ You can use Lychee right after the installation. Here are some advanced features
### Settings
Sign in and click the gear on the top left corner to change your settings. If you want to edit them manually: MySQL details are stored in `data/config.php`. Other options and hidden settings are stored directly in the database. [Settings »](docs/Settings.md)
Sign in and click the gear in the top left corner to change your settings. If you want to edit them manually: MySQL details are stored in `data/config.php`. Other options and hidden settings are stored directly in the database. [Settings »](docs/Settings.md)
### Update
@ -29,7 +31,7 @@ Lychee is ready to use, right out of the box. If you want to contribute and edit
### Keyboard Shortcuts
These shortcuts will help you to use Lychee even faster. [Keyboard Shortcuts »](docs/Keyboard Shortcuts.md)
These shortcuts will help you to use Lychee even faster. [Keyboard Shortcuts »](docs/Keyboard%20Shortcuts.md)
### Dropbox import
@ -45,13 +47,13 @@ Lychee uses [Imagick](http://www.imagemagick.org) when installed on your server.
### Docker
Browse the [Docker Hub Registry](https://hub.docker.com/r/kdelfour/lychee-docker/) for various automated Lychee-Docker builds. We recommed to use [lychee-docker](https://hub.docker.com/r/kdelfour/lychee-docker/) by [kdelfour](https://github.com/kdelfour).
Browse the [Docker Hub Registry](https://hub.docker.com/r/kdelfour/lychee-docker/) for various automated Lychee-Docker builds. We recommend using [lychee-docker](https://hub.docker.com/r/kdelfour/lychee-docker/) by [kdelfour](https://github.com/kdelfour).
### Plugins and Extensions
The plugin-system of Lychee allows you to execute scripts, when a certain action fires. Plugins are hooks, which are injected directly into Lychee. [Plugin documentation »](docs/Plugins.md)
The plugin-system of Lychee allows you to execute scripts when a certain action fires. Plugins are hooks, which are injected directly into Lychee. [Plugin documentation »](docs/Plugins.md)
It's also possible to build extensions upon Lychee. The way to do so isn't documented and can change every time. We recommend to use the plugin-system, when possible.
It's also possible to build extensions upon Lychee. The way to do so isn't documented and can change every time. We recommend using the plugin-system, when possible.
Here's a list of all available Plugins and Extensions:
@ -70,7 +72,3 @@ Here's a list of all available Plugins and Extensions:
## Troubleshooting
Take a look at the [FAQ](docs/FAQ.md) if you have problems. Discovered a bug? Please create an issue here on GitHub!
## Donate
I am working hard on continuously developing and maintaining Lychee. Please consider making a donation via PayPal (from [our site](http://lychee.electerious.com/)) to keep the project going strong and me motivated.

2
dist/main.css vendored

File diff suppressed because one or more lines are too long

21
dist/main.js vendored

File diff suppressed because one or more lines are too long

8
dist/view.js vendored

File diff suppressed because one or more lines are too long

@ -27,7 +27,7 @@ You can also use the [direct download](https://github.com/electerious/Lychee/arc
Change the permissions of `uploads/`, `data/` and all their subfolders. Sufficient read/write privileges are required.
chmod -R 777 uploads/ data/
chmod -R 750 uploads/ data/
### 4. Finish

@ -26,6 +26,7 @@ final class Admin extends Access {
case 'Album::setTitle': self::setAlbumTitleAction(); break;
case 'Album::setDescription': self::setAlbumDescriptionAction(); break;
case 'Album::setPublic': self::setAlbumPublicAction(); break;
case 'Album::setPosition': self::setPositionAction(); break;
case 'Album::delete': self::deleteAlbumAction(); break;
case 'Album::merge': self::mergeAlbumsAction(); break;
@ -115,6 +116,15 @@ final class Admin extends Access {
}
private static function setPositionAction() {
Validator::required(isset($_POST['albumID'],$_POST['photoOrder']), __METHOD__);
$album = new Album($_POST['albumID']);
Response::json($album->setPosition());
}
private static function setAlbumPublicAction() {
Validator::required(isset($_POST['albumID'], $_POST['password'], $_POST['visible'], $_POST['downloadable']), __METHOD__);

@ -344,6 +344,41 @@ final class Album {
}
public function setPosition(){
// Check dependencies
Validator::required(isset($_POST['photoOrder']), __METHOD__);
// Call plugins
Plugins::get()->activate(__METHOD__, 0, func_get_args());
$id_list = implode(',', $_POST['photoOrder']);
$indices = [];
$size = count(explode(',',$id_list));
for($i = 0; $i < $size; $i++){
$indices[$i] = $i;
}
$whens = implode(
" ",
array_map(
function ($id, $value) {
return "WHEN {$id} THEN {$value}";
},
explode(',',$id_list),
$indices
)
);
$query = Database::prepare(Database::get(), "UPDATE ? SET position = CASE id ? END WHERE id IN (?)", array(LYCHEE_TABLE_PHOTOS, $whens, $id_list));
$result = Database::execute(Database::get(), $query, __METHOD__, __LINE__);
// Call plugins
Plugins::get()->activate(__METHOD__, 1, func_get_args());
if ($result===false) return false;
return true;
}
/**
* @return boolean Returns true when successful.
*/

@ -208,7 +208,7 @@ final class Photo {
$info = $this->getInfo($path);
// Use title of file if IPTC title missing
if ($info['title']==='') $info['title'] = substr(basename($file['name'], $extension), 0, 30);
if ($info['title']==='') $info['title'] = substr(basename($file['name'], $extension), 0, 100);
if ($exists===false) {
@ -709,7 +709,7 @@ final class Photo {
// Parse photo
$photo['sysdate'] = strftime('%d %b. %Y', substr($photo['id'], 0, -4));
if (strlen($photo['takestamp'])>1) $photo['takedate'] = strftime('%d %b. %Y', $photo['takestamp']);
if (strlen($photo['takestamp'])>1) $photo['takedate'] = strftime('%d %b. %Y %T', $photo['takestamp']);
// Parse medium
if ($photo['medium']==='1') $photo['medium'] = LYCHEE_URL_UPLOADS_MEDIUM . $photo['url'];
@ -832,7 +832,7 @@ final class Photo {
}
// Read EXIF
if ($info['mime']=='image/jpeg') $exif = @exif_read_data($url, 'EXIF', false, false);
if ($info['mime']=='image/jpeg') $exif = @exif_read_data($url, 'EXIF, IFD0', false, false);
else $exif = false;
// EXIF Metadata

@ -24,7 +24,8 @@ CREATE TABLE IF NOT EXISTS `?` (
`album` bigint(20) unsigned NOT NULL,
`checksum` char(40) DEFAULT NULL,
`medium` tinyint(1) NOT NULL DEFAULT '0',
`position` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `Index_album` (`album`),
KEY `Index_star` (`star`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

@ -0,0 +1,25 @@
<?php
/**
* Update to version 3.1.7
*/
use Lychee\Modules\Database;
use Lychee\Modules\Response;
// Add position to photos
$query = Database::prepare($connection, "SELECT `position` FROM `?` LIMIT 1", array(LYCHEE_TABLE_PHOTOS));
$result = Database::execute($connection, $query, 'update_030107', __LINE__);
if ($result===false) {
$query = Database::prepare($connection, "ALTER TABLE `?` ADD `position` TINYINT(1) NOT NULL", array(LYCHEE_TABLE_PHOTOS));
$result = Database::execute($connection, $query, 'update_030107', __LINE__);
if ($result===false) Response::error('Could not add position to database!');
}
// Set version
if (Database::setVersion($connection, '030107')===false) Response::error('Could not update version of database!');
?>

@ -83,6 +83,7 @@ paths.main = {
],
scripts: [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/jquery-ui-dist/jquery-ui.min.js',
'node_modules/mousetrap/mousetrap.min.js',
'node_modules/mousetrap/plugins/global-bind/mousetrap-global-bind.min.js',
'node_modules/basiccontext/dist/basicContext.min.js',

@ -28,6 +28,7 @@
"gulp-sass": "^3.1.0",
"gulp-uglify": "^2.1.1",
"jquery": "^3.2.0",
"jquery-ui": "^1.12.1",
"mousetrap": "^1.6.0"
}
}

@ -30,6 +30,21 @@ album.getID = function() {
}
album.load = function(albumID, refresh = false) {
$('.content').sortable({
stop: function(event, ui){
let albumID = ui.item.data('album-id');
let photoOrder = $('.content').children().map(function(){
return $(this).data('id');
}).get();
let params = {
albumID: albumID,
photoOrder: photoOrder
};
api.post('Album::setPosition', params, function(data) {
if (data!==true) lychee.error(null, params, data)
})
}
});
password.get(albumID, function() {

@ -5,8 +5,8 @@
lychee = {
title : document.title,
version : '3.1.6',
versionCode : '030106',
version : '3.1.7',
versionCode : '030107',
updatePath : '//update.electerious.com/index.json',
updateURL : 'https://github.com/electerious/Lychee',

Loading…
Cancel
Save