Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaned up a bunch of stuff.. now I can't remember, but it was quite …

…awesome and action packed
  • Loading branch information...
commit 369807a78081c02f4ea372c789f33b4d115742b6 1 parent d56d29a
@csarven authored
View
9 classes/Tools.php
@@ -11,10 +11,11 @@ class Tools
{
var $config;
- function __construct()
+ function __construct($data)
{
$this->config = array();
$this->setPrefixes();
+ $this->setConfig($data);
// $this->setObjectMapping();
$this->setAPIElements();
$this->getHTTPRequest();
@@ -118,6 +119,12 @@ function setPrefixes()
}
+ function setConfig($data)
+ {
+ $this->config['data'] = $data;
+// print_r($this->config);
+ }
+
function buildQueryURI($query = null)
{
$prefixes = $this->getPrefix();
View
55 js/index.js
@@ -26,13 +26,10 @@ var T = { // Tool
U: {
init : function () {
T.U.initSearchPanel();
-// T.handleInteraction();
},
initSearchPanel : function () {
-// $("#form_search #address").focus();
//console.log("initSearchPanel");
- // the search button has been hit, show nearby schools
$('#' + T.C.ID_SUBMIT).click(function () {
T.U.searchAction();
});
@@ -62,31 +59,56 @@ var T = { // Tool
},
getSearchValues : function () {
+//console.log('getSearchValue');
T.I.INDICATOR = $('#' + T.C.ID_INDICATOR).val();
T.I.COUNTRY = $('#' + T.C.ID_COUNTRY).val();
T.I.YEAR = $('#' + T.C.ID_YEAR).val();
+//console.log(T.I.INDICATOR);
+//console.log(T.I.COUNTRY);
+//console.log(T.I.YEAR);
},
setSearchValues : function (urlParams) {
+//console.log('setSearchValues');
+//console.log(urlParams);
$('#' + T.C.ID_INDICATOR).val(urlParams.indicator);
- $('#' + T.C.ID_COUNTRY).val(urlParams.country);
- $('#' + T.C.ID_YEAR).val(urlParams.year);
+ if (urlParams.country != '') {
+ $('#' + T.C.ID_COUNTRY).val(urlParams.country);
+ }
+ if (urlParams.year != '') {
+ $('#' + T.C.ID_YEAR).val(urlParams.year);
+ }
},
searchAction : function () {
- if (window.location.pathname != '/'+T.C.BASE_URI) {
+//console.log('searchAction');
+//console.log('window.location.pathname: ' + window.location.pathname);
+//console.log('T.C.BASE_URI: ' + T.C.BASE_URI);
+// if (window.location.pathname == T.C.BASE_URI) {
+//console.log("IF");
T.U.getSearchValues();
- var urlParams = $.param({
- 'indicator' : T.I.INDICATOR,
- 'country' : T.I.COUNTRY,
- 'year' : T.I.YEAR
- });
-//console.log("searchAction");
+ if (T.I.COUNTRY != '') {
+ var urlParams = $.param({
+ 'indicator' : T.I.INDICATOR,
+ 'country' : T.I.COUNTRY,
+ });
+ }
+
+ if (T.I.YEAR != '') {
+ var urlParams = $.param({
+ 'indicator' : T.I.INDICATOR,
+ 'year' : T.I.YEAR
+ });
+ }
+
+//console.log(urlParams);
window.location = T.C.BASE_URI + '?' + urlParams;
- }
+// } else {
+//console.log("ELSE");
+// }
- T.U.showObservations();
+// T.U.showObservations();
},
showObservations : function() {
@@ -108,7 +130,7 @@ var T = { // Tool
renderChart : {
indicators : function (indicatorNotation, dimensions) {
-// console.log("renderChart.indicators");
+//console.log("renderChart.indicators");
// if (countries.length != 0) {
// var uri;
@@ -126,6 +148,7 @@ var T = { // Tool
}
//console.log(uriIndicator);
+//console.log(uriObservations);
var indicatorURI, indicatorPrefLabel, indicatorDefinition;
$('#' + 'results').addClass('processing');
@@ -151,7 +174,7 @@ var T = { // Tool
var countryPrefLabel;
-//console.log(uriObservations);
+
$('#' + 'results').addClass('processing');
$.getJSON(uriObservations, function (data, textStatus) {
//console.log(data);
View
5,407 templates/header.world-development-indicators.html
12 additions, 5,395 deletions not shown
View
46 templates/html.world-development-indicators.html
@@ -1,46 +0,0 @@
-<?php
- $charset = "utf-8";
- $lang = "en";
-
- $xmlProlog = '';
-
-# if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") || stristr($_SERVER["HTTP_ACCEPT"],"application/xml") || stristr($_SERVER["HTTP_ACCEPT"],"text/xml") || !isset($_SERVER["HTTP_ACCEPT"])) {
-
-# if (stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
-# $contentType="application/xhtml+xml";
-# }
-# else if (stristr($_SERVER["HTTP_ACCEPT"],"application/xml")) {
-# $contentType="application/xml";
-# }
-# else if (stristr($_SERVER["HTTP_ACCEPT"],"text/xml")) {
-# $contentType="text/xml";
-# }
-# else {
-# $contentType="application/xhtml+xml";
-# }
-
-# $xmlProlog = '<?xml version="1.0" encoding="'.$charset.'"?>'."\n";
-# }
-# else {
- $contentType = "text/html";
-# }
-
- header ("Content-Type: $contentType; charset=$charset");
- header ("Content-Language: $lang");
-
- echo $xmlProlog;
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
- xmlns:owl="http://www.w3.org/2002/07/owl#"
- xmlns:dcterms="http://purl.org/dc/terms/"
- xmlns:foaf="http://xmlns.com/foaf/0.1/"
- xmlns:v="http://www.w3.org/2006/vcard/ns#"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:dbr="http://dbpedia.org/resource/"
- xmlns:dbp="http://dbpedia.org/property/"
- xmlns:wgs="http://www.w3.org/2003/01/geo/wgs84_pos#"
- xml:lang="<?php echo $lang; ?>">
View
17 templates/tool.world-development-indicators.html
@@ -1,11 +1,13 @@
-<?php require_once 'head.world-development-indicators.html'; ?>
<?php
-// $school = $this->getSchool();
-// $schoolData = $this->getSchoolValues($school);
-// print_r($schoolData);
+ header("Content-type: text/html; charset=utf-8");
?>
- <title>World Development Indicators observations tool &#8212; World Bank Linked Data</title>
- <meta name="description" content="Tool to display World Development Indicators observations"/>
+<!DOCTYPE HTML>
+<html>
+
+<?php require_once 'head.world-development-indicators.html'; ?>
+
+ <title>View for '<?php echo $this->config['data']['worldDevelopmentIndicators'][$this->config['requestQuery']['indicator']]; ?>' &#8212; World Bank Linked Data</title>
+ <meta name="description" content="Tool to display World Development Indicators: <?php echo $this->config['data']['worldDevelopmentIndicators'][$this->config['requestQuery']['indicator']]; ?>"/>
</head>
<body id="observation">
@@ -17,7 +19,8 @@
<div id="content_inner">
<div id="results">
- <div id="details"></div>
+ <div id="results_linechart"></div>
+ <div id="results_geochart"></div>
</div>
</div>
</div>
View
2  theme/base/css/display.css
@@ -479,7 +479,7 @@ margin-right:1em;
display:none;
}
#observation #form_indicator select {
-width:20em;
+width:25em;
}
#observation #form_country select {
width:15em;
View
5,401 tool.world-development-indicators.php
5,400 additions, 1 deletion not shown
Please sign in to comment.
Something went wrong with that request. Please try again.