Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

Use core color generator if available #1425

Merged
merged 1 commit into from
Apr 17, 2016

Conversation

skjnldsv
Copy link
Contributor

All in the title!
If the core color generator offers the string.toHsl() function, then we're using it for the accounts colors! :)

refs owncloud/core#23768
fix #1423

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @Gomez, @ChristophWurst and @jancborchardt to be potential reviewers

@ChristophWurst
Copy link
Contributor

@skjnldsv please have a look at the failing code style checks

$ sh -c "if [ '$TEST_JS' = 'TRUE' ]; then grunt; fi"

Running "jscs:src" (jscs) task

requireSpaceAfterKeywords: One space required after "if" keyword at js/views/helper.js :

    35 | Handlebars.registerHelper('accountColor', function(account) {

    36 |  var hash = md5(account);

    37 |  if(typeof hash.toHsl === 'function') {

------------^

    38 |   var hsl = hash.toHsl();

    39 |   return new Handlebars.SafeString('hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)');

requireSpaceBeforeBinaryOperators: Operator + should not stick to preceding expression at js/views/helper.js :

    37 |  if(typeof hash.toHsl === 'function') {

    38 |   var hsl = hash.toHsl();

    39 |   return new Handlebars.SafeString('hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)');

--------------------------------------------------^

    40 |  } else {

    41 |   var maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16);

requireSpaceAfterBinaryOperators: Operator + should not stick to following expression at js/views/helper.js :

    37 |  if(typeof hash.toHsl === 'function') {

    38 |   var hsl = hash.toHsl();

    39 |   return new Handlebars.SafeString('hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)');

---------------------------------------------------^

    40 |  } else {

    41 |   var maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16);

requireSpaceBeforeBinaryOperators: Operator + should not stick to preceding expression at js/views/helper.js :

    37 |  if(typeof hash.toHsl === 'function') {

    38 |   var hsl = hash.toHsl();

    39 |   return new Handlebars.SafeString('hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)');

---------------------------------------------------------^

    40 |  } else {

    41 |   var maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16);

requireSpaceAfterBinaryOperators: Operator + should not stick to following expression at js/views/helper.js :

    37 |  if(typeof hash.toHsl === 'function') {

    38 |   var hsl = hash.toHsl();

    39 |   return new Handlebars.SafeString('hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)');

----------------------------------------------------------^

    40 |  } else {

    41 |   var maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16);

requireSpaceBeforeBinaryOperators: Operator + should not stick to preceding expression at js/views/helper.js :

    37 |  if(typeof hash.toHsl === 'function') {

    38 |   var hsl = hash.toHsl();

    39 |   return new Handlebars.SafeString('hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)');

--------------------------------------------------------------^

    40 |  } else {

    41 |   var maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16);

requireSpaceAfterBinaryOperators: Operator + should not stick to following expression at js/views/helper.js :

    37 |  if(typeof hash.toHsl === 'function') {

    38 |   var hsl = hash.toHsl();

    39 |   return new Handlebars.SafeString('hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)');

---------------------------------------------------------------^

    40 |  } else {

    41 |   var maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16);

requireSpaceBeforeBinaryOperators: Operator + should not stick to preceding expression at js/views/helper.js :

    37 |  if(typeof hash.toHsl === 'function') {

    38 |   var hsl = hash.toHsl();

    39 |   return new Handlebars.SafeString('hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)');

---------------------------------------------------------------------^

    40 |  } else {

    41 |   var maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16);

requireSpaceAfterBinaryOperators: Operator + should not stick to following expression at js/views/helper.js :

    37 |  if(typeof hash.toHsl === 'function') {

    38 |   var hsl = hash.toHsl();

    39 |   return new Handlebars.SafeString('hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)');

----------------------------------------------------------------------^

    40 |  } else {

    41 |   var maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16);

requireSpaceBeforeBinaryOperators: Operator + should not stick to preceding expression at js/views/helper.js :

    37 |  if(typeof hash.toHsl === 'function') {

    38 |   var hsl = hash.toHsl();

    39 |   return new Handlebars.SafeString('hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)');

---------------------------------------------------------------------------^

    40 |  } else {

    41 |   var maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16);

requireSpaceAfterBinaryOperators: Operator + should not stick to following expression at js/views/helper.js :

    37 |  if(typeof hash.toHsl === 'function') {

    38 |   var hsl = hash.toHsl();

    39 |   return new Handlebars.SafeString('hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)');

----------------------------------------------------------------------------^

    40 |  } else {

    41 |   var maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16);

requireSpaceBeforeBinaryOperators: Operator + should not stick to preceding expression at js/views/helper.js :

    37 |  if(typeof hash.toHsl === 'function') {

    38 |   var hsl = hash.toHsl();

    39 |   return new Handlebars.SafeString('hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)');

----------------------------------------------------------------------------------^

    40 |  } else {

    41 |   var maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16);

requireSpaceAfterBinaryOperators: Operator + should not stick to following expression at js/views/helper.js :

    37 |  if(typeof hash.toHsl === 'function') {

    38 |   var hsl = hash.toHsl();

    39 |   return new Handlebars.SafeString('hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)');

-----------------------------------------------------------------------------------^

    40 |  } else {

    41 |   var maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16);

>> 13 code style errors found!

@ChristophWurst
Copy link
Contributor

👍 looks good otherwise and works

@skjnldsv
Copy link
Contributor Author

@ChristophWurst, my bad! Should be good now :)

@ChristophWurst
Copy link
Contributor

@skjnldsv thanks!

@ChristophWurst ChristophWurst merged commit 84979b2 into master Apr 17, 2016
@skjnldsv skjnldsv deleted the use-core-color-generator branch April 17, 2016 09:51
@skjnldsv
Copy link
Contributor Author

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants