1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
$(document).ready(function() {
var editor = CodeMirror.fromTextArea('query', {
height: "250px",
parserfile: "parsesparql.js",
stylesheet: "css/sparqlcolors.css",
path: "/js/"
});
});
//$(document).ready(function() {
// $('#queryform').submit(function(e){
// // Fallback for browser that don't support the history API
// if (!('replaceState' in window.history)) {
// alert('replaceState not available');
// return true;
// }
//
// // Ensure middle, control and command clicks act normally
// if (e.which == 2 || e.metaKey || e.ctrlKey){
// alert('meta key preventing replaceState');
// return true;
// }
//
// var url = '?query=' + escape(editor.getCode());
// alert(url);
// $.get(url, function(results) {
// window.history.pushState(null, "SPARQL Query Results", url);
// alert(results.results.bindings[0]);
// $('#results').empty();
// if(results['results']['bindings']){
// for (var i in results['results']['bindings']) {
// var w = results['results']['bindings'][i];
// var desc = w['Description']['value'];
// var triples = w['Number_of_Triples']['value'];
// var agency = w['Agency']['value'];
// var title = w['Title']['value'];
//
// var ok = true;
// if (keyword.length > 0) {
// if (title.indexOf(keyword) == -1) {
// ok = false;
// }
// }
//
// if (ok) {
// add_dataset(w);
// }
// }
// }
// });
// return false;
// })
//});
|