From 2da84a727bc52304ded4129ea2df8a147f47c6e9 Mon Sep 17 00:00:00 2001 From: Anon Ray Date: Wed, 10 Jul 2013 17:20:01 +0530 Subject: [PATCH] The annotation bar can now be shifted to top or bottom --- static/text-annotation.js | 18 ++++++++++++++++-- static/tree.js | 32 ++++++++++++++++++++------------ 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/static/text-annotation.js b/static/text-annotation.js index 10ad0ec..9dfbdfd 100644 --- a/static/text-annotation.js +++ b/static/text-annotation.js @@ -36,7 +36,7 @@ var attributes = {}; //$(document).mouseout(onHoverOut); }; window.listAnno = function() { // list annotations of current page - console.log('listing annotations'); + //console.log('listing annotations'); $.get(config.indexer + '/search?data=' + JSON.stringify({'where': window.location.search.split('url=')[1]}), function(data) { @@ -61,6 +61,18 @@ var attributes = {}; //$(document).unbind('mouseover', onHover); //$(document).unbind('mouseout', onHoverOut); }; + window.shiftBar = function() { + var margin_top = $('#annotate-bar').css('marginTop'); + var margin = Number(margin_top.split('px')[0]); + if(margin < 10) { + $('#annotate-bar').css('marginTop', (window.innerHeight-50)+'px'); + $('#shift-bar').html('⇑'); + } + else { + $('#annotate-bar').css('marginTop', '0px'); + $('#shift-bar').html('⇓'); + } + }; var toolbar_template = function() { return '' + '
'+ '