[Pkg-javascript-commits] [jquery-minicolors] 23/46: Fix hex parsing so it doesn't conflict with entering keywords
David Prévot
taffit at moszumanska.debian.org
Sun Oct 25 17:18:25 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 3e12bbb2d37e797ccbcca22804c8f9e8f8cd3e3f
Author: Cory LaViska <cory at abeautifulsite.net>
Date: Thu Sep 17 16:21:10 2015 -0400
Fix hex parsing so it doesn't conflict with entering keywords
---
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 09e2802..e33ccab 100644
--- a/jquery.minicolors.js
+++ b/jquery.minicolors.js
@@ -727,7 +727,8 @@
// Parses a string and returns a valid hex string when possible
function parseHex(string, expand) {
- string = string.replace(/[^A-F0-9]/ig, '');
+ string = string.replace(/^#/g, '');
+ if( !string.match(/^[A-F0-9]+/ig) ) return 'nope';
if( string.length !== 3 && string.length !== 6 ) return '';
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 94938d3..075b9df 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,n=i.attr("data-format"),s=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