MCPcopy Index your code
hub / github.com/GoogleTrends/data / showData

Function showData

tableload.js:196–240  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194 }
195
196 function showData() {
197 console.log(currentData);
198 var d,i;
199 var tableRecords = document.querySelectorAll("#files tr.record");
200 var table = document.getElementById("files")
201 for (i = 0; i < tableRecords.length; i ++) {
202 table.removeChild(tableRecords[i]);
203 }
204
205 var currentPage = document.getElementById("currentPage");
206 var totalPages = document.getElementById("totalPages");
207
208 totalPages.innerHTML = maxPages;
209 currentPage.innerHTML = (page + 1);
210
211 for(i = page * pagination; i < Math.min((page + 1) * pagination, currentData.length); i++) {
212 d = currentData[i];
213 var newRow = document.createElement("tr");
214 newRow.classList.add("record");
215 ["title", "date", "coverage", "subject", "link"].forEach(function(k) {
216 var newCell = document.createElement("td");
217 if (k !== "link") {
218 if (k === "date") {
219 var date = new Date(d[k]);
220 newCell.innerHTML = (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getUTCFullYear();
221 } else {
222 newCell.innerHTML = d[k];
223 }
224 } else {
225 https://raw.githubusercontent.com/jckr/drunken-sansa/master/
226 var a = document.createElement("a");
227 a.setAttribute("href", "https://raw.githubusercontent.com/" + account + "/" + repo + "/master/" + d[k]);
228 a.setAttribute("download", "");
229 a.setAttribute("target", "_blank");
230 a.innerHTML = "Download"
231 newCell.appendChild(a);
232 }
233 newRow.appendChild(newCell);
234 })
235 table.appendChild(newRow);
236 }
237
238
239
240 }
241}

Callers 2

initFiltersFunction · 0.85
filterDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…