From: Tara L Andrews Date: Sun, 5 Feb 2012 23:42:32 +0000 (+0100) Subject: add application launcher buttons for stexaminer and relationship mapper X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=57acbbe2384a484550eaf2ba2bbc7920fabe94a5;p=scpubgit%2Fstemmatology.git add application launcher buttons for stexaminer and relationship mapper --- diff --git a/stemmaweb/root/css/relationship.css b/stemmaweb/root/css/relationship.css index 315cee0..7d1f179 100644 --- a/stemmaweb/root/css/relationship.css +++ b/stemmaweb/root/css/relationship.css @@ -1,4 +1,3 @@ - diff --git a/stemmaweb/root/css/stexaminer.css b/stemmaweb/root/css/stexaminer.css new file mode 100644 index 0000000..9c5ec84 --- /dev/null +++ b/stemmaweb/root/css/stexaminer.css @@ -0,0 +1,61 @@ +#variants_table { + float: left; + width: 450px; + height: 550px; + border-right: 1px #c6dcf1 solid; + margin-left: 20px; + overflow: auto; +} +#stemma_graph { + height: 450px; + float: left; + width: 500px; + text-align: center; + border: 1px #c6dcf1 solid; +} +#statistics { + font-style: italic; + margin-bottom: 25px; + position: relative; + top: -15px; +} +.genealogical { + background: #88ffaa; +} +.coincidental { + background: #fff; +} +.conflict { + background: #ff6666; +} +.active_variant_row { + background: #c6dcf1; + font-style: italic; +} +.active_variant_cell { + background: #e8f1fe; +} +.cellb0 { + border-right: 20px solid #ffeeaa; +} +.cellb1 { + border-right: 20px solid #afc6e9; +} +.cellb2 { + border-right: 20px solid #d5fff6; +} +.cellb3 { + border-right: 20px solid #ffccaa; +} +.cellb4 { + border-right: 20px solid #ffaaaa; +} +.cellb5 { + border-right: 20px solid #e5ff80; +} +.cellb6 { + border-right: 20px solid #e5d5ff; +} +.cellb7 { + border-right: 20px solid #ffd5e5; +} diff --git a/stemmaweb/root/css/style.css b/stemmaweb/root/css/style.css index 3732efc..ca0233a 100644 --- a/stemmaweb/root/css/style.css +++ b/stemmaweb/root/css/style.css @@ -1,5 +1,3 @@ - \ No newline at end of file diff --git a/stemmaweb/root/images/b_button_a.png b/stemmaweb/root/images/b_button_a.png new file mode 100644 index 0000000..a04e123 Binary files /dev/null and b/stemmaweb/root/images/b_button_a.png differ diff --git a/stemmaweb/root/images/b_button_span.png b/stemmaweb/root/images/b_button_span.png new file mode 100644 index 0000000..2d80f72 Binary files /dev/null and b/stemmaweb/root/images/b_button_span.png differ diff --git a/stemmaweb/root/images/c_button_a.png b/stemmaweb/root/images/c_button_a.png new file mode 100644 index 0000000..effad11 Binary files /dev/null and b/stemmaweb/root/images/c_button_a.png differ diff --git a/stemmaweb/root/images/c_button_span.png b/stemmaweb/root/images/c_button_span.png new file mode 100644 index 0000000..aff9680 Binary files /dev/null and b/stemmaweb/root/images/c_button_span.png differ diff --git a/stemmaweb/root/js/componentload.js b/stemmaweb/root/js/componentload.js index 8db28dd..cc5c1d3 100644 --- a/stemmaweb/root/js/componentload.js +++ b/stemmaweb/root/js/componentload.js @@ -1,4 +1,4 @@ -function loadTradition( textid ) { +function loadTradition( textid, textname ) { // First insert the placeholder image var basepath = window.location.pathname if( basepath.lastIndexOf('/') == basepath.length - 1 ) { @@ -25,4 +25,13 @@ function loadTradition( textid ) { variant_svg_element.height.baseVal.value = container_height; variant_svg_element.width.baseVal.value = (svg_width/svg_height * container_height); }); + + // Then populate the various elements with the right text name/ID. + // Stemma and variant graph titles + $('.texttitle').empty(); + $('.texttitle').append( textname ); + // Stexaminer submit action + $('#run_stexaminer').attr( 'action', basepath + "/stexaminer/" + textid ); + // Relationship mapper submit action + $('#run_relater').attr( 'action', basepath + "/relation/" + textid ); } diff --git a/stemmaweb/root/js/stemmagadget.js b/stemmaweb/root/js/stemmagadget.js new file mode 100644 index 0000000..f22a4da --- /dev/null +++ b/stemmaweb/root/js/stemmagadget.js @@ -0,0 +1,36 @@ +var colors = ['#ffeeaa','#afc6e9','#d5fff6','#ffccaa','#ffaaaa','#e5ff80','#e5d5ff','#ffd5e5']; + +$(document).ready(function() { + $('svg').width('485px'); +}) + + + +function load_stemma_svg( topic, data, subscriberData ) { + var params = {}; + var postData = {}; + + postData.textid = data; + + params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.POST; + params[gadgets.io.RequestParameters.POST_DATA] = gadgets.io.encodeValues(postData); + var url = "http://eccentricity.org:3000/svg_service"; + + gadgets.io.makeRequest(url, + function (o) { + displaySVG(o.text); + }, params); + +} + +function loaded() { + gadgets.window.adjustHeight(400); + subId = gadgets.Hub.subscribe("interedition.svg.dot.coloring", do_color_nodes); + subId = gadgets.Hub.subscribe("interedition.svg.dot.decoloring", de_color_nodes); + subId = gadgets.Hub.subscribe("interedition.tradition.selected", load_stemma_svg); +} + +if (gadgets.util.hasFeature('pubsub-2')) { + gadgets.HubSettings.onConnect = function(hum, suc, err) { loaded(); }; +} +else gadgets.util.registerOnLoadHandler(loaded); diff --git a/stemmaweb/root/js/stexaminer.js b/stemmaweb/root/js/stexaminer.js index ffe2c93..8645109 100644 --- a/stemmaweb/root/js/stexaminer.js +++ b/stemmaweb/root/js/stexaminer.js @@ -3,7 +3,7 @@ var row_triggered = false; $(document).ready(function() { $('.rowid').click( function() { row_triggered = true; - $('ellipse').attr( {stroke:'black', fill:'#fff'} ); + $('ellipse').attr( {stroke:'white', fill:'#fff'} ); $('.node').children('polygon').attr( {stroke:'#fff', fill:'#fff'} ); $('.node').children('text').attr( {stroke:'none', fill:'#000'} ); $('tr.active_variant_row').children('td').removeClass('cellb0 cellb1 cellb2 cellb3 cellb4 cellb5 cellb6 cellb7'); @@ -17,7 +17,7 @@ function color_nodes( column_index, arr_node_ids, arr_greynode_ids ) { if( !row_triggered ) { $('tr.active_variant_row').children('td').removeClass('cellb0 cellb1 cellb2 cellb3 cellb4 cellb5 cellb6 cellb7'); $('td.active_variant_cell').removeClass('active_variant_cell'); - $('ellipse').attr( {stroke:'black', fill:'#fff'} ); + $('ellipse').attr( {stroke:'white', fill:'#fff'} ); $('.node').children('polygon').attr( {stroke:'#fff', fill:'#fff'} ); $('.node').children('text').attr( {stroke:'none', fill:'#000'} ); }; diff --git a/stemmaweb/root/src/directory.tt b/stemmaweb/root/src/directory.tt index 97054da..a8030e4 100644 --- a/stemmaweb/root/src/directory.tt +++ b/stemmaweb/root/src/directory.tt @@ -3,7 +3,7 @@