diff --git a/src/main/webapp/scripts/project/data-table-cell-ui.js b/src/main/webapp/scripts/project/data-table-cell-ui.js index 7038a6851..55b0ab503 100644 --- a/src/main/webapp/scripts/project/data-table-cell-ui.js +++ b/src/main/webapp/scripts/project/data-table-cell-ui.js @@ -50,73 +50,74 @@ DataTableCellUI.prototype._render = function() { }); } else { $(divContent).html(cell.v); - $(' ').appendTo(divContent); - var ul = $('
').addClass("data-table-recon-candidates").appendTo(divContent); - if (this._dataTableView._showRecon && "c" in r && r.c.length > 0) { - var candidates = r.c; - var renderCandidate = function(candidate, index) { - var li = $('
').addClass("data-table-recon-candidate").appendTo(ul); + if (this._dataTableView._showRecon) { + var ul = $('
').addClass("data-table-recon-candidates").appendTo(divContent); + if ("c" in r && r.c.length > 0) { + var candidates = r.c; + var renderCandidate = function(candidate, index) { + var li = $('
').addClass("data-table-recon-candidate").appendTo(ul); + + $(' ') + .addClass("data-table-recon-match-similar") + .attr("title", "Match this topic to this cell and other cells with the same content") + .appendTo(li).click(function(evt) { + self._doMatchTopicToSimilarCells(candidate); + }); + + $(' ') + .addClass("data-table-recon-match") + .attr("title", "Match this topic to this cell") + .appendTo(li).click(function(evt) { + self._doMatchTopicToOneCell(candidate); + }); + + $('') + .addClass("data-table-recon-topic") + .attr("href", "http://www.freebase.com/view" + candidate.id) + .attr("target", "_blank") + .click(function(evt) { + self._previewCandidateTopic(candidate.id, this); + evt.preventDefault(); + return false; + }) + .text(candidate.name) + .appendTo(li); + + $('').addClass("data-table-recon-score").text("(" + Math.round(candidate.score) + ")").appendTo(li); + }; - $(' ') - .addClass("data-table-recon-match-similar") - .attr("title", "Match this topic to this cell and other cells with the same content") - .appendTo(li).click(function(evt) { - self._doMatchTopicToSimilarCells(candidate); - }); - - $(' ') - .addClass("data-table-recon-match") - .attr("title", "Match this topic to this cell") - .appendTo(li).click(function(evt) { - self._doMatchTopicToOneCell(candidate); - }); - - $('') - .addClass("data-table-recon-topic") - .attr("href", "http://www.freebase.com/view" + candidate.id) - .attr("target", "_blank") - .click(function(evt) { - self._previewCandidateTopic(candidate.id, this); - evt.preventDefault(); - return false; - }) - .text(candidate.name) - .appendTo(li); - - $('').addClass("data-table-recon-score").text("(" + Math.round(candidate.score) + ")").appendTo(li); - }; - - for (var i = 0; i < candidates.length; i++) { - renderCandidate(candidates[i], i); + for (var i = 0; i < candidates.length; i++) { + renderCandidate(candidates[i], i); + } } + + var liNew = $('
').addClass("data-table-recon-candidate").appendTo(ul); + $(' ') + .addClass("data-table-recon-match-similar") + .attr("title", "Create a new topic for this cell and other cells with the same content") + .appendTo(liNew).click(function(evt) { + self._doMatchNewTopicToSimilarCells(); + }); + + $(' ') + .addClass("data-table-recon-match") + .attr("title", "Create a new topic for this cell") + .appendTo(liNew).click(function(evt) { + self._doMatchNewTopicToOneCell(); + }); + + $('').text("(New topic)").appendTo(liNew); + + $('') + .addClass("data-table-recon-search") + .click(function(evt) { + self._searchForMatch(); + return false; + }) + .text("search for match") + .appendTo($('
').appendTo(divContent)); } - - var liNew = $('
').addClass("data-table-recon-candidate").appendTo(ul); - $(' ') - .addClass("data-table-recon-match-similar") - .attr("title", "Create a new topic for this cell and other cells with the same content") - .appendTo(liNew).click(function(evt) { - self._doMatchNewTopicToSimilarCells(); - }); - - $(' ') - .addClass("data-table-recon-match") - .attr("title", "Create a new topic for this cell") - .appendTo(liNew).click(function(evt) { - self._doMatchNewTopicToOneCell(); - }); - - $('').text("(New topic)").appendTo(liNew); - - $('') - .addClass("data-table-recon-search") - .click(function(evt) { - self._searchForMatch(); - return false; - }) - .text("search for match") - .appendTo($('
').appendTo(divContent)); } } }; diff --git a/src/main/webapp/scripts/project/data-table-view.js b/src/main/webapp/scripts/project/data-table-view.js index c8dcdb867..aa3b1f4db 100644 --- a/src/main/webapp/scripts/project/data-table-view.js +++ b/src/main/webapp/scripts/project/data-table-view.js @@ -255,7 +255,7 @@ DataTableView.prototype.render = function() { td.innerHTML = " "; } else { var cell = (column.cellIndex < cells.length) ? cells[column.cellIndex] : null; - new DataTableCellUI(this, cell, row.i, column.cellIndex, td); + new DataTableCellUI(self, cell, row.i, column.cellIndex, td); } } }; diff --git a/src/main/webapp/scripts/project/list-facet.js b/src/main/webapp/scripts/project/list-facet.js index a76583ae1..ec4f1db1c 100644 --- a/src/main/webapp/scripts/project/list-facet.js +++ b/src/main/webapp/scripts/project/list-facet.js @@ -150,18 +150,24 @@ ListFacet.prototype.render = function() { var footerDiv = $('
').addClass("facet-footer").appendTo(container); if (this._options.sort == "name") { - $('').addClass("action").text("re-sort choices by count").click(function() { + $('').addClass("action").text("re-sort by count").click(function() { self._options.sort = "count"; self._reSortChoices(); self.render(); }).appendTo(footerDiv); } else { - $('').addClass("action").text("re-sort choices by name").click(function() { + $('').addClass("action").text("re-sort by name").click(function() { self._options.sort = "name"; self._reSortChoices(); self.render(); }).appendTo(footerDiv); } + + $('').html(" • ").appendTo(footerDiv); + + $('').addClass("action").text("refresh").click(function() { + ui.browsingEngine.update(); + }).appendTo(footerDiv); } };