Changeset 29423


Ignore:
Timestamp:
11/12/14 14:54:33 (6 years ago)
Author:
ak19
Message:

Changes made to some functions that were deleted in new version of jquery

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
    19var sparqlEndpoint= location.protocol + '//' + location.hostname + ":3030/greenstone/query" ;
    2 var collectionName = gs.cgiParams.c;
    3 
     10//Contains the query built
    411var comparisonQuery;
     12//Hard limit for results returned from a query
    513var hardLimit = 2000;
     14//sgvizler chart width/height
    615var defaultChartWidth = 468;
    716var defaultChartHeight = 200;
     17//just to keep track of amount of queries running
    818var currentQueries = 0;
    919
    10 var leftCollection = "nz-natlib-cat";
    11 var rightCollection = "hathitrust-tab";
    12 
    13 //Contains details about a comparison
     20//collection names
     21var leftCollection = "";
     22var 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
    1433function ComparisonQuery(){
    1534    this.page = 1;
     
    2039    this.refine_L = "";
    2140    if($('#cb_leftRefineSearch').is(':checked'))
    22         this.refine_L = "  <" + $('#sel_leftVisualizePredicate').val();// + "> ?common";
     41        this.refine_L = "  <" + $('#sel_leftVisualizePredicate').val() + "> ";// + "> ?common";
    2342
    2443    this.pred_R = $('#sel_rightPredicate').val();
     
    2645    this.refine_R = "";
    2746    if($('#cb_rightRefineSearch').is(':checked'))
    28         this.refine_R = "  <" + $('#sel_rightVisualizePredicate').val();// + "> ?common";
     47        this.refine_R = "  <" + $('#sel_rightVisualizePredicate').val() + "> ";// + "> ?common";
    2948    $('#span_PageNum').text("1");   
    3049}
     
    3251function setupPage(){
    3352    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
    3458    drawSide("left",leftCollection);
    3559    apply_functions("left",leftCollection);
    3660    drawSide("right",rightCollection);
    3761    apply_functions("right",rightCollection);
     62   
     63    //apply css to generated objects
    3864    apply_styles();
     65
     66    //populates predicate dropdown boxes
    3967    populatePredicateSelector("all", "sel_comparisonPredicate");
    4068}
     
    156184
    157185    //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(){
    159187        var clickedText = tidyPredicate($(this).children(":first").text());
    160188        $('#sel_' + side + 'Predicate option[text="' + clickedText + '"]').attr('selected','selected');
     
    176204
    177205    $('#cb_' + side + 'RefineSearch').on('click', function(){
    178         $('#table_' + side + 'RefineControls').toggle();   
     206        //$('#table_' + side + 'RefineControls').toggle(); 
     207        $('#table_' + side + 'RefineControls').toggle("slide", { direction: "up" });
    179208    });
    180209
     
    188217    });
    189218}
     219
     220// When a predicate is clicked on one side, makes the same predicate on
     221// the opposite side bold, to stand out
    190222function showSimilarPredicates(side,clickedText){
    191 
    192223    var oppositeSide;
    193224    if(side == "left")
  • main/trunk/model-sites-dev/von-sparql/js/von-sparql-setup.js

    r28914 r29423  
     1//SPARQL endpoint queries are sent to
    12var sparqlEndpoint= location.protocol + '//' + location.hostname + ":3030/greenstone/query" ;
    23var collectionName = gs.cgiParams.c;
     4
     5//returns the query used to recieve autocomplete data
    36function getAutocompleteQuery()
    47{
     
    1316
    1417}
     18
     19//Sets up various parts of the page, setting up onclick actions etc
    1520function setupPage()
    1621{
     
    9297function setupCharts()
    9398{   
    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(){
    95101        var clickedText = tidyPredicate($(this).text());
     102        $('#sel_Predicate option').removeAttr("selected");
    96103        $('#sel_Predicate option[text="' + clickedText + '"]').attr("selected","selected");
    97104        $('#sel_Predicate option').filter(function(){
Note: See TracChangeset for help on using the changeset viewer.