@@ -233,8 +233,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
233233
234234 var page = $ ( '#app-' + app . id ) ;
235235
236- // image loading kung-fu (IE doesn't properly scale SVGs, so disable app icons)
237- if ( app . preview && ! OC . Util . isIE ( ) ) {
236+ if ( app . preview ) {
238237 var currentImage = new Image ( ) ;
239238 currentImage . src = app . preview ;
240239
@@ -286,8 +285,10 @@ OC.Settings.Apps = OC.Settings.Apps || {
286285 img = '<svg viewBox="0 0 72 72">' ;
287286 img += '<image x="0" y="0" width="72" height="72" preserveAspectRatio="xMinYMin meet" xlink:href="' + url + '" class="app-icon" /></svg>' ;
288287 } else {
288+ var rnd = Math . floor ( ( Math . random ( ) * 100 ) ) + new Date ( ) . getSeconds ( ) + new Date ( ) . getMilliseconds ( ) ;
289289 img = '<svg width="32" height="32" viewBox="0 0 32 32">' ;
290- img += '<image x="0" y="0" width="32" height="32" preserveAspectRatio="xMinYMin meet" filter="url(#invertIcon)" xlink:href="' + url + '?v=' + oc_config . version + '" class="app-icon"></image></svg>' ;
290+ img += '<defs><filter id="invertIconApps-' + rnd + '"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"></feColorMatrix></filter></defs>'
291+ img += '<image x="0" y="0" width="32" height="32" preserveAspectRatio="xMinYMin meet" filter="url(#invertIconApps-' + rnd + ')" xlink:href="' + url + '?v=' + oc_config . version + '" class="app-icon"></image></svg>' ;
291292 }
292293 return img ;
293294 } ,
@@ -631,24 +632,29 @@ OC.Settings.Apps = OC.Settings.Apps || {
631632 }
632633
633634 if ( $ ( '#appmenu' ) . children ( 'li[data-id="' + entry . id + '"]' ) . length === 0 ) {
634- var li = $ ( '<li></li>' ) ;
635- li . attr ( 'data-id' , entry . id ) ;
636- var img = '<img src="' + entry . icon + '" class="app-icon">' ;
637- var a = $ ( '<a></a>' ) . attr ( 'href' , entry . href ) ;
638- var filename = $ ( '<span></span>' ) ;
639- var loading = $ ( '<div class="icon-loading-dark"></div>' ) . css ( 'display' , 'none' ) ;
640- filename . text ( entry . name ) ;
641- a . prepend ( filename ) ;
642- a . prepend ( loading ) ;
643- a . prepend ( img ) ;
644- li . append ( a ) ;
645- $ ( '#appmenu li[data-id=' + previousEntry . id + ']' ) . after ( li ) ;
646- if ( addedApps [ entry . id ] ) {
647- li . animate ( { opacity : 0.5 } )
648- . animate ( { opacity : 1 } )
649- . animate ( { opacity : 0.5 } )
650- . animate ( { opacity : 1 } ) ;
651- }
635+ var li = $ ( '<li></li>' ) ;
636+ li . attr ( 'data-id' , entry . id ) ;
637+ var img = '<img src="' + entry . icon + '" class="app-icon">' ;
638+ if ( OCA . Theming && OCA . Theming . inverted ) {
639+ img = '<svg width="20" height="20" viewBox="0 0 20 20">' ;
640+ img += '<defs><filter id="invert"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" /></filter></defs>' ;
641+ img += '<image x="0" y="0" width="20" height="20" preserveAspectRatio="xMinYMin meet" filter="url(#invert)" xlink:href="' + entry . icon + '" class="app-icon" /></svg>' ;
642+ }
643+ var a = $ ( '<a></a>' ) . attr ( 'href' , entry . href ) ;
644+ var filename = $ ( '<span></span>' ) ;
645+ var loading = $ ( '<div class="icon-loading-dark"></div>' ) . css ( 'display' , 'none' ) ;
646+ filename . text ( entry . name ) ;
647+ a . prepend ( filename ) ;
648+ a . prepend ( loading ) ;
649+ a . prepend ( img ) ;
650+ li . append ( a ) ;
651+ $ ( '#appmenu li[data-id=' + previousEntry . id + ']' ) . after ( li ) ;
652+ if ( addedApps [ entry . id ] ) {
653+ li . animate ( { opacity : 0.5 } )
654+ . animate ( { opacity : 1 } )
655+ . animate ( { opacity : 0.5 } )
656+ . animate ( { opacity : 1 } ) ;
657+ }
652658 }
653659 previousEntry = entry ;
654660 }
0 commit comments