sarted work on marking/tagging...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-11-19 06:49:03 +03:00
parent 0fa9ed572c
commit 2f15a08003
3 changed files with 88 additions and 0 deletions

View File

@ -1908,6 +1908,10 @@ var DataWithTagsPrototype = {
return this
},
// XXX
toggleTag: function(tags, gids, action){
},
getTags: function(gids){
gids = arguments.length > 1 ? [].slice.call(arguments) : gids
gids = gids == null ? this.getImage() : gids

View File

@ -193,6 +193,9 @@ $(function(){
'ui-animation',
'ui-bounds-indicators',
'ui-current-image-indicator',
'image-marks',
'image-bookmarks',
])
// this publishes all the actions...

View File

@ -1722,6 +1722,87 @@ module.GlobalStateIndicator = Feature({
//---------------------------------------------------------------------
var ImageMarkActions = actions.Actions({
toggleMark: ['',
// XXX make this a real toggler...
function(target, action){
// XXX do tagging on data and get the correct action if one is not given...
if(this.ribbons != null){
this.ribbons.toggleImageMark(target, 'selected', action)
}
return action
}],
// mode can be:
// "ribbon" - next marked in current ribbon (default)
// "all" - next marked in sequence
nextMarked: ['',
function(mode){
mode = mode == null ? 'ribbon' : mode
// XXX
}],
prevMarked: ['',
function(mode){
mode = mode == null ? 'ribbon' : mode
// XXX
}],
firstMarked: ['',
function(mode){
mode = mode == null ? 'ribbon' : mode
// XXX
}],
lastMarked: ['',
function(mode){
mode = mode == null ? 'ribbon' : mode
// XXX
}],
cropMarked: ['',
function(mode){
mode = mode == null ? 'ribbon' : mode
// XXX
}],
})
var ImageMarks =
module.ImageMarks = Feature({
title: '',
doc: '',
tag: 'image-marks',
actions: ImageMarkActions,
})
//---------------------------------------------------------------------
var ImageBookmarkActions = actions.Actions({
})
var ImageBookmarks =
module.ImageBookmarks = Feature({
title: '',
doc: '',
tag: 'image-bookmarks',
actions: ImageBookmarkActions,
})
/**********************************************************************
* vim:set ts=4 sw=4 : */