From 24a21bab8d248b0675684ed27a3c045e205ab393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Benqu=C3=A9?= Date: Thu, 2 Sep 2021 15:12:48 +0100 Subject: [PATCH 1/4] Add conditional section icon --- .../fonts/cptools/fonts/cptools.eot | Bin 0 -> 10608 bytes .../fonts/cptools/fonts/cptools.svg | 43 ++++++------- .../fonts/cptools/fonts/cptools.ttf | Bin 10112 -> 10444 bytes .../fonts/cptools/fonts/cptools.woff | Bin 10188 -> 10520 bytes customize.dist/fonts/cptools/style.css | 57 +++++++++--------- www/form/inner.js | 2 +- 6 files changed, 53 insertions(+), 49 deletions(-) create mode 100644 customize.dist/fonts/cptools/fonts/cptools.eot diff --git a/customize.dist/fonts/cptools/fonts/cptools.eot b/customize.dist/fonts/cptools/fonts/cptools.eot new file mode 100644 index 0000000000000000000000000000000000000000..dbfc79bf73c81531115f45317de113d1a8d1d0ac GIT binary patch literal 10608 zcmb_i3v`>+eZTj6N}r_f)9aIL*_JFzwvsruCCifHBqoUyoS4K3annE;TOPzOn%G_v z0-=FrXU&5hXklG}&@N?$C54X131^gU9c6_xI6HKQwV@r1o{n`uU+45}WqmM9-tXQ| zlI2HYhwhWU@BZ(-|NH*m|LflIrG&h`gb+#uGV`J2e#%m|Tt73N;aX4itvQsO{pjQt zGER<=G5ijY!^qZ2KN%oH-AyWv$Dkn#<@du}^v%^SGe`##z~6)5g`eNUq8C{;K0`pEW<1&;%MX4_}Jki=qH{ff6elVD85DSCo&vR1^4%+lmDyn6QGt+5tsk!OV>$Eqa~S%Gwo z*s!<)(&~Q_naWR1u|j|ehw0Rhf)dJA)=LQmmQj%g;>dM!lxe&xr-@kZX7K~@PO=({ zeh~BB(bPtB*U$_LTWPF8F=(O~>eTcHB2+DgVVZ8wuA#wVh%&tJ{Dr2Gs3+=4XQE~r zA#D+bmKH%21yhhkQ4v~N1w}w;3V4u%#}pJ1iLEUNMHx|1_**L#vB6TRClSY8E|gge={@UKbV%Gkw={ssqa^U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No newline at end of file diff --git a/customize.dist/fonts/cptools/fonts/cptools.ttf b/customize.dist/fonts/cptools/fonts/cptools.ttf index 788b7f881a5c1f34e58560d04b46e5a84eb2ae3d..41ae6ef3732edf23c4ceb2565a0d81787262db46 100644 GIT binary patch delta 569 zcmXv~O=uHA82x5uHwpRM-L%_k4M}5nV_S{dq_&rc8YBlTlwt_#MVB`1iuqZZ7NXEJ zQV}nTI_OEkgNTQM=w7Nw$-#qQ5R_gjh!>#;Pl5#xy7+Cyfj4j7d-KhFGp)(a)G`nN z2tW%M9G*OLC@n=id(nA=xHw%gtlr|MrvN01x-e(dEo2$B%f7ktm07d-t`BtsKr5If zVmc=Y)G3>s@_oT?ZN3r5H? zz&^L2ziL!Uugb$is5QLghE=OCV52w&SKS;K+q~O8M&kF#X%goX>nnvpL6JVjjvrbVYlphcS_= zj8c|LxwA?|X7LwlEJ$xTzn$+J8$>07{gS+w>_5t=z?YPkJ<=0ocB0Sp^P{`J4Y)t+ z&1B+Vhe8*m>^214HvxPpuB87nU)9D{?VrCB0!0$?u*iRE*>!Fk3 yrj(aDa#C)|50$*K78%Bq+8dUM4$KfEP`NyP+c>WjAd44ef delta 446 zcmX>T*x+B!z{tSBz|GLWz|3IaAFOZ0FT^GX6xjpB3CX#M1>#|smNGCf$^iKx>50V! zKw1FE2hkkqIhAP}CF=hG`4tQd$^sdwi7B!sZ)+JCR62n2W*I;M_8%--K>h(BUnL{A zq@r#QYYmY31jz5n$xn7n?9`eBG)xs_phs?EMFE2WV?B_+1ISm%OUzB(nWd!;HaALTa4Cbl%Fe)W@WSi}`M=*b^c%>|Vq;$TSzCLlH0 zM$JZsIgf#d#f>2fD9HuHWI}lP9RD_<_}PF^Dk8G2}6JF@9lMz%0kSiG__N zkL3=l1?xQ4BW%yuTR50FoVa4RE^sSxH*r7W3E>st^WzuepTqx6AV45TP)x7`93{$= jxzwMF8!&`1q%ssS6f+D<$V97BDa{W&mYEKv+EN z(z5i#VvyJ#AfE$@1=4dW(|}?}7#LK5>Qq8fg66qpq$Z{?FsMlY)tG^>97lUh22chywRN z>3^G@m?E71ZT6qsC2GQ0FxgQ~j)!UYzd!$8U%A34%E+?$ALD8M&7MLgER#|CXAl^L&aQF1tJcXWMBeP zEN%>?lO0rTB!G-4<~#--paL!+HUr{75S~0kRV554$qUxQ#UR2U$8dmAfJujG8nYAg z0hSP!6|4fRb*#789N5y>J2=!hmT>Lk`o~?weS}Aar-j#rua4i1|BQf|K!d;>K{vr2 sLRvtRK<-tU%%%2R+=wBJA(f$sp_n0)A)g@+7zgGIdJIOBIn<8;0R5kVT>t<8 delta 505 zcmbOcbjDw-+~3WOfsp|S)Xy+*gXsna_Q{NzViR?Q>*bPj6AKs^7&CwpAs{Rsc4=vP zVlhZ;50K9R#RBO$m1#h+BMc160wBCmqW(`tYGMilgUS`48Z!`X?BnX69>?c^K^(L zb`)>e%qwidviYDm5A$SG)hCR`4shHlGuASIf|P-Q2^e$2lZ(|)i5oD4F{CmSF%&aoGUPMl0Yl83L65;; Ia)`ze08rj(g#Z8m diff --git a/customize.dist/fonts/cptools/style.css b/customize.dist/fonts/cptools/style.css index 874b6068f..7b3227453 100644 --- a/customize.dist/fonts/cptools/style.css +++ b/customize.dist/fonts/cptools/style.css @@ -1,10 +1,10 @@ @font-face { font-family: 'cptools'; - src: url('fonts/cptools.eot?chd5a1'); - src: url('fonts/cptools.eot?chd5a1#iefix') format('embedded-opentype'), - url('fonts/cptools.ttf?chd5a1') format('truetype'), - url('fonts/cptools.woff?chd5a1') format('woff'), - url('fonts/cptools.svg?chd5a1#cptools') format('svg'); + src: url('fonts/cptools.eot?6tk5ck'); + src: url('fonts/cptools.eot?6tk5ck#iefix') format('embedded-opentype'), + url('fonts/cptools.ttf?6tk5ck') format('truetype'), + url('fonts/cptools.woff?6tk5ck') format('woff'), + url('fonts/cptools.svg?6tk5ck#cptools') format('svg'); font-weight: normal; font-style: normal; font-display: block; @@ -14,7 +14,7 @@ /* use !important to prevent issues with browser extensions that change fonts */ font-family: 'cptools' !important; display: inline-block; - speak: none; + speak: never; font-style: normal; font-weight: normal; font-variant: normal; @@ -26,6 +26,9 @@ -moz-osx-font-smoothing: grayscale; } +.cptools-form-conditional:before { + content: "\e900"; +} .cptools-form-poll:before { content: "\e910"; } @@ -57,65 +60,65 @@ content: "\e91d"; } .cptools-folder-no-color:before { - content: "\e900"; + content: "\e901"; } .cptools-whiteboard:before { - content: "\e901"; + content: "\e902"; } .cptools-new-template:before { - content: "\e902"; + content: "\e903"; } .cptools-shared-folder:before { - content: "\e903"; + content: "\e904"; } .cptools-file-upload:before { - content: "\e904"; + content: "\e905"; } .cptools-template:before { - content: "\e905"; + content: "\e906"; } .cptools-poll:before { - content: "\e906"; + content: "\e907"; } .cptools-slide:before { - content: "\e907"; + content: "\e908"; } .cptools-sheet:before { - content: "\e908"; + content: "\e909"; } .cptools-folder-open:before { - content: "\e909"; + content: "\e90a"; } .cptools-kanban:before { - content: "\e90a"; + content: "\e90b"; } .cptools-folder:before { - content: "\e90b"; + content: "\e90c"; } .cptools-shared-folder-open:before { - content: "\e90c"; + content: "\e90d"; } .cptools-code:before { - content: "\e90d"; + content: "\e90e"; } .cptools-richtext:before { - content: "\e90e"; + content: "\e90f"; } .cptools-file:before { - content: "\e90f"; + content: "\e911"; } .cptools-palette:before { - content: "\e911"; + content: "\e912"; } .cptools-folder-upload:before { - content: "\e912"; + content: "\e913"; } .cptools-add-bottom:before { - content: "\e913"; + content: "\e914"; } .cptools-add-top:before { - content: "\e914"; + content: "\e915"; } .cptools-destroy:before { - content: "\e915"; + content: "\e91f"; } diff --git a/www/form/inner.js b/www/form/inner.js index 147a9138f..040f77fa3 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -1048,7 +1048,7 @@ define([ }; }, printResults: function () { return; }, - icon: h('i.fa.fa-question') + icon: h('i.cptools.cptools-form-conditional') }, }; From 37430f529419148ac73f71e58eed759ebad33f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Benqu=C3=A9?= Date: Thu, 2 Sep 2021 15:31:05 +0100 Subject: [PATCH 2/4] Remove margin on icon-only button to remove a condition --- www/form/inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/form/inner.js b/www/form/inner.js index 040f77fa3..38ddc35ba 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -3047,7 +3047,7 @@ define([ $(iSelect).hide(); var remove = h('button.btn.btn-danger-alt.cp-condition-remove', [ - h('i.fa.fa-times') + h('i.fa.fa-times.nomargin') ]); $(remove).on('click', function () { $content.remove(); From d2db3a5c5a0c85d8d5fb45bd37b43126e11ca9e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Benqu=C3=A9?= Date: Thu, 2 Sep 2021 16:21:10 +0100 Subject: [PATCH 3/4] Review use of primary, secondary, default buttons --- www/form/app-form.less | 2 +- www/form/inner.js | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/www/form/app-form.less b/www/form/app-form.less index 031411800..6435e6f07 100644 --- a/www/form/app-form.less +++ b/www/form/app-form.less @@ -215,7 +215,7 @@ min-height: 300px; border: 2px dashed @cryptpad_text_col; // XXX padding: 20px; - margin-top: 10px; + margin-top: 20px; background: @cp_app-bg; .cp-form-creator-add-inline { button[data-type="section"] { diff --git a/www/form/inner.js b/www/form/inner.js index 38ddc35ba..07da962c3 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -2292,7 +2292,7 @@ define([ var $container = $('div.cp-form-creator-answered').empty().css('display', ''); var viewOnly = content.answers.cantEdit || APP.isClosed; - var action = h('button.btn.btn-primary', [ + var action = h(viewOnly ? 'button.btn.btn-secondary' : 'button.btn.btn-primary', [ viewOnly ? h('i.fa.fa-bar-chart') : h('i.fa.fa-pencil'), h('span', viewOnly ? Messages.form_viewAnswer : Messages.form_editAnswer) ]); @@ -2313,19 +2313,20 @@ define([ if (answers._time) { APP.lastAnswerTime = answers._time; } + Messages.form_viewAllAnswers = "View all responses ({0})"; // XXX // If responses are public, show button to view them var responses; if (content.answers.privateKey) { var l = getAnswersLength(answers); - responses = h('button.btn.btn-default', [ + responses = h('button.btn.btn-secondary', [ h('i.fa.fa-bar-chart'), - h('span.cp-button-name', Messages._getKey('form_results', [l])) + h('span.cp-button-name', Messages._getKey('form_viewAllAnswers', [l])) ]); var sframeChan = framework._.sfCommon.getSframeChannel(); sframeChan.query("Q_FORM_FETCH_ANSWERS", content.answers, function (err, obj) { var answers = obj && obj.results; var l = getAnswersLength(answers); - $(responses).find('.cp-button-name').text(Messages._getKey('form_results', [l])); + $(responses).find('.cp-button-name').text(Messages._getKey('form_viewAllAnswers', [l])); }); $(responses).click(function () { sframeChan.query("Q_FORM_FETCH_ANSWERS", content.answers, function (err, obj) { @@ -2973,14 +2974,14 @@ define([ }; Messages.form_conditional_add = "Add condition OR"; Messages.form_conditional_addAnd = "Add condition AND"; - var addCondition = h('button.btn.btn-default', [ + var addCondition = h('button.btn.btn-secondary', [ h('i.fa.fa-plus'), h('span', Messages.form_conditional_add) ]); var $addC = $(addCondition); var getConditions; var getAddAndButton = function ($container, rules) { - var btn = h('button.btn.btn-default.cp-form-add-and', [ + var btn = h('button.btn.btn-secondary.cp-form-add-and', [ h('i.fa.fa-plus'), h('span', Messages.form_conditional_addAnd) ]); @@ -3012,7 +3013,7 @@ define([ options: qOptions, // Entries displayed in the menu isSelect: true, caretDown: true, - buttonCls: 'btn btn-secondary' + buttonCls: 'btn btn-default' }; var qSelect = UIElements.createDropdown(qConfig); Messages.form_condition_is = 'is'; // XXX @@ -3040,7 +3041,7 @@ define([ options: iOptions, // Entries displayed in the menu isSelect: true, caretDown: true, - buttonCls: 'btn btn-secondary' + buttonCls: 'btn btn-default' }; var iSelect = UIElements.createDropdown(iConfig); iSelect.setValue(isOn ? 1 : 0); @@ -3104,7 +3105,7 @@ define([ //container: $(type), isSelect: true, caretDown: true, - buttonCls: 'btn btn-secondary' + buttonCls: 'btn btn-default' }; var vSelect = UIElements.createDropdown(vConfig); vSelect.addClass('cp-form-condition-values'); @@ -3788,7 +3789,7 @@ define([ refreshResponse(); // Make answers anonymous - Messages.form_makeAnon = "Anonymous responses"; // XXX + Messages.form_makeAnon = "Anonymize responses"; // XXX var anonContainer = h('div.cp-form-anon-container'); var $anon = $(anonContainer); var refreshAnon = function () { From e3ac524aadcbb318941bfd1b05d712fa4f71ce8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Benqu=C3=A9?= Date: Fri, 3 Sep 2021 11:39:03 +0100 Subject: [PATCH 4/4] Mark temporary text with XXX --- www/form/inner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/form/inner.js b/www/form/inner.js index 07da962c3..61c2b8015 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -2972,8 +2972,8 @@ define([ }).filter(Boolean); return values; }; - Messages.form_conditional_add = "Add condition OR"; - Messages.form_conditional_addAnd = "Add condition AND"; + Messages.form_conditional_add = "Add condition OR"; // XXX + Messages.form_conditional_addAnd = "Add condition AND"; // XXX var addCondition = h('button.btn.btn-secondary', [ h('i.fa.fa-plus'), h('span', Messages.form_conditional_add)