[sagenb] 01/01: Minor fix to the vanderlee colorpicker patch

Ximin Luo infinity0 at debian.org
Fri Dec 2 23:04:02 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository sagenb.

commit e1d9fe7705043fb412afffab16c903b6fcf3efdc
Author: Ximin Luo <infinity0 at pwned.gg>
Date:   Sat Dec 3 00:03:20 2016 +0100

    Minor fix to the vanderlee colorpicker patch
---
 .../switch-system-jquery-vanderlee-colorpicker.patch    | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/debian/patches/switch-system-jquery-vanderlee-colorpicker.patch b/debian/patches/switch-system-jquery-vanderlee-colorpicker.patch
index 89f5961..b5876f8 100644
--- a/debian/patches/switch-system-jquery-vanderlee-colorpicker.patch
+++ b/debian/patches/switch-system-jquery-vanderlee-colorpicker.patch
@@ -7,7 +7,7 @@ Forwarded: not-needed
 
 --- a/sagenb/notebook/interact.py
 +++ b/sagenb/notebook/interact.py
-@@ -483,18 +483,12 @@
+@@ -483,53 +483,40 @@
                    <input type="text"
                           id="%s"
                           name="color"
@@ -28,7 +28,12 @@ Forwarded: not-needed
  
          # JS
          s += """<script>
-@@ -506,27 +500,21 @@
+              setTimeout(function () {
+-                 var def = '%s'.slice(1), div = $('#%s-picker div'),
+-                     input = $('#%s'), picker = $('#%s-picker');
++                 var def = '%s'.slice(1), input = $('#%s');
+                  input.css({
+                      backgroundColor: '%s',
                       // Should be good enough:
                       color: (parseInt(def.slice(0, 2), 16) + parseInt(def.slice(2, 4), 16) + parseInt(def.slice(4, 6), 16)) / 3 > 127 ? '#000000' : '#ffffff'
                   });
@@ -53,7 +58,7 @@ Forwarded: not-needed
 -                     onSubmit : function (hsb, hex, rgb, el) {
 -                         $(el).ColorPickerHide();
 -                     }
-+                 picker.colorpicker({
++                 input.colorpicker({
 +                    color: '%s',
 +                    alpha: true,
 +                    showOn: 'all',
@@ -70,7 +75,11 @@ Forwarded: not-needed
 +
                   });
               }, 1);
-              </script>""" % (default, id, id, id, default, default, change)
+-             </script>""" % (default, id, id, id, default, default, change)
++             </script>""" % (default, id, default, default, change)
+ 
+     elif widget == 'jpicker':
+         raise ValueError("not supported in Debian")
 --- a/sagenb/data/sage/html/notebook/base.html
 +++ b/sagenb/data/sage/html/notebook/base.html
 @@ -23,8 +23,8 @@

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagenb.git



More information about the debian-science-commits mailing list