Changeset 29434
- Timestamp:
- 2014-11-17T11:08:04+13:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-sites-dev/von-sparql/js/von-sparql-comparison-setup.js
r29423 r29434 50 50 51 51 function setupPage(){ 52 //load available collection names into dropdown lists 53 52 54 sgvizler_setup(); 55 56 populateCollectionDropdowns(); 57 53 58 //Load collection names from dropdown boxes 54 59 leftCollection = $('#sel_leftCollection').val(); 55 60 rightCollection = $('#sel_rightCollection').val(); 56 61 62 57 63 //Draw buttons, etc for each side of page 58 64 drawSide("left",leftCollection); … … 66 72 //populates predicate dropdown boxes 67 73 populatePredicateSelector("all", "sel_comparisonPredicate"); 74 } 75 76 //Loads collection names into seletors 77 function populateCollectionDropdowns(){ 78 var path = location.pathname; 79 var libraryName = path.split("/")[2]; 80 var url = location.protocol + '//' + location.hostname + ":" + location.port + "/greenstone3/" + libraryName + "?o=xml" ; 81 82 //Ajax to get page xml 83 $.ajax({ 84 url: url, 85 type:"GET", 86 async: false, 87 }) 88 .done(function( xmlDoc ) { 89 //foreach collection returned 90 $("#sel_leftCollection").empty(); 91 $("#sel_rightCollection").empty(); 92 $(xmlDoc).find("page pageResponse collectionList collection").each(function(){ 93 var name = $(this).attr("name"); 94 $("#sel_leftCollection").append("<option value=\"" + name + "\">" + name + " </option>"); 95 $("#sel_rightCollection").append("<option value=\"" + name + "\">" + name + " </option>"); 96 }); 97 }); 98 68 99 } 69 100
Note:
See TracChangeset
for help on using the changeset viewer.