Last active
October 29, 2017 18:00
-
-
Save martin12333/640a6751aeaa86432cdef6e4d3fe9745 to your computer and use it in GitHub Desktop.
OpenRefine: Displaying Images in cells: by https://groups.google.com/forum/#!topic/openrefine/4E2JqYHxZB8/discussion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Assuming that you're using version 2.1, then you could dig into the Javascript source code of your Google Refine download and hack this feature. Take a look at this file and line: | |
//http://code.google.com/p/google-refine/source/browse/tags/2.1/main/webapp/modules/core/scripts/views/data-table/cell-ui.js#75 | |
//You would want to change it to something like this | |
} else if (URL.looksLikeUrl(cell.v)) { | |
if (cell.v.endsWith(".jpg") || cell.v.endsWith(".jpeg") || cell.v.endsWith(".png")) { | |
$('<img>') | |
.attr("src", cell.v) | |
.attr("href", cell.v) | |
.attr("target", "_blank") | |
.appendTo(divContent); | |
} else { | |
$('<a>') | |
.text(cell.v) | |
.attr("href", cell.v) | |
.attr("target", "_blank") | |
.appendTo(divContent); | |
} | |
} else { | |
... | |
//David |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment