From dd9e8d5029f47459d78431336265a98743515735 Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Sun, 9 Jul 2017 17:18:54 +0200 Subject: [PATCH] No comment. --- static/main.js | 4 ++++ static/storage.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/static/main.js b/static/main.js index b62bb953..50db8daf 100644 --- a/static/main.js +++ b/static/main.js @@ -61,6 +61,10 @@ Date.prototype.yyyymmdd = function(time) { // http://stackoverflow.com/questions return this.getFullYear()+""+mm+""+dd+ ""; // padding }; var date = new Date(); +String.prototype.replaceAll = function(search, replacement) { + var target = this; + return target.split(search).join(replacement); +}; // image data // key is the name of the item in the database, value is the name of the image on wiki.factorio.com/images/* diff --git a/static/storage.js b/static/storage.js index d2dd1040..8b9c7dbd 100644 --- a/static/storage.js +++ b/static/storage.js @@ -9,7 +9,7 @@ function drawcontents(data) { } else if(imagelinks[data[i].name]) { img = imagelinks[data[i].name]; } else { - img = "https://wiki.factorio.com/images/" + capitalizeFirstLetter(data[i].name.replace('-','_')) + ".png"; + img = "https://wiki.factorio.com/images/" + capitalizeFirstLetter(data[i].name.replaceAll('-','_')) + ".png"; } var searchField = document.querySelector("#search"); if(!searchField.value || data[i].name.includes(searchField.value)) {