diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2018-08-27 01:13:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-27 01:13:52 +0300 |
commit | d3f4beb1665050a60f385c4486e5289ca95844c4 (patch) | |
tree | 9606ec43f9df60f4006a2734cbbda086fabb8969 | |
parent | 7fa07ac4959ac97efbe63e30cce0dc1cda91604d (diff) | |
parent | efb30e25730441dce92beadccced585826163a55 (diff) |
Merge pull request #1158 from nextcloud/bugfix/noid/use-search-term-as-room-name-againv3.99.12
Use the search term as conversation name again
-rw-r--r-- | appinfo/info.xml | 2 | ||||
-rw-r--r-- | css/style.scss | 12 | ||||
-rw-r--r-- | js/app.js | 39 | ||||
-rw-r--r-- | js/views/roomlistview.js | 4 |
4 files changed, 39 insertions, 18 deletions
diff --git a/appinfo/info.xml b/appinfo/info.xml index 9ba15706e..84ff56540 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -17,7 +17,7 @@ And in the works for the [coming versions](https://github.com/nextcloud/spreed/m ]]></description> - <version>3.99.11</version> + <version>3.99.12</version> <licence>agpl</licence> <author>Daniel Calviño Sánchez</author> diff --git a/css/style.scss b/css/style.scss index ac36f077c..b614ab5eb 100644 --- a/css/style.scss +++ b/css/style.scss @@ -127,14 +127,14 @@ margin: 0 !important; } -.select2-result .icon-contacts-dark.avatar, -.select2-result .icon-add.avatar, -#app-navigation .icon-contacts-dark, -#app-navigation .app-navigation-entry-link .icon-public, -#app-navigation .icon-add { - border-radius: 0; +.select2-result .icon-contacts.avatar, +.select2-result .icon-public-white.avatar, +#app-navigation .icon-contacts, +#app-navigation .app-navigation-entry-link .icon-public-white { + border-radius: 50%; width: 32px; height: 32px; + background-color: var(--color-background-darker); } #app-navigation .favorite-mark { @@ -87,7 +87,7 @@ itemId: 'new', shareTypes: [OC.Share.SHARE_TYPE_USER, OC.Share.SHARE_TYPE_GROUP] }; - }, + }.bind(this), results: function (response) { // TODO improve error case if (response.ocs.data === undefined) { @@ -106,11 +106,32 @@ //Add custom entry to create a new empty group or public room if (OCA.SpreedMe.app._searchTerm === '') { - results.unshift({ id: "create-public-room", displayName: t('spreed', 'New public conversation'), type: "createPublicRoom"}); - results.unshift({ id: "create-group-room", displayName: t('spreed', 'New group conversation'), type: "createGroupRoom"}); + results.unshift({ + id: "create-public-room", + displayName: t('spreed', 'New public conversation'), + type: "createPublicRoom" + }); + results.unshift({ + id: "create-group-room", + displayName: t('spreed', 'New group conversation'), + type: "createGroupRoom" + }); } else { - results.push({ id: "create-group-room", displayName: t('spreed', 'New group conversation'), type: "createGroupRoom"}); - results.push({ id: "create-public-room", displayName: t('spreed', 'New public conversation'), type: "createPublicRoom"}); + var shortenedName = OCA.SpreedMe.app._searchTerm; + if (OCA.SpreedMe.app._searchTerm.length > 25) { + shortenedName = shortenedName.substring(0, 25) + '…'; + } + + results.push({ + id: "create-group-room", + displayName: shortenedName, + type: "createGroupRoom" + }); + results.push({ + id: "create-public-room", + displayName: t('spreed', '{name} (public)', { name: shortenedName }), + type: "createPublicRoom" + }); } return { @@ -123,12 +144,12 @@ callback({id: element.val()}); }, formatResult: function (element) { - if ((element.type === "createGroupRoom") || (element.type === "createPublicRoom")) { - return '<span><div class="avatar icon-add"></div>' + escapeHTML(element.displayName) + '</span>'; + if (element.type === "createPublicRoom") { + return '<span><div class="avatar icon-public-white"></div>' + escapeHTML(element.displayName) + '</span>'; } - if (element.type === 'group') { - return '<span><div class="avatar icon-contacts-dark"></div>' + escapeHTML(element.displayName) + '</span>'; + if (element.type === "createGroupRoom" || element.type === 'group') { + return '<span><div class="avatar icon-contacts"></div>' + escapeHTML(element.displayName) + '</span>'; } return '<span><div class="avatar" data-user="' + escapeHTML(element.id) + '" data-user-display-name="' + escapeHTML(element.displayName) + '"></div>' + escapeHTML(element.displayName) + '</span>'; diff --git a/js/views/roomlistview.js b/js/views/roomlistview.js index d165673ac..0ad970e88 100644 --- a/js/views/roomlistview.js +++ b/js/views/roomlistview.js @@ -203,13 +203,13 @@ this.$el.find('.public-room').removeClass('public-room').addClass('private-room'); _.each(this.$el.find('.avatar'), function(a) { - $(a).removeClass('icon-public').addClass('icon-contacts-dark'); + $(a).removeClass('icon-public-white').addClass('icon-contacts'); }); } else if (this.model.get('type') === ROOM_TYPE_PUBLIC_CALL) { // Public room this.$el.find('.private-room').removeClass('private-room').addClass('public-room'); _.each(this.$el.find('.avatar'), function(a) { - $(a).removeClass('icon-contacts-dark').addClass('icon-public'); + $(a).removeClass('icon-contacts').addClass('icon-public-white'); }); } }, |