forked from nutritionix/nutrition-label
-
Notifications
You must be signed in to change notification settings - Fork 0
/
changelog.txt
827 lines (647 loc) · 42.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
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
scrollHeightPixel : 95,
//this is to set how many decimal places will be shown on the nutrition values (calories, fat, protein, vitamin a, iron, etc)
decimalPlacesForNutrition : 1,
//this is to set how many decimal places will be shown for the "% daily values*"
decimalPlacesForDailyValues : 0,
//show the customizable link at the bottom
showBottomLink : false,
//url for the customizable link at the bottom
urlBottomLink : 'http://www.nutritionix.com',
//link name for the customizable link at the bottom
nameBottomLink : 'Nutritionix',
//default calorie intake
calorieIntake : 2000,
//these are the recommended daily intake values
dailyValueTotalFat : 65,
dailyValueSatFat : 20,
dailyValueCholesterol : 300,
dailyValueSodium : 2400,
dailyValueCarb : 300,
dailyValueFiber : 25,
//these values can be change to hide some nutrition values
showServingSize : true,
showCalories : true,
showFatCalories : true,
showTotalFat : true,
showSatFat : true,
showTransFat : true,
showPolyFat : true,
showMonoFat : true,
showCholesterol : true,
showSodium : true,
showTotalCarb : true,
showFibers : true,
showSugars : true,
showProteins : true,
showVitaminA : true,
showVitaminC : true,
showCalcium : true,
showIron : true,
//to show the 'amount per serving' text
showAmountPerServing : true,
//to show the 'servings per container' data and replace the default 'Serving Size' value (without unit and servings per container text and value)
showServingsPerContainer : false,
//to show the item name. there are special cases where the item name is replaced with 'servings per container' value
showItemName : true,
//to show the ingredients value or not
showIngredients : true,
//to show the calorie diet info at the bottom of the label
showCalorieDiet : false,
//the are to set some values as 'not applicable'. this means that the nutrition label will appear but the value will be a 'gray dash'
naServingSize : false,
naCalories : false,
naFatCalories : false,
naTotalFat : false,
naSatFat : false,
naTransFat : false,
naPolyFat : false,
naMonoFat : false,
naCholesterol : false,
naSodium : false,
naTotalCarb : false,
naFibers : false,
naSugars : false,
naProteins : false,
naVitaminA : false,
naVitaminC : false,
naCalcium : false,
naIron : false,
//these are the default values for the nutrition info
valueServingSize : 0,
valueServingSizeUnit : '',
valueServingPerContainer : 1,
valueCalories : 0,
valueFatCalories : 0,
valueTotalFat : 0,
valueSatFat : 0,
valueTransFat : 0,
valuePolyFat : 0,
valueMonoFat : 0,
valueCholesterol : 0,
valueSodium : 0,
valueTotalCarb : 0,
valueFibers : 0,
valueSugars : 0,
valueProteins : 0,
valueVitaminA : 0,
valueVitaminC : 0,
valueCalcium : 0,
valueIron : 0,
//these are the values for the optional calorie diet
valueCol1CalorieDiet : 2000,
valueCol2CalorieDiet : 2500,
valueCol1DietaryTotalFat : 0,
valueCol2DietaryTotalFat : 0,
valueCol1DietarySatFat : 0,
valueCol2DietarySatFat : 0,
valueCol1DietaryCholesterol : 0,
valueCol2DietaryCholesterol : 0,
valueCol1DietarySodium : 0,
valueCol2DietarySodium : 0,
valueCol1DietaryTotalCarb : 0,
valueCol2DietaryTotalCarb : 0,
valueCol1Dietary : 0,
valueCol2Dietary : 0,
//these text settings is so you can create nutrition labels in different languages or to simply change them to your need
textNutritionFacts : 'Nutrition Facts',
textDailyValues : 'Daily Value',
textServingSize : 'Serving Size',
textServingsPerContainer : 'Servings Per Container',
textAmountPerServing : 'Amount Per Serving',
textCalories : 'Calories',
textFatCalories : 'Calories from Fat',
textTotalFat : 'Total Fat',
textSatFat : 'Saturated Fat',
textTransFat : '<i>Trans</i> Fat',
textPolyFat : 'Polyunsaturated Fat',
textMonoFat : 'Monounsaturated Fat',
textCholesterol : 'Cholesterol',
textSodium : 'Sodium',
textTotalCarb : 'Total Carbohydrates',
textFibers : 'Dietary Fiber',
textSugars : 'Sugars',
textProteins : 'Protein',
textVitaminA : 'Vitamin A',
textVitaminC : 'Vitamin C',
textCalcium : 'Calcium',
textIron : 'Iron',
ingredientLabel : 'INGREDIENTS:',
ingredientList : 'None',
textPercentDailyPart1 : 'Percent Daily Values are based on a',
textPercentDailyPart2 : 'calorie diet'
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------