community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rlenfer...@apache.org
Subject svn commit: r1839354 - /comdev/project-logos/site/js/logofinder.js
Date Mon, 27 Aug 2018 17:35:28 GMT
Author: rlenferink
Date: Mon Aug 27 17:35:28 2018
New Revision: 1839354

URL: http://svn.apache.org/viewvc?rev=1839354&view=rev
Log:
Resolved problem of showing wrong image icons for originals when the project name contains
the extension (e.g. 'ai' in 'Pony Mail')

Modified:
    comdev/project-logos/site/js/logofinder.js

Modified: comdev/project-logos/site/js/logofinder.js
URL: http://svn.apache.org/viewvc/comdev/project-logos/site/js/logofinder.js?rev=1839354&r1=1839353&r2=1839354&view=diff
==============================================================================
--- comdev/project-logos/site/js/logofinder.js (original)
+++ comdev/project-logos/site/js/logofinder.js Mon Aug 27 17:35:28 2018
@@ -111,8 +111,9 @@ function make_div(key, project) {
         // original:
         let img =imgs[0];
         img.opath = img.opath || 'undef.svg';
-        let ma = img.opath.match(/(eps|svg|ai|pdf)/);
-        let oext = ma ? ma[1] : 'svg';
+        let allowedExtensions = ['eps', 'svg', 'ai', 'pdf'];
+        let imgExt = img.opath.split('.').pop();
+        let oext = allowedExtensions.includes(imgExt) ? imgExt : 'svg';
         let arr = [
                 new HTML('img', {src:'images/%s.png'.format(oext), style: {maxWidth: '24px',
maxHeight: '24px'}}),
                 new HTML('br'),



Mime
View raw message