Commit d34525e2dc00689b069c203ba1a22721f1422b77

Authored by Benjamin Renard
1 parent d93e3f55

Fix URL in catalog (#7621)

Showing 1 changed file with 4 additions and 9 deletions   Show diff stats
js/app/views/CatalogUI.js
... ... @@ -483,16 +483,11 @@ Ext.define('amdaUI.CatalogUI', {
483 483 width: pramColumnWidth * parseInt(obj.size),
484 484 editor: 'textfield',
485 485 renderer :function(value){
486   - if(value.startsWith("www") ||value.startsWith("WWW")) {
487   - myURL = '<a href="http://' + value + '" target="_blank">' + value +'</a>';
488   - }else if(value.startsWith("http") ||value.startsWith("HTTP")){
489   - myURL = '<a href=' + value + ' target="_blank">' + value +'</a>';
490   - }else if(value.endsWith(".com") || value.endsWith(".fr") || value.endsWith(".org") || value.endsWith(".eu") ){
491   - myURL = '<a href="http://www.' + value + '" target=_blank">' + value +'</a>';
492   - }else{
493   - myURL = value;
  486 + var renderedVal = value;
  487 + if(value.toLowerCase().startsWith("http://") ||value.toLowerCase().startsWith("https://")) {
  488 + renderedVal = '<a href="' + value + '" target="_blank">' + value +'</a>';
494 489 }
495   - return myURL;
  490 + return renderedVal;
496 491 },
497 492 filter: {type: 'string'}
498 493 });
... ...