From 93c811ab705e8383bf787777e06d9b1082236f53 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 21 Jun 2019 21:45:14 +0100 Subject: [PATCH] Update typedInput icons to svg Map any request for one of our pngs to its svg replacement --- .../src/images/typedInput/09.png | Bin 638 -> 0 bytes .../src/images/typedInput/09.svg | 1 + .../src/images/typedInput/az.png | Bin 546 -> 0 bytes .../src/images/typedInput/az.svg | 1 + .../src/images/typedInput/bin.png | Bin 638 -> 0 bytes .../src/images/typedInput/bin.svg | 1 + .../src/images/typedInput/bool.png | Bin 646 -> 0 bytes .../src/images/typedInput/bool.svg | 1 + .../src/images/typedInput/env.png | Bin 809 -> 0 bytes .../src/images/typedInput/env.svg | 1 + .../src/images/typedInput/expr.png | Bin 563 -> 0 bytes .../src/images/typedInput/expr.svg | 1 + .../src/images/typedInput/json.png | Bin 588 -> 0 bytes .../src/images/typedInput/json.svg | 1 + .../src/images/typedInput/re.png | Bin 502 -> 0 bytes .../src/images/typedInput/re.svg | 1 + .../src/images/typedInput/target.png | Bin 944 -> 0 bytes .../src/images/typedInput/target.svg | 1 + .../src/js/ui/common/typedInput.js | 32 +++++++++++------- 19 files changed, 28 insertions(+), 13 deletions(-) delete mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/09.png create mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/09.svg delete mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/az.png create mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/az.svg delete mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/bin.png create mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/bin.svg delete mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/bool.png create mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/bool.svg delete mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/env.png create mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/env.svg delete mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/expr.png create mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/expr.svg delete mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/json.png create mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/json.svg delete mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/re.png create mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/re.svg delete mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/target.png create mode 100644 packages/node_modules/@node-red/editor-client/src/images/typedInput/target.svg diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/09.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/09.png deleted file mode 100644 index 247371fe5b75d644ec451afc35a922f08f50a05f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 638 zcmV-^0)hRBP)C*uC+KGxOa^k1h1v7{?RJ$;9J_*&3!p4js; z9*a0=2-iNRe;@Y^qz_wW&ad+$R zUxhY2!VN<&Rhta#Zxx0s-os&sC}CxBL7pUv_;c*S``m;uTckk;eu`g%a|$A~i6%yc Yzlo({07*qoM6N<$f+#^5zyJUM diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/09.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/09.svg new file mode 100644 index 000000000..29c54b860 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/09.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/az.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/az.png deleted file mode 100644 index 5f5d2404e0ed7e1642d7fbf9ae0f570dce108e74..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 546 zcmV+-0^R+IP)7WeHaB9K(2r z7ns8P7|81)qDhPhd74WI>TaBy%Hy~t#oiOgMWIqpG8D&LIZUG_JjF7)qOB88@H@^; zOAokiTCo%zA7D3*TSDhKY5?=~I!-H^9bvx>qb~;VLCEPhp;GS)ue{{nQlzviXwO)) z?ewqE#Uu5T)`@SVxZY#Em*+5@PtigOvu~Q z^AM{>u~`jn>Pg%Ya`pz7n=N(&UxdHAu8g&XX%jwQyF#Ns6Gh(l7#;~07*qoM6N<$f>2KFGXMYp diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/az.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/az.svg new file mode 100644 index 000000000..e0abbdc4a --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/az.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/bin.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/bin.png deleted file mode 100644 index 615c8dd4f3198640f514ad0eb8fdc15358767146..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 638 zcmV-^0)hRBP)n5PYxHzM>-C=1J=8V89Pj{m2wVbA12=%D!1e0Dq9~lI zZi`4C*btFv5xF+%%C7<+fcwA!yLS|LX)8QdHz|ZL7edew!V-I|q%N)io4{>g%kF&w z?f~P!<%W4>+e+$yQ@{z}4X`%Qw+w6pXJeD54me{8^RcGy2k-?rk`p*(?RvwU@0BrG zfJMuZDS@$^z@OGOJ#@nMF&nUN?cs(w)4*y@;8)-maJ;7P5YPoa=LBxqkvL@;TaAm> zzRC#%cw~Ec4>)OAc>!3kv-vm{*pwJAfV;p=tDnDP6}V-EJSz|bJ^{{HJ^co}1~!_k zBO>q0vRtu>v@hYTwz?M8WpnBH9(gdlfW7y#z#_0KRbWu61)z4din>+6BJzh+fkCON zz3@$&DR-O)UDrNM4F_kF`{+}NfRaN6kwF7Q&%{$s8fJZqD}!u zi8=)sCF&Gll&DjHQKC)(Mu~bX5je7_TY+U+zID#6h{$pdQSZAnD_d7slKqvR-d$1e Y0I$TC)FcL_WdHyG07*qoM6N<$f>f^*EC2ui diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/bin.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/bin.svg new file mode 100644 index 000000000..0ef91aed8 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/bin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/bool.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/bool.png deleted file mode 100644 index 9530983de0643b48827f4c18f8dc94466710fa10..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 646 zcmV;10(t$3P)PAQx7ue*4k_y0cs z=Xsy=yw9aVg$n;0wG!M;44?;H(e@2*FoN&@DyTl(zyzi=a=FOo(rYO#jfb+WWqKSZS@qvX*_Q7aXQ*} z77@G>$$fFXzKu{FAJO0BV^!S0TtsjflZo}!46)ylw=ToaByKkwJ5q=XW7G}w3z;NQ z$1mZ-c$gtLjzvWTYeEJMbeY+&jlF}on<3T+s-@4<1nZcUSbs)3q>4YP2>+1A#Y0|AHpfcr%NN~twqQk zLL*OU?XMzOEsU*4(o2?#&BDw749iN0^~N(lgvY!T28FL|3H zi|gpdYuv#r;mQa-+KcVNqdhJ>Qe-DgXcg diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/bool.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/bool.svg new file mode 100644 index 000000000..e2e4297c7 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/bool.svg @@ -0,0 +1 @@ + diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/env.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/env.png deleted file mode 100644 index 0ea51da0023ac14d71b8c2c32bc976f01116cc0b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 809 zcmV+^1J?YBP)rcp@khRiULR=6-%Tr4HYQq=sp z5tBbH%b${^T&!FeQBEr^q@+D9n&nU1>*lCmZ_oSg`MvKeCFknAr}KNi&pFTU`#tA@ zf88ee9uSd|AP8;+K~Nfo;Zxu9i7Xy+B~TCS&!)nJXLZFuh5ei=BIP1d;PW2^F+j?I zgTOkVD&irBfhWLmRehclpor`RP6N|o7H|=0Rn?!~mqtVm0Ox?o77Br0;2BT@ddrHr~Z`PB2t?#z;rFWVCqt4E$tJL8^FzM z1V5J2h)5N1-$0{m6lez?0&i3`nX{IfShoX*9L0&U_f~zUs=mufybX8(umNZ=j!w^T zyE{zC$Fc@Y0j~${nU-F*DY7Ib?Gmsns?FI9;H0CaZK_%gtO6c6IXi*Id`o=yU diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/expr.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/expr.png deleted file mode 100644 index 704105ce5846cbcd5233b418fdecf8bb7b6da5f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 563 zcmV-30?hr1P)?yH0l-N_ zK~z}7?bkhM6k!m?@!y>nqY<=H6l_vBSXf0NpoJicqF^V8B8ZJez&f2+*=Qx&X(eUVQ8+S=1kV4H9fLlN;1lbN|#GHHe} ziapqm!Z9i-_pM30%Z6yufWd%FGY7E;A8v6c=zDQ@D=@c%7N;+P0^N=*JD5t!9*4c!D>X z`L$QUu2yLl@d|fv4bz!9SF|ffL|?Tj{kK2gz5$yocmKc?(!~G(002ovPDHLkV1loh B^i%)< diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/expr.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/expr.svg new file mode 100644 index 000000000..c6357af50 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/expr.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/json.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/json.png deleted file mode 100644 index 57ac8761f1a7abd6235ab925758f180231bd7cc6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 588 zcmV-S0<-;zP)kuL+`yu4cy2HQimBMQ}c7PSN$9`k(G9s;lW~ zrK_)`zaL{5!Z+NC_$ILypD>G`Da9PaUCf0m2D8L>2S;PZM&$k`T*79&!4*v7LBziW ztq`~36fR?-OOb!*Y)8ezRg*B@k$0xZuqu+6L*C(44d7#Z4(+{lfU86NS_78rONeXg z0RKk6x^*rGu&e%GVE;cDdtDviaEKohK=~@&T@`o$qoI8-0XP%lBzAN&HZXykvYp~S z1`~iIcpApIhQlInazuMux{Cb?uv{lG)iK_#ydyS;8)cuQRL$c@nW=#zxE`u{f}IJl zZL&RePBuNq#lK2mADSWId;;)7$Zaavz>8jK3y(s3ECDzX;zPWs0)*EgZb$&;IWLPk zW5Ci0ub}UBfXk*Hu diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/re.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/re.png deleted file mode 100644 index 87deb02ae237124fc0b22712ff302a93b49eb5c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 502 zcmVsXA%o~oCCe1Vgq6hnik{vIT_j6ob?2D@4R&qPh(6tnoAD@aPz s72@Mn0pT~I(zuI4tuG-VA>p}j4bhcAFLP%~xc~qF07*qoM6N<$f;eE(;Q#;t diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/re.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/re.svg new file mode 100644 index 000000000..c30cbff55 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/re.svg @@ -0,0 +1 @@ + diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/target.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/target.png deleted file mode 100644 index cc9833b73c2db1156146db7eec1477f77829347e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 944 zcmV;h15f;kP)m-OT_113gJZ zK~#9!?VG=E(?Aq}Kc@u=QB@2by>|dH5$QyhbgYEb`~|3689P817-0d1j_ran(5(Y3 zWndr-NGG);3~UVE=zuB}F;s-17q}jFa=uIK5Z;q2r;hL4eRybF4*@Nh%*^?OCv3We~Liy0CQsHxLn-YDub^NGa9Nxi6EM0L+7{ z3Non^t_sMR-$eyb00mG01yBG5PynTx$jd>m0v+I`$K?xJ>(hS%P$_jC*aX&rdCy^I zKo{87T7Q~aK&8|(;C`f<=UVFrQw3qSGK(I_8{jF>^HkFYwt!XZ+%eG6T7Rew&{(eLz}*9O166JSI}T(!#*(pN zqHDpO04ou2n6WEH*T9v#wOBA`Ls`jlNv-uLJw-12ZX6p=65*O3hq>h_Fb`1IU2lZA zYN(5DIvYw9T)~)KqdRZT$yv~3DBr9ge!(?E;D%VzcGWZBTG@;QW~7WC;~=Ex)9$*=_%!I`}<{RmmAV2w+40xnko z7&S*D^3hdmSkmAV^gXU=g)UBOoiyy25g={Bq?4*OO*+*x z3s11V*)&+J15zd|wXJGDC{=3&d@`p_jkaYkd;m2f$or;rTXyXk(s>KrWVWr>tERN+ z=eeqH@?B6atrpDbEps7*vMl?Wrs)E3+nl-sya&Fxn@yHwBf-)%&2!Ctr{LWSS!--h z=8!*~v=g%-^oWx-=bgAk^Z$|7x>;8oT(?rGMN_+NMCjWvIu@-oZN0WYZ(0Z)CtutF z4vZzrSnYtnJ8GTS-l#NwOM*^a>wa#WfLWHkP1AHAxD4DZaSNOQFMzwDyJaO7%*l9W z@9|kt>%b>(oW^=^<_lf{6hHwKKmim$0TjUcM1B}DNysXG+9M(&A|fL4Kg%!w2P%)& SfOeMv0000 diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js index f5fe03890..0ef5b2102 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js @@ -32,6 +32,12 @@ return v; } } + var mapDeprecatedIcon = function(icon) { + if (/^red\/images\/typedInput\/.+\.png$/.test(icon)) { + icon = icon.replace(/.png$/,".svg"); + } + return icon; + } var allOptions = { msg: {value:"msg",label:"msg.",validate:RED.utils.validatePropertyExpression}, flow: {value:"flow",label:"flow.",hasValue:true, @@ -46,13 +52,13 @@ parse: contextParse, export: contextExport }, - str: {value:"str",label:"string",icon:"red/images/typedInput/az.png"}, - num: {value:"num",label:"number",icon:"red/images/typedInput/09.png",validate:/^[+-]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?$/}, - bool: {value:"bool",label:"boolean",icon:"red/images/typedInput/bool.png",options:["true","false"]}, + str: {value:"str",label:"string",icon:"red/images/typedInput/az.svg"}, + num: {value:"num",label:"number",icon:"red/images/typedInput/09.svg",validate:/^[+-]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?$/}, + bool: {value:"bool",label:"boolean",icon:"red/images/typedInput/bool.svg",options:["true","false"]}, json: { value:"json", label:"JSON", - icon:"red/images/typedInput/json.png", + icon:"red/images/typedInput/json.svg", validate: function(v) { try{JSON.parse(v);return true;}catch(e){return false;}}, expand: function() { var that = this; @@ -74,12 +80,12 @@ }) } }, - re: {value:"re",label:"regular expression",icon:"red/images/typedInput/re.png"}, + re: {value:"re",label:"regular expression",icon:"red/images/typedInput/re.svg"}, date: {value:"date",label:"timestamp",hasValue:false}, jsonata: { value: "jsonata", label: "expression", - icon: "red/images/typedInput/expr.png", + icon: "red/images/typedInput/expr.svg", validate: function(v) { try{jsonata(v);return true;}catch(e){return false;}}, expand:function() { var that = this; @@ -94,7 +100,7 @@ bin: { value: "bin", label: "buffer", - icon: "red/images/typedInput/bin.png", + icon: "red/images/typedInput/bin.svg", expand: function() { var that = this; RED.editor.editBuffer({ @@ -108,12 +114,12 @@ env: { value: "env", label: "env variable", - icon: "red/images/typedInput/env.png" + icon: "red/images/typedInput/env.svg" }, node: { value: "node", label: "node", - icon: "red/images/typedInput/target.png", + icon: "red/images/typedInput/target.svg", valueLabel: function(container,value) { var node = RED.nodes.node(value); var nodeDiv = $('
',{class:"red-ui-search-result-node"}).css({ @@ -353,7 +359,7 @@ if (opt.icon.indexOf("<") === 0) { $(opt.icon).prependTo(op); } else if (opt.icon.indexOf("/") !== -1) { - $('',{src:opt.icon,style:"margin-right: 4px; height: 18px;"}).prependTo(op); + $('',{src:mapDeprecatedIcon(opt.icon),style:"margin-right: 4px; height: 18px;"}).prependTo(op); } else { $('',{class:"red-ui-typedInput-icon "+opt.icon}).prependTo(op); } @@ -507,7 +513,7 @@ $(o.icon).prependTo(this.optionSelectLabel); } else if (o.icon.indexOf("/") !== -1) { // url - $('',{src:o.icon,style:"height: 18px;"}).prependTo(this.optionSelectLabel); + $('',{src:mapDeprecatedIcon(o.icon),style:"height: 18px;"}).prependTo(this.optionSelectLabel); } else { // icon class $('',{class:"red-ui-typedInput-icon "+o.icon}).prependTo(this.optionSelectLabel); @@ -619,8 +625,8 @@ else if (opt.icon.indexOf("/") !== -1) { image = new Image(); image.name = opt.icon; - image.src = opt.icon; - $('',{src:opt.icon,style:"margin-right: 4px;height: 18px;"}).prependTo(this.selectLabel); + image.src = mapDeprecatedIcon(opt.icon); + $('',{src:mapDeprecatedIcon(opt.icon),style:"margin-right: 4px;height: 18px;"}).prependTo(this.selectLabel); } else { $('',{class:"red-ui-typedInput-icon "+opt.icon}).prependTo(this.selectLabel);