From 6a02fe5f0106a451bd452a5ffe4f1ee78d74883a Mon Sep 17 00:00:00 2001 From: vinmenn Date: Tue, 19 May 2015 14:44:59 +0200 Subject: [PATCH 1/4] Added selectColor into option object Now is possible to init colorpicker with both selectColor and other options: Eg. .simplecolorpicker({ theme: 'glyphicons', selectColor: '#e1e1e1' }) --- jquery.simplecolorpicker.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jquery.simplecolorpicker.js b/jquery.simplecolorpicker.js index ac63238..67c71c5 100644 --- a/jquery.simplecolorpicker.js +++ b/jquery.simplecolorpicker.js @@ -212,6 +212,11 @@ if (data === undefined) { $this.data('simplecolorpicker', (data = new SimpleColorPicker(this, options))); } + /* Added selectColor option with other options */ + if (option.selectColor) { + args.push(option.selectColor); + option = 'selectColor'; + } if (typeof option === 'string') { data[option].apply(data, args); } From 5d26413b82949384c2faf3d534b27372b1756f61 Mon Sep 17 00:00:00 2001 From: vinmenn Date: Tue, 19 May 2015 14:48:12 +0200 Subject: [PATCH 2/4] Updated readme with selectColoOption --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f052383..354337b 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,16 @@ $('select[name="colorpicker"]').simplecolorpicker({ - theme: font to use for the ok/check mark (default: `''`), available themes: [`regularfont`](https://github.com/tkrotoff/jquery-simplecolorpicker/blob/master/jquery.simplecolorpicker-regularfont.css), [`fontawesome`](https://github.com/tkrotoff/jquery-simplecolorpicker/blob/master/jquery.simplecolorpicker-fontawesome.css), [`glyphicons`](https://github.com/tkrotoff/jquery-simplecolorpicker/blob/master/jquery.simplecolorpicker-glyphicons.css) - picker: show the colors inside a picker instead of inline (default: `false`) - pickerDelay: show and hide animation delay in milliseconds (default: `0`) - +- +#### Added selectColor option +Now y +```JavaScript +$('select[name="colorpicker"]') + .simplecolorpicker({ theme: 'glyphicons', selectColor: '#e1e1e1' }) + .on('change', function() { + $(document.body).css('background-color', $('select[name="colorpicker"]').val()); + }); +``` ## Browser support Simplecolorpicker supports all modern browsers starting with Internet Explorer 8 included. From ee22642c280ca8fdcf1289ec3a79cabc63396d40 Mon Sep 17 00:00:00 2001 From: vinmenn Date: Tue, 19 May 2015 14:49:14 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 354337b..0bc395e 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,10 @@ $('select[name="colorpicker"]').simplecolorpicker({ - picker: show the colors inside a picker instead of inline (default: `false`) - pickerDelay: show and hide animation delay in milliseconds (default: `0`) - + #### Added selectColor option -Now y +Now is possible to use selectColor with other options: + ```JavaScript $('select[name="colorpicker"]') .simplecolorpicker({ theme: 'glyphicons', selectColor: '#e1e1e1' }) @@ -72,6 +74,7 @@ $('select[name="colorpicker"]') $(document.body).css('background-color', $('select[name="colorpicker"]').val()); }); ``` + ## Browser support Simplecolorpicker supports all modern browsers starting with Internet Explorer 8 included. From 893578f44a459c3b4353bd8aa73e829e20a29bb5 Mon Sep 17 00:00:00 2001 From: vinmenn Date: Tue, 19 May 2015 14:52:06 +0200 Subject: [PATCH 4/4] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 0bc395e..c2a480f 100644 --- a/README.md +++ b/README.md @@ -62,10 +62,9 @@ $('select[name="colorpicker"]').simplecolorpicker({ - theme: font to use for the ok/check mark (default: `''`), available themes: [`regularfont`](https://github.com/tkrotoff/jquery-simplecolorpicker/blob/master/jquery.simplecolorpicker-regularfont.css), [`fontawesome`](https://github.com/tkrotoff/jquery-simplecolorpicker/blob/master/jquery.simplecolorpicker-fontawesome.css), [`glyphicons`](https://github.com/tkrotoff/jquery-simplecolorpicker/blob/master/jquery.simplecolorpicker-glyphicons.css) - picker: show the colors inside a picker instead of inline (default: `false`) - pickerDelay: show and hide animation delay in milliseconds (default: `0`) -- #### Added selectColor option -Now is possible to use selectColor with other options: +Now is possible to use **selectColor** with other options: ```JavaScript $('select[name="colorpicker"]')