calendar icon indicating copy to clipboard operation
calendar copied to clipboard

Richer Calendar colors options

Open elioqoshi opened this issue 9 years ago • 15 comments

The owncloud calendar app currently offers 33 colors to assign to calendars. I have linked Thunderbird's lightning calendar addon via CalDav with owncloud and I'm able to choose any color from the RGB spectrum for calendars in Thunderbird, while my choice is limited to 33 colors in owncloud.

This might not be something major, but sometimes it's useful to have a specific color code for a calendar (I separate my calendars by organizations for example).

Does this make sense?

elioqoshi avatar Feb 08 '16 12:02 elioqoshi

Let's use an html5 color input. Webkit Nightly builds already supports it, so Safari will probably support it somewhat soon as well

http://caniuse.com/#feat=input-color

georgehrke avatar Feb 29 '16 17:02 georgehrke

Still no support for input color in safari 9.1 :disappointed:

georgehrke avatar Mar 22 '16 10:03 georgehrke

Putting on hold till Safari supports input color

georgehrke avatar Apr 11 '16 13:04 georgehrke

Let's just check if input color is supported and only show the advanced input otherwise.

georgehrke avatar May 10 '16 13:05 georgehrke

Hello. I'm following this issue with a lot of interest. I'm also annoyed by the lack of available colors, so I'm very impatient to be able to add one with a specific color code. Meanwhile, may I ask something ? Why here elioqoshi says that "owncloud calendar app currently offers 33 colors to assign to calendars" ? Personally, I can only choose between 9 colors. Have I misunderstood something ? (OC 9.1 ; Calendar app 1.3.3)

laspic avatar Sep 02 '16 14:09 laspic

There's now a random color button. https://github.com/owncloud/calendar/pull/701

tcitworld avatar Sep 03 '16 07:09 tcitworld

I've seen that. Nice improvement, even if it doesn't match with my needs (in particularly, I've never managed with it to get a gray and, from what i can see, the "random" always choose a new color in the same pastel palette). So, it's still easier for me to personalize color agenda via PhpMyAdmin. What about these 33 colors ?

laspic avatar Sep 03 '16 07:09 laspic

For me, the random button just goes through the preselected standard colors, it does not add more colors. I think the 33 colors refer to an earlier version of owncloud. In the current version 9.0.5, I get 8 (not 9) colors in the color picker. Btw, great workaround to go in via phpMyAdmin and adjust colors there :)

d-tamm avatar Oct 15 '16 09:10 d-tamm

There used to be a workaround a few versions ago. Users could edit /var/www/owncloud/apps/calendar/lib/calendar.php manually, but this file seems to have disappeared. Does anyone know where this file is now? I still have leftover custom colours, but I can't find them anywhere.

protist avatar Dec 02 '16 23:12 protist

You have to put them to ./apps/calendar/js/public/app.js somewhere around line 5875. About half a year ago it was also possible to do this via a theme. But it seems to be not supported anymore.

Also here the random button just jumps randomly in these 8 colors. So quite useless in my point of view.

Defining more colors like in PullRequest #60 was not accepted, so it would be very nice to have some kind of arbitrary color picker. For me it would be sufficient, if I could define my own set of colors via a (company) theme again.

EtlamGit avatar Dec 11 '16 17:12 EtlamGit

Thanks @EtlamGit. I found the line, and modified it as below

--- /var/www/owncloud/apps/calendar/js/public/app.js.factory_default	2016-12-12 19:52:38.109146413 +1100
+++ /var/www/owncloud/apps/calendar/js/public/app.js	2016-12-12 20:03:00.848151134 +1100
@@ -5871,7 +5871,7 @@
 			self.colors.push(self.rgbToHex(self._hslToRgb(hsl)));
 		});
 	} else {
-		this.colors = ['#31CC7C', '#317CCC', '#FF7A66', '#F1DB50', '#7C31CC', '#CC317C', '#3A3B3D', '#CACBCD'];
+                this.colors = ['#377EB8', '#4DAF4A', '#E41A1C', '#FF7F00', '#984EA3', '#17E3DD', '#999999', '#555555'];
 	}
 });

However, after restarting apache2, and even restarting for good measure, the colour picker looked the same as before.

I also agree that a arbitrary colour picker would be very useful.

protist avatar Dec 12 '16 09:12 protist

I always fall into that trap also... This is caused by the fact, that scripts (.js) and style (.css) are cached in your browser, but the content (*.html, *.php) not. Just press CTRL-F5 to force a complete reload. Restarting apache is not necessary. You could also change this code while being logged into your cloud.

EtlamGit avatar Dec 12 '16 15:12 EtlamGit

In the past I've held Shift and clicked the refresh button. However, I tried both of these, and the colour picker still didn't change. Searching the web suggested that both of these should do the same thing.

protist avatar Dec 12 '16 20:12 protist

Yes, you are right. My solution is working only with the 9.0.x branch. The latest 9.1.x branch is using HSL defined default colors. So you have to do a two-step to get 'your' colors:

  • a little above the line I mentioned earlier is the declaration var hashValues [...]. Remove all colors there (and revert your previous changes 6 lines below also.)
  • insert your colors near line 5743 where you find another this.colors

EtlamGit avatar Dec 17 '16 11:12 EtlamGit

@EtlamGit Apologies for the delay in replying. Hope you had a good holiday too! 😁 Thank you very much for your response; it works perfectly for me. Cheers.

protist avatar Jan 04 '17 10:01 protist