mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-07-23 09:55:44 +00:00
CSS fix + preparation for the new peers photos
This commit is contained in:
parent
ad110a9837
commit
42272c9164
@ -37,7 +37,7 @@
|
|||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
}
|
}
|
||||||
#app-mailbox-peers li > a {
|
#app-mailbox-peers li > a {
|
||||||
display: block;
|
display: inline-block;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
-moz-box-sizing: border-box; box-sizing: border-box;
|
-moz-box-sizing: border-box; box-sizing: border-box;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
@ -32,6 +32,24 @@ function arrayUnique(arr) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Imported from ownCloud contact app
|
||||||
|
app.filter('peerColor', function() {
|
||||||
|
return function(input) {
|
||||||
|
// Check if core has the new color generator
|
||||||
|
if(typeof input.toHsl === 'function') {
|
||||||
|
var hsl = input.toHsl();
|
||||||
|
return 'hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)';
|
||||||
|
} else {
|
||||||
|
// If not, we use the old one
|
||||||
|
/* global md5 */
|
||||||
|
var hash = md5(input).substring(0, 4),
|
||||||
|
maxRange = parseInt('ffff', 16),
|
||||||
|
hue = parseInt(hash, 16) / maxRange * 256;
|
||||||
|
return 'hsl(' + hue + ', 90%, 65%)';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile',
|
app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile',
|
||||||
function ($scope, $interval, $timeout, $compile) {
|
function ($scope, $interval, $timeout, $compile) {
|
||||||
$scope.buttons = [
|
$scope.buttons = [
|
||||||
|
@ -10,8 +10,8 @@ use \OCA\OcSms\Lib\CountryCodes;
|
|||||||
<div id="app-mailbox-peers">
|
<div id="app-mailbox-peers">
|
||||||
<ul class="contact-list">
|
<ul class="contact-list">
|
||||||
<li ng-repeat="contact in contacts" peer-label="{{ contact.label }}">
|
<li ng-repeat="contact in contacts" peer-label="{{ contact.label }}">
|
||||||
<div class="ocsms-plavatar" style="background-image: url('{{ contact.avatar }}');" ng-show="contact.avatar != ''"></div>
|
<div class="ocsms-plavatar" style="background-image: url('{{ contact.avatar }}');" ng-show="contact.avatar !== undefined"></div>
|
||||||
<div class="ocsms-plavatar" ng-show="contact.avatar == ''"></div>
|
<div class="ocsms-plavatar" ng-show="contact.avatar === undefined" ng-style="{'background-color': (contact.label | peerColor)}"></div>
|
||||||
<a class="ocsms-plname" style="{{ contact.unread > 0 ? 'font-weight:bold;' : ''}}" mailbox-label="{{ contact.label }}" mailbox-navigation="{{ contact.nav }}" ng-click="loadConversation(contact);" href="#">{{ contact.label }}{{ contact.unread > 0 ? ' (' + contact.unread + ') ' : '' }}</a>
|
<a class="ocsms-plname" style="{{ contact.unread > 0 ? 'font-weight:bold;' : ''}}" mailbox-label="{{ contact.label }}" mailbox-navigation="{{ contact.nav }}" ng-click="loadConversation(contact);" href="#">{{ contact.label }}{{ contact.unread > 0 ? ' (' + contact.unread + ') ' : '' }}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user