mirror of
https://github.com/nextcloud/ocsms.git
synced 2026-08-21 21:32:59 +00:00
CSS fix + preparation for the new peers photos
This commit is contained in:
@@ -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',
|
||||
function ($scope, $interval, $timeout, $compile) {
|
||||
$scope.buttons = [
|
||||
|
||||
Reference in New Issue
Block a user