Skip to content

Commit

Permalink
Add 'kerstboom' garbage type / move icons
Browse files Browse the repository at this point in the history
  • Loading branch information
aiolos committed Jan 3, 2018
1 parent 8498392 commit a9ee6ae
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 9 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added img/garbage/tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion js/garbage.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ function getTrashRow(garbage) {
function filterReturnDates(returnDates) {
return returnDates
.sort(function(a,b) {return (a.date > b.date) ? 1 : ((b.date > a.date) ? -1 : 0);} )
.filter(function (element) {
return settings['garbage'].hasOwnProperty(element.garbageType);
})
.slice(0, getMaxItems())
}

Expand All @@ -335,7 +338,7 @@ function addToContainer(random, returnDates) {
}

function mapGarbageType(garbageType) {
if (garbageType.match(/(gft)|(tuin)|(refuse bin)|(green)|(groen)|(Biodégradables)/i)) {
if (garbageType.match(/(gft)|(tuin)|(refuse bin)|(green)|(groen)|(Biodégradables)|(snoei)/i)) {
return 'gft';
}
else if (garbageType.match(/(black)|(zwart)/i)) {
Expand All @@ -359,6 +362,9 @@ function mapGarbageType(garbageType) {
else if (garbageType.match(/(milieu)/i)) {
return 'milieu';
}
else if (garbageType.match(/(kerst)/i)) {
return 'kerstboom';
}
return 'black';
}

Expand Down
17 changes: 9 additions & 8 deletions js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,14 +463,15 @@ if (typeof(settings['units']) === 'undefined') {
}
if (typeof(settings['garbage']) === 'undefined') {
settings['garbage'] = {
gft: {kliko: 'green', code: '#375b23', name: 'GFT', icon: 'img/kliko_green.png'},
pmd: {kliko: 'orange', code: '#db5518', name: 'PMD', icon: 'img/kliko_orange.png'},
rest: {kliko: 'grey', code: '#5e5d5c', name: 'Restafval', icon: 'img/kliko_grey.png'},
papier: {kliko: 'blue', code: '#153477', name: 'Papier', icon: 'img/kliko_blue.png'},
kca: {kliko: 'red', code: '#b21807', name: 'Chemisch afval', icon: 'img/kliko_red.png'},
brown: {kliko: 'brown', code: '#7c3607', name: 'Bruin', icon: 'img/kliko_brown.png'},
black: {kliko: 'black', code: '#000000', name: 'Zwart', icon: 'img/kliko_black.png'},
milieu: {kliko: 'yellow', code: '#f9e231', name: 'Geel', icon: 'img/kliko_yellow.png'},
gft: {kliko: 'green', code: '#375b23', name: 'GFT', icon: 'img/garbage/kliko_green.png'},
pmd: {kliko: 'orange', code: '#db5518', name: 'PMD', icon: 'img/garbage/kliko_orange.png'},
rest: {kliko: 'grey', code: '#5e5d5c', name: 'Restafval', icon: 'img/garbage/kliko_grey.png'},
papier: {kliko: 'blue', code: '#153477', name: 'Papier', icon: 'img/garbage/kliko_blue.png'},
kca: {kliko: 'red', code: '#b21807', name: 'Chemisch afval', icon: 'img/garbage/kliko_red.png'},
brown: {kliko: 'brown', code: '#7c3607', name: 'Bruin', icon: 'img/garbage/kliko_brown.png'},
black: {kliko: 'black', code: '#000000', name: 'Zwart', icon: 'img/garbage/kliko_black.png'},
milieu: {kliko: 'yellow', code: '#f9e231', name: 'Geel', icon: 'img/garbage/kliko_yellow.png'},
kerstboom: {kliko: 'green', code: '#375b23', name: 'Kerstboom', icon: 'img/garbage/tree.png'},
};
}
if (typeof(settings['garbage_use_names']) === 'undefined') settings['garbage_use_names'] = 0;
Expand Down

0 comments on commit a9ee6ae

Please sign in to comment.