From 06219a44cf00fb15f6ffb1cddaa10ba128f197a1 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 29 Apr 2013 23:38:16 +0400 Subject: [PATCH] added basic marking operations (toggle ribbon and toggle block)... Signed-off-by: Alex A. Naanou --- ui/index.html | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ui/index.html b/ui/index.html index 8305f6a5..467a57fd 100755 --- a/ui/index.html +++ b/ui/index.html @@ -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')