@@ -780,7 +780,21 @@ return _.isRegExp(keyword) ? keyword.source :_.escapeRegExp(keyword);
780
780
} ) . join ( "|" ) , result = "" , lastIndex = 0 , flags = caseSensitive ? "g" :"ig" , regex = new RegExp ( source , flags ) ; null !== ( match = regex . exec ( str ) ) ; ) lastIndex < match . index && ( result += _ . escape ( str . substring ( lastIndex , match . index ) ) ) , result += "<mark>" + _ . escape ( match [ 0 ] ) + "</mark>" , lastIndex = regex . lastIndex ;
781
781
return lastIndex < str . length && ( result += _ . escape ( str . substring ( lastIndex ) ) ) , result ;
782
782
} ;
783
- } ] ) , angular . module ( "openshiftCommonUI" ) . filter ( "linkify" , [ "HTMLService" , function ( HTMLService ) {
783
+ } ] ) , angular . module ( "openshiftCommonUI" ) . filter ( "imageForIconClass" , [ "isAbsoluteURLFilter" , function ( isAbsoluteURLFilter ) {
784
+ return function ( iconClass ) {
785
+ if ( ! iconClass ) return "" ;
786
+ var logoImage = _ . get ( window , [ "OPENSHIFT_CONSTANTS" , "LOGOS" , iconClass ] ) ;
787
+ if ( ! logoImage ) return "" ;
788
+ var logoBaseUrl = _ . get ( window , "OPENSHIFT_CONSTANTS.LOGO_BASE_URL" ) ;
789
+ return ! logoBaseUrl || isAbsoluteURLFilter ( logoImage ) ? logoImage :( logoBaseUrl . endsWith ( "/" ) || ( logoBaseUrl += "/" ) , logoBaseUrl + logoImage ) ;
790
+ } ;
791
+ } ] ) , angular . module ( "openshiftCommonUI" ) . filter ( "isAbsoluteURL" , function ( ) {
792
+ return function ( url ) {
793
+ if ( ! url ) return ! 1 ;
794
+ var uri = new URI ( url ) , protocol = uri . protocol ( ) ;
795
+ return uri . is ( "absolute" ) && ( "http" === protocol || "https" === protocol ) ;
796
+ } ;
797
+ } ) , angular . module ( "openshiftCommonUI" ) . filter ( "linkify" , [ "HTMLService" , function ( HTMLService ) {
784
798
return function ( text , target , alreadyEscaped ) {
785
799
return HTMLService . linkify ( text , target , alreadyEscaped ) ;
786
800
} ;
0 commit comments