VladislavNechepaev

Untitled

Sep 27th, 2021
987
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. values.support_with_lunch = lunchCheckbox.checked
  2.         fsNative.support_with_lunch.value = lunchCheckbox.checked ? "1" : "0"
  3.         if (values.support_with_lunch) {
  4.           if (meidoActive) {
  5.             console.log("====================")
  6.             console.log("[MEIDO] checking display conditions...")
  7.             console.log(`- weekday: ${weekdayGlobal}`)
  8.             console.log(`- internal time: ${currentHoursGlobal}:${currentMinutesGlobal}`)
  9.             console.log(`- selected access week: ${values.accessWeek}`)
  10.             console.log(`- does location supports Meido? ${officeMeido[values.office]}`)
  11.             console.log(`- Meido ID received? ${hasMeidoId}`)
  12.             console.log("====================")
  13.             if (!meidoTimeCheck || values.access_week === "Current week" || !officeMeido[values.office] || !hasMeidoId) {
  14.               if (values.office === "Lviv_test") {
  15.                 lunchTypeSelector.parentNode.hidden = true
  16.                 lunchTypeSelector.value = null
  17.                 lunchLviv.hidden = false
  18.               } else {
  19.                 lunchTypeSelector.parentNode.hidden = false
  20.                 lunchTypeSelector.value = lunchTypeSelector.value ? lunchTypeSelector.value : mealTypes[0]
  21.                 lunchLviv.hidden = true
  22.               }      
  23.               meidoMenu.hidden = true
  24.               meidoShown = false
  25.             } else {
  26.               lunchTypeSelector.parentNode.hidden = true
  27.               lunchTypeSelector.value = null
  28.               lunchLviv.hidden = true
  29.               meidoMenu.hidden = false
  30.               meidoShown = true
  31.             }
  32.           } else {
  33.             lunchTypeSelector.parentNode.hidden = false
  34.             lunchTypeSelector.value = lunchTypeSelector.value ? lunchTypeSelector.value : mealTypes[0]
  35.             meidoShown = false
  36.           }
  37.         } else {
  38.           console.log('hiding all')
  39.           lunchTypeSelector.parentNode.hidden = true
  40.           lunchTypeSelector.value = null
  41.           if (meidoActive) meidoMenu.hidden = true
  42.           meidoShown = false
  43.           lunchLviv.hidden = true
  44.         }
  45.  
  46. //==============================
  47.  
  48. if (meidoShown && (fsNative.meido.value === "" || fsNative.meido.value === "{}")) {
  49.             alert("Please select meals in the Meido menu")
  50.             return false
  51.           }
RAW Paste Data