added basic marking operations (toggle ribbon and toggle block)...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-04-29 23:38:16 +04:00
parent a895ed85fe
commit 06219a44cf

View File

@ -138,7 +138,35 @@ Split the API into the following sections:
var toggleImageMark = createCSSClassToggler('.current.image', 'marked')
function invertImageMarks(){
return $('.current.image')
.closest('.ribbon')
.find('.image')
.toggleClass('marked')
}
// this will toggle marks in the current continuous section of marked
// or unmarked images...
function toggleImageMarkBlock(image){
if(image == null){
image = $('.current.image')
}
// we need to invert this...
var state = toggleImageMark()
var _convert = function(){
if(toggleImageMark(this, '?') == state){
return false
}
toggleImageMark(this, state)
}
image.nextAll('.image').each(_convert)
image.prevAll('.image').each(_convert)
return state
}
// XXX should we use the createCSSClassToggler for this?
// XXX revise: does extra stuff...
function toggleImageProportions(mode){
var image = $('.image')