modal.show("Connection Failed","Unable to connect to host database because access was denied. Double-check your host, username and password and ensure that access from your current location is permitted.",buttons,null,false);
modal.show('Connection Failed','Unable to connect to host database because access was denied. Double-check your host, username and password and ensure that access from your current location is permitted.',buttons,null,false);
modal.show("Creation Failed","Unable to create the database. Double-check your host, username and password and ensure that the specified user has the rights to modify and add content to the database.",buttons,null,false);
modal.show('Creation Failed','Unable to create the database. Double-check your host, username and password and ensure that the specified user has the rights to modify and add content to the database.',buttons,null,false);
modal.show("Saving Failed","Unable to save this configuration. Permission denied in <b>'data/'</b>. Please set the read, write and execute rights for others in <b>'data/'</b> and <b>'uploads/'</b>. Take a look the readme for more information.",buttons,null,false);
returnfalse;
}
}
// Could not create file
if(data.indexOf('Warning: Could not create file!')!==-1){
modal.show("Configuration Failed","Something unexpected happened. Please try again and check your installation and server. Take a look the readme for more information.",buttons,null,false);
modal.show('Saving Failed',"Unable to save this configuration. Permission denied in <b>'data/'</b>. Please set the read, write and execute rights for others in <b>'data/'</b> and <b>'uploads/'</b>. Take a look the readme for more information.",buttons,null,false);
modal.show('Configuration Failed','Something unexpected happened. Please try again and check your installation and server. Take a look the readme for more information.',buttons,null,false);
returnfalse;
// Configuration successful
window.location.reload();
},400);
}
}else{
});
// Configuration successful
window.location.reload();
}],
["",function(){}]
];
}
modal.show("Configuration","Enter your database connection details below: <input id='dbHost' class='text less' type='text' placeholder='Database Host (optional)' value=''><input id='dbUser' class='text less' type='text' placeholder='Database Username' value=''><input id='dbPassword' class='text more' type='password' placeholder='Database Password' value=''><br>Lychee will create its own database. If required, you can enter the name of an existing database instead:<input id='dbName' class='text less' type='text' placeholder='Database Name (optional)' value=''><input id='dbTablePrefix' class='text more' type='text' placeholder='Table prefix (optional)' value=''>",buttons,-235,false);
});
},
}],
['',function(){}]
];
createLogin:function(){
modal.show('Configuration',"Enter your database connection details below: <input id='dbHost' class='text less' type='text' placeholder='Database Host (optional)' value=''><input id='dbUser' class='text less' type='text' placeholder='Database Username' value=''><input id='dbPassword' class='text more' type='password' placeholder='Database Password' value=''><br>Lychee will create its own database. If required, you can enter the name of an existing database instead:<input id='dbName' class='text less' type='text' placeholder='Database Name (optional)' value=''><input id='dbTablePrefix' class='text more' type='text' placeholder='Table prefix (optional)' value=''>",buttons,-235,false);
modal.show("Wrong Input","The username or password you entered is not long enough. Please try again with another username and password!",buttons,null,false);
modal.show('Wrong Input','The username or password you entered is not long enough. Please try again with another username and password!',buttons,null,false);
lychee.sorting='ORDER BY '+sorting[0]+' '+sorting[1];
lychee.load();
}elselychee.error(null,params,data);
if(lychee.sorting!==""){
});
sorting=lychee.sorting.replace("ORDER BY ","").split(" ");
}],
['Cancel',function(){}]
];
$("select#settings_type").val(sorting[0]);
$("select#settings_order").val(sorting[1]);
modal.show('Change Sorting',
"Sortphotosby\
<selectid='settings_type'>\
<optionvalue='id'>UploadTime</option>\
<optionvalue='takestamp'>TakeDate</option>\
<optionvalue='title'>Title</option>\
<optionvalue='description'>Description</option>\
<optionvalue='public'>Public</option>\
<optionvalue='star'>Star</option>\
<optionvalue='type'>PhotoFormat</option>\
</select>\
inan\
<selectid='settings_order'>\
<optionvalue='ASC'>Ascending</option>\
<optionvalue='DESC'>Descending</option>\
</select>\
order.\
",buttons);
}
if(lychee.sorting!==''){
},
sorting=lychee.sorting.replace('ORDER BY ','').split(' ');
setDropboxKey:function(callback){
$('select#settings_type').val(sorting[0]);
$('select#settings_order').val(sorting[1]);
varbuttons,
params,
key;
}
buttons=[
["Set Key",function(){
}
key=$(".message input.text#key").val();
settings.setDropboxKey=function(callback){
params="setDropboxKey&key="+key;
lychee.api(params,function(data){
varbuttons,
params,
key;
if(data===true){
lychee.dropboxKey=key;
if(callback)lychee.loadDropbox(callback);
}elselychee.error(null,params,data);
buttons=[
['Set Key',function(){
});
key=$('.message input.text#key').val();
}],
["Cancel",function(){}]
];
params='setDropboxKey&key='+key;
lychee.api(params,function(data){
modal.show("Set Dropbox Key","In order to import photos from your Dropbox, you need a valid drop-ins app key from <a href='https://www.dropbox.com/developers/apps/create'>their website</a>. Generate yourself a personal key and enter it below: <input id='key' class='text' type='text' placeholder='Dropbox API Key' value='"+lychee.dropboxKey+"'>",buttons);
if(data===true){
lychee.dropboxKey=key;
if(callback)lychee.loadDropbox(callback);
}elselychee.error(null,params,data);
}
});
}],
['Cancel',function(){}]
];
modal.show('Set Dropbox Key',"In order to import photos from your Dropbox, you need a valid drop-ins app key from <a href='https://www.dropbox.com/developers/apps/create'>their website</a>. Generate yourself a personal key and enter it below: <input id='key' class='text' type='text' placeholder='Dropbox API Key' value='"+lychee.dropboxKey+"'>",buttons);