- Timestamp:
- 2014-11-12T14:54:33+13:00 (9 years ago)
- Location:
- main/trunk/model-sites-dev/von-sparql/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-sites-dev/von-sparql/js/von-sparql-comparison-setup.js
r28914 r29423 1 /////////////////////////////////////////////// 2 // // 3 // Setup for comparisons // 4 // Query generation code is messy, watch out!// 5 // // 6 /////////////////////////////////////////////// 7 8 //SPARQL endpoint location 1 9 var sparqlEndpoint= location.protocol + '//' + location.hostname + ":3030/greenstone/query" ; 2 var collectionName = gs.cgiParams.c; 3 10 //Contains the query built 4 11 var comparisonQuery; 12 //Hard limit for results returned from a query 5 13 var hardLimit = 2000; 14 //sgvizler chart width/height 6 15 var defaultChartWidth = 468; 7 16 var defaultChartHeight = 200; 17 //just to keep track of amount of queries running 8 18 var currentQueries = 0; 9 19 10 var leftCollection = "nz-natlib-cat"; 11 var rightCollection = "hathitrust-tab"; 12 13 //Contains details about a comparison 20 //collection names 21 var leftCollection = ""; 22 var rightCollection = ""; 23 24 // ComparisonQuery object contains details about a comparison to be made between 2 datasets 25 // page Page number 26 // datsetSelection Left or right dataset 27 // pred_L Left predicate 28 // predval_L Left predicate value (if restricting to a specific value) 29 // refine_L Left predicate to use for comparison after restriction 30 // pred_R Right predicate 31 // predval_R Right predicate value (if restricting to a specific value) 32 // refine_R Right predicate to use for comparison after restriction 14 33 function ComparisonQuery(){ 15 34 this.page = 1; … … 20 39 this.refine_L = ""; 21 40 if($('#cb_leftRefineSearch').is(':checked')) 22 this.refine_L = " <" + $('#sel_leftVisualizePredicate').val() ;// + "> ?common";41 this.refine_L = " <" + $('#sel_leftVisualizePredicate').val() + "> ";// + "> ?common"; 23 42 24 43 this.pred_R = $('#sel_rightPredicate').val(); … … 26 45 this.refine_R = ""; 27 46 if($('#cb_rightRefineSearch').is(':checked')) 28 this.refine_R = " <" + $('#sel_rightVisualizePredicate').val() ;// + "> ?common";47 this.refine_R = " <" + $('#sel_rightVisualizePredicate').val() + "> ";// + "> ?common"; 29 48 $('#span_PageNum').text("1"); 30 49 } … … 32 51 function setupPage(){ 33 52 sgvizler_setup(); 53 //Load collection names from dropdown boxes 54 leftCollection = $('#sel_leftCollection').val(); 55 rightCollection = $('#sel_rightCollection').val(); 56 57 //Draw buttons, etc for each side of page 34 58 drawSide("left",leftCollection); 35 59 apply_functions("left",leftCollection); 36 60 drawSide("right",rightCollection); 37 61 apply_functions("right",rightCollection); 62 63 //apply css to generated objects 38 64 apply_styles(); 65 66 //populates predicate dropdown boxes 39 67 populatePredicateSelector("all", "sel_comparisonPredicate"); 40 68 } … … 156 184 157 185 //When a <tr> in overview table is selected, select in predicate dropdown 158 $('#div_' + side + 'Overview.overview tr').live("click", function(){186 $(document).on("click", "#div_" + side + "Overview.overview tr", function(){ 159 187 var clickedText = tidyPredicate($(this).children(":first").text()); 160 188 $('#sel_' + side + 'Predicate option[text="' + clickedText + '"]').attr('selected','selected'); … … 176 204 177 205 $('#cb_' + side + 'RefineSearch').on('click', function(){ 178 $('#table_' + side + 'RefineControls').toggle(); 206 //$('#table_' + side + 'RefineControls').toggle(); 207 $('#table_' + side + 'RefineControls').toggle("slide", { direction: "up" }); 179 208 }); 180 209 … … 188 217 }); 189 218 } 219 220 // When a predicate is clicked on one side, makes the same predicate on 221 // the opposite side bold, to stand out 190 222 function showSimilarPredicates(side,clickedText){ 191 192 223 var oppositeSide; 193 224 if(side == "left") -
main/trunk/model-sites-dev/von-sparql/js/von-sparql-setup.js
r28914 r29423 1 //SPARQL endpoint queries are sent to 1 2 var sparqlEndpoint= location.protocol + '//' + location.hostname + ":3030/greenstone/query" ; 2 3 var collectionName = gs.cgiParams.c; 4 5 //returns the query used to recieve autocomplete data 3 6 function getAutocompleteQuery() 4 7 { … … 13 16 14 17 } 18 19 //Sets up various parts of the page, setting up onclick actions etc 15 20 function setupPage() 16 21 { … … 92 97 function setupCharts() 93 98 { 94 $('#div_PredicateOverview .google-visualization-table-tr-even td:first-child, #div_PredicateOverview .google-visualization-table-tr-odd td:first-child').live("click", function(){ 99 100 $(document).on("click", "#div_PredicateOverview .google-visualization-table-tr-even td:first-child, #div_PredicateOverview .google-visualization-table-tr-odd td:first-child", function(){ 95 101 var clickedText = tidyPredicate($(this).text()); 102 $('#sel_Predicate option').removeAttr("selected"); 96 103 $('#sel_Predicate option[text="' + clickedText + '"]').attr("selected","selected"); 97 104 $('#sel_Predicate option').filter(function(){
Note:
See TracChangeset
for help on using the changeset viewer.