callumacrae / jscolor Goto Github PK
View Code? Open in Web Editor NEW:red_circle: :large_blue_circle: JSColor + Bower
Home Page: http://jscolor.com/
:red_circle: :large_blue_circle: JSColor + Bower
Home Page: http://jscolor.com/
I noticed that the jscolor I get when using bower install ("bower install JSColor --save") does not work on the following element:
<p>Color: <input id="background-color" class="jscolor {onFineChange:'updateBackground(this)'}" value="6A9AAB"></p>
Which should be valid + works with the minified version I got from the site (the zip you can download from http://jscolor.com/)
I debugged it and saw that in this line in bind():
if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) {
It fails on the condition:
e[i].className.match(matchClass)
So I compared this part with the minified version I had from the site (I edited the names etc in the minified so it will be easier to compare):
var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?', 'i'); // from bower
var r = new RegExp('(^|\\s)('+jscolor.bindClass+')(\\s*(\\{[^}]*\\})|\\s|$)','i'); // minified
as you can see the regex is slightly different which I guess is the problem.
The bower version of jscolor have a wrong regex that don't identify valid input fields that are shown as examples in the site and are successfully identified by the (probably older) minified zip version.
Awesome lib btw ๐
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.