From 0375097666fb8cd47a3509ad95b099bdcb8eb090 Mon Sep 17 00:00:00 2001 From: Dave Perrett Date: Thu, 30 May 2013 13:06:10 +1200 Subject: [PATCH] Bump version to 1.1.4. --- README.markdown | 1 + VERSION | 2 +- jquery.simple-color.js | 9 ++++++--- jquery.simple-color.min.js | 6 +++--- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.markdown b/README.markdown index 2db8d7c..5469491 100644 --- a/README.markdown +++ b/README.markdown @@ -170,6 +170,7 @@ Total time: 2 seconds Change history ----------- +* **Version 1.1.4 (2013-05-30)** : Add support for jQuery 1.9.1 (thanks [napcs](https://github.com/napcs)). * **Version 1.1.3 (2013-04-07)** : Rename *callback* option to *onSelect*. * **Version 1.1.2 (2013-04-06)** : Add *onCellEnter*, *onClose* and *livePreview* options (thanks [jbergen](https://github.com/jbergen)). * **Version 1.1.1 (2013-03-29)** : Add *callback* option (thanks [jbergen](https://github.com/jbergen)). diff --git a/VERSION b/VERSION index 9c1218c..1b87bcd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.3 \ No newline at end of file +1.1.4 \ No newline at end of file diff --git a/jquery.simple-color.js b/jquery.simple-color.js index 78365aa..c108f09 100644 --- a/jquery.simple-color.js +++ b/jquery.simple-color.js @@ -7,7 +7,7 @@ * Licensed under the MIT license: * http://www.opensource.org/licenses/mit-license.php * - * Version: 1.1.3 (201304080141) + * Version: 1.1.4 (201305301304) */ (function($) { /** @@ -129,10 +129,13 @@ // Figure out the cell dimensions options.totalWidth = options.columns * (options.cellWidth + (2 * options.cellMargin)); - if ($.browser.msie) { + + // this should probably do feature detection - I don't know why we need +2 for IE + // but this works for jQuery 1.9.1 + if (navigator.userAgent.indexOf("MSIE")!=-1){ options.totalWidth += 2; } - + options.totalHeight = Math.ceil(options.colors.length / options.columns) * (options.cellHeight + (2 * options.cellMargin)); // Store these options so they'll be available to the other functions diff --git a/jquery.simple-color.min.js b/jquery.simple-color.min.js index a5efb32..a854eac 100644 --- a/jquery.simple-color.min.js +++ b/jquery.simple-color.min.js @@ -7,15 +7,15 @@ * Licensed under the MIT license: * http://www.opensource.org/licenses/mit-license.php * - * Version: 1.1.3 (201304080141) + * Version: 1.1.4 (201305301304) */ (function(b){b.fn.simpleColor=function(a){var k=["990033","ff3366","cc0033","ff0033","ff9999","cc3366","ffccff","cc6699","993366","660033","cc3399","ff99cc","ff66cc","ff99ff","ff6699","cc0066","ff0066","ff3399","ff0099","ff33cc","ff00cc","ff66ff","ff33ff","ff00ff","cc0099","990066","cc66cc","cc33cc","cc99ff","cc66ff","cc33ff","993399","cc00cc","cc00ff","9900cc","990099","cc99cc","996699","663366","660099","9933cc","660066","9900ff","9933ff","9966cc","330033","663399","6633cc","6600cc","9966ff","330066", "6600ff","6633ff","ccccff","9999ff","9999cc","6666cc","6666ff","666699","333366","333399","330099","3300cc","3300ff","3333ff","3333cc","0066ff","0033ff","3366ff","3366cc","000066","000033","0000ff","000099","0033cc","0000cc","336699","0066cc","99ccff","6699ff","003366","6699cc","006699","3399cc","0099cc","66ccff","3399ff","003399","0099ff","33ccff","00ccff","99ffff","66ffff","33ffff","00ffff","00cccc","009999","669999","99cccc","ccffff","33cccc","66cccc","339999","336666","006666","003333","00ffcc", "33ffcc","33cc99","00cc99","66ffcc","99ffcc","00ff99","339966","006633","336633","669966","66cc66","99ff99","66ff66","339933","99cc99","66ff99","33ff99","33cc66","00cc66","66cc99","009966","009933","33ff66","00ff66","ccffcc","ccff99","99ff66","99ff33","00ff33","33ff33","00cc33","33cc33","66ff33","00ff00","66cc33","006600","003300","009900","33ff00","66ff00","99ff00","66cc00","00cc00","33cc00","339900","99cc66","669933","99cc33","336600","669900","99cc00","ccff66","ccff33","ccff00","999900","cccc00", "cccc33","333300","666600","999933","cccc66","666633","999966","cccc99","ffffcc","ffff99","ffff66","ffff33","ffff00","ffcc00","ffcc66","ffcc33","cc9933","996600","cc9900","ff9900","cc6600","993300","cc6633","663300","ff9966","ff6633","ff9933","ff6600","cc3300","996633","330000","663333","996666","cc9999","993333","cc6666","ffcccc","ff3333","cc3333","ff6666","660000","990000","cc0000","ff0000","ff3300","cc9966","ffcc99","ffffff","cccccc","999999","666666","333333","000000","000000","000000","000000", "000000","000000","000000","000000","000000"];a=b.extend({defaultColor:this.attr("defaultColor")||"#FFF",border:this.attr("border")||"1px solid #000",cellWidth:this.attr("cellWidth")||10,cellHeight:this.attr("cellHeight")||10,cellMargin:this.attr("cellMargin")||1,boxWidth:this.attr("boxWidth")||"115px",boxHeight:this.attr("boxHeight")||"20px",columns:this.attr("columns")||16,insert:this.attr("insert")||"after",buttonClass:this.attr("buttonClass")||"",colors:this.attr("colors")||k,displayColorCode:this.attr("displayColorCode")|| -false,colorCodeAlign:this.attr("colorCodeAlign")||"center",colorCodeColor:this.attr("colorCodeColor")||"#FFF",onSelect:null,onCellEnter:null,onClose:null,livePreview:false},a||{});this.hide();a.totalWidth=a.columns*(a.cellWidth+2*a.cellMargin);if(b.browser.msie)a.totalWidth+=2;a.totalHeight=Math.ceil(a.colors.length/a.columns)*(a.cellHeight+2*a.cellMargin);b.simpleColorOptions=a;this.each(function(){a=b.simpleColorOptions;var e=b("
");e.css("position","relative"); -var j=this.value&&this.value!=""?this.value:a.defaultColor,c=b("
");c.css({backgroundColor:j,border:a.border,width:a.boxWidth,height:a.boxHeight,"line-height":a.boxHeight,cursor:"pointer"});e.append(c);if(a.displayColorCode){c.text(this.value);c.css({color:a.colorCodeColor,textAlign:a.colorCodeAlign})}c.bind("click",{container:e,input:this,display_box:c},function(f){b("html").bind("click.simpleColorDisplay",function(d){b("html").unbind("click.simpleColorDisplay"); +false,colorCodeAlign:this.attr("colorCodeAlign")||"center",colorCodeColor:this.attr("colorCodeColor")||"#FFF",onSelect:null,onCellEnter:null,onClose:null,livePreview:false},a||{});this.hide();a.totalWidth=a.columns*(a.cellWidth+2*a.cellMargin);if(navigator.userAgent.indexOf("MSIE")!=-1)a.totalWidth+=2;a.totalHeight=Math.ceil(a.colors.length/a.columns)*(a.cellHeight+2*a.cellMargin);b.simpleColorOptions=a;this.each(function(){a=b.simpleColorOptions;var e=b("
");e.css("position", +"relative");var j=this.value&&this.value!=""?this.value:a.defaultColor,c=b("
");c.css({backgroundColor:j,border:a.border,width:a.boxWidth,height:a.boxHeight,"line-height":a.boxHeight,cursor:"pointer"});e.append(c);if(a.displayColorCode){c.text(this.value);c.css({color:a.colorCodeColor,textAlign:a.colorCodeAlign})}c.bind("click",{container:e,input:this,display_box:c},function(f){b("html").bind("click.simpleColorDisplay",function(d){b("html").unbind("click.simpleColorDisplay"); b(".simpleColorChooser").hide();d=b(d.target);if(d.is(".simpleColorCell")===false||b.contains(b(f.target).closest(".simpleColorContainer")[0],d[0])===false){c.css("backgroundColor",j);a.displayColorCode&&c.text(j)}a.onClose&&a.onClose()});if(f.data.container.chooser)f.data.container.chooser.toggle();else{var g=b("
");g.css({border:a.border,margin:"0 0 0 5px",width:a.totalWidth,height:a.totalHeight,top:0,left:a.boxWidth,position:"absolute"});f.data.container.chooser= g;f.data.container.append(g);for(var h=0;h");i.css({width:a.cellWidth+"px",height:a.cellHeight+"px",margin:a.cellMargin+"px",cursor:"pointer",lineHeight:a.cellHeight+"px",fontSize:"1px","float":"left",backgroundColor:"#"+a.colors[h]});g.append(i);if(a.onCellEnter||a.livePreview)i.bind("mouseenter",function(){a.onCellEnter&&a.onCellEnter(this.id);if(a.livePreview){c.css("backgroundColor","#"+this.id);a.displayColorCode&& c.text("#"+this.id)}});i.bind("click",{input:f.data.input,chooser:g,display_box:c},function(d){d.data.input.value="#"+this.id;b(d.data.input).change();d.data.display_box.css("backgroundColor","#"+this.id);d.data.chooser.hide();d.data.display_box.show();a.displayColorCode&&d.data.display_box.text("#"+this.id);a.onSelect&&a.onSelect(this.id)})}}});b(this).after(e)});b(".simpleColorDisplay").each(function(){b(this).click(function(e){e.stopPropagation()})});return this};b.fn.closeSelector=function(){this.each(function(){var a=