From cca3316c58540f4f1fd3f4784bf5e9fa2fcd1608 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Fri, 26 Aug 2011 12:24:16 +0200 Subject: [PATCH 1/2] Removed lock icon and related functionality --- modules/color/color-rtl.css | 4 --- modules/color/color.css | 14 ------------- modules/color/color.js | 44 +---------------------------------------- modules/color/images/lock.png | Bin 230 -> 0 bytes 4 files changed, 1 insertions(+), 61 deletions(-) delete mode 100644 modules/color/images/lock.png diff --git a/modules/color/color-rtl.css b/modules/color/color-rtl.css index bfbcd49..8893f6a 100644 --- a/modules/color/color-rtl.css +++ b/modules/color/color-rtl.css @@ -35,10 +35,6 @@ #palette .both { background-position: 0 -54px; } -#palette .lock { - float: right; - right: -10px; -} html.js #preview { float: right; } diff --git a/modules/color/color.css b/modules/color/color.css index e513dad..ae31b95 100644 --- a/modules/color/color.css +++ b/modules/color/color.css @@ -49,20 +49,6 @@ #palette .both { background-position: 100% -54px; /* LTR */ } - -#palette .lock { - float: left; /* LTR */ - position: relative; - top: -1.4em; - left: -10px; /* LTR */ - width: 20px; - height: 25px; - background: url(images/lock.png) no-repeat 50% 2px; - cursor: pointer; -} -#palette .unlocked { - background-position: 50% -22px; -} #palette .form-item { width: 20em; } diff --git a/modules/color/color.js b/modules/color/color.js index 43099ad..037a00b 100644 --- a/modules/color/color.js +++ b/modules/color/color.js @@ -10,7 +10,6 @@ Drupal.behaviors.color = { } var inputs = []; var hooks = []; - var locks = []; var focused = null; // Add Farbtastic. @@ -133,21 +132,8 @@ Drupal.behaviors.color = { if ($(input).val() && $(input).val() != color) { $(input).val(color); - // Update locked values. + // Update preview. if (propagate) { - i = input.i; - for (j = i + 1; ; ++j) { - if (!locks[j - 1] || $(locks[j - 1]).is('.unlocked')) break; - matched = shift_color(color, reference[input.key], reference[inputs[j].key]); - callback(inputs[j], matched, false); - } - for (j = i - 1; ; --j) { - if (!locks[j] || $(locks[j]).is('.unlocked')) break; - matched = shift_color(color, reference[input.key], reference[inputs[j].key]); - callback(inputs[j], matched, false); - } - - // Update preview. preview(); } @@ -192,39 +178,11 @@ Drupal.behaviors.color = { // Link to color picker temporarily to initialize. farb.linkTo(function () {}).setColor('#000').linkTo(this); - // Add lock. - var i = inputs.length; - if (inputs.length) { - var lock = $('
').toggle( - function () { - $(this).addClass('unlocked'); - $(hooks[i - 1]).attr('class', - locks[i - 2] && $(locks[i - 2]).is(':not(.unlocked)') ? 'hook up' : 'hook' - ); - $(hooks[i]).attr('class', - locks[i] && $(locks[i]).is(':not(.unlocked)') ? 'hook down' : 'hook' - ); - }, - function () { - $(this).removeClass('unlocked'); - $(hooks[i - 1]).attr('class', - locks[i - 2] && $(locks[i - 2]).is(':not(.unlocked)') ? 'hook both' : 'hook down' - ); - $(hooks[i]).attr('class', - locks[i] && $(locks[i]).is(':not(.unlocked)') ? 'hook both' : 'hook up' - ); - } - ); - $(this).after(lock); - locks.push(lock); - }; - // Add hook. var hook = $('
'); $(this).after(hook); hooks.push(hook); - $(this).parent().find('.lock').click(); this.i = i; inputs.push(this); }) diff --git a/modules/color/images/lock.png b/modules/color/images/lock.png deleted file mode 100644 index 9e1e00e5efd11ffcf50d13257fd935b92804f840..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 230 zcmeAS@N?(olHy`uVBq!ia0vp@Ky1Xp3?w&5E;IvD>H$6>t}hukBqk>A+`04P$B%~& z9s2wC@7=q1fsz$v>Hq)k`+uMD*RNk&w{C6I)wBhQGL{7S1v5B2yO9Ru(jdb$7)ZM{Pc1Y-?hq&k#F}a$H0#_yH$+eNWJyV zS+9Izn}U6*lkVi>_5a-$bGOb6XENKZ<(Ty8=4y_vped4C?pNbf^*A=^p75V{Vb;aJ c`|GV4`>omJ4i$SG16s`B>FVdQ&MBb@0I4ToN&o-= -- 1.7.3.1 From a1aa56870a2df8c0d5cb7d6497e384292d8a79c0 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Fri, 26 Aug 2011 14:55:38 +0200 Subject: [PATCH 2/2] Remove all of the hook/lock stuff - incuding images and css --- modules/color/color-rtl.css | 14 -------------- modules/color/color.css | 18 ------------------ modules/color/color.js | 6 ------ modules/color/images/hook-rtl.png | Bin 116 -> 0 bytes modules/color/images/hook.png | Bin 116 -> 0 bytes 5 files changed, 0 insertions(+), 38 deletions(-) delete mode 100644 modules/color/images/hook-rtl.png delete mode 100644 modules/color/images/hook.png diff --git a/modules/color/color-rtl.css b/modules/color/color-rtl.css index 8893f6a..d30451c 100644 --- a/modules/color/color-rtl.css +++ b/modules/color/color-rtl.css @@ -21,20 +21,6 @@ margin-right: 0; margin-left: 5px; } -#palette .hook { - float: right; -} -#palette .down, -#palette .up, -#palette .both { - background: url(images/hook-rtl.png) no-repeat 0 0; -} -#palette .up { - background-position: 0 -27px; -} -#palette .both { - background-position: 0 -54px; -} html.js #preview { float: right; } diff --git a/modules/color/color.css b/modules/color/color.css index ae31b95..03dcc58 100644 --- a/modules/color/color.css +++ b/modules/color/color.css @@ -31,24 +31,6 @@ margin-right: 5px; /* LTR */ cursor: pointer; } - -#palette .hook { - float: left; /* LTR */ - margin-top: 3px; - width: 16px; - height: 16px; -} -#palette .down, -#palette .up, -#palette .both { - background: url(images/hook.png) no-repeat 100% 0; /* LTR */ -} -#palette .up { - background-position: 100% -27px; /* LTR */ -} -#palette .both { - background-position: 100% -54px; /* LTR */ -} #palette .form-item { width: 20em; } diff --git a/modules/color/color.js b/modules/color/color.js index 037a00b..e2f7bb4 100644 --- a/modules/color/color.js +++ b/modules/color/color.js @@ -9,7 +9,6 @@ Drupal.behaviors.color = { return; } var inputs = []; - var hooks = []; var focused = null; // Add Farbtastic. @@ -178,11 +177,6 @@ Drupal.behaviors.color = { // Link to color picker temporarily to initialize. farb.linkTo(function () {}).setColor('#000').linkTo(this); - // Add hook. - var hook = $('
'); - $(this).after(hook); - hooks.push(hook); - this.i = i; inputs.push(this); }) diff --git a/modules/color/images/hook-rtl.png b/modules/color/images/hook-rtl.png deleted file mode 100644 index a26b211e126c298b68a23bef312d8a6dd68f9f29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 116 zcmeAS@N?(olHy`uVBq!ia0vp^96%h%$P6T}I+T6~QfvV}A+Age3@$D%RWpnNfFg_~ zL4Lsu4$p3+0XZ_BE{-7_Gm{e>82?L31t{n>ta@edSNfw=Fjbr(|C+$R=?YfIf$A7M MUHx3vIVCg!0H}H$FVdQ&MBb@0PV6N4FCWD -- 1.7.3.1