? Success
Pull Request for # 7401

User tests: Successful: Unsuccessful:

avatar JoomliC
JoomliC
31 Jul 2015

This PR is currently in stand-by, after @wilsonge suggestion, i have opened a PR to propose this change directly to the library minicolors.js : claviska/jquery-minicolors#170
As Joomla is using currently an outdated version of this script (2013), i have udpated my changes of the minicolors.js to the latest minicolors.js version.
So... waiting for news...

In the same time, the bug fix for simplecolors.js with chosen.js is now moved to an new PR : #7855


First, this PR gives a solution to this issue : http://issues.joomla.org/tracker/joomla-cms/7401

Secondly, it fixes an issue with simplecolors picker (control=simple) due to chosen.js file changes in Joomla 3.2.3... (and another minor issue with input value and RTL)

And then, this one adds the possibility to enable an alpha slider in the color picker, and to save a rgba value for input.

Note : This PR is B/C and changes nothing to the color form field in place.

New XML attributes

keywords

(optional) allows to one or more valid keyword(s), comma separated : transparent,inherit,initial (Note: none is allowed as an entry (as user often think it's a valid keyword), but will be replaced by transparent)

XML: keywords="none,transparent,inherit,initial"
Usage: enter the keyword in the field input (script will allow only keywords in the xml attribute)

joomla_color_keywords

alpha

(optional) show or hide the opacity slider (true or false). If true, the color picker will return a rgba color.

XML: alpha="true"
Usage: Pick the opacity in the slider

joomla_color_alpha_picker


  • Bug with simplecolors.js
    This bug fix is moved to a new PR : #7855 Fix issue with simplecolors.js (since 3.2.3, bug due to chosen.js change) joomla_color_simple_fix

RTL support

Add RTL support. If position is default, the picker will be on the left if RTL language (currently it's right on LTR).
The input value was converted to RTL before, but with issue in some cases. To prevent this, the input value will always be LTR as it is not to be translated or converted as a CSS code value.
joomla_color_picker_rtl

Test instructions:

Add these fields to the settings part of an xml file of one extension (eg. template). Then go to that extension settings in the admin and test the different color fields.

<field name="color1" type="color" label="Color field" />
<field name="color2" type="color" label="Color field (WITH validate=color)" validate="color" />
<field name="color3" type="color" label="With keywords (NO validate=color)" keywords="none,transparent,inherit,initial" />
<field name="color4" type="color" label="With alpha (NO validate=color)" alpha="true" />
<field name="color5" type="color" label="With keywords and alpha (NO validate=color)" alpha="true" keywords="none,transparent,inherit,initial" />
<field name="color6" type="color" label="With keywords and alpha (WITH validate=color)" validate="color" alpha="true" keywords="none,transparent,inherit,initial" />
<field name="color7" type="color" label="Simple: Custom Color List" default="transparent" control="simple" colors="transparent,#FFFFFF,#000000,#FF0000,#00FF00,#0000FF,#00FFFF,#FF00FF,#FFFF00" />

This PR is based on the great work already done by @nonumber (#807) to integrate the great color picker created by @claviska (maybe some changes could interest you ?)

As the Joomla! Docs is not "yet" updated (but i will soon...) for this form field input, you can check here for all other attributes already available : #807 (Thanks Peter! ;-) )

avatar JoomliC JoomliC - open - 31 Jul 2015
avatar JoomliC JoomliC - change - 31 Jul 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 31 Jul 2015
Labels Added: ?
avatar brianteeman brianteeman - change - 1 Aug 2015
Category Libraries
avatar brianteeman brianteeman - change - 1 Aug 2015
Title
Color form field type: new XML attributes + bug fix + RTL support
Color form field type: new XML attributes + bug fix + RTL support
avatar wilsonge
wilsonge - comment - 1 Aug 2015

Rather than immediately hacking the JS library up, please can you investigate contributing these fixes back to the library (https://github.com/claviska/jquery-minicolors/).

If the fixes don't get accepted there then we'll come back and see if we want to do it ourselves or not. But want to move away from this habit where we hack up 3rd party libraries and make them hard to update.

avatar brianteeman brianteeman - change - 1 Aug 2015
Rel_Number 0 7401
Relation Type Pull Request for
avatar JoomliC
JoomliC - comment - 1 Aug 2015

@wilsonge Thanks George, yes i understand.
I can see to contribute the minicolors script, as i think i can do this with no issue for this script, and in the same time, it could answer to a requested feature already opened for this library (claviska/jquery-minicolors#75)

So, should i split this PR into new separated PR for issue not related to this script ? (bug with simple picker, issue with 'none' value, as well as issue with RTL language ?) 1 for each issue ?
And about the simple picker which is already a "barely adapted" version of 'Very simple jQuery Color Picker', is it possible to apply fix for 'none' there too (to replace none by transparent, to keep w3c validated) ?

Thank you!
Cyril

avatar cr2a-graphique
cr2a-graphique - comment - 28 Aug 2015

:+1:

Is this PR go on next maj ? other whise which version include this PR ?

avatar Bakual
Bakual - comment - 28 Aug 2015

It has to be tested first. If no issues arise and review is fine, it can go into the next major.
Currently it misses any tests and as such it will not be merged.

If you want this happen. Please test it ☺

avatar JoomliC
JoomliC - comment - 28 Aug 2015

@Bakual & @cr2a-graphique :
This is not really to be tested yet, as @wilsonge requested to propose the changes to the original library.

Rather than immediately hacking the JS library up, please can you investigate contributing these fixes back to the library (https://github.com/claviska/jquery-minicolors/). If the fixes don't get accepted there then we'll come back and see if we want to do it ourselves or not. But want to move away from this habit where we hack up 3rd party libraries and make them hard to update.

Note that i have processed a few changes (and simplify the code in order to not be Joomla only, but for global use), and in a few days, i will create a PR for minicolors script : https://github.com/claviska/jquery-minicolors/
If this one is accepted, so i will be able to propose this PR, with the new official script (no hack... i hope, as it is a feature request by minicolors library users too!).

So, in a few days, i will divide this PR into separated ones :

  • one for bug fixes concerning simple colors picker
  • one about RTL fixes
  • one in "standby" for the opacity and keywords options

Will keep you informed here ;-)

Cyril

avatar cr2a-graphique
cr2a-graphique - comment - 31 Aug 2015

so sory @JoomliC but how i can test it, and send you result ?

avatar JoomliC
JoomliC - comment - 10 Sep 2015

@cr2a-graphique Sorry for slow response...

This PR is not yet ready to be tested.
First, as requested by @wilsonge it's better to propose this change and improvement to the original library.
This proposal is now created : claviska/jquery-minicolors#170

I'm waiting to get news from the developer of the minicolors.js script, and will update this PR when i will have an answer.

Thank you for your patience!

Note: i have changed the script for the PR pushed to the jquery-minicolors project, to allow a real flexibility and to work outside Joomla!

avatar wilsonge
wilsonge - comment - 10 Sep 2015

Thankyou :)

avatar brianteeman
brianteeman - comment - 10 Mar 2016

@JoomliC Any update on this?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7602.

avatar brianteeman brianteeman - change - 10 Mar 2016
The description was changed
avatar brianteeman brianteeman - change - 10 Mar 2016
Category Libraries Fields Libraries
avatar wilsonge
wilsonge - comment - 10 Mar 2016

The developer of the minicolors plugin merged in the pull request adding this functionality - so we should just need to update the PR with the new version of the library (instead of the using the hacked copy) and we are good to go

avatar JoomliC
JoomliC - comment - 10 Mar 2016

@brianteeman Soon! ;-)

I will close this one when i will open a new one with the update of the library jquery-mini-colors (all changes accepted and improved with help of its developer, and final version of it ok since January)) and another one(s) about not directly related issue (as was removed from here, and already merged) to separate clearly the issues.
I have planned to do this this month (need a day for new integration, and testing as well for B/C and new attributes), and don't want to wait more, as it is still fresh in my mind :smile:

Thank you!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7602.

avatar brianteeman
brianteeman - comment - 10 Mar 2016

Cool @JoomliC over to you

avatar JoomliC
JoomliC - comment - 10 Mar 2016
The developer of the minicolors plugin merged in the pull request adding this functionality - so we should just need to update the PR with the new version of the library (instead of the using the hacked copy) and we are good to go

Yes about my main PR, but some other changes and improvements done later in separate PRs.
Thanks to a good communication with the developer of minicolors, we were able to get to a good ending solution!
i have just to update the library, and then review the integration (as changes from my original PR in the way to activate new attributes) ;-)

avatar brianteeman
brianteeman - comment - 29 Apr 2016

Closed please see #10129

avatar brianteeman brianteeman - change - 29 Apr 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-04-29 10:46:05
Closed_By brianteeman
avatar brianteeman brianteeman - close - 29 Apr 2016
avatar brianteeman brianteeman - close - 29 Apr 2016
avatar JoomliC
JoomliC - comment - 29 Apr 2016

Thanks @brianteeman ! (you closed it before i did ;-) )

Add a Comment

Login with GitHub to post a comment