[Pkg-javascript-commits] [jquery-minicolors] 03/09: Adds supports for 'use strict' - fixes #179
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 c5156df595291345f109c67995a0815eaabdd4bd
Author: Cory LaViska <cory at abeautifulsite.net>
Date: Tue Nov 17 14:44:45 2015 -0500
Adds supports for 'use strict' - fixes #179
---
jquery.minicolors.js | 21 ++++++++++++++-------
jquery.minicolors.min.js | 2 +-
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/jquery.minicolors.js b/jquery.minicolors.js
index 54694de..7b95f37 100644
--- a/jquery.minicolors.js
+++ b/jquery.minicolors.js
@@ -23,6 +23,8 @@
/* jshint ignore:end */
}(function ($) {
+ 'use strict';
+
// Defaults
$.minicolors = {
defaults: {
@@ -148,7 +150,8 @@
var minicolors = $('<div class="minicolors" />'),
defaults = $.minicolors.defaults,
- opacity = input.attr('data-opacity');
+ opacity = input.attr('data-opacity'),
+ size;
// Do nothing if already initialized
if( input.data('minicolors-initialized') ) return;
@@ -171,9 +174,9 @@
// Input size
if( settings.format === 'rgb' ) {
- $input_size = settings.opacity ? '25' : '20';
+ size = settings.opacity ? '25' : '20';
} else {
- $input_size = settings.keywords ? '11' : '7';
+ size = settings.keywords ? '11' : '7';
}
// The input
@@ -181,7 +184,7 @@
.addClass('minicolors-input')
.data('minicolors-initialized', false)
.data('minicolors-settings', settings)
- .prop('size', $input_size)
+ .prop('size', size)
.wrap(minicolors)
.after(
'<div class="minicolors-panel minicolors-slider-' + settings.control + '">' +
@@ -363,6 +366,7 @@
hex = input.val(),
opacity = input.attr('data-opacity'),
+ value,
// Helpful references
minicolors = input.parent(),
@@ -513,6 +517,8 @@
hsb,
opacity,
keywords,
+ alpha,
+ value,
x, y, r, phi,
// Helpful references
@@ -793,13 +799,13 @@
// Checks if a string is a valid RGB(A) string
function isRgb(string) {
- rgb = string.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
+ var rgb = string.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
return (rgb && rgb.length === 4) ? true : false;
}
// Function to get alpha from a RGB(A) string
function getAlpha(rgba) {
- rgba = rgba.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+(\.\d{1,2})?|\.\d{1,2})[\s+]?/i);
+ var rgba = rgba.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+(\.\d{1,2})?|\.\d{1,2})[\s+]?/i);
return (rgba && rgba.length === 6) ? rgba[4] : '1';
}
@@ -948,7 +954,8 @@
keywords,
hex,
rgba,
- swatchOpacity;
+ swatchOpacity,
+ value;
if( !input.data('minicolors-initialized') ) return;
diff --git a/jquery.minicolors.min.js b/jquery.minicolors.min.js
index 120b942..5e5d7c9 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 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
+!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function($){"use strict";function i(i,t){var o=$('<div class="minicolors" />'),a=$.minicolors.defaults,s=i.attr("data-opacity"),n;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.positi [...]
\ 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