JSFiddle - React, Tailwind, and code Playground
by Terrance Smith
HTML
<table id="BasicContent">
<tr>
<th>Key</th>
<th>Value</th>
</tr>
</table>
JavaScript
var jsonDetails = {};
/// Dependency on lodash
//http://www.imdb.com/title/tt0420223/
//https://www.themoviedb.org/movie/158852
//http://www.freebase.com/m/0bm2nq
//wikipedia_id ???
var GuideBoxParser;
GuideBoxParser = (function () {
function guideBoxParser(jsonResult) {
guideBoxParser.jsonResult = jsonResult;
}
guideBoxParser.basicInfoKeys = ["title", "release_date", "rating", "rottentomatoes", "imdb", "freebase", "wikipedia_id", "metacritic", "overview", "poster_400x570"];
guideBoxParser.webSources = ["free_web_sources", "free_ios_sources", "free_android_sources", "tv_everywhere_web_sources", "tv_everywhere_ios_sources", "tv_everywhere_android_sources", "subscription_web_sources", "subscription_ios_sources", "subscription_android_sources", "purchase_ios_sources", "purchase_android_sources", "other_sources"];
guideBoxParser.prototype.webSources = _.select(guideBoxParser.jsonResult, function (value, key) {
if (_.indexOf(webSources, key) > -1) {
return value;
}
});
guideBoxParser.prototype.getMovieEntryBasicDetails = function () {
_.select(guideBoxParser.jsonResult, function (value, key) {
if (_.indexOf(guideBoxParser.basicInfoKeys, key) > -1) {
return {
key: value
};
}
});
};
return guideBoxParser;
})();
var DomGen;
DomGen = (function () {
function domGen() {
}
domGen.prototype.AddRow = function (tableId, key, val) {
// Get a reference to the table
var tableRef = document.getElementById(tableId);
// Insert a row in the table at row index 0
var newRow = tableRef.insertRow(tableRef.rows.length);
var valCell = newRow.insertCell(0);
var valText = document.createTextNode(val);
valCell.appendChild(valText);
var keyCell = newRow.insertCell(0);
var keyText = document.createTextNode(key);
...