From 667d6c715fc3b7576e6757644fed44ca0d9d2e1c Mon Sep 17 00:00:00 2001 From: Milan Date: Mon, 22 Apr 2019 00:51:12 +0200 Subject: [PATCH] use html5 color input --- .../planung/templates/user_settings.html | 71 +++---------------- 1 file changed, 11 insertions(+), 60 deletions(-) diff --git a/website/agenda/planung/templates/user_settings.html b/website/agenda/planung/templates/user_settings.html index dbc6fbb..1562e27 100644 --- a/website/agenda/planung/templates/user_settings.html +++ b/website/agenda/planung/templates/user_settings.html @@ -6,61 +6,8 @@ selectedId = ($(this).attr('id')); showColors(); }); - //$("#content").append(getColor(8)); }); - /* - function getColor(noOfColors) { - var html = ""; - var frequency = 5 / noOfColors; - for (var i = 0; i < noOfColors;++i) { - r = Math.sin(frequency * i + 0) * (127) + 128; - g = Math.sin(frequency * i + 1) * (127) + 128; - b = Math.sin(frequency * i + 3) * (127) + 128; - li = '
  • '; - li = li.replace("{r}", Math.floor(r)); - li = li.replace("{g}", Math.floor(g)); - li = li.replace("{b}", Math.floor(b)); - html = html + li; - } - return html; - } - - function showColors(){ - var colors=['00','22','44','66','88','aa','cc','ee','ff']; - var content=''; - - for (var i in colors){ - for (var j in colors){ - var r=colors[i]; - var g=colors[colors.length-j-1]; - var b =Math.round((i-j))% colors.length; - if(b<0)b=Math.round((j-i))% colors.length; - b=colors[b] - var value='#'+r+g+b; - content+='
    '; - } - content+='
    ' - } - - for (var i in colors){ - var gray=colors[colors.length-i-1]; - var value='#'+gray+gray+gray; - content+='
    '; - } - content+='
    ' - - $("#colors").html(content); - $("#colors div.col").click( - function(){ - var color=$(this).attr("value"); - $('#'+selectedId).css('background',color); - $('#'+selectedId).attr('value',color); - } - ); - } - */ - function showColors() { var colors = [ '#ef9a9a', '#f48fb1', '#ce93d8', '#b39ddb', '#9fa8da', '#90caf9', '#81d4fa', '#80deea', '#80cbc4', '#a5d6a7', @@ -87,8 +34,8 @@ @@ -142,9 +89,12 @@ div.col { : + style="padding:0;background: <TMPL_VAR value>" + name="" + class="color" + value="" + type="color" + > @@ -153,10 +103,11 @@ div.col { -
    + - +