After [installing Node.js](http://nodejs.org) you can use the included `npm` package manager to install the global requirements and Lychee-dependencies with the following command:
cd src/
npm install -g bower gulp
npm install&& bower install
npm install -g gulp
npm install
### Build
The Gruntfile is located in `src/` and can be easily executed using the `gulp` command.
The Gulpfile is located in `src/` and can be easily executed using the `gulp` command.
### Watch for changes
@ -23,4 +22,4 @@ While developing, you might want to use the following command to watch for chang
gulp watch
`gulp` will automatically build Lychee everytime you save a file.
`gulp watch` will automatically build Lychee everytime you save a file.
@ -68,13 +68,15 @@ if (!isset($dbPassword)) $error .= ('Error: No property for $dbPassword in con
if (!isset($dbHost)||$dbHost==='') $error .= ('Error: No property for $dbHost in config.php' . PHP_EOL);
# Settings
if (!isset($settings['username'])||$settings['username']=='') $error .= ('Error: Username empty or not set in database' . PHP_EOL);
if (!isset($settings['password'])||$settings['password']=='') $error .= ('Error: Password empty or not set in database' . PHP_EOL);
if (!isset($settings['thumbQuality'])||$settings['thumbQuality']=='') $error .= ('Error: No or wrong property for thumbQuality in database' . PHP_EOL);
if (!isset($settings['sortingPhotos'])||$settings['sortingPhotos']=='') $error .= ('Error: Wrong property for sortingPhotos in database' . PHP_EOL);
if (!isset($settings['sortingAlbums'])||$settings['sortingAlbums']=='') $error .= ('Error: Wrong property for sortingAlbums in database' . PHP_EOL);
if (!isset($settings['plugins'])) $error .= ('Error: No property for plugins in database' . PHP_EOL);
if (!isset($settings['imagick'])||$settings['imagick']=='') $error .= ('Error: No or wrong property for imagick in database' . PHP_EOL);
if (!isset($settings['username'])||$settings['username']=='') $error .= ('Error: Username empty or not set in database' . PHP_EOL);
if (!isset($settings['password'])||$settings['password']=='') $error .= ('Error: Password empty or not set in database' . PHP_EOL);
if (!isset($settings['thumbQuality'])||$settings['thumbQuality']=='') $error .= ('Error: No or wrong property for thumbQuality in database' . PHP_EOL);
if (!isset($settings['sortingPhotos'])||$settings['sortingPhotos']=='') $error .= ('Error: Wrong property for sortingPhotos in database' . PHP_EOL);
if (!isset($settings['sortingAlbums'])||$settings['sortingAlbums']=='') $error .= ('Error: Wrong property for sortingAlbums in database' . PHP_EOL);
if (!isset($settings['plugins'])) $error .= ('Error: No property for plugins in database' . PHP_EOL);
if (!isset($settings['imagick'])||$settings['imagick']=='') $error .= ('Error: No or wrong property for imagick in database' . PHP_EOL);
if (!isset($settings['identifier'])||$settings['identifier']=='') $error .= ('Error: No or wrong property for identifier in database' . PHP_EOL);
if (!isset($settings['skipDuplicates'])||$settings['skipDuplicates']=='') $error .= ('Error: No or wrong property for skipDuplicates in database' . PHP_EOL);
if (!isset($settings['checkForUpdates'])||($settings['checkForUpdates']!='0'&&$settings['checkForUpdates']!='1')) $error .= ('Error: No or wrong property for checkForUpdates in database' . PHP_EOL);
body:"<p>Please enter a description for this album: <input class='text' data-name='description' type='text' maxlength='800' placeholder='Description' value='" +oldDescription+"'></p>",
body:`<p>Please enter a description for this album: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='${oldDescription}'></p>`,
body:"<p>Enter a description for this photo: <input class='text' data-name='description' type='text' maxlength='800' placeholder='Description' value='" +oldDescription+"'></p>",
body:`<p>Enter a description for this photo: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='${oldDescription}'></p>`,
if(photoIDs.length===1)msg="<p>Enter your tags for this photo. You can add multiple tags by separating them with a comma: " +input+"</p>";
elsemsg="<p>Enter your tags for all "+photoIDs.length+" selected photos. Existing tags will be overwritten. You can add multiple tags by separating them with a comma: " +input+"</p>";
if(photoIDs.length===1)msg=`<p>Enter your tags for this photo. You can add multiple tags by separating them with a comma: ${input}</p>`
elsemsg=`<p>Enter your tags for all ${photoIDs.length} selected photos. Existing tags will be overwritten. You can add multiple tags by separating them with a comma: ${input}</p>`
body:"<p>Please enter the direct link to a photo to import it: <input class='text' data-name='link' type='text' placeholder='http://' value='"+url+"'></p>",
body:`<p>Please enter the direct link to a photo to import it: <input class='text' name='link' type='text' placeholder='http://' value='${url}'></p>`,
buttons:{
action:{
title:'Import',
@ -333,63 +349,102 @@ upload.start = {
fn:basicModal.close
}
}
});
})
},
server:function(){
varalbumID=album.getID(),
action;
if(albumID===false)albumID=0;
letalbumID=album.getID()
if(albumID===false)albumID=0
action=function(data){
constaction=function(data){
var files=[];
let files=[]
files[0]={
name:data.path,
supported:true
};
name:data.path,
supported:true
}
upload.show('Importing from server',files,function(){
body:"<p>This action will import all photos, folders and sub-folders which are located in the following directory. The <b>original files will be deleted</b> after the import when possible. <input class='text' data-name='path' type='text' maxlength='100' placeholder='Absolute path to directory' value='"+lychee.location+"uploads/import/'></p>",
body:`<p>This action will import all photos, folders and sub-folders which are located in the following directory. The <b>original files will be deleted</b> after the import when possible. <input class='text' name='path' type='text' maxlength='100' placeholder='Absolute path to directory' value='${lychee.location}uploads/import/'></p>`,
buttons:{
action:{
title:'Import',
@ -400,60 +455,78 @@ upload.start = {
fn:basicModal.close
}
}
});
})
},
dropbox:function(){
varalbumID=album.getID(),
links='',
success;
letalbumID=album.getID()
if(albumID===false)albumID=0
if(albumID===false)albumID=0;
constsuccess=function(files){
success=function(files){
letlinks=''
for(vari=0;i<files.length;i++){
for(leti=0;i<files.length;i++){
links+=files[i].link+',';
links+=files[i].link+','
files[i]={
name:files[i].link,
supported:true
};
name:files[i].link,
supported:true
}
}
// Remove last comma
links=links.substr(0,links.length-1);
links=links.substr(0,links.length-1)
upload.show('Importing from Dropbox',files,function(){