From: Sarven Capadisli Date: Tue, 16 Jun 2009 02:33:10 +0000 (+0000) Subject: Converts user entry in the form of '#1B2' into '#11BB22' for user X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bd8f9a979acb1607e00499dfba223a51b57596af;p=quix0rs-gnu-social.git Converts user entry in the form of '#1B2' into '#11BB22' for user design swatches --- diff --git a/js/farbtastic/farbtastic.go.js b/js/farbtastic/farbtastic.go.js index 4e0493b40a..2f202ced1f 100644 --- a/js/farbtastic/farbtastic.go.js +++ b/js/farbtastic/farbtastic.go.js @@ -59,7 +59,9 @@ $(document).ready(function() { swatches .each(SynchColors) .blur(function() { - $(this).val($(this).val().toUpperCase()); + tv = $(this).val(); + $(this).val(tv.toUpperCase()); + (tv.length == 4) ? ((tv[0] == '#') ? $(this).val('#'+tv[1]+tv[1]+tv[2]+tv[2]+tv[3]+tv[3]) : '') : ''; }) .focus(function() { $('#color-picker').show();