[Pkg-javascript-commits] [jquery-minicolors] 02/09: Fixes #180

David Prévot taffit at moszumanska.debian.org
Sat Jan 9 21:06:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository jquery-minicolors.

commit b5b394773383b1dc6cba2be9a24cebed02024fa9
Author: Cory LaViska <cory at abeautifulsite.net>
Date:   Tue Nov 17 14:20:20 2015 -0500

    Fixes #180
---
 config.codekit           |  4 +++-
 index.html               | 19 +++++++++++--------
 jquery.minicolors.js     | 21 ++++++++-------------
 jquery.minicolors.min.js |  2 +-
 4 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/config.codekit b/config.codekit
index 1b02a62..b8f57b7 100644
--- a/config.codekit
+++ b/config.codekit
@@ -1,6 +1,6 @@
 {
 "CodeKitInfo": "This is a CodeKit 2.x project configuration file. It is designed to sync project settings across multiple machines. MODIFYING THE CONTENTS OF THIS FILE IS A POOR LIFE DECISION. If you do so, you will likely cause CodeKit to crash. This file is not useful unless accompanied by the project that created it in CodeKit 2. This file is not backwards-compatible with CodeKit 1.x. For more information, see: http:\/\/incident57.com\/codekit",
-"creatorBuild": "19051",
+"creatorBuild": "19076",
 "files": {
 	"\/bower.json": {
 		"fileType": 524288,
@@ -756,7 +756,9 @@
 	"typescriptAutoOutputPathStyle": 2,
 	"typescriptCreateDeclarationFile": 0,
 	"typescriptCreateSourceMap": 0,
+	"typescriptJSXMode": 0,
 	"typescriptMinifyOutput": 0,
+	"typescriptModuleResolutionType": 0,
 	"typescriptModuleType": 0,
 	"typescriptNoImplicitAny": 0,
 	"typescriptPreserveConstEnums": 0,
diff --git a/index.html b/index.html
index 6552deb..282444d 100644
--- a/index.html
+++ b/index.html
@@ -243,8 +243,8 @@
                             <br>
                             <input type="text" id="rgb" class="form-control demo" data-format="rgb" value="rgb(33, 147, 58)">
                             <span class="help-block">
-                                RGB input can be assigned by including the <code>data-format</code> attribute
-                                or by setting the <code>format</code> option to <code>rgb</code>.
+                                RGB input can be assigned by setting the <code>format</code> option
+                                to <code>rgb</code>.
                             </span>
                         </div>
                     </div>
@@ -254,8 +254,9 @@
                             <br>
                             <input type="text" id="rgba" class="form-control demo" data-format="rgb" data-opacity=".5" value="rgba(52, 64, 158, 0.5)">
                             <span class="help-block">
-                                RGB(A) input can be assigned by including the <code>data-format</code> and <code>data-opacity</code> attributes
-                                or by setting the <code>format</code> option to <code>rgb</code> and <code>opacity</code> option to <code>true</code>.
+                                RGB(A) input can be assigned by setting the <code>format</code>
+                                option to <code>rgb</code> and <code>opacity</code> option to
+                                <code>true</code>.
                             </span>
                         </div>
                     </div>
@@ -272,8 +273,9 @@
                             <br>
                             <input type="text" id="opacity" class="form-control demo" data-opacity=".5" value="#766fa8">
                             <span class="help-block">
-                                Opacity can be assigned by including the <code>data-opacity</code> attribute
-                                or by setting the <code>opacity</code> option to <code>true</code>.
+                                Opacity can be assigned by including the <code>data-opacity</code>
+                                attribute or by setting the <code>opacity</code> option to
+                                <code>true</code>.
                             </span>
                         </div>
                     </div>
@@ -283,8 +285,9 @@
                             <br>
                             <input type="text" id="keywords" class="form-control demo" data-keywords="transparent, initial, inherit" value="transparent">
                             <span class="help-block">
-                                CSS-wide keywords can be assigned by including the <code>data-keywords</code> attribute
-                                or by setting the <code>keywords</code> option to a comma-separated list of valid keywords: <code>transparent, initial, inherit</code>.<br />
+                                CSS-wide keywords can be assigned by setting the <code>keywords</code>
+                                option to a comma-separated list of valid keywords: <code>transparent,
+                                initial, inherit</code>.
                             </span>
                         </div>
                     </div>
diff --git a/jquery.minicolors.js b/jquery.minicolors.js
index 6daaa51..54694de 100644
--- a/jquery.minicolors.js
+++ b/jquery.minicolors.js
@@ -148,8 +148,6 @@
 
         var minicolors = $('<div class="minicolors" />'),
             defaults = $.minicolors.defaults,
-            format = input.attr('data-format'),
-            keywords = input.attr('data-keywords'),
             opacity = input.attr('data-opacity');
 
         // Do nothing if already initialized
@@ -172,10 +170,10 @@
         }
 
         // Input size
-        if( format === 'rgb' ) {
-            $input_size = opacity ? '25' : '20';
+        if( settings.format === 'rgb' ) {
+            $input_size = settings.opacity ? '25' : '20';
         } else {
-            $input_size = keywords ? '11' : '7';
+            $input_size = settings.keywords ? '11' : '7';
         }
 
         // The input
@@ -364,8 +362,6 @@
         var hue, saturation, brightness, x, y, r, phi,
 
             hex = input.val(),
-            format = input.attr('data-format'),
-            keywords = input.attr('data-keywords'),
             opacity = input.attr('data-opacity'),
 
             // Helpful references
@@ -477,7 +473,7 @@
             if( settings.opacity ) input.attr('data-opacity', opacity);
 
             // Set color string
-            if( format === 'rgb' ) {
+            if( settings.format === 'rgb' ) {
                 // Returns RGB(A) string
                 var rgb = hex2rgb(hex),
                     opacity = input.attr('data-opacity') === '' ? 1 : keepWithin( parseFloat( input.attr('data-opacity') ).toFixed(2), 0, 1 );
@@ -515,9 +511,8 @@
 
         var hex,
             hsb,
-            format = input.attr('data-format'),
-            keywords = input.attr('data-keywords'),
             opacity,
+            keywords,
             x, y, r, phi,
 
             // Helpful references
@@ -553,7 +548,7 @@
         hsb = hex2hsb(hex);
 
         // Get array of lowercase keywords
-        keywords = !keywords ? [] : $.map(keywords.split(','), function(a) {
+        keywords = !settings.keywords ? [] : $.map(settings.keywords.split(','), function(a) {
             return $.trim(a.toLowerCase());
         });
 
@@ -949,8 +944,8 @@
         // Update value on blur
         .on('blur.minicolors', '.minicolors-input', function() {
             var input = $(this),
-                keywords = input.attr('data-keywords'),
                 settings = input.data('minicolors-settings'),
+                keywords,
                 hex,
                 rgba,
                 swatchOpacity;
@@ -958,7 +953,7 @@
             if( !input.data('minicolors-initialized') ) return;
 
             // Get array of lowercase keywords
-            keywords = !keywords ? [] : $.map(keywords.split(','), function(a) {
+            keywords = !settings.keywords ? [] : $.map(settings.keywords.split(','), function(a) {
                 return $.trim(a.toLowerCase());
             });
 
diff --git a/jquery.minicolors.min.js b/jquery.minicolors.min.js
index fd2125c..120b942 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 o=$('<div class="minicolors" />'),a=$.minicolors.defaults,s=i.attr("data-opacity");i.data("minicolors-initialized")||(t=$.extend(!0,{},a,t),o.addClass("minicolors-theme-"+t.theme).toggleClass("minicolors-with-opacity",t.opacity).toggleClass("minicolors-no-data-uris",t.dataUris!==!0),void 0!==t.position&&$.each(t.po [...]
\ 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