summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-10-11 10:23:45 +0200
committerJoas Schilling <coding@schilljs.com>2016-10-11 10:23:45 +0200
commitb1314942d7b82dce28d9ee41523a68f0b40eab91 (patch)
tree84e8b9aa71a838e1c0c68a6e2312d04432d884e8
parentcc4b51490e5ad1c950c543eed6e6cd5285a1af5d (diff)
downloadnextcloud-server-b1314942d7b82dce28d9ee41523a68f0b40eab91.tar.gz
nextcloud-server-b1314942d7b82dce28d9ee41523a68f0b40eab91.zip
Fix authors that have a mail or homepage
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--settings/js/apps.js26
1 files changed, 24 insertions, 2 deletions
diff --git a/settings/js/apps.js b/settings/js/apps.js
index 5119b35178e..cd554812ec9 100644
--- a/settings/js/apps.js
+++ b/settings/js/apps.js
@@ -184,7 +184,15 @@ OC.Settings.Apps = OC.Settings.Apps || {
}
if (_.isArray(app.author)) {
- app.author = app.author.join(', ');
+ var authors = [];
+ _.each(app.author, function (author) {
+ if (typeof author === 'string') {
+ authors.push(author);
+ } else {
+ authors.push(author['@value']);
+ }
+ });
+ app.author = authors.join(', ');
}
var html = template(app);
@@ -518,7 +526,21 @@ OC.Settings.Apps = OC.Settings.Apps || {
// Author Name
apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) {
if (_.isArray(app.author)) {
- return app.author.join(', ').toLowerCase().indexOf(query) !== -1;
+ var authors = [];
+ _.each(app.author, function (author) {
+ if (typeof author === 'string') {
+ authors.push(author);
+ } else {
+ authors.push(author['@value']);
+ if (!_.isUndefined(author['@attributes']['homepage'])) {
+ authors.push(author['@attributes']['homepage']);
+ }
+ if (!_.isUndefined(author['@attributes']['mail'])) {
+ authors.push(author['@attributes']['mail']);
+ }
+ }
+ });
+ return authors.join(' ').toLowerCase().indexOf(query) !== -1;
}
return app.author.toLowerCase().indexOf(query) !== -1;
}));