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