@ -8,13 +8,13 @@ contextMenu = {}
contextMenu . add = function ( e ) {
let items = [
{ t ype: 'item' , t itle: build . iconic ( 'image' ) + 'Upload Photo' , fn : ( ) => $ ( '#upload_files' ) . click ( ) } ,
{ type : 'separator' } ,
{ t ype: 'item' , t itle: build . iconic ( 'link-intact' ) + 'Import from Link' , fn : upload . start . url } ,
{ t ype: 'item' , t itle: build . iconic ( 'dropbox' , 'ionicons' ) + 'Import from Dropbox' , fn : upload . start . dropbox } ,
{ t ype: 'item' , t itle: build . iconic ( 'terminal' ) + 'Import from Server' , fn : upload . start . server } ,
{ type : 'separator' } ,
{ t ype: 'item' , t itle: build . iconic ( 'folder' ) + 'New Album' , fn : album . add }
{ t itle: build . iconic ( 'image' ) + 'Upload Photo' , fn : ( ) => $ ( '#upload_files' ) . click ( ) } ,
{ } ,
{ t itle: build . iconic ( 'link-intact' ) + 'Import from Link' , fn : upload . start . url } ,
{ t itle: build . iconic ( 'dropbox' , 'ionicons' ) + 'Import from Dropbox' , fn : upload . start . dropbox } ,
{ t itle: build . iconic ( 'terminal' ) + 'Import from Server' , fn : upload . start . server } ,
{ } ,
{ t itle: build . iconic ( 'folder' ) + 'New Album' , fn : album . add }
]
basicContext . show ( items , e . originalEvent )
@ -26,15 +26,15 @@ contextMenu.add = function(e) {
contextMenu . settings = function ( e ) {
let items = [
{ t ype: 'item' , t itle: build . iconic ( 'person' ) + 'Change Login' , fn : settings . setLogin } ,
{ t ype: 'item' , t itle: build . iconic ( 'sort-ascending' ) + 'Change Sorting' , fn : settings . setSorting } ,
{ t ype: 'item' , t itle: build . iconic ( 'dropbox' , 'ionicons' ) + 'Set Dropbox' , fn : settings . setDropboxKey } ,
{ type : 'separator' } ,
{ t ype: 'item' , t itle: build . iconic ( 'info' ) + 'About Lychee' , fn : ( ) => window . open ( lychee . website ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'wrench' ) + 'Diagnostics' , fn : ( ) => window . open ( 'plugins/check/' ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'align-left' ) + 'Show Log' , fn : ( ) => window . open ( 'plugins/displaylog/' ) } ,
{ type : 'separator' } ,
{ t ype: 'item' , t itle: build . iconic ( 'account-logout' ) + 'Sign Out' , fn : lychee . logout }
{ t itle: build . iconic ( 'person' ) + 'Change Login' , fn : settings . setLogin } ,
{ t itle: build . iconic ( 'sort-ascending' ) + 'Change Sorting' , fn : settings . setSorting } ,
{ t itle: build . iconic ( 'dropbox' , 'ionicons' ) + 'Set Dropbox' , fn : settings . setDropboxKey } ,
{ } ,
{ t itle: build . iconic ( 'info' ) + 'About Lychee' , fn : ( ) => window . open ( lychee . website ) } ,
{ t itle: build . iconic ( 'wrench' ) + 'Diagnostics' , fn : ( ) => window . open ( 'plugins/check/' ) } ,
{ t itle: build . iconic ( 'align-left' ) + 'Show Log' , fn : ( ) => window . open ( 'plugins/displaylog/' ) } ,
{ } ,
{ t itle: build . iconic ( 'account-logout' ) + 'Sign Out' , fn : lychee . logout }
]
basicContext . show ( items , e . originalEvent )
@ -53,9 +53,9 @@ contextMenu.album = function(albumID, e) {
let showMerge = ( albums . json && albums . json . albums && Object . keys ( albums . json . albums ) . length > 1 )
let items = [
{ t ype: 'item' , t itle: build . iconic ( 'pencil' ) + 'Rename' , fn : ( ) => album . setTitle ( [ albumID ] ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'collapse-left' ) + 'Merge' , visible : showMerge , fn : ( ) => { basicContext . close ( ) ; contextMenu . mergeAlbum ( albumID , e ) } } ,
{ t ype: 'item' , t itle: build . iconic ( 'trash' ) + 'Delete' , fn : ( ) => album . delete ( [ albumID ] ) }
{ t itle: build . iconic ( 'pencil' ) + 'Rename' , fn : ( ) => album . setTitle ( [ albumID ] ) } ,
{ t itle: build . iconic ( 'collapse-left' ) + 'Merge' , visible : showMerge , fn : ( ) => { basicContext . close ( ) ; contextMenu . mergeAlbum ( albumID , e ) } } ,
{ t itle: build . iconic ( 'trash' ) + 'Delete' , fn : ( ) => album . delete ( [ albumID ] ) }
]
$ ( '.album[data-id="' + albumID + '"]' ) . addClass ( 'active' )
@ -76,10 +76,10 @@ contextMenu.albumMulti = function(albumIDs, e) {
let showMerge = ( albums . json && albums . json . albums && Object . keys ( albums . json . albums ) . length > 1 )
let items = [
{ t ype: 'item' , t itle: build . iconic ( 'pencil' ) + 'Rename All' , fn : ( ) => album . setTitle ( albumIDs ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'collapse-left' ) + 'Merge All' , visible : showMerge && autoMerge , fn : ( ) => album . merge ( albumIDs ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'collapse-left' ) + 'Merge' , visible : showMerge && ! autoMerge , fn : ( ) => { basicContext . close ( ) ; contextMenu . mergeAlbum ( albumIDs [ 0 ] , e ) } } ,
{ t ype: 'item' , t itle: build . iconic ( 'trash' ) + 'Delete All' , fn : ( ) => album . delete ( albumIDs ) }
{ t itle: build . iconic ( 'pencil' ) + 'Rename All' , fn : ( ) => album . setTitle ( albumIDs ) } ,
{ t itle: build . iconic ( 'collapse-left' ) + 'Merge All' , visible : showMerge && autoMerge , fn : ( ) => album . merge ( albumIDs ) } ,
{ t itle: build . iconic ( 'collapse-left' ) + 'Merge' , visible : showMerge && ! autoMerge , fn : ( ) => { basicContext . close ( ) ; contextMenu . mergeAlbum ( albumIDs [ 0 ] , e ) } } ,
{ t itle: build . iconic ( 'trash' ) + 'Delete All' , fn : ( ) => album . delete ( albumIDs ) }
]
items . push ( )
@ -103,15 +103,15 @@ contextMenu.albumTitle = function(albumID, e) {
let title = lychee . html ` <img class='cover' width='16' height='16' src=' $ ${ this . thumbs [ 0 ] } '><div class='title'> $ ${ this . title } </div> `
if ( this . id != albumID ) items . push ( { t ype: 'item' , t itle, fn : ( ) => lychee . goto ( this . id ) } )
if ( this . id != albumID ) items . push ( { t itle, fn : ( ) => lychee . goto ( this . id ) } )
} )
items . unshift ( { type : 'separator' } )
items . unshift ( { } )
}
items . unshift ( { t ype: 'item' , t itle: build . iconic ( 'pencil' ) + 'Rename' , fn : ( ) => album . setTitle ( [ albumID ] ) } )
items . unshift ( { t itle: build . iconic ( 'pencil' ) + 'Rename' , fn : ( ) => album . setTitle ( [ albumID ] ) } )
basicContext . show ( items , e . originalEvent , contextMenu . close )
@ -133,7 +133,7 @@ contextMenu.mergeAlbum = function(albumID, e) {
let title = lychee . html ` <img class='cover' width='16' height='16' src=' $ ${ this . thumbs [ 0 ] } '><div class='title'> $ ${ this . title } </div> `
if ( this . id != albumID ) items . push ( { t ype: 'item' , t itle, fn : ( ) => album . merge ( [ albumID , this . id ] ) } )
if ( this . id != albumID ) items . push ( { t itle, fn : ( ) => album . merge ( [ albumID , this . id ] ) } )
} )
@ -154,13 +154,13 @@ contextMenu.photo = function(photoID, e) {
// in order to keep the selection
let items = [
{ t ype: 'item' , t itle: build . iconic ( 'star' ) + 'Star' , fn : ( ) => photo . setStar ( [ photoID ] ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'tag' ) + 'Tags' , fn : ( ) => photo . editTags ( [ photoID ] ) } ,
{ type : 'separator' } ,
{ t ype: 'item' , t itle: build . iconic ( 'pencil' ) + 'Rename' , fn : ( ) => photo . setTitle ( [ photoID ] ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'layers' ) + 'Duplicate' , fn : ( ) => photo . duplicate ( [ photoID ] ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'folder' ) + 'Move' , fn : ( ) => { basicContext . close ( ) ; contextMenu . move ( [ photoID ] , e ) } } ,
{ t ype: 'item' , t itle: build . iconic ( 'trash' ) + 'Delete' , fn : ( ) => photo . delete ( [ photoID ] ) }
{ t itle: build . iconic ( 'star' ) + 'Star' , fn : ( ) => photo . setStar ( [ photoID ] ) } ,
{ t itle: build . iconic ( 'tag' ) + 'Tags' , fn : ( ) => photo . editTags ( [ photoID ] ) } ,
{ } ,
{ t itle: build . iconic ( 'pencil' ) + 'Rename' , fn : ( ) => photo . setTitle ( [ photoID ] ) } ,
{ t itle: build . iconic ( 'layers' ) + 'Duplicate' , fn : ( ) => photo . duplicate ( [ photoID ] ) } ,
{ t itle: build . iconic ( 'folder' ) + 'Move' , fn : ( ) => { basicContext . close ( ) ; contextMenu . move ( [ photoID ] , e ) } } ,
{ t itle: build . iconic ( 'trash' ) + 'Delete' , fn : ( ) => photo . delete ( [ photoID ] ) }
]
$ ( '.photo[data-id="' + photoID + '"]' ) . addClass ( 'active' )
@ -178,13 +178,13 @@ contextMenu.photoMulti = function(photoIDs, e) {
multiselect . stopResize ( )
let items = [
{ t ype: 'item' , t itle: build . iconic ( 'star' ) + 'Star All' , fn : ( ) => photo . setStar ( photoIDs ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'tag' ) + 'Tag All' , fn : ( ) => photo . editTags ( photoIDs ) } ,
{ type : 'separator' } ,
{ t ype: 'item' , t itle: build . iconic ( 'pencil' ) + 'Rename All' , fn : ( ) => photo . setTitle ( photoIDs ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'layers' ) + 'Duplicate All' , fn : ( ) => photo . duplicate ( photoIDs ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'folder' ) + 'Move All' , fn : ( ) => { basicContext . close ( ) ; contextMenu . move ( photoIDs , e ) } } ,
{ t ype: 'item' , t itle: build . iconic ( 'trash' ) + 'Delete All' , fn : ( ) => photo . delete ( photoIDs ) }
{ t itle: build . iconic ( 'star' ) + 'Star All' , fn : ( ) => photo . setStar ( photoIDs ) } ,
{ t itle: build . iconic ( 'tag' ) + 'Tag All' , fn : ( ) => photo . editTags ( photoIDs ) } ,
{ } ,
{ t itle: build . iconic ( 'pencil' ) + 'Rename All' , fn : ( ) => photo . setTitle ( photoIDs ) } ,
{ t itle: build . iconic ( 'layers' ) + 'Duplicate All' , fn : ( ) => photo . duplicate ( photoIDs ) } ,
{ t itle: build . iconic ( 'folder' ) + 'Move All' , fn : ( ) => { basicContext . close ( ) ; contextMenu . move ( photoIDs , e ) } } ,
{ t itle: build . iconic ( 'trash' ) + 'Delete All' , fn : ( ) => photo . delete ( photoIDs ) }
]
basicContext . show ( items , e . originalEvent , contextMenu . close )
@ -194,21 +194,21 @@ contextMenu.photoMulti = function(photoIDs, e) {
contextMenu . photoTitle = function ( albumID , photoID , e ) {
let items = [
{ t ype: 'item' , t itle: build . iconic ( 'pencil' ) + 'Rename' , fn : ( ) => photo . setTitle ( [ photoID ] ) }
{ t itle: build . iconic ( 'pencil' ) + 'Rename' , fn : ( ) => photo . setTitle ( [ photoID ] ) }
]
let data = album . json
if ( data . content !== false && data . num > 1 ) {
items . push ( { type : 'separator' } )
items . push ( { } )
// Generate list of albums
$ . each ( data . content , function ( index ) {
let title = lychee . html ` <img class='cover' width='16' height='16' src=' $ ${ this . thumbUrl } '><div class='title'> $ ${ this . title } </div> `
if ( this . id != photoID ) items . push ( { t ype: 'item' , t itle, fn : ( ) => lychee . goto ( albumID + '/' + this . id ) } )
if ( this . id != photoID ) items . push ( { t itle, fn : ( ) => lychee . goto ( albumID + '/' + this . id ) } )
} )
@ -226,8 +226,8 @@ contextMenu.photoMore = function(photoID, e) {
let showDownload = lychee . publicMode === false || ( ( album . json && album . json . downloadable && album . json . downloadable === '1' ) && lychee . publicMode === true )
let items = [
{ t ype: 'item' , t itle: build . iconic ( 'fullscreen-enter' ) + 'Full Photo' , fn : ( ) => window . open ( photo . getDirectLink ( ) ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'cloud-download' ) + 'Download' , visible : showDownload , fn : ( ) => photo . getArchive ( photoID ) }
{ t itle: build . iconic ( 'fullscreen-enter' ) + 'Full Photo' , fn : ( ) => window . open ( photo . getDirectLink ( ) ) } ,
{ t itle: build . iconic ( 'cloud-download' ) + 'Download' , visible : showDownload , fn : ( ) => photo . getArchive ( photoID ) }
]
basicContext . show ( items , e . originalEvent )
@ -244,7 +244,7 @@ contextMenu.move = function(photoIDs, e) {
// Show only 'Add album' when no album available
items = [
{ t ype: 'item' , t itle: 'New Album' , fn : album . add }
{ t itle: 'New Album' , fn : album . add }
]
} else {
@ -256,15 +256,15 @@ contextMenu.move = function(photoIDs, e) {
let title = lychee . html ` <img class='cover' width='16' height='16' src=' $ ${ this . thumbs [ 0 ] } '><div class='title'> $ ${ this . title } </div> `
if ( this . id != album . getID ( ) ) items . push ( { t ype: 'item' , t itle, fn : ( ) => photo . setAlbum ( photoIDs , this . id ) } )
if ( this . id != album . getID ( ) ) items . push ( { t itle, fn : ( ) => photo . setAlbum ( photoIDs , this . id ) } )
} )
// Show Unsorted when unsorted is not the current album
if ( album . getID ( ) !== '0' ) {
items . unshift ( { type : 'separator' } )
items . unshift ( { t ype: 'item' , t itle: 'Unsorted' , fn : ( ) => photo . setAlbum ( photoIDs , 0 ) } )
items . unshift ( { } )
items . unshift ( { t itle: 'Unsorted' , fn : ( ) => photo . setAlbum ( photoIDs , 0 ) } )
}
@ -282,15 +282,15 @@ contextMenu.sharePhoto = function(photoID, e) {
iconClass = 'ionicons'
let items = [
{ t ype: 'item' , t itle: ` <input readonly id="link" value=" ${ link } "> ` , fn : ( ) => { } , class : ' noHover' } ,
{ type : 'separator' } ,
{ t ype: 'item' , t itle: build . iconic ( 'twitter' , iconClass ) + 'Twitter' , fn : ( ) => photo . share ( photoID , 'twitter' ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'facebook' , iconClass ) + 'Facebook' , fn : ( ) => photo . share ( photoID , 'facebook' ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'envelope-closed' ) + 'Mail' , fn : ( ) => photo . share ( photoID , 'mail' ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'dropbox' , iconClass ) + 'Dropbox' , fn : ( ) => photo . share ( photoID , 'dropbox' ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'link-intact' ) + 'Direct Link' , fn : ( ) => window . open ( photo . getDirectLink ( ) ) } ,
{ type : 'separator' } ,
{ t ype: 'item' , t itle: build . iconic ( 'ban' ) + 'Make Private' , fn : ( ) => photo . setPublic ( photoID ) }
{ t itle: ` <input readonly id="link" value=" ${ link } "> ` , fn : ( ) => { } , class : ' basicContext__item-- noHover' } ,
{ } ,
{ t itle: build . iconic ( 'twitter' , iconClass ) + 'Twitter' , fn : ( ) => photo . share ( photoID , 'twitter' ) } ,
{ t itle: build . iconic ( 'facebook' , iconClass ) + 'Facebook' , fn : ( ) => photo . share ( photoID , 'facebook' ) } ,
{ t itle: build . iconic ( 'envelope-closed' ) + 'Mail' , fn : ( ) => photo . share ( photoID , 'mail' ) } ,
{ t itle: build . iconic ( 'dropbox' , iconClass ) + 'Dropbox' , fn : ( ) => photo . share ( photoID , 'dropbox' ) } ,
{ t itle: build . iconic ( 'link-intact' ) + 'Direct Link' , fn : ( ) => window . open ( photo . getDirectLink ( ) ) } ,
{ } ,
{ t itle: build . iconic ( 'ban' ) + 'Make Private' , fn : ( ) => photo . setPublic ( photoID ) }
]
basicContext . show ( items , e . originalEvent )
@ -303,14 +303,14 @@ contextMenu.shareAlbum = function(albumID, e) {
let iconClass = 'ionicons'
let items = [
{ t ype: 'item' , t itle: ` <input readonly id="link" value=" ${ location . href } "> ` , fn : ( ) => { } , class : ' noHover' } ,
{ type : 'separator' } ,
{ t ype: 'item' , t itle: build . iconic ( 'twitter' , iconClass ) + 'Twitter' , fn : ( ) => album . share ( 'twitter' ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'facebook' , iconClass ) + 'Facebook' , fn : ( ) => album . share ( 'facebook' ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'envelope-closed' ) + 'Mail' , fn : ( ) => album . share ( 'mail' ) } ,
{ type : 'separator' } ,
{ t ype: 'item' , t itle: build . iconic ( 'pencil' ) + 'Edit Sharing' , fn : ( ) => album . setPublic ( albumID , true , e ) } ,
{ t ype: 'item' , t itle: build . iconic ( 'ban' ) + 'Make Private' , fn : ( ) => album . setPublic ( albumID , false ) }
{ t itle: ` <input readonly id="link" value=" ${ location . href } "> ` , fn : ( ) => { } , class : ' basicContext__item-- noHover' } ,
{ } ,
{ t itle: build . iconic ( 'twitter' , iconClass ) + 'Twitter' , fn : ( ) => album . share ( 'twitter' ) } ,
{ t itle: build . iconic ( 'facebook' , iconClass ) + 'Facebook' , fn : ( ) => album . share ( 'facebook' ) } ,
{ t itle: build . iconic ( 'envelope-closed' ) + 'Mail' , fn : ( ) => album . share ( 'mail' ) } ,
{ } ,
{ t itle: build . iconic ( 'pencil' ) + 'Edit Sharing' , fn : ( ) => album . setPublic ( albumID , true , e ) } ,
{ t itle: build . iconic ( 'ban' ) + 'Make Private' , fn : ( ) => album . setPublic ( albumID , false ) }
]
basicContext . show ( items , e . originalEvent )