From 9ec99940e73d3474d0fd86f9e12072ea97538440 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Wed, 8 Apr 2015 08:46:02 +0200 Subject: [PATCH] [ADD] backport web_widget_color fixes #51 --- web_widget_color/__init__.py | 25 + web_widget_color/__openerp__.py | 140 +++ web_widget_color/static/lib/jscolor/arrow.gif | Bin 0 -> 66 bytes web_widget_color/static/lib/jscolor/cross.gif | Bin 0 -> 83 bytes web_widget_color/static/lib/jscolor/demo.html | 12 + web_widget_color/static/lib/jscolor/hs.png | Bin 0 -> 2684 bytes web_widget_color/static/lib/jscolor/hv.png | Bin 0 -> 2865 bytes .../static/lib/jscolor/jscolor.js | 1010 +++++++++++++++++ web_widget_color/static/src/css/widget.css | 23 + web_widget_color/static/src/img/form_view.png | Bin 0 -> 1826 bytes web_widget_color/static/src/img/icon.png | Bin 0 -> 3454 bytes web_widget_color/static/src/img/list_view.png | Bin 0 -> 13773 bytes web_widget_color/static/src/img/picker.png | Bin 0 -> 5998 bytes web_widget_color/static/src/js/widget.js | 59 + web_widget_color/static/src/xml/widget.xml | 24 + 15 files changed, 1293 insertions(+) create mode 100644 web_widget_color/__init__.py create mode 100644 web_widget_color/__openerp__.py create mode 100644 web_widget_color/static/lib/jscolor/arrow.gif create mode 100644 web_widget_color/static/lib/jscolor/cross.gif create mode 100644 web_widget_color/static/lib/jscolor/demo.html create mode 100644 web_widget_color/static/lib/jscolor/hs.png create mode 100644 web_widget_color/static/lib/jscolor/hv.png create mode 100644 web_widget_color/static/lib/jscolor/jscolor.js create mode 100644 web_widget_color/static/src/css/widget.css create mode 100644 web_widget_color/static/src/img/form_view.png create mode 100644 web_widget_color/static/src/img/icon.png create mode 100644 web_widget_color/static/src/img/list_view.png create mode 100644 web_widget_color/static/src/img/picker.png create mode 100644 web_widget_color/static/src/js/widget.js create mode 100644 web_widget_color/static/src/xml/widget.xml diff --git a/web_widget_color/__init__.py b/web_widget_color/__init__.py new file mode 100644 index 00000000..c18661e9 --- /dev/null +++ b/web_widget_color/__init__.py @@ -0,0 +1,25 @@ +# -*- encoding: utf-8 -*- +############################################################################ +# +# Odoo, Open Source Web Color +# Copyright (C) 2012 Savoir-faire Linux (). +# Copyright (C) 2014 Anybox +# Copyright (C) 2015 Taktik SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# @author Étienne Beaudry Auger +# @author Adil Houmadi +# +############################################################################## diff --git a/web_widget_color/__openerp__.py b/web_widget_color/__openerp__.py new file mode 100644 index 00000000..4d00eb83 --- /dev/null +++ b/web_widget_color/__openerp__.py @@ -0,0 +1,140 @@ +# -*- encoding: utf-8 -*- +############################################################################ +# +# Odoo, Open Source Web Widget Color +# Copyright (C) 2012 Savoir-faire Linux (). +# Copyright (C) 2014 Anybox +# Copyright (C) 2015 Taktik SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# @author Étienne Beaudry Auger +# @author Adil Houmadi +# +############################################################################## +{ + 'name': "Web Widget Color", + 'category': "web", + 'version': "1.0", + 'depends': ['base', 'web'], + 'description': ''' +Color widget for Odoo web client +================================ + +This module aims to add a color picker to Odoo. + +It's a `jsColor `_ lib integration. + + +Features +======== + +* The picker allow the user to quickly select a color on edit mode + + |picker| + + .. note:: + + Notice how html code and the background color is updating when selecting + a color. + + +* Display the color on form view when you are not editing it + + |formview| + +* Display the color on list view to quickly find what's wrong! + + |listview| + + +Requirements +============ + +This module has been ported to 8.0 + + +Usage +===== + +You need to declare a char field of at least size 7:: + + _columns = { + 'color': fields.char( + u"Couleur", + help=u"Toutes couleur valid css, exemple blue ou #f57900" + ), + } + + OR + + color = fields.Char( + string="Color", + help="Choose your color" + ) + + +In the view declaration, put widget='color' attribute in the field tag:: + + ... + + + ... + + + ... + + + ... + +.. |picker| image:: /web_widget_color/static/src/img/picker.png +.. |formview| image:: /web_widget_color/static/src/img/form_view.png +.. |listview| image:: /web_widget_color/static/src/img/list_view.png + +Credits +======= + +Contributors +------------ + +* Adil Houmadi + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org.''', + 'qweb': [ + 'static/src/xml/widget.xml', + ], + 'css': [ + 'static/src/css/widget.css', + ], + 'js': [ + 'static/lib/jscolor/jscolor.js', + 'static/src/js/widget.js', + ], + 'auto_install': False, + 'installable': True, + 'web_preload': True, +} diff --git a/web_widget_color/static/lib/jscolor/arrow.gif b/web_widget_color/static/lib/jscolor/arrow.gif new file mode 100644 index 0000000000000000000000000000000000000000..246478a864f812d93d4cd0e0d0ad1c8e2d09c825 GIT binary patch literal 66 zcmZ?wbhEHbWM|-JSjfZx1poj4Utv=LM2bII7`Ygj7<53QAbAERVV@R>f}L*~a`L;Z PKCZl?^}@uHk--`OML81Y literal 0 HcmV?d00001 diff --git a/web_widget_color/static/lib/jscolor/cross.gif b/web_widget_color/static/lib/jscolor/cross.gif new file mode 100644 index 0000000000000000000000000000000000000000..0ee9c7ac517bee40b78aea03afa809631f0b69fa GIT binary patch literal 83 zcmZ?wbhEHb + + jscolor demo + + + + + + Click here: + + + diff --git a/web_widget_color/static/lib/jscolor/hs.png b/web_widget_color/static/lib/jscolor/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Qe;Bk#LI3~& literal 0 HcmV?d00001 diff --git a/web_widget_color/static/lib/jscolor/hv.png b/web_widget_color/static/lib/jscolor/hv.png new file mode 100644 index 0000000000000000000000000000000000000000..1c5e01f8bcecc4cf835e8eeeaa43ef2c06789022 GIT binary patch literal 2865 zcmX9=3pmqV7@teXHB3Y-6(VIKN(`gs(lEJ2EJSn5Crm8<3KhyeDHUOICnT3LV_lSr zSZ;GyqBJp=+1PCR_SJKqbI$X;=RD_m-{1TDz3)kPaYD#Qs!D=DAQ^i*TUWu}ESNzO z!h$tb?&uc~NOHs8*4pjL*kZxr-PxxyX>x_gxykAYer+%xw7GJL6<~$lv;J_uukT@e zT+7b}$(pn*(JJ8$DZ#LZ01jlU-F%s?>x-3}&1jWkz{Hc;TVcidNj^67rKf!1D*@3) ztLL+`4RJ%9hMug+6V6!!-IHycuV!0OlQmpmv2CKSg0YG1{n}Dwm~{0fWmk@tnE%bH zGDMD}$zh}Xd*A5Jr>Ab?KaI7@rj$4go;`Iq6;(c5H(>=6GfP&HNa3NNYQLnDvJ2ne z$YJeDOOojN`RsDxcPJ(@V2^adMpBgs?_RszQhhwQTbkTUT9<$&gblmnY#tn#SD%?s z6!FjP;K)%vq`iXljQbV;EA`q3gN>D#kt_%-rrtu}_V)B!9x+O;F>_Uw;U$2LUW(r( zZ^t$jiL0NIPPJC#r9ftBYTo7JNd@BVMwfPoS>#W-s{js57)P8TQqF2LKJSC~q zN`(OhzStrI{*42`M}?+OHN|N(nHmc2&ss7X>pqp|EuFchzf#w`Q<>0h788{$3pLsi z{A+Y8H$ZvOeD+cX_=w?G*WmD7#5x;KQ;esP!0)6)^5AH8-y+H+(ltKN1HTE6jI?K z(Oj2zOym!q0yMO-dc+a4KFGVLQdOCayj7RKSbo5}XS%`Er&=Enk8l=Lt4N_|ws%>z zDTw$}Y`Nm#m5bv zhmbvJfbg?pPsmqI$V;VUb6K4%(8Blyamyoc^3Mt~#nxOV2-1;QS z7!g7Xk6~wu3v&9INnRdHE*g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Lq*p?!~??u&DrIz2ow@FRy0XX+-+%7G>uU0&kTN1W1G| zr>H6)4|9Ji%2`d{EBb%`9?5PNx968;9+OmY4|DC?&+M;;jN=L6in4xY&Q$twq0QFAeZuQ15|q?2tO{QUL* E0LKozl>h($ literal 0 HcmV?d00001 diff --git a/web_widget_color/static/lib/jscolor/jscolor.js b/web_widget_color/static/lib/jscolor/jscolor.js new file mode 100644 index 00000000..47c89616 --- /dev/null +++ b/web_widget_color/static/lib/jscolor/jscolor.js @@ -0,0 +1,1010 @@ +/** + * jscolor, JavaScript Color Picker + * + * @version 1.4.4 + * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html + * @author Jan Odvarko, http://odvarko.cz + * @created 2008-06-15 + * @updated 2014-12-09 + * @link http://jscolor.com + */ + + +var jscolor = { + + + dir : '', // location of jscolor directory (leave empty to autodetect) + bindClass : 'color', // class name + binding : true, // automatic binding via + preloading : true, // use image preloading? + + + install : function() { + jscolor.addEvent(window, 'load', jscolor.init); + }, + + + init : function() { + if(jscolor.binding) { + jscolor.bind(); + } + if(jscolor.preloading) { + jscolor.preload(); + } + }, + + + getDir : function() { + if(!jscolor.dir) { + var detected = jscolor.detectDir(); + jscolor.dir = detected!==false ? detected : 'jscolor/'; + } + return jscolor.dir; + }, + + + detectDir : function() { + var base = location.href; + + var e = document.getElementsByTagName('base'); + for(var i=0; i vs[a] ? + (-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) : + tp[a], + -vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ? + (-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) : + (tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c) + ]; + } + drawPicker(pp[a], pp[b]); + } + }; + + + this.importColor = function() { + if(!valueElement) { + this.exportColor(); + } else { + if(!this.adjust) { + if(!this.fromString(valueElement.value, leaveValue)) { + styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage; + styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor; + styleElement.style.color = styleElement.jscStyle.color; + this.exportColor(leaveValue | leaveStyle); + } + } else if(!this.required && /^\s*$/.test(valueElement.value)) { + valueElement.value = ''; + styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage; + styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor; + styleElement.style.color = styleElement.jscStyle.color; + this.exportColor(leaveValue | leaveStyle); + + } else if(this.fromString(valueElement.value)) { + // OK + } else { + this.exportColor(); + } + } + }; + + + this.exportColor = function(flags) { + if(!(flags & leaveValue) && valueElement) { + var value = this.toString(); + if(this.caps) { value = value.toUpperCase(); } + if(this.hash) { value = '#'+value; } + valueElement.value = value; + } + if(!(flags & leaveStyle) && styleElement) { + styleElement.style.backgroundImage = "none"; + styleElement.style.backgroundColor = + '#'+this.toString(); + styleElement.style.color = + 0.213 * this.rgb[0] + + 0.715 * this.rgb[1] + + 0.072 * this.rgb[2] + < 0.5 ? '#FFF' : '#000'; + } + if(!(flags & leavePad) && isPickerOwner()) { + redrawPad(); + } + if(!(flags & leaveSld) && isPickerOwner()) { + redrawSld(); + } + }; + + + this.fromHSV = function(h, s, v, flags) { // null = don't change + if(h !== null) { h = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, h)); } + if(s !== null) { s = Math.max(0.0, this.minS, Math.min(1.0, this.maxS, s)); } + if(v !== null) { v = Math.max(0.0, this.minV, Math.min(1.0, this.maxV, v)); } + + this.rgb = HSV_RGB( + h===null ? this.hsv[0] : (this.hsv[0]=h), + s===null ? this.hsv[1] : (this.hsv[1]=s), + v===null ? this.hsv[2] : (this.hsv[2]=v) + ); + + this.exportColor(flags); + }; + + + this.fromRGB = function(r, g, b, flags) { // null = don't change + if(r !== null) { r = Math.max(0.0, Math.min(1.0, r)); } + if(g !== null) { g = Math.max(0.0, Math.min(1.0, g)); } + if(b !== null) { b = Math.max(0.0, Math.min(1.0, b)); } + + var hsv = RGB_HSV( + r===null ? this.rgb[0] : r, + g===null ? this.rgb[1] : g, + b===null ? this.rgb[2] : b + ); + if(hsv[0] !== null) { + this.hsv[0] = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, hsv[0])); + } + if(hsv[2] !== 0) { + this.hsv[1] = hsv[1]===null ? null : Math.max(0.0, this.minS, Math.min(1.0, this.maxS, hsv[1])); + } + this.hsv[2] = hsv[2]===null ? null : Math.max(0.0, this.minV, Math.min(1.0, this.maxV, hsv[2])); + + // update RGB according to final HSV, as some values might be trimmed + var rgb = HSV_RGB(this.hsv[0], this.hsv[1], this.hsv[2]); + this.rgb[0] = rgb[0]; + this.rgb[1] = rgb[1]; + this.rgb[2] = rgb[2]; + + this.exportColor(flags); + }; + + + this.fromString = function(hex, flags) { + var m = hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i); + if(!m) { + return false; + } else { + if(m[1].length === 6) { // 6-char notation + this.fromRGB( + parseInt(m[1].substr(0,2),16) / 255, + parseInt(m[1].substr(2,2),16) / 255, + parseInt(m[1].substr(4,2),16) / 255, + flags + ); + } else { // 3-char notation + this.fromRGB( + parseInt(m[1].charAt(0)+m[1].charAt(0),16) / 255, + parseInt(m[1].charAt(1)+m[1].charAt(1),16) / 255, + parseInt(m[1].charAt(2)+m[1].charAt(2),16) / 255, + flags + ); + } + return true; + } + }; + + + this.toString = function() { + return ( + (0x100 | Math.round(255*this.rgb[0])).toString(16).substr(1) + + (0x100 | Math.round(255*this.rgb[1])).toString(16).substr(1) + + (0x100 | Math.round(255*this.rgb[2])).toString(16).substr(1) + ); + }; + + + function RGB_HSV(r, g, b) { + var n = Math.min(Math.min(r,g),b); + var v = Math.max(Math.max(r,g),b); + var m = v - n; + if(m === 0) { return [ null, 0, v ]; } + var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m); + return [ h===6?0:h, m/v, v ]; + } + + + function HSV_RGB(h, s, v) { + if(h === null) { return [ v, v, v ]; } + var i = Math.floor(h); + var f = i%2 ? h-i : 1-(h-i); + var m = v * (1 - s); + var n = v * (1 - s*f); + switch(i) { + case 6: + case 0: return [v,n,m]; + case 1: return [n,v,m]; + case 2: return [m,v,n]; + case 3: return [m,n,v]; + case 4: return [n,m,v]; + case 5: return [v,m,n]; + } + } + + + function removePicker() { + delete jscolor.picker.owner; + document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB); + } + + + function drawPicker(x, y) { + if(!jscolor.picker) { + jscolor.picker = { + box : document.createElement('div'), + boxB : document.createElement('div'), + pad : document.createElement('div'), + padB : document.createElement('div'), + padM : document.createElement('div'), + sld : document.createElement('div'), + sldB : document.createElement('div'), + sldM : document.createElement('div'), + btn : document.createElement('div'), + btnS : document.createElement('span'), + btnT : document.createTextNode(THIS.pickerCloseText) + }; + for(var i=0,segSize=4; iD4PB-gRLN!ud3B`(_ zeZ{p~8)?whr5bmQmL=4+m!NHkXhZGSowGl7&U@aS=RCLXr?xMUsC{DRO5Y)od*DQolji}D869; z8da!={k&Bsw;O3`IQ?;lWDO=Z97cN{NuF2|hxzD+0p0J~rO71zQ(XF?#pcr)@y z5S3U`{hmqJ^_E>any;^&6CQTQqSH%uHPdbfj6kU0mYEe;0?FDQhR#2t7gABhea}~% z_zBy##@1aLS>X}L12%OHJdbc7|m0->WFSVX5;|F5mIhMJgoTl-U-8d6(3i$$aTj{7U^d*s$s z;4N`%O?CC9{c)38CMH*gPe&@&mNss;zjR^YfM+o-85iNwwBPIa{LQe6gfLN0gVZg5HByUN4>q%?`C_TQ0P6u<-EMW z;NY&(FO%ZAp;c8?jg&!?&y;l9P+(<|5bLOa&Y~*r6#g zGBu?LuG<+vAue%~I6prPnM~%6y#EOGbJ>4%x0d(4!b-alX|mTl0qk{KC9^$y)cz}U zXZOtu3ZtT>>_=%T=0l=zUuB>H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file mode 100644 index 0000000000000000000000000000000000000000..540f72db957725439a21eb0e7815690944fdc319 GIT binary patch literal 3454 zcmV-^4T18BP)uVsURyykzcv%6s1k2>nBb5B~yRM*DKh{1iuX$s_a0O$ST~l#ZPi z`lfI{=J39AK*{QTMAbhEvkA1 zpfJm5lh|D+A17780rSXIwKbUWNhyK0ik3sxc`o?M>Wt*7SPT84i^f+}DG%v39y}30 zGMyoPs_un0Iwekd7;+*;d3eSLUJ1XZtL}BIf`Cw%<$>>DcXF@3y~zfzW2SDYdc^l# z?~GP8wp6=4>O0|K*?O0%i-1trf}b+*S+e=$o# z3qtQU>-+T>#(M667x7HRY9qBtc&rz<%C7}!noh5{TBp-0f8~^09@U#Trd0W5Jfq7C zD=k-(fKa##f0eN6NHPh{o9Kwy7CYxx5=c&UpMGOfHpPn(tNbGVI()gdpO8pEC~Uy@ z)C`zvk+5wy!R7L6xy`kN0qd3bX>?gG!SL2r9@0|27oJS^7!wIN#TSa|F(gSOq+8fB zS$-|Eg;cVK*W`kfEoIk+O^TCaW#t!^)MAq_BsIqpFe=Pk;l)ulpXV?ug`-I%JhYEg z#s0tUY~nQC%G=tUlCiIPxjK|z>$=Ar_PEVjy%>h^enl(+1)fKHNcuPIAER(BBBGGI zViF0%#q#f+$#$o^M4kXcidB79Qa(`7=de#IXtQ7R2)B!Lis@c~SA>~>cf`1~>p3&b z>{>OpBPa7rR|xnYV|=jSz}%kZNXb5*U;g)iX~BXIu-TZt3a4i!<+CPilaaDDrga(* z1wpy1T=i?DqAf4RpXUZ!$JjZ^v5<4|QpDW}JNj5$cx{$cg>68q$tC62nDel{@@Z=* zzs@p5u zXt0!oR1;el2M5q&(qIS-JCCMlc#QHJo$#a+9ulXH=$ zE{e9D3}<^e-%d*-gTV?u!TSsy!6wG~*cvPew|!*UFg~z{wUE^SRg3yaxQ!}?0VGY;2IGtm@mCb<)?`;8%TzHIg%@&{OMH0qG zd8eIU4U*?6r))LjA^Xadf51_X*er+-gg)Tyi=2Cprkf0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NfAu7Mpjj@!nPa7c8%sU}t?;737GtLH2_8Y?NEHlZgbQcOE7U01l;%Ep+( zR870-oJby4M#3>XC#bdKM5yne!DT+R)~tWT)V_pB!C+?LQcwUxdahqA+CZ2F?0ezI40 z!uoH5%hvgn7?%=P4JU@Evo@|K)xCC*H3=t9Hx04&YD~i+8b2j?sqV@)cXM3+E5V#W zpTSp^Zjlc-E}ifzH##j?RmM9_HsMfZ(9Y2Dk_!dGuhRJ$!Aq-to#yV+@P8H*@q(|0 z|Dx!h1zK#aQMS(B&3it*b4%6ZDs0$G<}9;w6#rasxQ218jeC1#=5K=uJZ{jp1T~J* zb>B_)wzbxn>umiNosZv(^4!m2&}f)Z@Vw}yspSG@V9Nfu_i$>5-UwUV@QlFc@M-Ied!p8o#_ZaU)ugyitj6;Hh|2JQoi^b8f z)q_U#T6l5NE>)3b6#>^VPB_l{uW~#uIQakP#mSloL!vrC+rp=kY0Fw_Nghs g$1B$F@Y{_41yuss%Nc1x5&!@I07*qoM6N<$g0nBi^Z)<= literal 0 HcmV?d00001 diff --git a/web_widget_color/static/src/img/list_view.png b/web_widget_color/static/src/img/list_view.png new file mode 100644 index 0000000000000000000000000000000000000000..f4965fd5e97f4a4e4b562dabcb6c001ffcc97d57 GIT binary patch literal 13773 zcmdUWbzD_lx9$d%kQOARUjb6Tf-*fJ{_xsMhzx(I?iR@U5wdb5`%rTzl8P9%kUsWFe3e^<^0)c-|K}G|CKo^4N zKd~|4_f4#%uke6rrX(+eI7j_UZ_JH_cW@jPbe|#+xFo3mXo#d_3V0LC<(`Tx)+9DH z5djzeNly#{L65j6BdO&vx|ZT;ptW~)Zfs>aatTfH@|~9&1AKQ9##M+kHF3V*kv6#f zW6iB->`#)OZ`D{&dH>Z$h1cje-vk*E}-h>o) z>~DA_3v-|6z9sh@`E&~{?4+U|iHqan!}Ee!!~4^WN6cfgOZUC(S-bQ%J*sV^YaziP`j_L{iuctv4`eY$c=19)#vtC*@ezHR)Tb zy)yS&>GV*F`1_s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{ + this.parse_value(this.$('input').val(), ''); + return true; + } catch (e) { + return false; + } + } + return true; + }, + render_value: function () { + var show_value = this.format_value(this.get('value'), ''); + if (!this.get("effective_readonly")) { + var $input = this.$el.find('input'); + $input.val(show_value); + $input.css("background-color", show_value) + jscolor.init(this.$el[0]); + } else { + this.$(".oe_form_char_content").text(show_value); + this.$('div').css("background-color", show_value) + } + } + }); + + /* + * Init jscolor for each editable mode on view form + */ + instance.web.FormView.include({ + to_edit_mode: function () { + this._super(); + jscolor.init(this.$el[0]); + } + }); +}; diff --git a/web_widget_color/static/src/xml/widget.xml b/web_widget_color/static/src/xml/widget.xml new file mode 100644 index 00000000..c62ae1cf --- /dev/null +++ b/web_widget_color/static/src/xml/widget.xml @@ -0,0 +1,24 @@ + + + + + + + + +
+ + + + + +
+ +