pick-a-color-rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/LICENSE +21 -0
- data/README.md +24 -0
- data/lib/pick-a-color-rails.rb +6 -0
- data/lib/pick-a-color-rails/engine.rb +6 -0
- data/lib/pick-a-color-rails/version.rb +6 -0
- data/pick-a-color-rails.gemspec +21 -0
- data/vendor/assets/javascripts/pick-a-color.min.js +2 -0
- data/vendor/assets/stylesheets/pick-a-color.min.css +85 -0
- metadata +120 -0
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2013 Lauren Sperber and Broadstreet Ads
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person
|
4
|
+
obtaining a copy of this software and associated documentation
|
5
|
+
files (the "Software"), to deal in the Software without
|
6
|
+
restriction, including without limitation the rights to use, copy,
|
7
|
+
modify, merge, publish, distribute, sublicense, and/or sell copies
|
8
|
+
of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
16
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
18
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
19
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
21
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
pick-a-color-rails
|
2
|
+
==================
|
3
|
+
|
4
|
+
Rails gem version of Pick-a-Color JavaScript library = jQuery based color picker optimized for Twitter Bootstrap 3.
|
5
|
+
|
6
|
+
**Source:** https://github.com/lauren/pick-a-color
|
7
|
+
|
8
|
+
### How to Use
|
9
|
+
|
10
|
+
**Add into your Gemfile**
|
11
|
+
|
12
|
+
`gem 'pick-a-color-rails'`
|
13
|
+
|
14
|
+
**Add into your application.js**
|
15
|
+
|
16
|
+
`//= require pick-a-color.min`
|
17
|
+
|
18
|
+
**Add into your application.css**
|
19
|
+
|
20
|
+
`*= require pick-a-color.min`
|
21
|
+
|
22
|
+
**In your Rails directory run**
|
23
|
+
|
24
|
+
`bundle install`
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/pick-a-color-rails/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Jiri Kaipr"]
|
6
|
+
gem.email = ["jiri.kaipr@gmail.com"]
|
7
|
+
gem.description = %q{Provides Pick-a-Color JavaScript library for your Rails application. It's a jQuery color picker for Twitter Bootstrap 3. Source code: https://github.com/lauren/pick-a-color}
|
8
|
+
gem.homepage = "https://github.com/jkaipr/pick-a-color-rails"
|
9
|
+
gem.summary = gem.description
|
10
|
+
|
11
|
+
gem.name = "pick-a-color-rails"
|
12
|
+
gem.require_paths = ["lib"]
|
13
|
+
gem.files = `git ls-files`.split("\n")
|
14
|
+
gem.version = PickAColorRails::Rails::VERSION
|
15
|
+
gem.platform = Gem::Platform::RUBY
|
16
|
+
|
17
|
+
gem.add_dependency "jquery-rails"
|
18
|
+
gem.add_dependency "tiny-color-rails"
|
19
|
+
gem.add_dependency "railties", ">= 3.0"
|
20
|
+
gem.add_development_dependency "bundler", ">= 1.0"
|
21
|
+
end
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! Pick-a-Color v1.2.2 | Copyright 2013 Lauren Sperber and Broadstreet Ads https://github.com/lauren/pick-a-color/blob/master/LICENSE | pick-a-color 2014-02-18 */
|
2
|
+
!function(a){"use strict";a.fn.pickAColor=function(b){var c="ontouchstart"in window,d=(parseInt(a(window).width(),10)<767?!0:!1,"localStorage"in window&&null!==window.localStorage&&"object"==typeof JSON),e=document.all&&!window.atob,f=c?"touchstart.pickAColor":"mousedown.pickAColor",g=c?"touchmove.pickAColor":"mousemove.pickAColor",h=c?"touchend.pickAColor":"mouseup.pickAColor",i=c?"touchend.pickAColor":"click.pickAColor",j="dragging.pickAColor",k="endDrag.pickAColor",l=a.extend({showSpectrum:!0,showSavedColors:!0,saveColorsPerElement:!1,fadeMenuToggle:!0,showAdvanced:!0,showBasicColors:!0,showHexInput:!0,allowBlank:!1,basicColors:{white:"fff",red:"f00",orange:"f60",yellow:"ff0",green:"008000",blue:"00f",purple:"800080",black:"000"}},b);l.showAdvanced||l.showBasicColors||(l.showBasicColors=!0);var m=l.showSavedColors&&l.showAdvanced||l.showBasicColors&&l.showSavedColors||l.showBasicColors&&l.showAdvanced,n=function(){var b=a("<div>").addClass("input-group-btn"),c=a("<button type='button'>").addClass("btn btn-default color-dropdown dropdown-toggle"),d=a("<span>").addClass("color-preview current-color"),f=a("<span>").addClass("caret"),g=a("<div>").addClass("color-menu dropdown-menu");if(l.showHexInput||(c.addClass("no-hex"),g.addClass("no-hex")),b.append(c.append(d).append(f)),m||l.showSpectrum||g.addClass("small"),m){var h=a("<div>").addClass("color-menu-tabs"),i=l.showBasicColors?"savedColors-tab tab":"savedColors-tab tab tab-active";l.showBasicColors&&h.append(a("<span>").addClass("basicColors-tab tab tab-active").append(a("<a>").text("Basic Colors"))),l.showSavedColors&&h.append(a("<span>").addClass(i).append(a("<a>").text("Saved Colors"))),l.showAdvanced&&h.append(a("<span>").addClass("advanced-tab tab").append(a("<a>").text("Advanced"))),g.append(h)}if(l.showBasicColors){var j=a("<div>").addClass("basicColors-content active-content");l.showSpectrum&&j.append(a("<h6>").addClass("color-menu-instructions").text("Tap spectrum or drag band to change color"));var k=a("<ul>").addClass("basic-colors-list");a.each(l.basicColors,function(b,c){var d=a("<li>").addClass("color-item"),f=a("<a>").addClass(b+" color-link"),g=a("<span>").addClass("color-preview "+b),h=a("<span>").addClass("color-label").text(b);if(f.append(g,h),g.append(),"#"!==c[0]&&(c="#"+c),g.css("background-color",c),l.showSpectrum){var i=a("<span>").addClass("color-box spectrum-"+b);e&&a.each([0,1],function(d){"fff"!==c&&"000"!==b&&i.append(a("<span>").addClass(b+"-spectrum-"+d+" ie-spectrum"))});var j=a("<span>").addClass("highlight-band");a.each([0,1,2],function(){j.append(a("<span>").addClass("highlight-band-stripe"))}),f.append(i.append(j))}k.append(d.append(f))}),g.append(j.append(k))}if(l.showSavedColors){var n=l.showBasicColors?"inactive-content":"active-content",o=a("<div>").addClass("savedColors-content").addClass(n);o.append(a("<p>").addClass("saved-colors-instructions").text("Type in a color or use the spectrums to lighten or darken an existing color.")),g.append(o)}if(l.showAdvanced){var p=l.showBasicColors||l.showSavedColors?"inactive-content":"active-content",q=a("<div>").addClass("advanced-content").addClass(p).append(a("<h6>").addClass("advanced-instructions").text("Tap spectrum or drag band to change color")),r=a("<ul>").addClass("advanced-list"),s=a("<li>").addClass("hue-item"),t=a("<span>").addClass("hue-text").text("Hue: ").append(a("<span>").addClass("hue-value").text("0")),u=a("<span>").addClass("color-box spectrum-hue");e&&a.each([0,1,2,3,4,5,6],function(b){u.append(a("<span>").addClass("hue-spectrum-"+b+" ie-spectrum hue"))});var v=a("<span>").addClass("highlight-band");a.each([0,1,2],function(){v.append(a("<span>").addClass("highlight-band-stripe"))}),r.append(s.append(t).append(u.append(v)));var w=a("<li>").addClass("lightness-item"),x=a("<span>").addClass("color-box spectrum-lightness"),y=a("<span>").addClass("lightness-text").text("Lightness: ").append(a("<span>").addClass("lightness-value").text("50%"));e&&a.each([0,1],function(b){x.append(a("<span>").addClass("lightness-spectrum-"+b+" ie-spectrum"))});var z=a("<span>").addClass("highlight-band");a.each([0,1,2],function(){z.append(a("<span>").addClass("highlight-band-stripe"))}),r.append(w.append(y).append(x.append(z)));var A=a("<li>").addClass("saturation-item"),B=a("<span>").addClass("color-box spectrum-saturation");e&&a.each([0,1],function(b){B.append(a("<span>").addClass("saturation-spectrum-"+b+" ie-spectrum"))});var C=a("<span>").addClass("highlight-band");a.each([0,1,2],function(){C.append(a("<span>").addClass("highlight-band-stripe"))});var D=a("<span>").addClass("saturation-text").text("Saturation: ").append(a("<span>").addClass("saturation-value").text("100%"));r.append(A.append(D).append(B.append(C)));var E=a("<li>").addClass("preview-item").append(a("<span>").addClass("preview-text").text("Preview")),F=a("<span>").addClass("color-preview advanced").append("<button class='color-select btn btn-mini advanced' type='button'>Select</button>");r.append(E.append(F)),g.append(q.append(r))}return b.append(g),b},o={},p={rowsInDropdown:8,maxColsInDropdown:2};if(l.showSavedColors){var q=[];if(d&&localStorage.allSavedColors)q=JSON.parse(localStorage.allSavedColors);else if(document.cookie.match("pickAColorSavedColors-allSavedColors=")){var r=document.cookie.split(";");a.each(r,function(a){r[a].match("pickAColorSavedColors-allSavedColors=")&&(q=r[a].split("=")[1].split(","))})}}var s={initialize:function(b){var c,d,e=a(this);e.attr("name")||e.attr("name","pick-a-color-"+b),d=e.attr("name"),e.addClass("pick-a-color"),l.allowBlank?e.val().match(/^\s+$|^$/)||(o.defaultColor=tinycolor(e.val()).toHex(),o.typedColor=o.defaultColor,e.val(o.defaultColor)):(o.defaultColor=tinycolor(e.val()).toHex(),o.typedColor=o.defaultColor,e.val(o.defaultColor)),a(e).wrap('<div class="input-group pick-a-color-markup" id="'+d+'">'),c=a(e.parent()),l.showHexInput?c.prepend('<span class="hex-pound input-group-addon">#</span>').append(n()):c.append(n()),l.showHexInput||e.attr("type","hidden")},updatePreview:function(a){l.allowBlank?(o.typedColor=a.val().match(/^\s+$|^$/)?"":tinycolor(a.val()).toHex(),""===o.typedColor?a.siblings(".input-group-btn").find(".current-color").css("background","none"):a.siblings(".input-group-btn").find(".current-color").css("background-color","#"+o.typedColor)):(o.typedColor=tinycolor(a.val()).toHex(),a.siblings(".input-group-btn").find(".current-color").css("background-color","#"+o.typedColor))},pressPreviewButton:function(){var a=arguments[0].thisEvent;a.stopPropagation(),s.toggleDropdown(a.target)},openDropdown:function(b,d){a(".color-menu").each(function(){var b=a(this);if("block"===b.css("display")){var c=b.parents(".input-group-btn");s.closeDropdown(c,b)}}),l.fadeMenuToggle&&!c?a(d).fadeIn("fast"):a(d).show(),a(b).addClass("open")},closeDropdown:function(b,d){l.fadeMenuToggle&&!c?a(d).fadeOut("fast"):a(d).css("display","none"),a(b).removeClass("open")},closeDropdownIfOpen:function(){var a=arguments[0].button,b=arguments[0].menu;"block"===b.css("display")&&s.closeDropdown(a,b)},toggleDropdown:function(b){var c=a(b).parents(".pick-a-color-markup"),d=c.find("input"),e=c.find(".input-group-btn"),f=c.find(".color-menu");d.is(":disabled")||"none"!==f.css("display")?s.closeDropdown(e,f):s.openDropdown(e,f)},tabbable:function(){var b=a(this),c=b.parents(".pick-a-color-markup");b.click(function(){var b=a(this),d=b.attr("class").split(" ")[0].split("-")[0]+"-content",e=b.parents(".dropdown-menu").find("."+d);b.hasClass("tab-active")||(c.find(".tab-active").removeClass("tab-active"),c.find(".active-content").removeClass("active-content").addClass("inactive-content"),b.addClass("tab-active"),a(e).addClass("active-content").removeClass("inactive-content"))})},getColorMultiplier:function(b,d,e){var f="basic"===e?parseInt(a(".color-box").first().width(),10):parseInt(a(".advanced-list").find(".color-box").first().width(),10);0===f&&(f="basic"===e?c?160:200:c?160:300);var g=f/2,h=d/f;return"bidirectional"===b?.5>=h?(1-d/g)/2:-((d-g)/g)/2:"darkenRight"===b?-(h/2):h/2},modifyHSLLightness:function(a,b){var c=a;return c.l+=b,c.l=Math.min(Math.max(0,c.l),1),tinycolor(c).toHslString()},getMoveableArea:function(a){var b={},c=a.parent(),d=a.outerWidth(),e=c.width(),f=c.offset();return b.minX=f.left,b.maxX=e-d,b},moveHighlightBand:function(b,d,e){var f=a(".highlight-band").first().outerWidth(),g=.75*f,h=c?e.originalEvent.pageX:e.pageX,i=h-d.minX-g;i=Math.max(0,Math.min(i,d.maxX)),b.css("position","absolute"),b.css("left",i)},horizontallyDraggable:function(){a(this).on(f,function(b){b.preventDefault();var c=a(b.delegateTarget);c.css("cursor","-webkit-grabbing"),c.css("cursor","-moz-grabbing");var d=s.getMoveableArea(c);a(document).on(g,function(a){c.trigger(j),s.moveHighlightBand(c,d,a)}).on(h,function(){a(document).off(g),a(document).off(j),c.css("cursor","-webkit-grab"),c.css("cursor","-moz-grab"),c.trigger(k),a(document).off(h)})}).on(h,function(b){b.stopPropagation(),a(document).off(g),a(document).off(j)})},modifyHighlightBand:function(a,b,c){var d={h:0,s:0,l:.05},e={h:0,s:0,l:.5},f=-b,g=a.find(".highlight-band-stripe"),h="lightenRight"===c?s.modifyHSLLightness(e,f):s.modifyHSLLightness(d,f);a.css("border-color",h),g.css("background-color",h)},calculateHighlightedColor:function(){var b,c,d,e,f,g,h,i,j=a(this),k=j.parent(),m=a(".highlight-band").first().outerWidth(),n=m/2,o=arguments[0].type;if("basic"===o){var p=k.attr("class").split("-")[2],q=l.basicColors[p];switch(c=tinycolor(q).toHsl(),q){case"fff":b="darkenRight";break;case"000":b="lightenRight";break;default:b="bidirectional"}}else{var r=j.parents(".advanced-list");e=arguments[0].hsl.s,h=r.find(".spectrum-hue"),d=arguments[0].hsl.h,g=r.find(".spectrum-saturation"),i=r.find(".lightness-value"),f=r.find(".color-preview"),c={h:arguments[0].hsl.h,l:.5,s:arguments[0].hsl.s},b="bidirectional"}var t=parseInt(j.css("left"),10)+n,u=s.getColorMultiplier(b,t,o),v=s.modifyHSLLightness(c,u),w="#"+tinycolor(v).toHex(),x=v.split("(")[1].split(")")[0].split(",")[2],y=parseInt(x.split("%")[0],10)/100;return"basic"===o?(k.siblings(".color-preview").css("background-color",w),k.prev(".color-label").replaceWith('<button class="color-select btn btn-mini" type="button">Select</button>'),"darkenRight"!==b&&s.modifyHighlightBand(j,u,b)):(f.css("background-color",w),i.text(x),s.updateSaturationStyles(g,d,y),s.updateHueStyles(h,e,y),s.modifyHighlightBand(a(".advanced-content .highlight-band"),u,b)),"basic"===o?tinycolor(v).toHex():y},updateSavedColorPreview:function(b){a.each(b,function(c){var d=a(b[c]),e=d.attr("class");d.find(".color-preview").css("background-color",e)})},updateSavedColorMarkup:function(b,c){if(c=c?c:q,l.showSavedColors&&c.length>0){l.saveColorsPerElement||(b=a(".savedColors-content"),c=q);var d=p.rowsInDropdown*p.maxColsInDropdown;c=c.slice(0,d);var e=a("<ul>").addClass("saved-color-col 0"),f=a("<ul>").addClass("saved-color-col 1");a.each(c,function(b,c){var d=a("<li>").addClass("color-item"),g=a("<a>").addClass(c);g.append(a("<span>").addClass("color-preview")),g.append(a("<span>").addClass("color-label").text(c)),d.append(g),0===b%2?e.append(d):f.append(d)}),b.html(e),b.append(f);var g=a(b).find("a");s.updateSavedColorPreview(g)}},setSavedColorsCookie:function(a,b){var c=new Date,d=31536e7,e=new Date(c.getTime()+d);e=e.toGMTString(),document.cookie="undefined"==typeof b?"pickAColorSavedColors-allSavedColors="+a+";expires="+e:"pickAColorSavedColors-"+b+"="+a+"; expires="+e},saveColorsToLocalStorage:function(a,b){if(d)if("undefined"==typeof b)try{localStorage.allSavedColors=JSON.stringify(a)}catch(c){localStorage.clear()}else try{localStorage["pickAColorSavedColors-"+b]=JSON.stringify(a)}catch(c){localStorage.clear()}else s.setSavedColorsCookie(a,b)},removeFromArray:function(b,c){-1!==a.inArray(c,b)&&b.splice(a.inArray(c,b),1)},updateSavedColors:function(a,b,c){s.removeFromArray(b,a),b.unshift(a),s.saveColorsToLocalStorage(b,c)},addToSavedColors:function(a,b,c){if(l.showSavedColors&&void 0!==a)if("#"!=a[0]&&(a="#"+a),s.updateSavedColors(a,q),l.saveColorsPerElement){var d=b.colors,e=b.dataAttr;s.updateSavedColors(a,d,e),s.updateSavedColorMarkup(c,d)}else s.updateSavedColorMarkup(c,q)},selectFromBasicColors:function(){var b=a(this).find("span:first").css("background-color"),c=arguments[0].els,d=arguments[0].savedColorsInfo;b=tinycolor(b).toHex(),a(c.thisEl).val(b),a(c.thisEl).trigger("change"),s.updatePreview(c.thisEl),s.addToSavedColors(b,d,c.savedColorsContent),s.closeDropdown(c.colorPreviewButton,c.colorMenu)},tapSpectrum:function(){var b=arguments[0].thisEvent,d=arguments[0].savedColorsInfo,e=arguments[0].els,f=arguments[0].mostRecentClick;b.stopPropagation();var g=a(this).find(".highlight-band"),h=s.getMoveableArea(g);c?s.moveHighlightBand(g,h,f):s.moveHighlightBand(g,h,b);var i=s.calculateHighlightedColor.apply(g,[{type:"basic"}]);s.addToSavedColors(i,d,e.savedColorsContent),e.touchInstructions.html("Press 'select' to choose this color")},executeUnlessScrolled:function(){var b,d,e=arguments[0].thisFunction,g=arguments[0].theseArguments;a(this).on(f,function(c){b=a(window).scrollTop(),d=c}).on(i,function(f){var h=b-a(window).scrollTop();return c&&Math.abs(h)>0?!1:(g.thisEvent=f,g.mostRecentClick=d,e.apply(a(this),[g]),void 0)})},updateSaturationStyles:function(b,c,d){var f=(100*d).toString()+"%",g="#"+tinycolor("hsl("+c+",0%,"+f).toHex(),h="#"+tinycolor("hsl("+c+",50%,"+f).toHex(),i="#"+tinycolor("hsl("+c+",100%,"+f).toHex(),j="",k=(a.each(["-webkit-linear-gradient","-o-linear-gradient"],function(a,b){j+="background-image: "+b+"(left, "+g+" 0%, "+h+" 50%, "+i+" 100%);"}),"progid:DXImageTransform.Microsoft.gradient(startColorstr='"+g+"', endColorstr='"+h+"', GradientType=1)"),l="progid:DXImageTransform.Microsoft.gradient(startColorstr='"+h+"', endColorstr='"+i+"', GradientType=1)";if(j="background-image: -moz-linear-gradient(left center, "+g+" 0%, "+h+" 50%, "+i+" 100%);"+"background-image: linear-gradient(to right, "+g+" 0%, "+h+" 50%, "+i+" 100%); "+"background-image: -webkit-gradient(linear, left top, right top,"+"color-stop(0, "+g+"),"+"color-stop(0.5, "+h+"),"+"color-stop(1, "+i+"));"+j,e){var m=a(b).find(".saturation-spectrum-0"),n=a(b).find(".saturation-spectrum-1");m.css("filter",k),n.css("filter",l)}else b.attr("style",j)},updateLightnessStyles:function(b,c,d){var f=(100*d).toString()+"%",g="#"+tinycolor("hsl("+c+","+f+",100%)").toHex(),h="#"+tinycolor("hsl("+c+","+f+",50%)").toHex(),i="#"+tinycolor("hsl("+c+","+f+",0%)").toHex(),j="",k=(a.each(["-webkit-linear-gradient","-o-linear-gradient"],function(a,b){j+="background-image: "+b+"(left, "+g+" 0%, "+h+" 50%, "+i+" 100%);"}),"progid:DXImageTransform.Microsoft.gradient(startColorstr='"+g+"', endColorstr='"+h+"', GradientType=1)"),l="progid:DXImageTransform.Microsoft.gradient(startColorstr='"+h+"', endColorstr='"+i+"', GradientType=1)";if(j="background-image: -moz-linear-gradient(left center, "+g+" 0%, "+h+" 50%, "+i+" 100%); "+"background-image: linear-gradient(to right, "+g+" 0%, "+h+" 50%, "+i+" 100%); "+"background-image: -webkit-gradient(linear, left top, right top,"+" color-stop(0, "+g+"),"+" color-stop(0.5, "+h+"),"+" color-stop(1, "+i+")); "+j,e){var m=a(b).find(".lightness-spectrum-0"),n=a(b).find(".lightness-spectrum-1");m.css("filter",k),n.css("filter",l)}else b.attr("style",j)},updateHueStyles:function(b,c,d){var f=(100*c).toString()+"%",g=(100*d).toString()+"%",h="#"+tinycolor("hsl(0,"+f+","+g+")").toHex(),i="#"+tinycolor("hsl(60,"+f+","+g+")").toHex(),j="#"+tinycolor("hsl(120,"+f+","+g+")").toHex(),k="#"+tinycolor("hsl(180,"+f+","+g+")").toHex(),l="#"+tinycolor("hsl(240,"+f+","+g+")").toHex(),m="#"+tinycolor("hsl(300,"+f+","+g+")").toHex(),n="#"+tinycolor("hsl(0,"+f+","+g+")").toHex(),o="progid:DXImageTransform.Microsoft.gradient(startColorstr='"+h+"', endColorstr='"+i+"', GradientType=1)",p="progid:DXImageTransform.Microsoft.gradient(startColorstr='"+i+"', endColorstr='"+j+"', GradientType=1)",q="progid:DXImageTransform.Microsoft.gradient(startColorstr='"+j+"', endColorstr='"+k+"', GradientType=1)",r="progid:DXImageTransform.Microsoft.gradient(startColorstr='"+k+"', endColorstr='"+l+"', GradientType=1)",s="progid:DXImageTransform.Microsoft.gradient(startColorstr='"+l+"', endColorstr='"+m+"', GradientType=1)",t="progid:DXImageTransform.Microsoft.gradient(startColorstr='"+m+"', endColorstr='"+n+"', GradientType=1)",u="";if(a.each(["-webkit-linear-gradient","-o-linear-gradient"],function(a,b){u+="background-image: "+b+"(left, "+h+" 0%, "+i+" 17%, "+j+" 24%, "+k+" 51%, "+l+" 68%, "+m+" 85%, "+n+" 100%);"}),u+="background-image: -webkit-gradient(linear, left top, right top,color-stop(0%, "+h+"),"+"color-stop(17%, "+i+"),"+"color-stop(34%, "+j+"),"+"color-stop(51%, "+k+"),"+"color-stop(68%, "+l+"),"+"color-stop(85%, "+m+"),"+"color-stop(100%, "+n+"));"+"background-image: linear-gradient(to right, "+h+" 0%, "+i+" 17%, "+j+" 24%,"+k+" 51%,"+l+" 68%,"+m+" 85%,"+n+" 100%); "+"background-image: -moz-linear-gradient(left center, "+h+" 0%, "+i+" 17%, "+j+" 24%, "+k+" 51%, "+l+" 68%, "+m+" 85%, "+n+" 100%);",e){var v=a(b).find(".hue-spectrum-0"),w=a(b).find(".hue-spectrum-1"),x=a(b).find(".hue-spectrum-2"),y=a(b).find(".hue-spectrum-3"),z=a(b).find(".hue-spectrum-4"),A=a(b).find(".hue-spectrum-5");v.css("filter",o),w.css("filter",p),x.css("filter",q),y.css("filter",r),z.css("filter",s),A.css("filter",t)}else b.attr("style",u)},getHighlightedHue:function(){var b=a(this),d=b.outerWidth(),e=d/2,f=parseInt(b.css("left"),10)+e,g=b.parents(".advanced-list"),h=g.find(".color-preview"),i=g.find(".spectrum-lightness"),j=g.find(".spectrum-saturation"),k=parseInt(g.find(".color-box").first().width(),10),l=g.find(".hue-value"),m=arguments[0].l,n=arguments[0].s,o=(100*n).toString()+"%",p=(100*m).toString()+"%";0===k&&(k=c?160:300);var q=Math.floor(360*(f/k)),r="hsl("+q+","+o+","+p+")";return r="#"+tinycolor(r).toHex(),h.css("background-color",r),l.text(q),s.updateLightnessStyles(i,q,n),s.updateSaturationStyles(j,q,m),q},getHighlightedSaturation:function(){var b=a(this),d=b.outerWidth(),e=d/2,f=parseInt(b.css("left"),10)+e,g=b.parents(".advanced-list"),h=g.find(".color-preview"),i=g.find(".spectrum-lightness"),j=g.find(".spectrum-hue"),k=g.find(".saturation-value"),l=parseInt(g.find(".color-box").first().width(),10),m=arguments[0].l,n=(100*m).toString()+"%",o=arguments[0].h;0===l&&(l=c?160:300);var p=f/l,q=Math.round(100*p).toString()+"%",r="hsl("+o+","+q+","+n+")";return r="#"+tinycolor(r).toHex(),h.css("background-color",r),k.text(q),s.updateLightnessStyles(i,o,p),s.updateHueStyles(j,p,m),p},updateAdvancedInstructions:function(a){a.html("Press the color preview to choose this color")}};return this.each(function(b){s.initialize.apply(this,[b]);var c,e,f={thisEl:a(this),thisWrapper:a(this).parent(),colorTextInput:a(this).find("input"),colorMenuLinks:a(this).parent().find(".color-menu li a"),colorPreviewButton:a(this).parent().find(".input-group-btn"),colorMenu:a(this).parent().find(".color-menu"),colorSpectrums:a(this).parent().find(".color-box"),basicSpectrums:a(this).parent().find(".basicColors-content .color-box"),touchInstructions:a(this).parent().find(".color-menu-instructions"),advancedInstructions:a(this).parent().find(".advanced-instructions"),highlightBands:a(this).parent().find(".highlight-band"),basicHighlightBands:a(this).parent().find(".basicColors-content .highlight-band")};if(m&&(f.tabs=f.thisWrapper.find(".tab")),l.showSavedColors&&(f.savedColorsContent=f.thisWrapper.find(".savedColors-content"),l.saveColorsPerElement))if(e={colors:[],dataObj:a(this).data()},a.each(e.dataObj,function(a){e.dataAttr=a}),d&&localStorage["pickAColorSavedColors-"+e.dataAttr])e.colors=JSON.parse(localStorage["pickAColorSavedColors-"+e.dataAttr]);else if(document.cookie.match("pickAColorSavedColors-"+e.dataAttr))for(var g=document.cookie.split(";"),n=0;n<g.length;n++)g[n].match(e.dataAttr)&&(e.colors=g[n].split("=")[1].split(","));else e.colors=q;l.showAdvanced&&(c={h:0,s:1,l:.5},f.advancedSpectrums=f.thisWrapper.find(".advanced-list").find(".color-box"),f.advancedHighlightBands=f.thisWrapper.find(".advanced-list").find(".highlight-band"),f.hueSpectrum=f.thisWrapper.find(".spectrum-hue"),f.lightnessSpectrum=f.thisWrapper.find(".spectrum-lightness"),f.saturationSpectrum=f.thisWrapper.find(".spectrum-saturation"),f.hueHighlightBand=f.thisWrapper.find(".spectrum-hue .highlight-band"),f.lightnessHighlightBand=f.thisWrapper.find(".spectrum-lightness .highlight-band"),f.saturationHighlightBand=f.thisWrapper.find(".spectrum-saturation .highlight-band"),f.advancedPreview=f.thisWrapper.find(".advanced-content .color-preview")),s.addToSavedColors(o.defaultColor,e,f.savedColorsContent),s.updatePreview(f.thisEl),f.thisEl.focus(function(){var b=a(this);o.typedColor=b.val(),l.allowBlank||b.val(""),s.toggleDropdown(f.colorPreviewButton,f.ColorMenu)}).blur(function(){var b=a(this);o.newValue=b.val(),o.newValue.match(/^\s+$|^$/)?l.allowBlank||b.val(o.typedColor):(o.newValue=tinycolor(o.newValue).toHex(),b.val(o.newValue),s.addToSavedColors(o.newValue,e,f.savedColorsContent)),s.toggleDropdown(f.colorPreviewButton,f.ColorMenu),s.updatePreview(b)}),s.executeUnlessScrolled.apply(f.colorPreviewButton,[{thisFunction:s.pressPreviewButton,theseArguments:{}}]),s.executeUnlessScrolled.apply(a(document),[{thisFunction:s.closeDropdownIfOpen,theseArguments:{button:f.colorPreviewButton,menu:f.colorMenu}}]),f.colorMenu.on(i,function(a){a.stopPropagation()}),f.thisEl.on(i,function(a){a.stopPropagation()}),s.executeUnlessScrolled.apply(f.colorMenuLinks,[{thisFunction:s.selectFromBasicColors,theseArguments:{els:f,savedColorsInfo:e}}]),m&&s.tabbable.apply(f.tabs),(l.showSpectrum||l.showAdvanced)&&s.horizontallyDraggable.apply(f.highlightBands),l.showSpectrum&&(s.executeUnlessScrolled.apply(f.basicSpectrums,[{thisFunction:s.tapSpectrum,theseArguments:{savedColorsInfo:e,els:f}}]),a(f.basicHighlightBands).on(j,function(a){a.target,s.calculateHighlightedColor.apply(this,[{type:"basic"}])}).on(k,function(a){var b=a.delegateTarget,c=s.calculateHighlightedColor.apply(b,[{type:"basic"}]);s.addToSavedColors(c,e,f.savedColorsContent)})),l.showAdvanced&&(a(f.hueHighlightBand).on(j,function(){c.h=s.getHighlightedHue.apply(this,[c])}),a(f.lightnessHighlightBand).on(j,function(){s.calculateHighlightedColor.apply(this,[{type:"advanced",hsl:c}])}).on(h,function(){c.l=s.calculateHighlightedColor.apply(this,[{type:"advanced",hsl:c}])}),a(f.saturationHighlightBand).on(j,function(){s.getHighlightedSaturation.apply(this,[c])}).on(k,function(){c.s=s.getHighlightedSaturation.apply(this,[c])}),a(f.advancedHighlightBand).on(k,function(){s.updateAdvancedInstructions(f.advancedInstructions)}),a(f.lightnessSpectrum).click(function(b){b.stopPropagation();var d=a(this).find(".highlight-band"),e=s.getMoveableArea(d);s.moveHighlightBand(d,e,b),c.l=s.calculateHighlightedColor.apply(d,[{type:"advanced",hsl:c}])}),a(f.hueSpectrum).click(function(b){b.stopPropagation();var d=a(this).find(".highlight-band"),e=s.getMoveableArea(d);s.moveHighlightBand(d,e,b),c.h=s.getHighlightedHue.apply(d,[c])}),a(f.saturationSpectrum).click(function(b){b.stopPropagation();var d=a(this).find(".highlight-band"),e=s.getMoveableArea(d);s.moveHighlightBand(d,e,b),c.s=s.getHighlightedSaturation.apply(d,[c])}),a(f.advancedSpectrums).click(function(){s.updateAdvancedInstructions(f.advancedInstructions)}),a(f.advancedPreview).click(function(){var b=tinycolor(a(this).css("background-color")).toHex();a(f.thisEl).val(b),a(f.thisEl).trigger("change"),s.updatePreview(f.thisEl),s.addToSavedColors(b,e,f.savedColorsContent),s.closeDropdown(f.colorPreviewButton,f.colorMenu)})),l.showSavedColors&&(a(f.savedColorsContent).click(function(b){var c=a(b.target);if(c.is("SPAN")||c.is("A")){var d=c.is("SPAN")?c.parent().attr("class").split("#")[1]:c.attr("class").split("#")[1];a(f.thisEl).val(d),a(f.thisEl).trigger("change"),s.updatePreview(f.thisEl),s.closeDropdown(f.colorPreviewButton,f.colorMenu),s.addToSavedColors(d,e,f.savedColorsContent)}}),l.saveColorsPerElement?l.saveColorsPerElement&&s.updateSavedColorMarkup(f.savedColorsContent,e.colors):s.updateSavedColorMarkup(f.savedColorsContent,q))})}}(jQuery);
|
@@ -0,0 +1,85 @@
|
|
1
|
+
|
2
|
+
.pick-a-color-markup *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
|
3
|
+
.pick-a-color-markup .hex-pound{padding-left:8px;padding-right:8px}@media screen and (max-width:991px){.pick-a-color-markup .hex-pound{padding:3px 5px 0px 5px;min-height:30px}}
|
4
|
+
.pick-a-color-markup .pick-a-color{padding:5px;height:34px;width:100%}@media screen and (max-width:991px){.pick-a-color-markup .pick-a-color{width:100%;font-size:18px;padding:9px;min-width:222px;height:47px}}
|
5
|
+
.pick-a-color-markup .input-group-btn .color-dropdown{padding:6px 5px}.pick-a-color-markup .input-group-btn .color-dropdown.no-hex{border-bottom-left-radius:4px;border-top-left-radius:4px}
|
6
|
+
.pick-a-color-markup .input-group-btn .color-dropdown:focus{background-color:#fff}
|
7
|
+
@media screen and (max-width:991px){.pick-a-color-markup .input-group-btn .color-dropdown{height:47px}}
|
8
|
+
.pick-a-color-markup .color-preview{border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 0 2px 2px rgba(0,0,0,0.075);box-shadow:inset 0 0 2px 2px rgba(0,0,0,0.075);height:1.429em;width:1.429em;display:inline-block;cursor:pointer;margin-right:5px}.pick-a-color-markup .color-preview.current-color{margin-bottom:-5px}
|
9
|
+
@media screen and (max-width:991px){.pick-a-color-markup .color-preview{height:1.875em;width:1.875em}}
|
10
|
+
.pick-a-color-markup .color-menu{text-align:left;padding:5px 0px;width:330px;font-size:14px;left:auto;}@media screen and (max-width:991px){.pick-a-color-markup .color-menu{left:-242px;width:293px}}.pick-a-color-markup .color-menu.small{width:100px}@media screen and (max-width:991px){.pick-a-color-markup .color-menu.small{left:-105px}}
|
11
|
+
.pick-a-color-markup .color-menu.no-hex{left:0px}
|
12
|
+
.pick-a-color-markup .color-menu ul{padding:0px;margin:0px}
|
13
|
+
.pick-a-color-markup .color-menu li{list-style-type:none;padding:5px 0px;margin:0px}
|
14
|
+
.pick-a-color-markup .color-menu .color-preview{vertical-align:middle;margin:0px}@media screen and (max-width:991px){.pick-a-color-markup .color-menu .color-preview{height:35px;width:35px}}.pick-a-color-markup .color-menu .color-preview.current-color,.pick-a-color-markup .color-menu .color-preview.white{background-color:#fff}
|
15
|
+
.pick-a-color-markup .color-menu .color-preview.red{background-color:#f00}
|
16
|
+
.pick-a-color-markup .color-menu .color-preview.orange{background-color:#f60}
|
17
|
+
.pick-a-color-markup .color-menu .color-preview.yellow{background-color:#ff0}
|
18
|
+
.pick-a-color-markup .color-menu .color-preview.green{background-color:#008000}
|
19
|
+
.pick-a-color-markup .color-menu .color-preview.blue{background-color:#00f}
|
20
|
+
.pick-a-color-markup .color-menu .color-preview.indigo{background-color:#4a0080}
|
21
|
+
.pick-a-color-markup .color-menu .color-preview.violet{background-color:#ee81ee}
|
22
|
+
.pick-a-color-markup .color-menu .color-preview.purple{background-color:#80007f}
|
23
|
+
.pick-a-color-markup .color-menu .color-preview.black{background-color:#000}
|
24
|
+
.pick-a-color-markup .color-menu .basicColors-content li>a,.pick-a-color-markup .color-menu .savedColors-content li>a{padding:5px 15px 3px 15px;cursor:default;min-height:25px;color:#333}.pick-a-color-markup .color-menu .basicColors-content li>a:hover,.pick-a-color-markup .color-menu .savedColors-content li>a:hover{background-color:#fff}
|
25
|
+
@media screen and (max-width:991px){.pick-a-color-markup .color-menu .basicColors-content li>a,.pick-a-color-markup .color-menu .savedColors-content li>a{min-height:40px}}
|
26
|
+
.pick-a-color-markup .color-menu .basicColors-content li:hover a,.pick-a-color-markup .color-menu .savedColors-content li:hover a{color:#333;background-image:none;filter:none;text-decoration:none;font-weight:bold}@media screen and (max-width:991px){.pick-a-color-markup .color-menu .basicColors-content li:hover a,.pick-a-color-markup .color-menu .savedColors-content li:hover a{background-color:#fff;font-weight:normal}}
|
27
|
+
.pick-a-color-markup .color-menu .btn.color-select{margin:0px 5px;height:20px;padding:0px 5px;margin-top:0px;line-height:1.5px;border-radius:4px}@media screen and (max-width:991px){.pick-a-color-markup .color-menu .btn.color-select{height:35px}}
|
28
|
+
.pick-a-color-markup .caret{margin-bottom:3px}
|
29
|
+
.pick-a-color-markup .color-menu-instructions,.pick-a-color-markup .advanced-instructions{text-align:center;padding:0px 6px;margin:0px;font-size:14px;font-weight:normal}@media screen and (min-width:992px){.pick-a-color-markup .color-menu-instructions,.pick-a-color-markup .advanced-instructions{display:none}}
|
30
|
+
.pick-a-color-markup .color-label{vertical-align:middle;margin:0px;margin-left:10px;cursor:pointer}@media screen and (max-width:991px){.pick-a-color-markup .color-label{margin-left:8px}}
|
31
|
+
.pick-a-color-markup .color-box{height:20px;width:200px;position:absolute;left:115px;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 0 2px 2px rgba(0,0,0,0.075);box-shadow:inset 0 0 2px 2px rgba(0,0,0,0.075);cursor:pointer}@media screen and (max-width:991px){.pick-a-color-markup .color-box{width:160px;height:35px}}
|
32
|
+
.pick-a-color-markup .black .highlight-band-stripe{background-color:#fff}
|
33
|
+
.pick-a-color-markup .spectrum-white{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#fff), to(#808080));background-image:-webkit-linear-gradient(left, color-stop(#fff 0), color-stop(#808080 100%));background-image:-moz-linear-gradient(left, #fff 0, #808080 100%);background-image:linear-gradient(to right, #fff 0, #808080 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ff808080', GradientType=1)}.pick-a-color-markup .spectrum-white .highlight-band{left:0px}
|
34
|
+
.pick-a-color-markup .spectrum-red{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #fff), color-stop(.5, #f00), color-stop(1, #000));background-image:-moz-linear-gradient(left center, #fff 0, #f00 50%, #000 100%);background-image:-webkit-linear-gradient(left, #fff 0, #f00 50%, #000 100%);background-image:-o-linear-gradient(left, #fff 0, #f00 50%, #000 100%);background-image:linear-gradient(to right, #fff 0, #f00 50%, #000 100%);background-repeat:repeat-x}
|
35
|
+
.pick-a-color-markup .spectrum-orange{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #fff), color-stop(.5, #f60), color-stop(1, #000));background-image:-moz-linear-gradient(left center, #fff 0, #f60 50%, #000 100%);background-image:-webkit-linear-gradient(left, #fff 0, #f60 50%, #000 100%);background-image:-o-linear-gradient(left, #fff 0, #f60 50%, #000 100%);background-image:linear-gradient(to right, #fff 0, #f60 50%, #000 100%);background-repeat:repeat-x}
|
36
|
+
.pick-a-color-markup .spectrum-yellow{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #fff), color-stop(.5, #ff0), color-stop(1, #000));background-image:-moz-linear-gradient(left center, #fff 0, #ff0 50%, #000 100%);background-image:-webkit-linear-gradient(left, #fff 0, #ff0 50%, #000 100%);background-image:-o-linear-gradient(left, #fff 0, #ff0 50%, #000 100%);background-image:linear-gradient(to right, #fff 0, #ff0 50%, #000 100%);background-repeat:repeat-x}
|
37
|
+
.pick-a-color-markup .spectrum-green{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #80ff80), color-stop(.5, #008000), color-stop(1, #000));background-image:-moz-linear-gradient(left center, #80ff80 0, #008000 50%, #000 100%);background-image:-webkit-linear-gradient(left, #80ff80 0, #008000 50%, #000 100%);background-image:-o-linear-gradient(left, #80ff80 0, #008000 50%, #000 100%);background-image:linear-gradient(to right, #80ff80 0, #008000 50%, #000 100%);background-repeat:repeat-x}
|
38
|
+
.pick-a-color-markup .spectrum-blue{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #fff), color-stop(.5, #00f), color-stop(1, #000));background-image:-moz-linear-gradient(left center, #fff 0, #00f 50%, #000 100%);background-image:-webkit-linear-gradient(left, #fff 0, #00f 50%, #000 100%);background-image:-o-linear-gradient(left, #fff 0, #00f 50%, #000 100%);background-image:linear-gradient(to right, #fff 0, #00f 50%, #000 100%);background-repeat:repeat-x}
|
39
|
+
.pick-a-color-markup .spectrum-purple{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #ff80ff), color-stop(.5, #80007f), color-stop(1, #000));background-image:-moz-linear-gradient(left center, #ff80ff 0, #80007f 50%, #000 100%);background-image:-webkit-linear-gradient(left, #ff80ff 0, #80007f 50%, #000 100%);background-image:-o-linear-gradient(left, #ff80ff 0, #80007f 50%, #000 100%);background-image:linear-gradient(to right, #ff80ff 0, #80007f 50%, #000 100%);background-repeat:repeat-x}
|
40
|
+
.pick-a-color-markup .spectrum-black{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#000), to(#808080));background-image:-webkit-linear-gradient(left, color-stop(#000 0), color-stop(#808080 100%));background-image:-moz-linear-gradient(left, #000 0, #808080 100%);background-image:linear-gradient(to right, #000 0, #808080 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff000000', endColorstr='#ff808080', GradientType=1)}.pick-a-color-markup .spectrum-black .highlight-band{left:0px;border:1px solid #808080}
|
41
|
+
.pick-a-color-markup .ie-spectrum{height:20px;width:100px;display:inline-block;top:-1}.pick-a-color-markup .ie-spectrum.hue{width:50.5px}@media screen and (max-width:991px){.pick-a-color-markup .ie-spectrum.hue{width:45.5px}}
|
42
|
+
@media screen and (max-width:991px){.pick-a-color-markup .ie-spectrum{width:80px;height:35px}}
|
43
|
+
.pick-a-color-markup .red-spectrum-0,.pick-a-color-markup .lightness-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#fff), to(#f00));background-image:-webkit-linear-gradient(left, color-stop(#fff 0), color-stop(#f00 100%));background-image:-moz-linear-gradient(left, #fff 0, #f00 100%);background-image:linear-gradient(to right, #fff 0, #f00 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffff0000', GradientType=1);border-bottom-left-radius:4px;border-top-left-radius:4px}
|
44
|
+
.pick-a-color-markup .red-spectrum-1,.pick-a-color-markup .lightness-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#f00), to(#000));background-image:-webkit-linear-gradient(left, color-stop(#f00 0), color-stop(#000 100%));background-image:-moz-linear-gradient(left, #f00 0, #000 100%);background-image:linear-gradient(to right, #f00 0, #000 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff0000', endColorstr='#ff000000', GradientType=1);border-bottom-right-radius:4px;border-top-right-radius:4px}
|
45
|
+
.pick-a-color-markup .lightness-spectrum-0,.pick-a-color-markup .lightness-spectrum-1{width:150px}@media screen and (max-width:991px){.pick-a-color-markup .lightness-spectrum-0,.pick-a-color-markup .lightness-spectrum-1{width:135px}}
|
46
|
+
.pick-a-color-markup .orange-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#fff), to(#f60));background-image:-webkit-linear-gradient(left, color-stop(#fff 0), color-stop(#f60 100%));background-image:-moz-linear-gradient(left, #fff 0, #f60 100%);background-image:linear-gradient(to right, #fff 0, #f60 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffff6600', GradientType=1);border-bottom-left-radius:4px;border-top-left-radius:4px}
|
47
|
+
.pick-a-color-markup .orange-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#f60), to(#000));background-image:-webkit-linear-gradient(left, color-stop(#f60 0), color-stop(#000 100%));background-image:-moz-linear-gradient(left, #f60 0, #000 100%);background-image:linear-gradient(to right, #f60 0, #000 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff6600', endColorstr='#ff000000', GradientType=1);border-bottom-right-radius:4px;border-top-right-radius:4px}
|
48
|
+
.pick-a-color-markup .yellow-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#fff), to(#ff0));background-image:-webkit-linear-gradient(left, color-stop(#fff 0), color-stop(#ff0 100%));background-image:-moz-linear-gradient(left, #fff 0, #ff0 100%);background-image:linear-gradient(to right, #fff 0, #ff0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffffff00', GradientType=1);border-bottom-left-radius:4px;border-top-left-radius:4px}
|
49
|
+
.pick-a-color-markup .yellow-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#ff0), to(#000));background-image:-webkit-linear-gradient(left, color-stop(#ff0 0), color-stop(#000 100%));background-image:-moz-linear-gradient(left, #ff0 0, #000 100%);background-image:linear-gradient(to right, #ff0 0, #000 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff00', endColorstr='#ff000000', GradientType=1);border-bottom-right-radius:4px;border-top-right-radius:4px}
|
50
|
+
.pick-a-color-markup .green-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#80ff80), to(#008000));background-image:-webkit-linear-gradient(left, color-stop(#80ff80 0), color-stop(#008000 100%));background-image:-moz-linear-gradient(left, #80ff80 0, #008000 100%);background-image:linear-gradient(to right, #80ff80 0, #008000 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff80ff80', endColorstr='#ff008000', GradientType=1);border-bottom-left-radius:4px;border-top-left-radius:4px}
|
51
|
+
.pick-a-color-markup .green-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#008000), to(#000));background-image:-webkit-linear-gradient(left, color-stop(#008000 0), color-stop(#000 100%));background-image:-moz-linear-gradient(left, #008000 0, #000 100%);background-image:linear-gradient(to right, #008000 0, #000 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff008000', endColorstr='#ff000000', GradientType=1);border-bottom-right-radius:4px;border-top-right-radius:4px}
|
52
|
+
.pick-a-color-markup .blue-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#fff), to(#00f));background-image:-webkit-linear-gradient(left, color-stop(#fff 0), color-stop(#00f 100%));background-image:-moz-linear-gradient(left, #fff 0, #00f 100%);background-image:linear-gradient(to right, #fff 0, #00f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ff0000ff', GradientType=1);border-bottom-left-radius:4px;border-top-left-radius:4px}
|
53
|
+
.pick-a-color-markup .blue-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#00f), to(#000));background-image:-webkit-linear-gradient(left, color-stop(#00f 0), color-stop(#000 100%));background-image:-moz-linear-gradient(left, #00f 0, #000 100%);background-image:linear-gradient(to right, #00f 0, #000 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000ff', endColorstr='#ff000000', GradientType=1);border-bottom-right-radius:4px;border-top-right-radius:4px}
|
54
|
+
.pick-a-color-markup .purple-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#ff80ff), to(#80007f));background-image:-webkit-linear-gradient(left, color-stop(#ff80ff 0), color-stop(#80007f 100%));background-image:-moz-linear-gradient(left, #ff80ff 0, #80007f 100%);background-image:linear-gradient(to right, #ff80ff 0, #80007f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff80ff', endColorstr='#ff80007f', GradientType=1);border-bottom-left-radius:4px;border-top-left-radius:4px}
|
55
|
+
.pick-a-color-markup .purple-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#80007f), to(#000));background-image:-webkit-linear-gradient(left, color-stop(#80007f 0), color-stop(#000 100%));background-image:-moz-linear-gradient(left, #80007f 0, #000 100%);background-image:linear-gradient(to right, #80007f 0, #000 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff80007f', endColorstr='#ff000000', GradientType=1);border-bottom-right-radius:4px;border-top-right-radius:4px}
|
56
|
+
.pick-a-color-markup .saturation-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#808080), to(#bf4040));background-image:-webkit-linear-gradient(left, color-stop(#808080 0), color-stop(#bf4040 100%));background-image:-moz-linear-gradient(left, #808080 0, #bf4040 100%);background-image:linear-gradient(to right, #808080 0, #bf4040 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff808080', endColorstr='#ffbf4040', GradientType=1);border-bottom-left-radius:4px;border-top-left-radius:4px;width:150px}@media screen and (max-width:991px){.pick-a-color-markup .saturation-spectrum-0{width:135px}}
|
57
|
+
.pick-a-color-markup .saturation-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#bf4040), to(#f00));background-image:-webkit-linear-gradient(left, color-stop(#bf4040 0), color-stop(#f00 100%));background-image:-moz-linear-gradient(left, #bf4040 0, #f00 100%);background-image:linear-gradient(to right, #bf4040 0, #f00 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffbf4040', endColorstr='#ffff0000', GradientType=1);border-bottom-right-radius:4px;border-top-right-radius:4px;width:150px}@media screen and (max-width:991px){.pick-a-color-markup .saturation-spectrum-1{width:135px}}
|
58
|
+
.pick-a-color-markup .hue-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#f00), to(#ff0));background-image:-webkit-linear-gradient(left, color-stop(#f00 0), color-stop(#ff0 100%));background-image:-moz-linear-gradient(left, #f00 0, #ff0 100%);background-image:linear-gradient(to right, #f00 0, #ff0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff0000', endColorstr='#ffffff00', GradientType=1)}
|
59
|
+
.pick-a-color-markup .hue-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#ff0), to(#0f0));background-image:-webkit-linear-gradient(left, color-stop(#ff0 0), color-stop(#0f0 100%));background-image:-moz-linear-gradient(left, #ff0 0, #0f0 100%);background-image:linear-gradient(to right, #ff0 0, #0f0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff00', endColorstr='#ff00ff00', GradientType=1)}
|
60
|
+
.pick-a-color-markup .hue-spectrum-2{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#0f0), to(#0ff));background-image:-webkit-linear-gradient(left, color-stop(#0f0 0), color-stop(#0ff 100%));background-image:-moz-linear-gradient(left, #0f0 0, #0ff 100%);background-image:linear-gradient(to right, #0f0 0, #0ff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff00', endColorstr='#ff00ffff', GradientType=1);left:-1px;position:relative}
|
61
|
+
.pick-a-color-markup .hue-spectrum-3{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#0ff), to(#00f));background-image:-webkit-linear-gradient(left, color-stop(#0ff 0), color-stop(#00f 100%));background-image:-moz-linear-gradient(left, #0ff 0, #00f 100%);background-image:linear-gradient(to right, #0ff 0, #00f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ffff', endColorstr='#ff0000ff', GradientType=1);left:-1px;position:relative}
|
62
|
+
.pick-a-color-markup .hue-spectrum-4{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#00f), to(#f0f));background-image:-webkit-linear-gradient(left, color-stop(#00f 0), color-stop(#f0f 100%));background-image:-moz-linear-gradient(left, #00f 0, #f0f 100%);background-image:linear-gradient(to right, #00f 0, #f0f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000ff', endColorstr='#ffff00ff', GradientType=1);left:-1px;position:relative}
|
63
|
+
.pick-a-color-markup .hue-spectrum-5{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#f0f), to(#f00));background-image:-webkit-linear-gradient(left, color-stop(#f0f 0), color-stop(#f00 100%));background-image:-moz-linear-gradient(left, #f0f 0, #f00 100%);background-image:linear-gradient(to right, #f0f 0, #f00 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00ff', endColorstr='#ffff0000', GradientType=1);left:-2px;position:relative}
|
64
|
+
.pick-a-color-markup .highlight-band{border:1px solid #222;border-radius:2px;-webkit-box-shadow:1px 1px 1px #333;box-shadow:1px 1px 1px #333;height:19px;width:11px;display:inline-block;cursor:pointer;cursor:-webkit-grab;cursor:-moz-grab;position:absolute;top:-1px;left:94.5px;text-align:center}@media screen and (max-width:991px){.pick-a-color-markup .highlight-band{width:21px;left:69.5px;height:34px}}
|
65
|
+
.pick-a-color-markup .highlight-band-stripe{min-height:80%;min-width:1px;background-color:#000;opacity:0.40;margin:2px 1px;display:inline-block;-webkit-box-shadow:1px 0 2px 0 #fff;box-shadow:1px 0 2px 0 #fff}@media screen and (max-width:991px){.pick-a-color-markup .highlight-band-stripe{margin:4px 2px}}
|
66
|
+
.pick-a-color-markup .color-menu-tabs{padding:5px 3px 3px 10px;font-size:12px;color:#333;border-bottom:1px solid #ccc;margin-bottom:5px}.pick-a-color-markup .color-menu-tabs .tab{padding:4px 5px;margin:5px;border-left:1px solid #fff;border-right:1px solid #fff;cursor:pointer;background-color:#fff}.pick-a-color-markup .color-menu-tabs .tab:hover{padding-bottom:6px;border-top:1px solid #ccc;border-right:1px solid #ccc;border-left:1px solid #ccc;border-top-right-radius:4px;border-top-left-radius:4px}
|
67
|
+
.pick-a-color-markup .color-menu-tabs a{color:#333;text-decoration:none}
|
68
|
+
.pick-a-color-markup .color-menu-tabs .tab-active{border-bottom:3px solid #fff;padding-bottom:5px;border-top:1px solid #ccc;border-right:1px solid #ccc;border-left:1px solid #ccc;border-top-right-radius:4px;border-top-left-radius:4px}
|
69
|
+
.pick-a-color-markup .active-content{display:block}
|
70
|
+
.pick-a-color-markup .inactive-content{display:none}
|
71
|
+
.pick-a-color-markup .savedColors-content{padding:5px 15px;white-space:normal}.pick-a-color-markup .savedColors-content li.color-item>a{margin-left:7px;padding-left:8px;border-radius:4px}
|
72
|
+
.pick-a-color-markup .saved-color-col{position:relative;left:-15px;float:left;width:149px}@media screen and (max-width:991px){.pick-a-color-markup .saved-color-col{width:130px}}
|
73
|
+
.pick-a-color-markup .advanced-content ul{margin-top:10px}
|
74
|
+
.pick-a-color-markup .advanced-content li{padding:5px 15px 3px 15px;cursor:default;min-height:25px;height:50px;position:relative}@media screen and (max-width:991px){.pick-a-color-markup .advanced-content li{min-height:70px}}
|
75
|
+
.pick-a-color-markup .advanced-content .color-preview{height:50px;width:300px;float:left;margin:0px 0px 10px 0px;background-color:#f00;text-align:center}.pick-a-color-markup .advanced-content .color-preview .color-select.btn.advanced{margin-top:15px;display:none}@media screen and (max-width:991px){.pick-a-color-markup .advanced-content .color-preview .color-select.btn.advanced{display:inline;margin-top:7px}}
|
76
|
+
.pick-a-color-markup .advanced-content .color-preview:hover .color-select.btn.advanced{display:inline}
|
77
|
+
@media screen and (max-width:991px){.pick-a-color-markup .advanced-content .color-preview{width:270px;margin-left:-10px}}
|
78
|
+
.pick-a-color-markup .advanced-content .spectrum-hue{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #f00), color-stop(17%, #ff0), color-stop(34%, #0f0), color-stop(51%, #0ff), color-stop(68%, #00f), color-stop(85%, #f0f), color-stop(100%, #f00));background-image:-moz-linear-gradient(left center, #f00 0, #ff0 17%, #0f0 24%, #0ff 51%, #00f 68%, #f0f 85%, #f00 100%);background-image:-webkit-linear-gradient(left, #f00 0, #ff0 17%, #0f0 24%, #0ff 51%, #00f 68%, #f0f 85%, #f00 100%);background-image:-o-linear-gradient(left, #f00 0, #ff0 17%, #0f0 24%, #0ff 51%, #00f 68%, #f0f 85%, #f00 100%);background-image:linear-gradient(to right, #f00 0, #ff0 17%, #0f0 24%, #0ff 51%, #00f 68%, #f0f 85%, #f00 100%);background-repeat:repeat-x}.pick-a-color-markup .advanced-content .spectrum-hue .highlight-band{left:0px}
|
79
|
+
.pick-a-color-markup .advanced-content .spectrum-lightness{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #fff), color-stop(.5, #f00), color-stop(1, #000));background-image:-moz-linear-gradient(left center, #fff 0, #f00 50%, #000 100%);background-image:-webkit-linear-gradient(left, #fff 0, #f00 50%, #000 100%);background-image:-o-linear-gradient(left, #fff 0, #f00 50%, #000 100%);background-image:linear-gradient(to right, #fff 0, #f00 50%, #000 100%);background-repeat:repeat-x}
|
80
|
+
.pick-a-color-markup .advanced-content .spectrum-saturation{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #808080), color-stop(.5, #f00), color-stop(1, #f00));background-image:-moz-linear-gradient(left center, #808080 0, #f00 50%, #f00 100%);background-image:-webkit-linear-gradient(left, #808080 0, #f00 50%, #f00 100%);background-image:-o-linear-gradient(left, #808080 0, #f00 50%, #f00 100%);background-image:linear-gradient(to right, #808080 0, #f00 50%, #f00 100%);background-repeat:repeat-x}.pick-a-color-markup .advanced-content .spectrum-saturation .highlight-band{left:287px}@media screen and (max-width:991px){.pick-a-color-markup .advanced-content .spectrum-saturation .highlight-band{left:247px}}
|
81
|
+
.pick-a-color-markup .advanced-content .spectrum-lightness .highlight-band{left:143.5px}@media screen and (max-width:991px){.pick-a-color-markup .advanced-content .spectrum-lightness .highlight-band{left:123.5px}}
|
82
|
+
.pick-a-color-markup .advanced-content .lightness-text,.pick-a-color-markup .advanced-content .hue-text,.pick-a-color-markup .advanced-content .saturation-text,.pick-a-color-markup .advanced-content .preview-text{vertical-align:middle;text-align:center;display:block}
|
83
|
+
.pick-a-color-markup .advanced-content .color-box{left:15px;top:25px;width:300px}@media screen and (max-width:991px){.pick-a-color-markup .advanced-content .color-box{width:270px;left:10px}}
|
84
|
+
.pick-a-color-markup .advanced-content .preview-item{height:80px}
|
85
|
+
@-moz-document url-prefix(){@media screen and (max-width:991px){div.pick-a-color-markup .color-menu{left:0px}}}
|
metadata
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pick-a-color-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jiri Kaipr
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: jquery-rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: tiny-color-rails
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: railties
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '3.0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: bundler
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '1.0'
|
78
|
+
description: ! 'Provides Pick-a-Color JavaScript library for your Rails application.
|
79
|
+
It''s a jQuery color picker for Twitter Bootstrap 3. Source code: https://github.com/lauren/pick-a-color'
|
80
|
+
email:
|
81
|
+
- jiri.kaipr@gmail.com
|
82
|
+
executables: []
|
83
|
+
extensions: []
|
84
|
+
extra_rdoc_files: []
|
85
|
+
files:
|
86
|
+
- .gitignore
|
87
|
+
- LICENSE
|
88
|
+
- README.md
|
89
|
+
- lib/pick-a-color-rails.rb
|
90
|
+
- lib/pick-a-color-rails/engine.rb
|
91
|
+
- lib/pick-a-color-rails/version.rb
|
92
|
+
- pick-a-color-rails.gemspec
|
93
|
+
- vendor/assets/javascripts/pick-a-color.min.js
|
94
|
+
- vendor/assets/stylesheets/pick-a-color.min.css
|
95
|
+
homepage: https://github.com/jkaipr/pick-a-color-rails
|
96
|
+
licenses: []
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
none: false
|
103
|
+
requirements:
|
104
|
+
- - ! '>='
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
109
|
+
requirements:
|
110
|
+
- - ! '>='
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
requirements: []
|
114
|
+
rubyforge_project:
|
115
|
+
rubygems_version: 1.8.23
|
116
|
+
signing_key:
|
117
|
+
specification_version: 3
|
118
|
+
summary: ! 'Provides Pick-a-Color JavaScript library for your Rails application. It''s
|
119
|
+
a jQuery color picker for Twitter Bootstrap 3. Source code: https://github.com/lauren/pick-a-color'
|
120
|
+
test_files: []
|