Skip to content

Commit

Permalink
Merge pull request #272 from neomjs/dev
Browse files Browse the repository at this point in the history
v1.0.40
  • Loading branch information
tobiu authored Mar 14, 2020
2 parents 0203c9b + 5a9b8e5 commit 3812e21
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
20 changes: 18 additions & 2 deletions examples/component/coronaGallery/CountryGallery.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@ import Gallery from '../../../src/component/Gallery.mjs';
* @extends Neo.component.Gallery
*/
class CountryGallery extends Gallery {
static getStaticConfig() {return {
/**
* A regex to replace blank chars
* @member {RegExp} flagRegEx=/ /gi
* @private
* @static
*/
flagRegEx: / /gi
}}

static getConfig() {return {
/**
* @member {String} className='Neo.examples.component.coronaGallery.CountryGallery'
* @private
*/
className: 'Neo.examples.component.coronaGallery.CountryGallery',
/**
* @member {String[]} cls=['rw2-article-gallery', 'neo-gallery', 'page', 'view']
* @member {String[]} cls=['neo-country-gallery', 'neo-gallery', 'page', 'view']
*/
cls: ['neo-country-gallery', 'neo-gallery', 'page', 'view'],
/**
Expand Down Expand Up @@ -140,12 +150,15 @@ class CountryGallery extends Gallery {
getCountryFlagUrl(name) {
let imageName = name.toLowerCase();

imageName = imageName.replace(/ /gi, '-');
imageName = imageName.replace(CountryGallery.flagRegEx, '-');

switch(imageName) {
case 'channel-islands':
imageName = 'jersey';
break;
case 'curaçao':
imageName = 'curacao';
break;
case 'czechia':
imageName = 'czech-republic';
break;
Expand Down Expand Up @@ -173,6 +186,9 @@ class CountryGallery extends Gallery {
case 'réunion':
imageName = 'france';
break;
case 'saint-lucia':
imageName = 'st-lucia';
break;
case 's.-korea':
imageName = 'south-korea';
break;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neo.mjs",
"version": "1.0.39",
"version": "1.0.40",
"description": "The webworkers driven UI framework",
"repository": {
"type": "git",
Expand Down

0 comments on commit 3812e21

Please sign in to comment.