summaryrefslogtreecommitdiffstats
path: root/settings/js/apps.js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2016-08-16 18:31:59 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2016-08-16 18:31:59 +0200
commit717e22267a1c23dda1b25b9d01bb1fada9ce8ab7 (patch)
tree544774d1018e19d462e79360b3fc86b6cdd39b16 /settings/js/apps.js
parent4946cc220de5926ef86dc8557ffb5c990f6482d3 (diff)
parent9db189174c26326bbb58d96f614a415cd15542d1 (diff)
downloadnextcloud-server-717e22267a1c23dda1b25b9d01bb1fada9ce8ab7.tar.gz
nextcloud-server-717e22267a1c23dda1b25b9d01bb1fada9ce8ab7.zip
Merge branch 'master' into implement_712
Diffstat (limited to 'settings/js/apps.js')
-rw-r--r--settings/js/apps.js29
1 files changed, 23 insertions, 6 deletions
diff --git a/settings/js/apps.js b/settings/js/apps.js
index 66c097e1257..f8ad9c7918c 100644
--- a/settings/js/apps.js
+++ b/settings/js/apps.js
@@ -196,14 +196,14 @@ OC.Settings.Apps = OC.Settings.Apps || {
if (app.preview && !OC.Util.isIE()) {
var currentImage = new Image();
currentImage.src = app.preview;
-
- currentImage.onload = function() {
- page.find('.app-image')
- .append(this)
- .fadeIn();
- };
}
+ currentImage.onload = function() {
+ page.find('.app-image')
+ .append(OC.Settings.Apps.imageUrl(app.preview, app.detailpage))
+ .fadeIn();
+ };
+
// set group select properly
if(OC.Settings.Apps.isType(app, 'filesystem') || OC.Settings.Apps.isType(app, 'prelogin') ||
OC.Settings.Apps.isType(app, 'authentication') || OC.Settings.Apps.isType(app, 'logging') ||
@@ -226,6 +226,23 @@ OC.Settings.Apps = OC.Settings.Apps || {
}
},
+ /**
+ * Returns the image for apps listing
+ * url : the url of the image
+ * appfromstore: bool to check whether the app is fetched from store or not.
+ */
+
+ imageUrl : function (url, appfromstore) {
+ var img = '<svg width="72" height="72" viewBox="0 0 72 72">';
+ if (appfromstore) {
+ img += '<image x="0" y="0" width="72" height="72" preserveAspectRatio="xMinYMin meet" xlink:href="' + url + '" class="app-icon" /></svg>';
+ } else {
+ 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>';
+ img += '<image x="0" y="0" width="72" height="72" preserveAspectRatio="xMinYMin meet" filter="url(#invert)" xlink:href="' + url + '" class="app-icon" /></svg>';
+ }
+ return img;
+ },
+
isType: function(app, type){
return app.types && app.types.indexOf(type) !== -1;
},