--- a/static/text-annotation.js
+++ b/static/text-annotation.js
@@ -36,7 +36,7 @@
//$(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 @@
//$(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 '
'+
'
'+
@@ -72,6 +84,8 @@
'' +
' '+
'' +
+ ' '+
+ ''+
'
' +
' '+
''+
@@ -90,7 +104,7 @@
window.shiftModal = function() {
var margin_left = $('#list-anno').css('marginLeft');
var margin = Number(margin_left.split('px')[0]);
- console.log(margin);
+ //console.log(margin);
if(margin < 100) {
$('#list-anno').css('marginLeft', '28%');
}
--- a/static/tree.js
+++ b/static/tree.js
@@ -42,19 +42,20 @@
drawRGraph();
return;
}
- console.log('Loading ontology file');
+ //console.log('Loading ontology file');
var url = 'static/graphs/GirijaKalyanaStory.json'
$.ajax({
type: 'GET',
url: url,
dataType: 'json',
success: function(data) {
- console.log('Ontology JSON loaded');
+ //console.log('Ontology JSON loaded');
ontology_json = data;
drawRGraph();
},
error: function(xhr, errtype, errtext) {
console.log('Could not load Ontology JSON!');
+ alert('Could not load Ontology JSON!');
console.log(errtype, ':', errtext);
}
});
@@ -93,7 +94,7 @@
};
var removeItem = function(event) {
- console.log($(event.currentTarget));
+ //console.log($(event.currentTarget));
var id = $(event.currentTarget).parent().parent().attr('id');
var node = id.split('-')[1];
$(event.currentTarget).parent().parent().remove();
@@ -120,7 +121,7 @@
event.stopPropagation();
}
//Log.write('centering node ', node.name);
- console.log('centering node', node.name);
+ //console.log('centering node', node.name);
RGraph.onClick(node.id, {
hideLabels: false,
onComplete: function() {
@@ -151,7 +152,7 @@
Stats.appendSelectedList();
},
remove: function(node) {
- console.log(node);
+ //console.log(node);
var idx = _.indexOf(sweet.nodes, node);
if(idx !== -1) {
sweet.nodes.splice(idx, 1);
@@ -197,12 +198,12 @@
var swts = '';
for(var i in sweet.swts) {
var data = sweet.swts[i];
- console.log(data);
+ //console.log(data);
var swt = '@'+data.who+' #'+data.what+' / '+data.where;
swt += ' {' + data.how.join() + ' }';
swts += swt + '\n';
}
- console.log(swts);
+ //console.log(swts);
$('#sweeted').html(sweeted_template(swts));
$('#sweeted').show();
sweet.swts = [];
@@ -247,7 +248,7 @@
//span: 5,
//height: 40,
//width: 150,
- angularWidth: 100,
+ //angularWidth: 100,
//autoHeight: true,
//autoWidth: true,
dim: 10
@@ -264,19 +265,21 @@
transition: $jit.Trans.Sine.easeIn,
levelDistance: 150,
onCreateLabel: function(domElement, node) {
- console.log('oncreatelabel');
+ //console.log('oncreatelabel');
},
onPlaceLabel: function(domElement, node) {
- console.log('onplacelabel');
+ //console.log('onplacelabel');
/*var style = domElement.style;
var top = parseInt(style.top);
console.log('top :', top);
style.top = (top - 40) + 'px';*/
},
Events: {
+ enableForEdges: true,
enable: true,
- type: 'Native',
- onMouseEnter: function() {
+ type: 'auto',
+ onMouseEnter: function(node, event, e) {
+ console.log(node, event, e);
rgraph.canvas.getElement().style.cursor = 'pointer';
},
onMouseLeave: function() {
@@ -288,6 +291,11 @@
return;
}
centerNode(e, node);
+ },
+ onDragMove: function(node, eventInfo, e) {
+ var pos = eventInfo.getPos();
+ node.pos.setc(pos.x, pos.y);
+ rgraph.plot();
}
}
});