From 60f050e2d8c421a2f50a6732162fb236ad7b68bd Mon Sep 17 00:00:00 2001 From: georgiamoon Date: Thu, 3 Sep 2015 11:37:16 -0400 Subject: [PATCH 1/5] adding OSCE not sure why it's not getting the full list, also term defs div shows with the term list --- web/js/definitions.js | 10 ++++++---- web/search.html | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/web/js/definitions.js b/web/js/definitions.js index 1e30f3d..ad2a907 100644 --- a/web/js/definitions.js +++ b/web/js/definitions.js @@ -6,7 +6,7 @@ function emptytext() { return '
Sorry, no terms meet the function buildDefaultDataObj() { var data = { resource_id : getResourceID(), - // fields : 'Term', + fields : 'Term', // limit: 500, // distinct : true, // this doesn't seem to work, but leaving in hope that it migh } @@ -51,7 +51,7 @@ function loadYears() { if ($('body').data('years') === undefined) { var data = buildDefaultDataObj(); data['fields'] = 'Year'; - data['limit'] = 1000; + data['limit'] = 10000; $.ajax({ // headers: {Authorization: getAuthToken()}, url: getCkanUrl(), @@ -395,6 +395,7 @@ function advSearchFormCheckboxValues() { var otherstate = parseInt($('form#search-form input:checkbox[name=OtherState]:checked').val()); var igo = parseInt($('form#search-form input:checkbox[name=IGO]:checked').val()); var othersource = parseInt($('form#search-form input:checkbox[name=OtherSource]:checked').val()); + var osceOfficial = parseInt($('form#search-form input:checkbox[name=OSCEOfficial]:checked').val()); // if (!ungge4) { var ungge4 = 0; } // if (!osce) { var osce = 0; } // if (!otherstate) { var otherstate = 0; } @@ -410,6 +411,7 @@ function advSearchFormCheckboxValues() { if(otherstate == 1) {values['OtherState'] = otherstate; i++;} if(igo == 1) {values['IGO'] = igo; i++;} if ( othersource == 1) {values['OtherSource'] = othersource; i++;} + if ( osceOfficial == 1) {values['OSCEOfficial'] = osceOfficial; i++;} if (i > 0) { return values; @@ -423,8 +425,8 @@ function loadUniqueSourceFields() { var data = { resource_id : getResourceID(), fields : 'Source', - limit: 500, - distinct : true, // this doesn't seem to work, but leaving in hope that it migh + limit: 10000, + //distinct : true, // this doesn't seem to work, but leaving in hope that it migh } var sources = {}; $.ajax({ diff --git a/web/search.html b/web/search.html index 001db86..dfff960 100644 --- a/web/search.html +++ b/web/search.html @@ -162,6 +162,7 @@

Advanced Filters:

+
From d3ac516bc3d2cb5b70da4f8ac9cd9b1c36c0f0a5 Mon Sep 17 00:00:00 2001 From: Nat Meysenburg Date: Fri, 4 Sep 2015 15:37:36 -0400 Subject: [PATCH 2/5] Remove call to googleapis that is repetative --- web/search.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/web/search.html b/web/search.html index dfff960..ffe3af1 100644 --- a/web/search.html +++ b/web/search.html @@ -176,8 +176,6 @@

Advanced Filters:

- - From 5420a1ed25f1d5b6a0d3c7fdc28872d9bf576d40 Mon Sep 17 00:00:00 2001 From: Nat Meysenburg Date: Fri, 4 Sep 2015 15:54:15 -0400 Subject: [PATCH 3/5] Remove unused calls to d3. --- web/search.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/web/search.html b/web/search.html index ffe3af1..b596204 100644 --- a/web/search.html +++ b/web/search.html @@ -132,10 +132,6 @@ - - - - @@ -177,7 +173,7 @@

Advanced Filters:

- + From f7ed2bf2189cffc84210d9e5116935d95cb3405e Mon Sep 17 00:00:00 2001 From: Nat Meysenburg Date: Fri, 4 Sep 2015 15:54:46 -0400 Subject: [PATCH 4/5] Remove unused word cloud. --- web/js/definitions.js | 73 ------------------------------------------- 1 file changed, 73 deletions(-) diff --git a/web/js/definitions.js b/web/js/definitions.js index ad2a907..cc5a1da 100644 --- a/web/js/definitions.js +++ b/web/js/definitions.js @@ -481,79 +481,6 @@ function buildDeepLink() { return link; } -// function wordCloud() { -// var words = loadTermsArray(); -// var fill = d3.scale.category20(); -// d3.layout.cloud().size([960, 400]) -// .words(words.map(function(d) { -// return {text: d, size: d.size}; -// })) -// .padding(3) -// .rotate(function() { return ~~(Math.random() * 2) * 90; }) -// .font("Impact") -// .fontSize(function(d) { return d.size; }) -// .on("end", draw) -// .start(); -// function draw(words) { -// d3.select("div#word-cloud").append("svg") -// .attr("width", 960) -// .attr("height", 400) -// .append("g") -// .attr("transform", "translate(150,150)") -// .selectAll("text") -// .data(words) -// .enter().append("text") -// .style("font-size", function(d) { return d.size + "px"; }) -// .style("font-family", "Impact") -// .style("fill", function(d, i) { return fill(i); }) -// .attr("text-anchor", "middle") -// .attr("transform", function(d) { -// return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; -// }) -// .text(function(d) { return d.text; }); -// } -// $('div#word-cloud text').click(function() { -// firequery($(this)[0].innerHTML, 'filters', 'all'); -// }); -// } - -// function map() { -// var width = 960, -// height = 500; - -// var projection = d3.geo.kavrayskiy7(), -// color = d3.scale.category20(), -// graticule = d3.geo.graticule(); - -// var path = d3.geo.path() -// .projection(projection); - -// var svg = d3.select("#map").append("svg") -// .attr("width", width) -// .attr("height", height); - -// svg.append("path") -// .datum(graticule) -// .attr("class", "graticule") -// .attr("d", path); - -// svg.append("path") -// .datum(graticule.outline) -// .attr("class", "graticule outline") -// .attr("d", path); - -// d3.json("map/world-50m.json", function(error, world) { -// var countries = topojson.feature(world, world.objects.countries).features; - - -// svg.selectAll(".country") -// .data(countries) -// .enter().insert("path", ".graticule") -// .attr("class", "country") -// .attr("d", path) -// // .style("fill", function(d, i) { return color(d.color = d3.max(neighbors[i], function(n) { return countries[n].color; }) + 1 | 0); }); -// }); -// } function definitionTabs() { $('ul#term-tabs').each(function(){ From 66a32e58925d03f060adb9c559bb76b0236c4ed8 Mon Sep 17 00:00:00 2001 From: Nat Meysenburg Date: Fri, 4 Sep 2015 17:01:50 -0400 Subject: [PATCH 5/5] Fix year sorting issue. --- web/js/definitions.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/js/definitions.js b/web/js/definitions.js index cc5a1da..cdaf68c 100644 --- a/web/js/definitions.js +++ b/web/js/definitions.js @@ -63,16 +63,16 @@ function loadYears() { for (i = 0; i < data.result.total; i++) { var year = data.result.records[i]; year = year['Year']; - if (year === 'No year given') { - var ckanyear = ''; - var year = year; + if (year === '.') { + var ckanyear = year; + var year = "No year given"; } else { var ckanyear = year; year = year.substring(0, year.length -2); } if (!(year in years)) { years[year] = ckanyear; } - } + } $('body').data('years', years); } }); @@ -86,13 +86,13 @@ function loadYearsArray() { $.each(years, function( k, v ) { out.push(k); }); - return out.sort(); + return out.sort(); } function buildYearSelect() { var ckanyears = loadYears(); var years = loadYearsArray(); var noyear = years.pop(); - var options = ''; + var options = ''; $.each(years, function(k, year) { options += ''; });