forked from nutritionix/nutrition-label
-
Notifications
You must be signed in to change notification settings - Fork 0
/
changelog.txt
1144 lines (839 loc) · 59.6 KB
/
changelog.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
version 11.0.10 - April 9, 2022
- minor fix https://github.com/nutritionix/nutrition-label/commit/bb9f6eaf3033cdcaeba3fbc9640df774d3bb5343
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 11.0.9 - March 23, 2022
- design changes on the 2018 label https://github.com/nutritionix/nutrition-label/issues/136
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 11.0.8 - October 27, 2021
- another bug fix related to this task https://github.com/nutritionix/nutrition-label/issues/135
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 11.0.7 - October 21, 2021
- bug fix related to this task https://github.com/nutritionix/nutrition-label/issues/135
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 11.0.6 - October 19, 2021
- accessibility improvements listed here https://github.com/nutritionix/nutrition-label/issues/135
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 11.0.5 - October 17, 2021
- accessibility improvements listed here https://github.com/nutritionix/nutrition-label/issues/134
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 11.0.4 - December 12, 2020
- css changes from Rommel to fix the validation issue "contrast between foreground and background colors meets WCAG 2 AA contrast ratio thresholds" for Axe https://dequeuniversity.com/rules/axe/3.5/region?application=AxeChrome
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 11.0.3 - December 9, 2020
- added `role="region" aria-label="nutrition label` on all label div so it will pass the aria landmark validation for Axe https://dequeuniversity.com/rules/axe/3.5/region?application=AxeChrome
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 11.0.2 - October 4, 2020
- fixed the arrow design issue on the legacy mobile labels (related to the use of the latest version of jqm) https://github.com/nutritionix/nutrition-label/issues/132
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 11.0.1 - September 30, 2020
- change the .toFixed function to something that's more reliable https://github.com/nutritionix/nutrition-label/issues/102
- also changed the tool used to minify the css and js files from https://github.com/yui/yuicompressor to this one https://javascript-minifier.com/ (using https://github.com/promatik/PHP-JS-CSS-Minifier)
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 10.0.6 - May 10, 2020
- made some changes on the code so the plugin can work with the latest version of jquery (currently it is version 3.5.1) https://github.com/nutritionix/nutrition-label/issues/129
- also changed the jquery used on the demo files from 2.2.0 to 3.5.1
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 10.0.5 - April 28, 2020
- made changes to the code to make it complient to the eslint. take note that the eslint setting is customized to fit the coding of the plugin https://github.com/nutritionix/nutrition-label/issues/126
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 10.0.4 - March 16, 2020
- fixed the issue on the extra bars on the label https://github.com/nutritionix/nutrition-label/issues/124
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 10.0.3 - February 17, 2020
- add an option to remove the bold formatting on the caffeine attribute (2018 label) https://github.com/nutritionix/nutrition-label/issues/125
- boldCaffeine : true, //this is for the 2018 version
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 10.0.2 - February 7, 2020
- more changes to the 2018 label https://github.com/nutritionix/nutrition-label/issues/121
- add a new setting for the 2018 label to allow to only show the textServingSize https://github.com/nutritionix/nutrition-label/issues/123
- //this is for the 2018 version and will only work when showServingUnitQuantity is false. see https://github.com/nutritionix/nutrition-label/issues/123
- showOnlyTheTextServingSize : false,
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 10.0.1 - January 21, 2020
- modification to the 2018 label for the nutrition values - vitamin d, calcium, iron and potassium https://github.com/nutritionix/nutrition-label/issues/120
- //this will only affect Vitamin D (valueVitaminD), Calcium (valueCalcium), Iron (valueIron) and Potassium (valuePotassium_2018).
- //this will tell the system to process these values as base values and not % Daily Values (default)
- useBaseValueFor2018LabelAndNotDVPercentage : false, //this is for the 2018 version
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 9.0.11 - January 12, 2020
- add a setting to allow the serving weight and unit value to be hidden on the legacy and 2018 version https://github.com/nutritionix/nutrition-label/issues/118
- fixed an overlooked issue on the /dist/demo/html files where "../js/nutritionLabel-min.js" is coded as "../css/nutritionLabel-min.js"
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 9.0.10 - November 16, 2019
- add a new nutrition label for the 2018 version - caffeine https://github.com/nutritionix/nutrition-label/issues/117
- added a new demo to test the rounding rule of the legacy version demo/legacy-version/demo-rounding-rule.html
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 9.0.9 - May 29, 2019
- add a feature on the uk version where the serving unit quantity can be changed https://github.com/nutritionix/nutrition-label/issues/107
- some code improvements
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 9.0.8 - May 15, 2019
- minor change on the uk label to change the default value Kj to kj https://github.com/nutritionix/nutrition-label/issues/114
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 9.0.7 - April 6, 2019
- moved the tooltip div inside the main div https://github.com/nutritionix/nutrition-label/issues/113
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 9.0.6 - April 1, 2019
- fix an issue with the 2018 label where "Amount per serving" is hard-coded instead of using the setting "textAmountPerServing"
- make the remaining hard-coded texts customizable by adding them on the settings https://github.com/nutritionix/nutrition-label/issues/112
- unitServingWeight : '<span aria-hidden="true">g</span><span class="sr-only"> grams</span>', //this is for the 2018 version
- textUKPer100 : 'Per', //this is for the uk version
- textUKDefaultServingNameIfEmpty : 'Serving', //this is for the uk version
- textDataNotAvailable : 'Data not available',
- textAriaLabelIncreaseQuantityArrow : 'Increase the Quantity Arrow',
- textAriaLabelDecreaseQuantityArrow : 'Decrease the Quantity Arrow',
- textAriaLabelChangeQuantityTextbox : 'Change the Quantity Textbox',
- textCalorieDietHtmlLegacyLessThan : 'Less than',
- textCalorieDietHtmlLegacyDietary : 'Dietary',
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 9.0.5 - March 31, 2019
- fixed a minor issue with the line height for the item name on the uk label https://github.com/nutritionix/nutrition-label/issues/111
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 9.0.4 - March 22, 2019
- add a div at the top for the item name on the uk version (should be hidden by default) https://github.com/nutritionix/nutrition-label/issues/109
- //to show the item name for the UK version. the main difference with the previous setting is this feature is set to false by default. the UK version will ignore the showItemName setting
- showItemNameForUK : false,
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 9.0.3 - March 22, 2019
- added a way to handle long serving unit names on the uk label https://github.com/nutritionix/nutrition-label/issues/110
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 9.0.2 - March 13, 2019
- for the uk label, if the serving name is empty, have it default to "Serving" https://github.com/nutritionix/nutrition-label/issues/108
- this is controlled by the setting convertEmptyServingNametoServingForUKLabel which is set to true by default
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 9.0.1 - March 8, 2019
- fixed a minor bug where the itemprop value for sodium as it was incorrect
- renamed showTheDailyValue to showPercentageCode as it seems more understandable for coders who wants to make changes on the code in the future
- a few minor improvement on the nutritionLabel.js file
- a few minor improvement on the demo files
- https://github.com/nutritionix/nutrition-label/issues/106
- new settings that are exclusive for the uk version and their default values
- dailyValueEnergyKcal : 2000,
- dailyValueProtein : 50,
- dailyValueSalt : 6,
- showDailyProtein : true,
- showDailyEnergy : true,
- unitEnergy_kj : 'Kj',
- unitEnergy_kcal : 'kcal',
- unitSalt : 'g',
- unitGramOrMlForThePer100Part : 'g',
- textUKTypicalValues : 'Typical Values',
- textUKReferenceIntake : 'Reference intake of an average adult',
- showUKVersion : false,
- please take note that the daily values needs to be changed to work properly on the uk version
- dailyValueTotalFat : 65, //this should be 70 for the uk version
- dailyValueCarb : 300, //this should be 260 for the uk version
- dailyValueSugar : 100, //this should be 90 for the uk version
- take note of these comments on how the plugin will select which version to show
//if the showLegacyVersion is true, the system will show the legacy version
//if both the showLegacyVersion and showUKVersion are false, the system will show the 2018 version
//if both the showLegacyVersion is false and showUKVersion is true, the system will show the uk version
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.15 - January 31, 2019
- fix the issue with the mobile demo pages
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.14 - September 26, 2018
- changes the setting indentSugarAndRemoveBoldStyleFor2018Label so to set it true by default https://github.com/nutritionix/nutrition-label/issues/104
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.13 - September 23, 2018
- when the fda rounding is enabled, round the 2018 version serving weight like how it is on the legacy version https://github.com/nutritionix/nutrition-label/issues/93
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.12 - September 23, 2018
- bug on the default value of indentSugarAndRemoveBoldStyleFor2018Label. it should be false by default and not true
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.11 - September 22, 2018
- new feature for the sugar details on the 2018 label https://github.com/nutritionix/nutrition-label/issues/103
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.10 - September 16, 2018
- changes on the feature for the 2018 label - option to hide the % Daily Values https://github.com/nutritionix/nutrition-label/issues/101
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.9 - September 14, 2018
- add a feature for %DV for total sugars https://github.com/nutritionix/nutrition-label/issues/99
- minor changes on the demo files in preparation to linting the code
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.8 - September 9, 2018
- changed the demo html code to use media='all' and not media='screen' https://github.com/nutritionix/nutrition-label/issues/96
- add a feature so the % daily values can be hidden (visible by default) https://github.com/nutritionix/nutrition-label/issues/100
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.7 - July 2, 2018
- more changes on task to hide the text near the bottom of the label that pertains to the daily values https://github.com/nutritionix/nutrition-label/issues/90#issuecomment-401797188
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.6 - June 27, 2018
- option to hide the % Daily Values https://github.com/nutritionix/nutrition-label/issues/90
- for the 2018 version, the "Daily Value" text is now controlled by the "textDailyValues" setting like the legacy version
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.5 - March 2, 2018
- minor changes to publish this on npm too
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.4 - January 16, 2018
- new attribute - sugar alcohol https://github.com/nutritionix/nutrition-label/issues/86
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.3 - October 9, 2017
- fixed a bug for task https://github.com/nutritionix/nutrition-label/issues/85
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.2 - October 7, 2017
- create a setting to allow users to customize the not applicable value https://github.com/nutritionix/nutrition-label/issues/85
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 8.0.1 - October 5, 2017
- moved the /dist/images to /dist/css/images to fix the path issue on the css
- put back the non minified version of the css and js on the dist files
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.15 - October 4, 2017
- fixed the bug - long item name scroll feature isn't appearing on most browsers https://github.com/nutritionix/nutrition-label/issues/79
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.14 - September 21, 2017
- added sr-only class style on the css (copied from bootstrap http://getbootstrap.com/)
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.13 - September 16, 2017
- improve how the label is read by screen readers https://github.com/nutritionix/nutrition-label/issues/80
- change the default unit values to make it more screen reader friendly. not all screen reader behaves the same so we opted to be on the safe side and make sure that these units are readable
- eg: 'g' => '<span aria-hidden="true">g</span><span class="sr-only"> grams</span>'
- up arrow, down arrow and the textbox are now screen reader friendly and it can be navigated using tab
- not applicable data is now screen reader friendly
- most daily percent value are hidden on screen reader. no idea yet if we can make this optional (eg. a setting to control this)
- added tabIndex to a few <div> and <span> elements to make it easy to use with screen reader. the outline is removed but devs can override it using css. the code that we use is "div, span{outline: 0;}"
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.12 - September 15, 2017
- added a new setting, "version (default 1)" to allow different styles on the labels. For this change, the legacy version will have an ability to show 2 different design on the servings area (best refer to the details on the task) https://github.com/nutritionix/nutrition-label/issues/77
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.11 - August 5, 2017
- https://github.com/nutritionix/nutrition-label/issues/78
- changed the default text for these two 2018 version attributes:
- Vit. D to Vitamin D
- Potas. to Potassium
- given these changes, removed the setting textPotassium_2018 as there is no need for it anymore and the 2018 label will now use the setting textPotassium, same as the legacy label
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.10 - August 1, 2017
- fixed a minor oversight where the default vitamin d unit was coded mg when it should have been mcg https://github.com/nutritionix/nutrition-label/issues/75#issuecomment-319099495
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.9 - July 30, 2017
- made some changes on the 2018 version based on the discussion here
- changed the default unit for vitamin D from IU to mcg
- added a new daily potassium value for the 2018 label with a default value of 4700. this way, it don't affect the optional potassium value for the legacy label https://github.com/nutritionix/nutrition-label/commit/cff80ba92a399a12d3ba5aa07f651cb751b5c1ff?w=1#diff-9ce72bf5eb39b381c67a00ed3b790dd5
- changed the daily calcium value to 1300. this value don't affect the legacy version, only the 2018 version
- changed the daily vitamin d value to 20. this value don't affect the legacy version, only the 2018 version
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.8 - July 15, 2017
- fixed a minor bug - missing line under the label header. see the discussion on https://github.com/nutritionix/nutrition-label/issues/73
- fixed a bug - issue with the serving weight gram on the 2018 label https://github.com/nutritionix/nutrition-label/issues/74
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.7 - June 30, 2017
- fixed the default base unit of Vitamin D (only available on the 2018 version). see the discussion on https://github.com/nutritionix/nutrition-label/issues/71
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.6 - June 15, 2017
- added <title> to the demo pages
- set poly and moni fat to be hidden by default https://github.com/nutritionix/nutrition-label/issues/70
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.5 - May 30, 2017
- improvement on the feature to trigger custom javascript commands when the quantity is changed https://github.com/nutritionix/nutrition-label/issues/68
- the change is to allow the current feature to work normally and to be able to have this feature work when the label is integrated in angular
- fixed an issue where the serving size unit scrolls down along with the item name https://github.com/nutritionix/nutrition-label/issues/67
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.4 - April 30, 2017
- https://github.com/nutritionix/nutrition-label/issues/59
- new setting showLegacyVersion (default to true), set this to false to show the 2018 version
- new settings that are exclusive for the 2018 version and their default values
- dailyValuePotassium: 3500
- dailyValueVitaminD : 400
- dailyValueAddedSugar : 50
- showPotassium_2018: true
- showVitaminD: true
- showAddedSugars : true
- naPotassium_2018: false
- naVitaminD : false
- naAddedSugars : false
- valuePotassium_2018: 0
- valueVitaminD : 0
- valueAddedSugars : 0
- unitPotassium: 'mg'
- unitPotassium_base: 'mg'
- unitPotassium_percent: '%'
- unitAddedSugars : 'g'
- unitVitaminD_base : 'mcg'
- unitVitaminD_percent : '%'
- unitCalcium_base : 'mg'
- unitCalcium_percent : '%'
- unitIron_base : 'mg'
- unitIron_percent : '%'
- textPotassium_2018 : 'Potas.'
- textVitaminD : 'Vit. D'
- textAddedSugars1 : 'Includes ',
- textAddedSugars2 : ' Added Sugars',
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.3 - March 23, 2017
- fix the bug where the custom js function feature isn't working https://github.com/nutritionix/nutrition-label/issues/64
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.2 - February 19, 2017
- added itemprop="servingSize" on the serving size element for the legacy version
- some code improvements for the legacy version
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 7.0.1 - January 23, 2017
- improvement on the code to prepare for the feature to allow the plugin to display the legacy version (current version) or the 2018 version
https://github.com/nutritionix/nutrition-label/issues/62
- bug fixes
- fixed a missing </span> on the sodium div
- fixed a bug on the fiber value where if the result of the formula [ daily fiber value * (calorie intake / 2000) ] is zero
(eg. there was an error in the input where the daily fiber value is set to zero), it will result to division by zero.
this possible error is caught on all other instances where if the result is zero, it is changed to 1 to prevent the "division by zero" error
- add an option for the user to choose to show the legacy label or the 2018 label (take note that the 2018 label isn't coded yet)
https://github.com/nutritionix/nutrition-label/issues/61
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.18 - November 28, 2016
- change <i> to <em> for WCAG 2.0 compliance
https://github.com/nutritionix/nutrition-label/pull/57
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.17 - November 11, 2016
- change <b> to <strong> for WCAG 2.0 compliance
https://github.com/nutritionix/nutrition-label/pull/56
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.16 - July 6, 2016
- updating the schema
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.15 - May 22, 2016
- changed the way userFunctionNameOnQuantityChange works
https://github.com/nutritionix/nutrition-label/pull/52
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.14 - May 11, 2016
- changed the way userFunctionNameOnQuantityChange works
https://github.com/nutritionix/nutrition-label/pull/52
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.13 - May 2, 2016
- Adding a new feature to trigger a user function when a quantity is changed and passing 3 values to it,
kind (input/arrows), old value, new value
https://github.com/nutritionix/nutrition-label/issues/51#issuecomment-216072925
- New Feature: when a user enters an invalid value on the quantity textbox, the label now replace it with the previous
valid value and not "1.0"
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.12 - May 1, 2016
- Add a way to fire google analytics event when changing the quantities
https://github.com/nutritionix/nutrition-label/issues/51
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.11 - March 4, 2016
- set the default value of showPotassium to be false as it's not commonly used by brands on their labels
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.10 - January 26, 2016
- fixed a bug when the user input a non numeric value
https://github.com/nutritionix/nutrition-label/issues/49
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.9 - January 26, 2016
- minor change: changing the default width and updating the demo pages
https://github.com/nutritionix/nutrition-label/issues/50
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.8 - January 18, 2016
- prevent a "division by zero" and added the ability to use potassium on the label
https://github.com/nutritionix/nutrition-label/issues/39
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.7 - January 18, 2016
- fixed the css issue with labels where the item name is long
https://github.com/nutritionix/nutrition-label/issues/44
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.6 - December 18, 2015
- serving weight grams is now linked to the quantity
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.5 - December 16, 2015
- Added Micro data
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.4 - November 20, 2014
- Fixed the bug - Servings Per Container disappears when the Serving Size is decreased
https://github.com/nutritionix/nutrition-label/issues/36
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.3 - October 18, 2014
- Added changes on the serving per container so it is now affected by the current quantity
https://github.com/nutritionix/nutrition-label/issues/32
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.2 - March 18, 2014
- Added spacing above ingredients list
https://github.com/nutritionix/nutrition-label/issues/35
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.1 - february 1, 2014
- new feature - allow html and js values to be added on the footer
https://github.com/nutritionix/nutrition-label/issues/34
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 6.0.0 - january 29, 2014
- changes on the rounding rules of Vitamins A and C, Calcium and Iron
https://github.com/nutritionix/nutrition-label/issues/33
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 5.0.5 - november 25, 2013
- added a new customizable setting decimalPlacesForQuantityTextbox and also drop unnecessary zeroes on the textbox
https://github.com/nutritionix/nutrition-label/issues/30
- fixed a bug when changing the quantity by entering different values using the keyboard
https://github.com/nutritionix/nutrition-label/issues/31
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 5.0.4 - october 31, 2013
- fixed google font Archivo Black
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 5.0.3 - october 20, 2013
- fixed a minor bug on the on the display when the fat calories is present but the calories isn't
https://github.com/nutritionix/nutrition-label/issues/28
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 5.0.2 - june 30, 2013
- fixed a minor bug on the FDA rounding rule
https://github.com/nutritionix/nutrition-label/issues/27
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 5.0.1 - june 23, 2013
- fixed a bug where the scroll isn't showing on long item names when that item name has no textbox
https://github.com/nutritionix/nutrition-label/issues/16#issuecomment-19864016
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 5.0.0 - june 19, 2013
- added a new setting hideNotAppicableValues (default false). When set to true, this will hide the values
if they are not applicable https://github.com/nutritionix/nutrition-label/issues/25
- added scrollbar when item name is too long. this feature can be turned off using the setting below
https://github.com/nutritionix/nutrition-label/issues/16
//to scroll the item name if the qQuery.height() is > scrollLongItemNamePixel
scrollLongItemName : true,
scrollLongItemNamePixel : 36,
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 4.0.10 - may 26, 2013
- added class names to vitamins, calcium and iron
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 4.0.9 - may 21, 2013
- fixed iOS css bugs on serving quantity textbox
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 4.0.8 - may 19, 2013
- bring back the disclaimer text feature but have it scroll like the long ingredients when scrollLongIngredients is true
https://github.com/nutritionix/nutrition-label/issues/20
//to show the disclaimer text or not
showDisclaimer : false,
//the height in px of the disclaimer div
scrollDisclaimer : 95,
valueDisclaimer : 'Please note that these nutrition values are estimated based on our standard serving portions. As food servings may have a slight variance each time you visit, please expect these values to be with in 10% +/- of your actual meal. If you have any questions about our nutrition calculator, please contact Nutritionix.', ingredientLabel : 'INGREDIENTS:',
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 4.0.7 - may 17, 2013
- fix the issue with the computation and the initial serving size unit value
https://github.com/nutritionix/nutrition-label/issues/19
- "nutrition multiplier" = 1.0 IF "original serving size quantity" is equal to or less than zero
- ELSE "nutrition multiplier" = 1 / "original serving size quantity"
- the new computation is
"final nutrition value" = "initial nutrition value" x "current serving size quantity" x "nutrition multiplier"
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 4.0.6 - may 13, 2013
- fixed the scroll not appearing on chrome mac
- removed the setting naServingUnitQuantity. Serving size cannot be "N/A", it will either have a value, or not appear at all
https://github.com/nutritionix/nutrition-label/issues/15
- added a new setting to allow hiding of the textbox arrows
https://github.com/nutritionix/nutrition-label/issues/13
//allow hiding of the textbox arrows
hideTextboxArrows : false
- worked on a feature about how the up and down arrow works when the value is between 0 to 2. see
https://github.com/nutritionix/nutrition-label/issues/14
- minor improvement - reduce the extra space between the textbox (if shown) and the serving unit name
https://github.com/nutritionix/nutrition-label/issues/17
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 4.0.5 - may 10, 2013
- fixed the bug where on the serving unit quantity when the initial value is 0 (zero)
https://github.com/nutritionix/nutrition-label/issues/12
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 4.0.4 - may 4, 2013
- https://github.com/nutritionix/nutrition-label/issues/10
- removed the showItemNameAtTheTop settings
- made more js and css fixes for the new textbox feature mentioned on 4.0.0 and 4.0.3
- changes on showBrandName and brandName. before, this is shown at the top before the 'title',
now it is shown on the same line as the 'item name'
- the show brand name will now appear after the item name if the setting showBrandName is true and brandName is not null
- "ITEM NAME" dash (-) "BRAND NAME"
- the item name will also now appear right after the 'title'
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 4.0.3 - apr 27, 2013
- fixed a bug where the scrolling ingredient is removed when the textbox value is changed
- fixed a bug where the not applicable tooltip stopped working when the textbox value is changed
- fixed a bug where the unit quantity textbox feature is not working properly when there are non numeric values on the settings.
- the system already filters this (see version 4.0.0 changes) but it still caused problems with the unit
quantity textbox feature
- MAJOR CHANGE: removed valueServingSize and it is now replaced with valueServingUnitQuantity
- this means that all the previous pages where you have implemented the plugin needs to be updated.
- you just need to rename valueServingSize to valueServingUnitQuantity
- REASON: after some discussion, it is decided that SERVING SIZE means "valueServingUnitQuantity valueServingSizeUnit"
- eg. Serving Size 8 Cookie (valueServingUnitQuantity = 8; valueServingSizeUnit = Cookie)
- eg. Serving Size 1.0 (valueServingUnitQuantity = 1.0)
- MAJOR CHANGE: renamed naServingSize to naServingUnitQuantity
- MAJOR CHANGE: renamed showServingSize to showServingUnitQuantity
- REASON: this is so all servingUnitQuantity settings will have the same prefix like the others ('na', 'show' and 'value')
- valueServingUnitQuantity => value of the serving size unit
- showServingUnitQuantity => show / hide the serving size div
- naServingUnitQuantity => set the serving size unit to be 'not applicable' or not
- MAJOR CHANGE: changes on the unit quantity textbox feature that was added on version 4.0.0
//this value can be changed and the value of the nutritions will be affected directly
//the computation is "current nutrition value" * "serving unit quantity value" = "final nutrition value"
//this can't be less than zero, all values less than zero is converted to zero
//the textbox to change this value is visible / enabled by default
//when enabled, user can change this value by clicking the arrow or changing the value on the textbox and
//pressing enter. the value on the label will be updated automatically
//different scenarios and the result if this feature is enabled
//NOTE 1: [ ] => means a textbox will be shown
//NOTE 2: on all cases below showServingUnitQuantityTextbox == true AND showServingUnitQuantity == true
//if showServingUnitQuantity == false, the values that should be on the 'serving size div' are empty or null
//CASE 1a: valueServingSizeUnit != '' (AND NOT null) && valueServingUnitQuantity >= 0 (AND NOT N/A)
//RESULT: textServingSize [valueServingUnitQuantity] valueServingSizeUnit
//CASE 2: valueServingSizeUnit != '' (AND NOT null) && valueServingUnitQuantity is N/A
//RESULT: textServingSize - (dash for not applicable) valueServingSizeUnit
//CASE 3a: valueServingSizeUnit == '' (OR null) && valueServingUnitQuantity is N/A
//RESULT: textServingSize - (dash for not applicable)
//NOTE 3: on all cases below showServingUnitQuantityTextbox == true AND showItemName == true
//if showItemName == false, the values that should be on the 'item name div' are empty or null
//CASE 1b: valueServingSizeUnit != '' (AND NOT null) && valueServingUnitQuantity <= 0 (AND NOT N/A)
//RESULT: [valueServingUnitQuantity default to 1.0] itemName
//CASE 3b: valueServingSizeUnit == '' (OR null) && valueServingUnitQuantity > 0 (AND NOT N/A)
//RESULT: [valueServingUnitQuantity] itemName
//CASE 3c: valueServingSizeUnit == '' (OR null) && valueServingUnitQuantity <= 0 (AND NOT N/A)
//RESULT: [valueServingUnitQuantity default to 1.0] itemName
//NOTE 4: to see the different resulting labels, check the html/demo-texbox-case*.html files to see different settings and the resulting label
valueServingUnitQuantity : 1.0,
valueServingSizeUnit : '',
showServingUnitQuantityTextbox : true,
//the name of the item for this label (eg. cheese burger or mayonnaise)
itemName : 'Item / Ingredient Name',
showServingUnitQuantity : true,
naServingUnitQuantity : false
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 4.0.2 - apr 15, 2013
- fixed the bug: the arrow links aren't clickable on IE8
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 4.0.1 - apr 14, 2013
- fixed the problem with internet explorer where the textbox changes aren't triggered when you press enter on the textbox
- preparing the code for more changes on the serving unit quantity feature
- NOTE: the demo files are using the non-minified version of the js and css file for the time being until
the 'serving unit quantity' feature is completed
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 4.0.0 - apr 11, 2013
- added a filter so that all settings that the plugin expects to be numeric will be checked and coverted to numeric if needed
- added a new feature to allow users to change the unit quantity of the label (default is 1.0)
https://github.com/nutritionix/nutrition-label/issues/3
- this value can be easily hidden by changing one of the settings (see below) (default is it is visible)
- the value can be adjusted by clicking the arrows or changing the value on the textbox and pressing enter or
focusing on another element on the page
//this value can be changed and the value of the nutritions will be affected directly
//the computation is "current nutrition value" * "value serving unit quantity" = "final nutrition value"
//this can't be less than zero, all values less than zero is converted to zero
//the textbox to change this is hidden by default
//when enabled, user can change this value by clicking the arrow or changing the value on the textbox and
//pressing enter. the value on the label will be updated automatically
valueServingUnitQuantity : 1.0,
showServingUnitQuantityTextbox : true
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 3.0.1 - mar 28, 2013
- fixed N/A tooltip
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 3.0.0 - mar 23, 2013
- made a few code improvements
- found a limitation that the valueServingSize and valueServingPerContainer can't be text like the other
nutrition values, solved that limitation
- hide the serving size when the value is zero, null or blank or '0' (text)
- improve the label when the showServingSize and showItemName are both set to false. Before, the bar was too
close to the label title; now, we added a bit of a space to make the label more presentable in cases like this
- also solved the case where showItemName is set to false, showServingSize is set to true, but both the
serving size and servings per container are hidden (see the above changes)
- automatically hide the serving size unit if it is null or blank
- added a new value 'valueServingWeightGrams'
- if the serving size is 1 and unit is Oz, the result is '1 Oz'
- if the serving weight grams is not zero, null, blank or '0':
- if the value is 85.33, the result will be (including the above example) '1 Oz (85.3g)'
(still affected by decimalPlacesForNutrition - in this case, it is 1)
- if the value is '~99', the result will be (including the above example) '1 Oz (~99g)'
- created a minified version of the css and used it on the demo pages (to make sure it's working)
to give other devs the option to use it too
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 2.0.4 - mar 20, 2013
- changed font-sizing from px to em
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 2.0.3 - mar 18, 2013
- fixed google font issue in IE 7 and 8
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 2.0.2 - mar 9, 2013
- fixed a bug where the minified version of the plugin is causing error
- added a minified version of the plugin
- minor change on the demo pages so that it uses the minified version of the plugin
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 2.0.1 - mar 6, 2013
- improve the width feature by changing this setting
//to allow percentage width - usually needed for mobile sites
allowPercentageWidth : false,
percentageWidth : 99
to:
//to allow custom width - usually needed for mobile sites
allowCustomWidth : false,
widthCustom : 'auto'
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 2.0.0 - mar 3, 2013
- some fixes on the showCalorieDiet - the ingredients and calorie daily intake text was included
in this block so when it is hidden, these 2 values are hidden too
- made some css fix - added a line class on the div with a class dvCalorieDiet
(contains the ingredients, calorie daily intake text and calorie diet)
- added more customizable values and added a feature to round the values based on FDA rounding rules
(taken from the default setting)
//to allow percentage width - usually needed for mobile sites
allowPercentageWidth : false,
percentageWidth : 99,
//the brand name of the item for this label (eg. just salad)
brandName : 'Brand where this item belongs to'
//to show the item name at the top of the page
showItemNameAtTheTop : false,
//show the brand where this item belongs to
showBrandName : false,
//to allow the label to have no border
allowNoBorder : false,
//customizable units for the values
unitCalories : '',
unitFatCalories : '',
unitTotalFat : 'g',
unitSatFat : 'g',
unitTransFat : 'g',
unitPolyFat : 'g',
unitMonoFat : 'g',
unitCholesterol : 'mg',
unitSodium : 'mg',
unitTotalCarb : 'g',
unitFibers : 'g',
unitSugars : 'g',
unitProteins : 'g',
unitVitaminA : '%',
unitVitaminC : '%',
unitCalcium : '%',
unitIron : '%',
//to enable rounding of the numerical values based on the FDA rounding rules
//http://goo.gl/RMD2O
allowFDARounding : false
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
version 1.0.0 - feb 28, 2013
- initial version
- customizable vales are (taken from the default setting)
//default width of the nutrition label
width : 260,
//the name of the item for this label (eg. cheese burger or mayonnaise)
itemName : 'Item / Ingredient Name',
//to scroll the ingredients if the innerheight is > scrollHeightComparison
scrollLongIngredients : false,
scrollHeightComparison : 100,
//the height in px of the ingredients div