[Pkg-javascript-commits] [jquery-minicolors] 25/46: Fixed regex bug
David Prévot
taffit at moszumanska.debian.org
Sun Oct 25 17:18:26 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository jquery-minicolors.
commit ed30f47330cb50ccd92e40f284e7e3b32e62726d
Author: Cory LaViska <cory at abeautifulsite.net>
Date: Thu Sep 17 16:33:21 2015 -0400
Fixed regex bug
---
jquery.minicolors.js | 3 ++-
jquery.minicolors.min.js | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/jquery.minicolors.js b/jquery.minicolors.js
index 78d1099..7b64a6e 100644
--- a/jquery.minicolors.js
+++ b/jquery.minicolors.js
@@ -728,8 +728,9 @@
// Parses a string and returns a valid hex string when possible
function parseHex(string, expand) {
string = string.replace(/^#/g, '');
- if( !string.match(/^[A-F0-9]+/ig) ) return '';
+ if( !string.match(/^[A-F0-9]{3,6}/ig) ) return '';
if( string.length !== 3 && string.length !== 6 ) return '';
+ console.log(string);
if( string.length === 3 && expand ) {
string = string[0] + string[0] + string[1] + string[1] + string[2] + string[2];
}
diff --git a/jquery.minicolors.min.js b/jquery.minicolors.min.js
index 458c3f4..665be36 100644
--- a/jquery.minicolors.min.js
+++ b/jquery.minicolors.min.js
@@ -8,4 +8,4 @@
* @license: http://opensource.org/licenses/MIT
*
*/
-!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function($){function i(i,t){var a=$('<div class="minicolors" />'),o=$.minicolors.defaults,s=i.attr("data-format"),n=i.attr("data-keywords"),e=i.attr("data-opacity");i.data("minicolors-initialized")||(t=$.extend(!0,{},o,t),a.addClass("minicolors-theme-"+t.theme).toggleClass("minicolors-with-opacity",t.opacity).toggleClass("minicolors-no-data-uris" [...]
\ No newline at end of file
+!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function($){function i(i,t){var a=$('<div class="minicolors" />'),o=$.minicolors.defaults,s=i.attr("data-format"),n=i.attr("data-keywords"),e=i.attr("data-opacity");i.data("minicolors-initialized")||(t=$.extend(!0,{},o,t),a.addClass("minicolors-theme-"+t.theme).toggleClass("minicolors-with-opacity",t.opacity).toggleClass("minicolors-no-data-uris" [...]
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/jquery-minicolors.git
More information about the Pkg-javascript-commits
mailing list