Skip to content

Commit 0b4142b

Browse files
committed
feat:reusable function appendPUSCheckbox
1 parent 5295c0d commit 0b4142b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

OpenFoodFactsPower.user.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,8 +1186,9 @@ ul#products_match_all > li > a > span { display: table-cell; width: 70%; vert
11861186
var listhelp = `<ul class="pus_menu">
11871187
<li>(?) or (h): this present help</li>
11881188
<hr>
1189-
<li><input class="pus-checkbox" type="checkbox" id="pus-ingredients-font"><label for="pus-ingredients-font">Ingredients fixed-width font</label></li>
1190-
<li><input class="pus-checkbox" type="checkbox" id="pus-always-show-barcode"><label for="pus-always-show-barcode">Always show barcodes</label></li>
1189+
${appendPUSCheckbox('pus-ingredients-font','Ingredients fixed-width font')}
1190+
${appendPUSCheckbox('pus-always-show-barcode','Always show barcodes')}
1191+
${appendPUSCheckbox('pus-rotation-hunger-games-buttons','Image rotation and Hunger Games buttons')}
11911192
<hr>
11921193
<li>(Shift+L): List edit mode</li>
11931194
<li>(Shift+b): Show/hide barcodes</li>
@@ -1254,6 +1255,10 @@ ul#products_match_all > li > a > span { display: table-cell; width: 70%; vert
12541255

12551256
} // if list mode
12561257

1258+
function appendPUSCheckbox(checkboxId, labelText){
1259+
return `<li><input class="pus-checkbox" type="checkbox" id="${checkboxId}"><label for="${checkboxId}">${labelText}</label></li>`;
1260+
}
1261+
12571262
var langcodes_with_different_countrycodes = [ "af", "am", "ar", "bn", "cs", "da", "dv", "dz", "el", "et", "fa", "hy", "ja", "ka", "kl", "km", "ko", "lo", "ms", "my", "na", "nb", "ne", "ps", "si", "sl", "sq", "sr", "sv", "ta", "tk", "uk", "ur", "vi", "zh" ];
12581263

12591264
//Copy data from the list textarea to the ingredients_text in the hidden form so it can be passed to the analyser

0 commit comments

Comments
 (0)