User tests: Successful: Unsuccessful:
This PR introduces a new vanilla Javascript colour picker and removes both the old jQuery pickers. This is still a WIP but I'm trying to keep B/C as much as possible. It does remove the simplecolours, but if you are currently using a colour form field, it should still work as expected with this.
Have a mess around with the picker and also test to see if the picker get initiated with subform fields.
Normal (defaults to HEX mode)
<field name="colour1" type="color" label="Colour" default="#000000" />
RGB Mode
<field name="colour2" type="color" label="Colour" default="rgb(0,0,0)" format="rgb" />
RGBA Mode
<field name="colour3" type="color" label="Colour" default="rgba(0,0,0,.5)" format="rgba" />
Category | ⇒ | JavaScript Repository Layout Libraries |
To be honest, this sounds like NIH syndrom to me. Or a deep aversion against JQuery.
Which I both don't can't follow.
Imho, if you want to get rid of that JQuery colorpicker, you should look for an extisting solution based on the HTML5 color input (http://caniuse.com/#feat=input-color) and some polyfill for the IE11 and Safari (caniuse suggests https://github.com/jonstipe/color-polyfill but that requires JQuery as well g).
Labels |
Added:
?
|
The link to the repo you added is 6 years old, requires jQuery, jQuery UI and Modernizr....so no thanks
I didn't say to use that. It's a link from caniuse I just shared. There may be others.
This is based on a script written by MDN. Not my own, just changes, and it will be added to a separate repo, so it can be maintained properly with the license that came with the original script.
As soon as you change anything, it becomes our own fork and we need to maintain it. Doesn't matter if it's in a separate repo or not. You're then just hiding the fact that you hack a 3rd party
We were discussing this last night and it sound like he had some reasoning to fork it and basically make it his own project. I'll let him explain his thinking a bit more, but at the first sound of it it wasn't just change for the sake of change.
This isn't a library that's on Github (that I know of), it's just a script that MDN published on Codepen and JSFiddle, therefore NOT maintained like other libraries are on Github. It had a hellish amount of rubbish, such as drag and drop, showing different shades of the colour selected, etc....which has now been removed.
Take a look for yourselves to see what I mean: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Colors/Color_picker_tool
I agree totally when it comes to libraries. In this particular case it's not really a library but rather a sample script one could use to build off of. Had they released it as a library we'd be having a different discussion, but for me this is one of those cases where it doesn't exactly fall into the "thou shalt not core hack your dependencies" preaching.
Status | New | ⇒ | Pending |
Build | staging | ⇒ | 4.0-dev |
Milestone |
Added: |
Milestone |
Added: |
Closing as I'm going to make this a web component
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-08-24 13:57:14 |
Closed_By | ⇒ | C-Lodder |
So this removes an external maintained JS (https://github.com/claviska/jquery-minicolors) in favor of an homebrewn one? Just because it requires JQuery?
Or do I miss something?