/[drupal]/contributions/modules/signwriter/color.js
ViewVC logotype

Contents of /contributions/modules/signwriter/color.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Tue Sep 2 04:26:33 2008 UTC (14 months, 3 weeks ago) by agileware
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, DRUPAL-6--1-1, DRUPAL-5--1-3, DRUPAL-5--1-2, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.1: +1 -0 lines
File MIME type: text/javascript
#260469 by solaas: Multiline Support.
#84485 by gpdinoz: Adding drop shadow to signwriter.
Enhanced the caching function.
Added uninstall to the install file.
1 /* $Id $ */
2 $(function() {
3 if (Drupal.jsEnabled) {
4 farbify($('#edit-background'), '#background-farb');
5 farbify($('#edit-foreground'), '#foreground-farb');
6 farbify($('#edit-shadow-color'), '#shadow-color-farb');
7 }
8 });
9
10 function updateColor(elt, farb) {
11 var text = elt.val();
12 if (text.length == 6)
13 farb.setColor('#' + text);
14 }
15
16 function farbify(elt, wrapper) {
17 var farb = $.farbtastic(wrapper);
18 farb.linkTo(function(color) {
19 elt
20 .css('background-color', color)
21 .css('color', this.hsl[2] > 0.5 ? '#000' : '#fff')
22 .val(color.substring(1));
23 });
24 farb.setColor('#' + elt.val());
25 elt.bind('keyup', function(){ updateColor(elt, farb); });
26 }

  ViewVC Help
Powered by ViewVC 1.1.2