@@ -780,7 +780,20 @@ 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
+ var logoBaseUrl = _ . get ( window , "OPENSHIFT_CONSTANTS.LOGO_BASE_URL" ) ;
785
+ return logoBaseUrl && ! logoBaseUrl . endsWith ( "/" ) && ( logoBaseUrl += "/" ) , function ( iconClass ) {
786
+ if ( ! iconClass ) return "" ;
787
+ var logoImage = _ . get ( window , [ "OPENSHIFT_CONSTANTS" , "LOGOS" , iconClass ] ) ;
788
+ return logoImage ? ! logoBaseUrl || isAbsoluteURLFilter ( logoImage ) ? logoImage :logoBaseUrl + logoImage :"" ;
789
+ } ;
790
+ } ] ) , angular . module ( "openshiftCommonUI" ) . filter ( "isAbsoluteURL" , function ( ) {
791
+ return function ( url ) {
792
+ if ( ! url ) return ! 1 ;
793
+ var uri = new URI ( url ) , protocol = uri . protocol ( ) ;
794
+ return uri . is ( "absolute" ) && ( "http" === protocol || "https" === protocol ) ;
795
+ } ;
796
+ } ) , angular . module ( "openshiftCommonUI" ) . filter ( "linkify" , [ "HTMLService" , function ( HTMLService ) {
784
797
return function ( text , target , alreadyEscaped ) {
785
798
return HTMLService . linkify ( text , target , alreadyEscaped ) ;
786
799
} ;
0 commit comments