From 359a51f1539a82b776c48e93c1c9e9271a0de6ed Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 28 Jun 2015 18:33:17 +0200 Subject: [PATCH] Updated modals to work with the new basicModal (data-name => name) --- src/scripts/album.js | 14 +++++++------- src/scripts/lychee.js | 8 ++++---- src/scripts/password.js | 11 +++++------ src/scripts/photo.js | 6 +++--- src/scripts/settings.js | 22 +++++++++++----------- src/scripts/upload.js | 4 ++-- 6 files changed, 32 insertions(+), 33 deletions(-) diff --git a/src/scripts/album.js b/src/scripts/album.js index e1f56b2..11725e7 100644 --- a/src/scripts/album.js +++ b/src/scripts/album.js @@ -138,7 +138,7 @@ album.add = function() { } basicModal.show({ - body: "

Enter a title for the new album:

", + body: "

Enter a title for the new album:

", buttons: { action: { title: 'Create Album', @@ -306,7 +306,7 @@ album.setTitle = function(albumIDs) { } - input = ""; + input = ""; if (albumIDs.length===1) msg = "

Enter a new title for this album: " + input + "

"; else msg = "

Enter a title for all " + albumIDs.length + " selected albums: " + input +"

"; @@ -361,7 +361,7 @@ album.setDescription = function(albumID) { } basicModal.show({ - body: "

Please enter a description for this album:

", + body: "

Please enter a description for this album:

", buttons: { action: { title: 'Set Description', @@ -431,7 +431,7 @@ album.setPublic = function(albumID, modal, e) { Password protected

Only accessible with a valid password.

- + ` @@ -457,8 +457,8 @@ album.setPublic = function(albumID, modal, e) { $('.basicModal .choice input[name="password"]').on('change', function() { - if ($(this).prop('checked')===true) $('.basicModal .choice input[data-name="password"]').show().focus(); - else $('.basicModal .choice input[data-name="password"]').hide(); + if ($(this).prop('checked')===true) $('.basicModal .choice input[name="passwordtext"]').show().focus(); + else $('.basicModal .choice input[name="passwordtext"]').hide(); }); @@ -482,7 +482,7 @@ album.setPublic = function(albumID, modal, e) { // Set password if ($('.basicModal .choice input[name="password"]:checked').length===1) { - password = $('.basicModal .choice input[data-name="password"]').val(); + password = $('.basicModal .choice input[name="passwordtext"]').val(); album.json.password = '1'; } else { password = ''; diff --git a/src/scripts/lychee.js b/src/scripts/lychee.js index 8238f18..6e0103d 100644 --- a/src/scripts/lychee.js +++ b/src/scripts/lychee.js @@ -127,8 +127,8 @@ lychee.loginDialog = function() { msg = `

- - + +

Lychee ${ lychee.version }Update available!

` @@ -150,8 +150,8 @@ lychee.loginDialog = function() { if (localStorage) { localUsername = localStorage.getItem('lychee_username'); if (localUsername!==null) { - if (localUsername.length>0) $('.basicModal input[data-name="username"]').val(localUsername); - $('.basicModal input[data-name="password"]').focus(); + if (localUsername.length>0) $('.basicModal input[name="username"]').val(localUsername); + $('.basicModal input[name="password"]').focus(); } } diff --git a/src/scripts/password.js b/src/scripts/password.js index eed704a..c0440f3 100644 --- a/src/scripts/password.js +++ b/src/scripts/password.js @@ -9,10 +9,9 @@ password = { } -password.get = function(albumID, callback) { +password.get = function(albumID, callback, passwd) { - var passwd = $('.basicModal input.text').val(), - params; + var params; if (lychee.publicMode===false) callback(); else if (album.json&&album.json.password==='0') callback(); @@ -23,7 +22,7 @@ password.get = function(albumID, callback) { album.json = {password: true}; callback(''); - } else if (passwd==undefined) { + } else if (passwd==null) { // Request password password.getDialog(albumID, callback); @@ -59,7 +58,7 @@ password.getDialog = function(albumID, callback) { cancel, msg = ''; - action = function() { password.get(albumID, callback) } + action = function(data) { password.get(albumID, callback, data.password) } cancel = function() { basicModal.close(); @@ -69,7 +68,7 @@ password.getDialog = function(albumID, callback) { msg = `

This album is protected by a password. Enter the password below to view the photos of this album: - +

` diff --git a/src/scripts/photo.js b/src/scripts/photo.js index 58d2d9f..4c3b83e 100644 --- a/src/scripts/photo.js +++ b/src/scripts/photo.js @@ -330,7 +330,7 @@ photo.setTitle = function(photoIDs) { } - input = ""; + input = ""; if (photoIDs.length===1) msg = "

Enter a new title for this photo: " + input + "

"; else msg = "

Enter a title for all " + photoIDs.length + " selected photos: " + input + "

"; @@ -509,7 +509,7 @@ photo.setDescription = function(photoID) { } basicModal.show({ - body: "

Enter a description for this photo:

", + body: "

Enter a description for this photo:

", buttons: { action: { title: 'Set Description', @@ -556,7 +556,7 @@ photo.editTags = function(photoIDs) { } - input = ""; + input = ""; if (photoIDs.length===1) msg = "

Enter your tags for this photo. You can add multiple tags by separating them with a comma: " + input + "

"; else msg = "

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 + "

"; diff --git a/src/scripts/settings.js b/src/scripts/settings.js index eda7102..2cc6cf0 100644 --- a/src/scripts/settings.js +++ b/src/scripts/settings.js @@ -117,14 +117,14 @@ settings.createConfig = function() { msg = `

Enter your database connection details below: - - - + + +

Lychee will create its own database. If required, you can enter the name of an existing database instead: - - + +

` @@ -191,8 +191,8 @@ settings.createLogin = function() { msg = `

Enter a username and password for your installation: - - + +

` @@ -254,12 +254,12 @@ settings.setLogin = function() { msg = `

Enter your current password: - +

Your username and password will be changed to the following: - - + +

` @@ -426,7 +426,7 @@ settings.setDropboxKey = function(callback) { msg = `

In order to import photos from your Dropbox, you need a valid drop-ins app key from their website. Generate yourself a personal key and enter it below: - +

` diff --git a/src/scripts/upload.js b/src/scripts/upload.js index 9d5833b..de17f6a 100755 --- a/src/scripts/upload.js +++ b/src/scripts/upload.js @@ -322,7 +322,7 @@ upload.start = { } basicModal.show({ - body: "

Please enter the direct link to a photo to import it:

", + body: "

Please enter the direct link to a photo to import it:

", buttons: { action: { title: 'Import', @@ -389,7 +389,7 @@ upload.start = { } basicModal.show({ - body: "

This action will import all photos, folders and sub-folders which are located in the following directory. The original files will be deleted after the import when possible.

", + body: "

This action will import all photos, folders and sub-folders which are located in the following directory. The original files will be deleted after the import when possible.

", buttons: { action: { title: 'Import',