mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-12-27 05:21:58 +00:00
some refactoring...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
e7520bab88
commit
f2233c93cf
@ -1900,17 +1900,16 @@ var CollectionTagsActions = actions.Actions({
|
|||||||
// NOTE: the rest of the tags are shared between all collections
|
// NOTE: the rest of the tags are shared between all collections
|
||||||
// NOTE: to disable local tags either delete this, set it to null
|
// NOTE: to disable local tags either delete this, set it to null
|
||||||
// or to an empty list.
|
// or to an empty list.
|
||||||
'collection-local-tags': [
|
'collection-local-tags': [],
|
||||||
'bookmark',
|
|
||||||
'selected',
|
|
||||||
],
|
|
||||||
|
|
||||||
|
/*
|
||||||
'collection-transfer-changes':
|
'collection-transfer-changes':
|
||||||
|
// XXX need a way to exrtend config values in order of merge
|
||||||
|
// and not manually...
|
||||||
CollectionActions.config['collection-transfer-changes']
|
CollectionActions.config['collection-transfer-changes']
|
||||||
.concat([
|
.concat([
|
||||||
'bookmarked',
|
|
||||||
'selected',
|
|
||||||
]),
|
]),
|
||||||
|
//*/
|
||||||
},
|
},
|
||||||
|
|
||||||
collectTagged: ['- Collections|Tag/',
|
collectTagged: ['- Collections|Tag/',
|
||||||
@ -1920,25 +1919,6 @@ var CollectionTagsActions = actions.Actions({
|
|||||||
function(tags, collection){
|
function(tags, collection){
|
||||||
return this.uncollect(this.data.getTaggedByAll(tags), collection) }],
|
return this.uncollect(this.data.getTaggedByAll(tags), collection) }],
|
||||||
|
|
||||||
// marked...
|
|
||||||
collectMarked: ['- Collections|Mark/',
|
|
||||||
function(collection){
|
|
||||||
return this.collectTagged('selected', collection) }],
|
|
||||||
uncollectMarked: ['Collections|Mark/Remove marked from collection',
|
|
||||||
{browseMode: function(){
|
|
||||||
return (!this.collection || this.marked.length == 0) && 'disabled' }},
|
|
||||||
function(collection){
|
|
||||||
return this.uncollectTagged('selected', collection) }],
|
|
||||||
|
|
||||||
// bookmarked...
|
|
||||||
collectBookmarked: ['- Collections|Bookmark/',
|
|
||||||
function(collection){
|
|
||||||
return this.collectTagged('bookmark', collection) }],
|
|
||||||
uncollectBookmarked: ['Collections|Bookmark/Remove bookmarked from collection',
|
|
||||||
{browseMode: function(){
|
|
||||||
return (!this.collection || this.bookmarked.length == 0) && 'disabled' }},
|
|
||||||
function(collection){
|
|
||||||
return this.uncollectTagged('bookmark', collection) }],
|
|
||||||
})
|
})
|
||||||
|
|
||||||
var CollectionTags =
|
var CollectionTags =
|
||||||
@ -1979,10 +1959,6 @@ module.CollectionTags = core.ImageGridFeatures.Feature({
|
|||||||
depends: [
|
depends: [
|
||||||
'collections',
|
'collections',
|
||||||
'tags',
|
'tags',
|
||||||
|
|
||||||
// XXX
|
|
||||||
'image-marks',
|
|
||||||
'image-bookmarks',
|
|
||||||
],
|
],
|
||||||
|
|
||||||
actions: CollectionTagsActions,
|
actions: CollectionTagsActions,
|
||||||
@ -2781,23 +2757,6 @@ var UICollectionActions = actions.Actions({
|
|||||||
})
|
})
|
||||||
}, null, false)],
|
}, null, false)],
|
||||||
|
|
||||||
// XXX should these be here or in marks-specific feature???
|
|
||||||
markImagesInCollection: ['Collections|Mark/$Mark images in collection...',
|
|
||||||
{browseMode: 'cropImagesInCollection'},
|
|
||||||
mixedModeCollectionAction(function(title){
|
|
||||||
var that = this
|
|
||||||
this.ensureCollection(title)
|
|
||||||
.then(function(collection){
|
|
||||||
var images = collection.data.getImages('all')
|
|
||||||
|
|
||||||
that.toggleMark(images, 'on')
|
|
||||||
})
|
|
||||||
})],
|
|
||||||
addMarkedToCollection: ['Collections|Mark/Add marked to $collection...',
|
|
||||||
{browseMode: function(){
|
|
||||||
return this.marked.length == 0 && 'disabled' }},
|
|
||||||
mixedModeCollectionAction(function(title){ this.collectMarked(title) })],
|
|
||||||
|
|
||||||
// XXX should this be in Collections/ ???
|
// XXX should this be in Collections/ ???
|
||||||
editDefaultCollections: ['Interface|Collections/Edit default collections...',
|
editDefaultCollections: ['Interface|Collections/Edit default collections...',
|
||||||
widgets.makeConfigListEditorDialog(
|
widgets.makeConfigListEditorDialog(
|
||||||
@ -2853,6 +2812,9 @@ module.UICollection = core.ImageGridFeatures.Feature({
|
|||||||
// XXX needed only for .addMarkedToCollection(..)
|
// XXX needed only for .addMarkedToCollection(..)
|
||||||
'collection-tags',
|
'collection-tags',
|
||||||
],
|
],
|
||||||
|
suggested: [
|
||||||
|
'ui-collection-marks',
|
||||||
|
],
|
||||||
|
|
||||||
actions: UICollectionActions,
|
actions: UICollectionActions,
|
||||||
|
|
||||||
@ -2893,6 +2855,85 @@ module.UICollection = core.ImageGridFeatures.Feature({
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------
|
||||||
|
|
||||||
|
var UICollectionMarksActions = actions.Actions({
|
||||||
|
config: {
|
||||||
|
'collection-local-tags':
|
||||||
|
// XXX need a way to exrtend config values in order of merge
|
||||||
|
// and not manually...
|
||||||
|
CollectionTagsActions.config['collection-local-tags']
|
||||||
|
.concat([
|
||||||
|
'bookmark',
|
||||||
|
'selected',
|
||||||
|
]),
|
||||||
|
|
||||||
|
'collection-transfer-changes':
|
||||||
|
// XXX need a way to exrtend config values in order of merge
|
||||||
|
// and not manually...
|
||||||
|
//CollectionTagsActions.config['collection-transfer-changes']
|
||||||
|
CollectionActions.config['collection-transfer-changes']
|
||||||
|
.concat([
|
||||||
|
'bookmarked',
|
||||||
|
'selected',
|
||||||
|
]),
|
||||||
|
},
|
||||||
|
|
||||||
|
// marked...
|
||||||
|
markImagesInCollection: ['Collections|Mark/$Mark images in collection...',
|
||||||
|
{browseMode: 'cropImagesInCollection'},
|
||||||
|
mixedModeCollectionAction(function(title){
|
||||||
|
var that = this
|
||||||
|
this.ensureCollection(title)
|
||||||
|
.then(function(collection){
|
||||||
|
var images = collection.data.getImages('all')
|
||||||
|
|
||||||
|
that.toggleMark(images, 'on')
|
||||||
|
})
|
||||||
|
})],
|
||||||
|
addMarkedToCollection: ['Collections|Mark/Add marked to $collection...',
|
||||||
|
{browseMode: function(){
|
||||||
|
return this.marked.length == 0 && 'disabled' }},
|
||||||
|
mixedModeCollectionAction(function(title){ this.collectMarked(title) })],
|
||||||
|
|
||||||
|
collectMarked: ['- Collections|Mark/',
|
||||||
|
function(collection){
|
||||||
|
return this.collectTagged('selected', collection) }],
|
||||||
|
uncollectMarked: ['Collections|Mark/Remove marked from collection',
|
||||||
|
{browseMode: function(){
|
||||||
|
return (!this.collection || this.marked.length == 0) && 'disabled' }},
|
||||||
|
function(collection){
|
||||||
|
return this.uncollectTagged('selected', collection) }],
|
||||||
|
|
||||||
|
// bookmarked...
|
||||||
|
collectBookmarked: ['- Collections|Bookmark/',
|
||||||
|
function(collection){
|
||||||
|
return this.collectTagged('bookmark', collection) }],
|
||||||
|
uncollectBookmarked: ['Collections|Bookmark/Remove bookmarked from collection',
|
||||||
|
{browseMode: function(){
|
||||||
|
return (!this.collection || this.bookmarked.length == 0) && 'disabled' }},
|
||||||
|
function(collection){
|
||||||
|
return this.uncollectTagged('bookmark', collection) }],
|
||||||
|
})
|
||||||
|
|
||||||
|
var UICollectionMarks =
|
||||||
|
module.UICollectionMarks = core.ImageGridFeatures.Feature({
|
||||||
|
title: '',
|
||||||
|
doc: '',
|
||||||
|
|
||||||
|
tag: 'ui-collection-marks',
|
||||||
|
depends: [
|
||||||
|
'collections',
|
||||||
|
'collection-tags',
|
||||||
|
'ui-collections',
|
||||||
|
'marks',
|
||||||
|
],
|
||||||
|
|
||||||
|
actions: UICollectionMarksActions,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
// XXX Things to try/do:
|
// XXX Things to try/do:
|
||||||
// - load directories as collections (auto?)...
|
// - load directories as collections (auto?)...
|
||||||
|
|||||||
@ -567,13 +567,15 @@ core.ImageGridFeatures.Feature({
|
|||||||
'removeFromCrop',
|
'removeFromCrop',
|
||||||
'reverseImages',
|
'reverseImages',
|
||||||
],
|
],
|
||||||
function(target){ return this.reload(true) }],
|
function(target){
|
||||||
|
return this.reload(true) }],
|
||||||
[[
|
[[
|
||||||
'reverseRibbons',
|
'reverseRibbons',
|
||||||
'cropGroup',
|
'cropGroup',
|
||||||
'syncTags',
|
'syncTags',
|
||||||
],
|
],
|
||||||
function(target){ return this.reload() }],
|
function(target){
|
||||||
|
return this.reload() }],
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user