diff --git a/js/components/BasePicker.js b/js/components/BasePicker.js index 63661b17..ab718b49 100644 --- a/js/components/BasePicker.js +++ b/js/components/BasePicker.js @@ -6,8 +6,8 @@ class BasePicker this.Grocy = Grocy; this.scopeSelector = scopeSelector; - this.scope = scopeSelector != null ? $(scope) : $(document); - this.$ = scopeSelector != null ? $(scope).find : $; + this.scope = scopeSelector != null ? $(scopeSelector) : $(document); + this.$ = scopeSelector != null ? $(scopeSelector).find : $; this.picker = null; this.input_element; diff --git a/js/components/barcodescanner.js b/js/components/barcodescanner.js index 9adc91ec..c5e86196 100644 --- a/js/components/barcodescanner.js +++ b/js/components/barcodescanner.js @@ -7,8 +7,8 @@ class barcodescanner this.Grocy = Grocy; this.scopeSelector = scopeSelector; - this.scope = scopeSelector != null ? $(scope) : $(document); - this.$ = scopeSelector != null ? $(scope).find : $; + this.scope = scopeSelector != null ? $(scopeSelector) : $(document); + this.$ = scopeSelector != null ? $(scopeSelector).find : $; // init component this.LiveVideoSizeAdjusted = false; @@ -79,7 +79,7 @@ class barcodescanner var dialog = bootbox.dialog({ message: '
', - title: Grocy.translate('Scan a barcode'), + title: self.Grocy.translate('Scan a barcode'), onEscape: function() { self.StopScanning(); @@ -98,7 +98,7 @@ class barcodescanner } }, cancel: { - label: Grocy.translate('Cancel'), + label: self.Grocy.translate('Cancel'), className: 'btn-secondary responsive-button', callback: function() { @@ -228,25 +228,25 @@ class barcodescanner } }, locator: { - patchSize: Grocy.UserSettings.quagga2_patchsize, - halfSample: Grocy.UserSettings.quagga2_halfsample, + patchSize: self.Grocy.UserSettings.quagga2_patchsize, + halfSample: self.Grocy.UserSettings.quagga2_halfsample, debug: { - showCanvas: Grocy.UserSettings.quagga2_debug, - showPatches: Grocy.UserSettings.quagga2_debug, - showFoundPatches: Grocy.UserSettings.quagga2_debug, - showSkeleton: Grocy.UserSettings.quagga2_debug, - showLabels: Grocy.UserSettings.quagga2_debug, - showPatchLabels: Grocy.UserSettings.quagga2_debug, - showRemainingPatchLabels: Grocy.UserSettings.quagga2_debug, + showCanvas: self.Grocy.UserSettings.quagga2_debug, + showPatches: self.Grocy.UserSettings.quagga2_debug, + showFoundPatches: self.Grocy.UserSettings.quagga2_debug, + showSkeleton: self.Grocy.UserSettings.quagga2_debug, + showLabels: self.Grocy.UserSettings.quagga2_debug, + showPatchLabels: self.Grocy.UserSettings.quagga2_debug, + showRemainingPatchLabels: self.Grocy.UserSettings.quagga2_debug, boxFromPatches: { - showTransformed: Grocy.UserSettings.quagga2_debug, - showTransformedBox: Grocy.UserSettings.quagga2_debug, - showBB: Grocy.UserSettings.quagga2_debug + showTransformed: self.Grocy.UserSettings.quagga2_debug, + showTransformedBox: self.Grocy.UserSettings.quagga2_debug, + showBB: self.Grocy.UserSettings.quagga2_debug } } }, - numOfWorkers: Grocy.UserSettings.quagga2_numofworkers, - frequency: Grocy.UserSettings.quagga2_frequency, + numOfWorkers: self.Grocy.UserSettings.quagga2_numofworkers, + frequency: self.Grocy.UserSettings.quagga2_frequency, decoder: { readers: [ "ean_reader", @@ -254,17 +254,17 @@ class barcodescanner "code_128_reader" ], debug: { - showCanvas: Grocy.UserSettings.quagga2_debug, - showPatches: Grocy.UserSettings.quagga2_debug, - showFoundPatches: Grocy.UserSettings.quagga2_debug, - showSkeleton: Grocy.UserSettings.quagga2_debug, - showLabels: Grocy.UserSettings.quagga2_debug, - showPatchLabels: Grocy.UserSettings.quagga2_debug, - showRemainingPatchLabels: Grocy.UserSettings.quagga2_debug, + showCanvas: self.Grocy.UserSettings.quagga2_debug, + showPatches: self.Grocy.UserSettings.quagga2_debug, + showFoundPatches: self.Grocy.UserSettings.quagga2_debug, + showSkeleton: self.Grocy.UserSettings.quagga2_debug, + showLabels: self.Grocy.UserSettings.quagga2_debug, + showPatchLabels: self.Grocy.UserSettings.quagga2_debug, + showRemainingPatchLabels: self.Grocy.UserSettings.quagga2_debug, boxFromPatches: { - showTransformed: Grocy.UserSettings.quagga2_debug, - showTransformedBox: Grocy.UserSettings.quagga2_debug, - showBB: Grocy.UserSettings.quagga2_debug + showTransformed: self.Grocy.UserSettings.quagga2_debug, + showTransformedBox: self.Grocy.UserSettings.quagga2_debug, + showBB: self.Grocy.UserSettings.quagga2_debug } } }, diff --git a/js/components/batterycard.js b/js/components/batterycard.js index 0c264b62..24a68aff 100644 --- a/js/components/batterycard.js +++ b/js/components/batterycard.js @@ -8,8 +8,8 @@ class batterycard this.Grocy = Grocy; this.scopeSelector = scopeSelector; - this.scope = scopeSelector != null ? $(scope) : $(document); - this.$ = scopeSelector != null ? $(scope).find : $; + this.scope = scopeSelector != null ? $(scopeSelector) : $(document); + this.$ = scopeSelector != null ? $(scopeSelector).find : $; } Refresh(batteryId) @@ -39,7 +39,7 @@ class batterycard console.error(xhr); } ); - }; + } } export { batterycard } \ No newline at end of file diff --git a/js/components/calendarcard.js b/js/components/calendarcard.js index c7444e81..e9f15739 100644 --- a/js/components/calendarcard.js +++ b/js/components/calendarcard.js @@ -5,8 +5,8 @@ class calendarcard this.Grocy = Grocy; this.scopeSelector = scopeSelector; - this.scope = scopeSelector != null ? $(scope) : $(document); - this.$ = scopeSelector != null ? $(scope).find : $; + this.scope = scopeSelector != null ? $(scopeSelector) : $(document); + this.$ = scopeSelector != null ? $(scopeSelector).find : $; this.$('#calendar').datetimepicker( { diff --git a/js/components/chorecard.js b/js/components/chorecard.js index abe929a0..56e4adc4 100644 --- a/js/components/chorecard.js +++ b/js/components/chorecard.js @@ -8,8 +8,8 @@ class chorecard this.Grocy = Grocy; this.scopeSelector = scopeSelector; - this.scope = scopeSelector != null ? $(scope) : $(document); - this.$ = scopeSelector != null ? $(scope).find : $; + this.scope = scopeSelector != null ? $(scopeSelector) : $(document); + this.$ = scopeSelector != null ? $(scopeSelector).find : $; } Refresh(choreId) @@ -46,6 +46,6 @@ class chorecard console.error(xhr); } ); - }; + } } export { chorecard } \ No newline at end of file diff --git a/js/components/datetimepicker.js b/js/components/datetimepicker.js index 73310226..ed990c26 100644 --- a/js/components/datetimepicker.js +++ b/js/components/datetimepicker.js @@ -8,8 +8,8 @@ class datetimepicker this.Grocy = Grocy; this.scopeSelector = scopeSelector; - this.scope = scopeSelector != null ? $(scope) : $(document); - this.$ = scopeSelector != null ? $(scope).find : $; + this.scope = scopeSelector != null ? $(scopeSelector) : $(document); + this.$ = scopeSelector != null ? $(scopeSelector).find : $; this.basename = basename; @@ -202,19 +202,19 @@ class datetimepicker if (e.keyCode === 38) // Up { - Grocy.Components.DateTimePicker.SetValue(dateObj.add(-1, 'months').format(format)); + this.SetValue(dateObj.add(-1, 'months').format(format)); } else if (e.keyCode === 40) // Down { - Grocy.Components.DateTimePicker.SetValue(dateObj.add(1, 'months').format(format)); + this.SetValue(dateObj.add(1, 'months').format(format)); } else if (e.keyCode === 37) // Left { - Grocy.Components.DateTimePicker.SetValue(dateObj.add(-1, 'years').format(format)); + this.SetValue(dateObj.add(-1, 'years').format(format)); } else if (e.keyCode === 39) // Right { - Grocy.Components.DateTimePicker.SetValue(dateObj.add(1, 'years').format(format)); + this.SetValue(dateObj.add(1, 'years').format(format)); } } else @@ -223,19 +223,19 @@ class datetimepicker if (e.keyCode === 38) // Up { - Grocy.Components.DateTimePicker.SetValue(dateObj.add(-1, 'days').format(format)); + this.SetValue(dateObj.add(-1, 'days').format(format)); } else if (e.keyCode === 40) // Down { - Grocy.Components.DateTimePicker.SetValue(dateObj.add(1, 'days').format(format)); + this.SetValue(dateObj.add(1, 'days').format(format)); } else if (e.keyCode === 37) // Left { - Grocy.Components.DateTimePicker.SetValue(dateObj.add(-1, 'weeks').format(format)); + this.SetValue(dateObj.add(-1, 'weeks').format(format)); } else if (e.keyCode === 39) // Right { - Grocy.Components.DateTimePicker.SetValue(dateObj.add(1, 'weeks').format(format)); + this.SetValue(dateObj.add(1, 'weeks').format(format)); } } } diff --git a/js/components/datetimepicker2.js b/js/components/datetimepicker2.js index 454be5c1..35382e8c 100644 --- a/js/components/datetimepicker2.js +++ b/js/components/datetimepicker2.js @@ -1,5 +1,3 @@ -import { EmptyElementWhenMatches } from '../helpers/extensions' -import { RefreshContextualTimeago } from '../configs/timeago' import { datetimepicker } from './datetimepicker' class datetimepicker2 extends datetimepicker diff --git a/js/components/numberpicker.js b/js/components/numberpicker.js index 98da2a69..5843b821 100644 --- a/js/components/numberpicker.js +++ b/js/components/numberpicker.js @@ -5,8 +5,8 @@ class numberpicker this.Grocy = Grocy; this.scopeSelector = scopeSelector; - this.scope = scopeSelector != null ? $(scope) : $(document); - this.$ = scopeSelector != null ? $(scope).find : $; + this.scope = scopeSelector != null ? $(scopeSelector) : $(document); + this.$ = scopeSelector != null ? $(scopeSelector).find : $; var self = this; this.$(".numberpicker-down-button").unbind('click').on("click", () => self.valueDownHandler(this)); @@ -14,7 +14,7 @@ class numberpicker this.$(".numberpicker").on("keyup", function() { - $this = $(this) + let $this = $(this) if ($this.attr("data-not-equal") && !$this.attr("data-not-equal").toString().isEmpty() && $this.attr("data-not-equal") == $this.val()) { $this[0].setCustomValidity("error"); @@ -136,7 +136,7 @@ class numberpicker if (max.isEmpty()) { element.parent().find(".invalid-feedback").text( - Grocy.translate("This cannot be lower than %1$s and needs to be a valid number with max. %2$s decimal places", + this.Grocy.translate("This cannot be lower than %1$s and needs to be a valid number with max. %2$s decimal places", parseFloat(min).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: decimals @@ -146,7 +146,7 @@ class numberpicker else { element.parent().find(".invalid-feedback").text( - Grocy.translate("This must between %1$s and %2$s and needs to be a valid number with max. %3$s decimal places", + this.Grocy.translate("This must between %1$s and %2$s and needs to be a valid number with max. %3$s decimal places", parseFloat(min).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: decimals diff --git a/js/components/productamountpicker.js b/js/components/productamountpicker.js index d40e6e58..1cd9095f 100644 --- a/js/components/productamountpicker.js +++ b/js/components/productamountpicker.js @@ -5,8 +5,8 @@ class productamountpicker this.Grocy = Grocy; this.scopeSelector = scopeSelector; - this.scope = scopeSelector != null ? $(scope) : $(document); - this.$ = scopeSelector != null ? $(scope).find : $; + this.scope = scopeSelector != null ? $(scopeSelector) : $(document); + this.$ = scopeSelector != null ? $(scopeSelector).find : $; Grocy.Use("numberpicker"); this.AllowAnyQuEnabled = false; @@ -26,7 +26,7 @@ class productamountpicker if (!this.AllowAnyQuEnabled) { - var qu = thisGrocy.QuantityUnits.find(elem => elem.id == destinationQuId); + var qu = this.Grocy.QuantityUnits.find(elem => elem.id == destinationQuId); this.qu_id.find("option").remove().end(); this.qu_id.attr("data-destination-qu-name", qu.name); this.qu_id.attr("data-destination-qu-name-plural", qu.name_plural); @@ -43,7 +43,7 @@ class productamountpicker { this.qu_id.append(''); } - }; + } } if (!this.InitialValueSet || forceInitialDisplayQu) diff --git a/js/components/productcard.js b/js/components/productcard.js index e8f2bd69..7dce5cf0 100644 --- a/js/components/productcard.js +++ b/js/components/productcard.js @@ -9,8 +9,8 @@ class productcard this.Grocy = Grocy; this.scopeSelector = scopeSelector; - this.scope = scopeSelector != null ? $(scope) : $(document); - this.$ = scopeSelector != null ? $(scope).find : $; + this.scope = scopeSelector != null ? $(scopeSelector) : $(document); + this.$ = scopeSelector != null ? $(scopeSelector).find : $; this.PriceHistoryChart = null; var self = this; @@ -133,7 +133,7 @@ class productcard if (productDetails.product.picture_file_name !== null && !productDetails.product.picture_file_name.isEmpty()) { self.$("#productcard-product-picture").removeClass("d-none"); - self.$("#productcard-product-picture").attr("src", Grocy.FormatUrl('/api/files/productpictures/' + btoa(productDetails.product.picture_file_name) + '?force_serve_as=picture&best_fit_width=400')); + self.$("#productcard-product-picture").attr("src", self.Grocy.FormatUrl('/api/files/productpictures/' + btoa(productDetails.product.picture_file_name) + '?force_serve_as=picture&best_fit_width=400')); } else { @@ -165,7 +165,7 @@ class productcard var chart = self.PriceHistoryChart.data; for (let dataPoint of priceHistoryDataPoints) { - let key = Grocy.translate("Unknown store"); + let key = self.Grocy.translate("Unknown store"); if (dataPoint.shopping_location) { key = dataPoint.shopping_location.name diff --git a/js/components/productpicker.js b/js/components/productpicker.js index e659d18d..4518021d 100644 --- a/js/components/productpicker.js +++ b/js/components/productpicker.js @@ -231,19 +231,19 @@ class productpicker extends BasePicker '/product/new?flow=InplaceNewProductWithName' + '&name=' + encodeURIComponent(input) + '&returnto=' + encodeURIComponent( - Grocy.CurrentUrlRelative + + self.Grocy.CurrentUrlRelative + "?flow=InplaceNewProductWithName" + "&" + self.embedded) + "&" + self.embedded); } }, addbarcode: { - label: 'B ' + Grocy.translate('Add as barcode to existing product'), + label: 'B ' + self.Grocy.translate('Add as barcode to existing product'), className: 'btn-info add-new-barcode-dialog-button responsive-button', callback: function() { self.PopupOpen = false; - window.location.href = Grocy.FormatUrl( + window.location.href = self.Grocy.FormatUrl( self.Grocy.CurrentUrlRelative + '?flow=InplaceAddBarcodeToExistingProduct' + '&barcode=' + encodeURIComponent(input) @@ -251,12 +251,12 @@ class productpicker extends BasePicker } }, addnewproductwithbarcode: { - label: 'A ' + Grocy.translate('Add as new product and prefill barcode'), + label: 'A ' + self.Grocy.translate('Add as new product and prefill barcode'), className: 'btn-warning add-new-product-with-barcode-dialog-button responsive-button ' + addProductWorkflowsAdditionalCssClasses, callback: function() { self.PopupOpen = false; - window.location.href = Grocy.FormatUrl( + window.location.href = self.Grocy.FormatUrl( '/product/new' + '?flow=InplaceNewProductWithBarcode' + '&barcode=' + encodeURIComponent(input) + @@ -271,7 +271,7 @@ class productpicker extends BasePicker } }; - if (!Grocy.FeatureFlags.DISABLE_BROWSER_BARCODE_CAMERA_SCANNING) + if (!this.Grocy.FeatureFlags.DISABLE_BROWSER_BARCODE_CAMERA_SCANNING) { buttons.retrycamerascanning = { label: 'C ', diff --git a/js/components/userfieldsform.js b/js/components/userfieldsform.js index 3e025111..959140d0 100644 --- a/js/components/userfieldsform.js +++ b/js/components/userfieldsform.js @@ -1,6 +1,6 @@ import { RandomString } from '../helpers/extensions'; import { LoadImagesLazy } from '../configs/lazy' -import uuid from 'uuid'; +import * as uuid from 'uuid'; import { datetimepicker } from "./datetimepicker"; class userfieldsform @@ -10,8 +10,8 @@ class userfieldsform this.Grocy = Grocy; this.scopeSelector = scopeSelector; - this.scope = scopeSelector != null ? $(scope) : $(document); - this.$ = scopeSelector != null ? $(scope).find : $; + this.scope = scopeSelector != null ? $(scopeSelector) : $(document); + this.$ = scopeSelector != null ? $(scopeSelector).find : $; this.$(".userfield-link").keyup(); @@ -116,7 +116,7 @@ class userfieldsform } var self = this; - Grocy.Api.Get('userfields/' + this.$("#userfields-form").data("entity") + '/' + this.Grocy.EditObjectId, + this.Grocy.Api.Get('userfields/' + this.$("#userfields-form").data("entity") + '/' + this.Grocy.EditObjectId, function(result) { $.each(result, function(key, value) diff --git a/js/configs/globalstate.js b/js/configs/globalstate.js index 68177374..e3f272a1 100644 --- a/js/configs/globalstate.js +++ b/js/configs/globalstate.js @@ -1,6 +1,6 @@ import { ResizeResponsiveEmbeds } from "../helpers/embeds"; import { IsTouchInputDevice } from "../helpers/input"; -import { BoolVal, GetFileNameFromPath, GetUriParam } from "../helpers/extensions"; +import { BoolVal, GetFileNameFromPath } from "../helpers/extensions"; // This function sets some global state and adds some global event listeners. function setInitialGlobalState(Grocy) @@ -229,7 +229,7 @@ function setInitialGlobalState(Grocy) { e.preventDefault(); - var link = GetUriParam("returnto"); + var link = Grocy.GetUriParam("returnto"); if (!link || !link.length > 0) { window.location.href = $(e.currentTarget).attr("href"); diff --git a/js/grocy.js b/js/grocy.js index ac5ddd25..81490179 100644 --- a/js/grocy.js +++ b/js/grocy.js @@ -9,7 +9,7 @@ import { WakeLock } from "./lib/WakeLock"; import { UISound } from "./lib/UISound"; import { Nightmode } from "./lib/nightmode"; import { HeaderClock } from "./helpers/clock"; -import { animateCSS, BoolVal, EmptyElementWhenMatches, GetUriParam, RemoveUriParam, UpdateUriParam } from "./helpers/extensions"; +import { animateCSS, BoolVal, EmptyElementWhenMatches } from "./helpers/extensions"; import Translator from "gettext-translator"; import { WindowMessageBag } from './helpers/messagebag'; import * as components from './components'; @@ -143,9 +143,6 @@ class GrocyClass setDatatableDefaults(grocy); // add some more functions to the global space - window.GetUriParam = GetUriParam; - window.UpdateUriParam = UpdateUriParam; - window.RemoveUriParam = RemoveUriParam; window.EmptyElementWhenMatches = EmptyElementWhenMatches; window.animateCSS = animateCSS; diff --git a/js/viewjs/about.js b/js/viewjs/about.js index 4e2c6657..09414bb2 100644 --- a/js/viewjs/about.js +++ b/js/viewjs/about.js @@ -18,3 +18,6 @@ } } + + +window.aboutView = aboutView diff --git a/js/viewjs/barcodescannertesting.js b/js/viewjs/barcodescannertesting.js index cc2ace6c..94e78c44 100644 --- a/js/viewjs/barcodescannertesting.js +++ b/js/viewjs/barcodescannertesting.js @@ -105,3 +105,6 @@ }); } + + +window.barcodescannertestingView = barcodescannertestingView diff --git a/js/viewjs/batteries.js b/js/viewjs/batteries.js index ff4699d1..d27a0bf9 100644 --- a/js/viewjs/batteries.js +++ b/js/viewjs/batteries.js @@ -49,3 +49,6 @@ } } + + +window.batteriesView = batteriesView diff --git a/js/viewjs/batteriesjournal.js b/js/viewjs/batteriesjournal.js index b370be25..049415b7 100644 --- a/js/viewjs/batteriesjournal.js +++ b/js/viewjs/batteriesjournal.js @@ -50,3 +50,6 @@ }); } + + +window.batteriesjournalView = batteriesjournalView diff --git a/js/viewjs/batteriesoverview.js b/js/viewjs/batteriesoverview.js index 52393627..2d29ed7d 100644 --- a/js/viewjs/batteriesoverview.js +++ b/js/viewjs/batteriesoverview.js @@ -134,3 +134,6 @@ RefreshStatistics(); } + + +window.batteriesoverviewView = batteriesoverviewView diff --git a/js/viewjs/batteriessettings.js b/js/viewjs/batteriessettings.js index 0b652f15..65541c3d 100644 --- a/js/viewjs/batteriessettings.js +++ b/js/viewjs/batteriessettings.js @@ -13,3 +13,6 @@ RefreshLocaleNumberInput(); } + + +window.batteriessettingsView = batteriessettingsView diff --git a/js/viewjs/batteryform.js b/js/viewjs/batteryform.js index ed35207a..897c7a9d 100644 --- a/js/viewjs/batteryform.js +++ b/js/viewjs/batteryform.js @@ -101,3 +101,6 @@ function batteryformView(Grocy, scope = null) Grocy.FrontendHelpers.ValidateForm('battery-form'); } + + +window.batteryformView = batteryformView diff --git a/js/viewjs/batterytracking.js b/js/viewjs/batterytracking.js index 4c720f26..1dce797c 100644 --- a/js/viewjs/batterytracking.js +++ b/js/viewjs/batterytracking.js @@ -108,3 +108,6 @@ Grocy.FrontendHelpers.ValidateForm('batterytracking-form'); }); } + + +window.batterytrackingView = batterytrackingView diff --git a/js/viewjs/calendar.js b/js/viewjs/calendar.js index 965969e0..3d8f8c73 100644 --- a/js/viewjs/calendar.js +++ b/js/viewjs/calendar.js @@ -105,4 +105,6 @@ function calendarView(Grocy, scope = null) } -window.calendarView = calendarView; \ No newline at end of file + + +window.calendarView = calendarView diff --git a/js/viewjs/choreform.js b/js/viewjs/choreform.js index cce1d344..0ba5bb10 100644 --- a/js/viewjs/choreform.js +++ b/js/viewjs/choreform.js @@ -251,3 +251,6 @@ }); } + + +window.choreformView = choreformView diff --git a/js/viewjs/chores.js b/js/viewjs/chores.js index 68a332a2..ffac1e32 100644 --- a/js/viewjs/chores.js +++ b/js/viewjs/chores.js @@ -48,3 +48,6 @@ } } + + +window.choresView = choresView diff --git a/js/viewjs/choresjournal.js b/js/viewjs/choresjournal.js index f708e250..6f262cbc 100644 --- a/js/viewjs/choresjournal.js +++ b/js/viewjs/choresjournal.js @@ -50,3 +50,6 @@ }); } + + +window.choresjournalView = choresjournalView diff --git a/js/viewjs/choresoverview.js b/js/viewjs/choresoverview.js index 854483af..26fc0f24 100644 --- a/js/viewjs/choresoverview.js +++ b/js/viewjs/choresoverview.js @@ -192,3 +192,6 @@ RefreshStatistics(); } + + +window.choresoverviewView = choresoverviewView diff --git a/js/viewjs/choressettings.js b/js/viewjs/choressettings.js index 4c96e8ce..3975a7b0 100644 --- a/js/viewjs/choressettings.js +++ b/js/viewjs/choressettings.js @@ -13,3 +13,6 @@ RefreshLocaleNumberInput(); } + + +window.choressettingsView = choressettingsView diff --git a/js/viewjs/choretracking.js b/js/viewjs/choretracking.js index ddd57cf6..f9965132 100644 --- a/js/viewjs/choretracking.js +++ b/js/viewjs/choretracking.js @@ -127,3 +127,6 @@ }); } + + +window.choretrackingView = choretrackingView diff --git a/js/viewjs/consume.js b/js/viewjs/consume.js index 7da02c60..ae23c54e 100644 --- a/js/viewjs/consume.js +++ b/js/viewjs/consume.js @@ -655,4 +655,6 @@ function consumeView(Grocy, scope = null) } } -window.consumeViw = consumeView; \ No newline at end of file + + +window.consumeView = consumeView diff --git a/js/viewjs/equipment.js b/js/viewjs/equipment.js index 0b7feeb0..da7012aa 100644 --- a/js/viewjs/equipment.js +++ b/js/viewjs/equipment.js @@ -101,4 +101,6 @@ function equipmentView(Grocy, scope = null) } -window.equipmentView = equipmentView \ No newline at end of file + + +window.equipmentView = equipmentView diff --git a/js/viewjs/equipmentform.js b/js/viewjs/equipmentform.js index bfda461b..5189d5c5 100644 --- a/js/viewjs/equipmentform.js +++ b/js/viewjs/equipmentform.js @@ -169,3 +169,6 @@ function equipmentformView(Grocy, scope = null) }); } + + +window.equipmentformView = equipmentformView diff --git a/js/viewjs/inventory.js b/js/viewjs/inventory.js index 47a32bbf..27faf2ab 100644 --- a/js/viewjs/inventory.js +++ b/js/viewjs/inventory.js @@ -386,4 +386,6 @@ function inventoryView(Grocy, scope = null) } -window.inventoryView = inventoryView \ No newline at end of file + + +window.inventoryView = inventoryView diff --git a/js/viewjs/locationcontentsheet.js b/js/viewjs/locationcontentsheet.js index d6e4dd36..608afb13 100644 --- a/js/viewjs/locationcontentsheet.js +++ b/js/viewjs/locationcontentsheet.js @@ -23,3 +23,6 @@ }); } + + +window.locationcontentsheetView = locationcontentsheetView diff --git a/js/viewjs/locationform.js b/js/viewjs/locationform.js index 71c7696e..2c06e0d6 100644 --- a/js/viewjs/locationform.js +++ b/js/viewjs/locationform.js @@ -101,4 +101,6 @@ function locationformView(Grocy, scope = null) } -window.locationformView = locationformView \ No newline at end of file + + +window.locationformView = locationformView diff --git a/js/viewjs/locations.js b/js/viewjs/locations.js index a02ee0fb..2239b71c 100644 --- a/js/viewjs/locations.js +++ b/js/viewjs/locations.js @@ -25,3 +25,6 @@ '/locations' ); } + + +window.locationsView = locationsView diff --git a/js/viewjs/login.js b/js/viewjs/login.js index 30e5ae4e..87706ebf 100644 --- a/js/viewjs/login.js +++ b/js/viewjs/login.js @@ -15,3 +15,6 @@ } } + + +window.loginView = loginView diff --git a/js/viewjs/manageapikeys.js b/js/viewjs/manageapikeys.js index 29096f10..578152b7 100644 --- a/js/viewjs/manageapikeys.js +++ b/js/viewjs/manageapikeys.js @@ -56,4 +56,6 @@ function manageapikeysView(Grocy, scope = null) } -window.manageapikeysView = manageapikeysView; \ No newline at end of file + + +window.manageapikeysView = manageapikeysView diff --git a/js/viewjs/mealplan.js b/js/viewjs/mealplan.js index 3b2cb117..48019764 100644 --- a/js/viewjs/mealplan.js +++ b/js/viewjs/mealplan.js @@ -24,6 +24,7 @@ function mealplanView(Grocy, scope = null) Grocy.Use("numberpicker"); var productamountpicker = Grocy.Use("productamountpicker"); var recipepicker = Grocy.Use("recipepicker"); + var productpicker = Grocy.Use("productpicker"); var setLocale = false; if (__t('fullcalendar_locale').replace(" ", "") !== "" && __t('fullcalendar_locale') != 'x') @@ -875,3 +876,6 @@ function mealplanView(Grocy, scope = null) }); } + + +window.mealplanView = mealplanView diff --git a/js/viewjs/openapiui.js b/js/viewjs/openapiui.js index 029af9f9..1b87eb6c 100644 --- a/js/viewjs/openapiui.js +++ b/js/viewjs/openapiui.js @@ -1,37 +1,28 @@ -function openapiuiView(Grocy, scope = null) +/* global SwaggerUIBundle, SwaggerUIStandalonePreset */ +function HideTopbarPlugin() { - var $scope = $; - if (scope != null) - { - $scope = $(scope).find; - } - - /* global SwaggerUIBundle, SwaggerUIStandalonePreset */ - function HideTopbarPlugin() - { - return { - components: { - Topbar: function() { return null } - } + return { + components: { + Topbar: function() { return null } } } - - const swaggerUi = SwaggerUIBundle({ - url: Grocy.OpenApi.SpecUrl, - dom_id: '#swagger-ui', - deepLinking: true, - presets: [ - SwaggerUIBundle.presets.apis, - SwaggerUIStandalonePreset - ], - plugins: [ - SwaggerUIBundle.plugins.DownloadUrl, - HideTopbarPlugin - ], - layout: 'StandaloneLayout', - docExpansion: "list" - }); - - window.ui = swaggerUi; - } + +const swaggerUi = SwaggerUIBundle({ + url: Grocy.OpenApi.SpecUrl, + dom_id: '#swagger-ui', + deepLinking: true, + presets: [ + SwaggerUIBundle.presets.apis, + SwaggerUIStandalonePreset + ], + plugins: [ + SwaggerUIBundle.plugins.DownloadUrl, + HideTopbarPlugin + ], + layout: 'StandaloneLayout', + docExpansion: "list" +}); + +window.ui = swaggerUi; + diff --git a/js/viewjs/productbarcodeform.js b/js/viewjs/productbarcodeform.js index 5f45d052..46c3441f 100644 --- a/js/viewjs/productbarcodeform.js +++ b/js/viewjs/productbarcodeform.js @@ -122,4 +122,6 @@ function productbarcodeformView(Grocy, scope = null) } -window.productbarcodeformView = productbarcodeformView \ No newline at end of file + + +window.productbarcodeformView = productbarcodeformView diff --git a/js/viewjs/productform.js b/js/viewjs/productform.js index 49c42f64..867d66d9 100644 --- a/js/viewjs/productform.js +++ b/js/viewjs/productform.js @@ -477,4 +477,6 @@ function productformView(Grocy, scope = null) } -window.productformView = productformView \ No newline at end of file + + +window.productformView = productformView diff --git a/js/viewjs/productgroupform.js b/js/viewjs/productgroupform.js index 97eb2787..8b7e8945 100644 --- a/js/viewjs/productgroupform.js +++ b/js/viewjs/productgroupform.js @@ -87,4 +87,6 @@ function productgroupformView(Grocy, scope = null) } -window.productgroupformView = productgroupformView \ No newline at end of file + + +window.productgroupformView = productgroupformView diff --git a/js/viewjs/productgroups.js b/js/viewjs/productgroups.js index 73b790e2..7b0e4462 100644 --- a/js/viewjs/productgroups.js +++ b/js/viewjs/productgroups.js @@ -34,3 +34,6 @@ } }); } + + +window.productgroupsView = productgroupsView diff --git a/js/viewjs/products.js b/js/viewjs/products.js index 9ea423b5..04300147 100644 --- a/js/viewjs/products.js +++ b/js/viewjs/products.js @@ -89,3 +89,6 @@ }); } + + +window.productsView = productsView diff --git a/js/viewjs/purchase.js b/js/viewjs/purchase.js index d4e1582c..3c3c75f5 100644 --- a/js/viewjs/purchase.js +++ b/js/viewjs/purchase.js @@ -592,4 +592,6 @@ function purchaseView(Grocy, scope = null) } -window.purchaseView = purchaseView \ No newline at end of file + + +window.purchaseView = purchaseView diff --git a/js/viewjs/quantityunitconversionform.js b/js/viewjs/quantityunitconversionform.js index b28c12c9..5000a9ad 100644 --- a/js/viewjs/quantityunitconversionform.js +++ b/js/viewjs/quantityunitconversionform.js @@ -222,4 +222,7 @@ function quantityunitconversionformView(Grocy, scope = null) } + + + window.quantityunitconversionformView = quantityunitconversionformView diff --git a/js/viewjs/quantityunitform.js b/js/viewjs/quantityunitform.js index 518421be..87a99204 100644 --- a/js/viewjs/quantityunitform.js +++ b/js/viewjs/quantityunitform.js @@ -1,4 +1,6 @@ -function quantityunitformView(Grocy, scope = null) +import { WindowMessageBag } from '../helpers/messagebag'; + +function quantityunitformView(Grocy, scope = null) { var $scope = $; if (scope != null) @@ -6,8 +8,6 @@ $scope = $(scope).find; } - import { WindowMessageBag } from '../helpers/messagebag'; - var userfields = Grocy.Use("userfieldsform"); $scope('.save-quantityunit-button').on('click', function(e) @@ -188,3 +188,6 @@ }); } + + +window.quantityunitformView = quantityunitformView diff --git a/js/viewjs/quantityunitpluraltesting.js b/js/viewjs/quantityunitpluraltesting.js index b0544e16..d919fc88 100644 --- a/js/viewjs/quantityunitpluraltesting.js +++ b/js/viewjs/quantityunitpluraltesting.js @@ -47,3 +47,6 @@ $scope("#amount").focus(); } + + +window.quantityunitpluraltestingView = quantityunitpluraltestingView diff --git a/js/viewjs/quantityunits.js b/js/viewjs/quantityunits.js index 6ae1abc9..6674a8d4 100644 --- a/js/viewjs/quantityunits.js +++ b/js/viewjs/quantityunits.js @@ -24,3 +24,6 @@ '/quantityunits' ); } + + +window.quantityunitsView = quantityunitsView diff --git a/js/viewjs/recipeform.js b/js/viewjs/recipeform.js index f02b1558..57349125 100644 --- a/js/viewjs/recipeform.js +++ b/js/viewjs/recipeform.js @@ -347,4 +347,6 @@ function recipeformView(Grocy, scope = null) } -window.recipeformView = recipeformView \ No newline at end of file + + +window.recipeformView = recipeformView diff --git a/js/viewjs/recipeposform.js b/js/viewjs/recipeposform.js index a21c19e9..c34cbd9e 100644 --- a/js/viewjs/recipeposform.js +++ b/js/viewjs/recipeposform.js @@ -11,6 +11,7 @@ function recipeposformView(Grocy, scope = null) Grocy.Use("numberpicker"); var productamountpicker = Grocy.Use("productamountpicker"); var productcard = Grocy.Use("productcard"); + var productpicker = Grocy.Use("productpicker"); Grocy.RecipePosFormInitialLoadDone = false; @@ -179,4 +180,6 @@ function recipeposformView(Grocy, scope = null) } -window.recipeposformView = recipeposformView \ No newline at end of file + + +window.recipeposformView = recipeposformView diff --git a/js/viewjs/recipes.js b/js/viewjs/recipes.js index dc9853a8..1111f554 100644 --- a/js/viewjs/recipes.js +++ b/js/viewjs/recipes.js @@ -277,3 +277,6 @@ } } + + +window.recipesView = recipesView diff --git a/js/viewjs/recipessettings.js b/js/viewjs/recipessettings.js index 540b7ec8..092e6977 100644 --- a/js/viewjs/recipessettings.js +++ b/js/viewjs/recipessettings.js @@ -17,4 +17,6 @@ function recipessettingsView(Grocy, scope = null) } -window.recipessettingsView = recipessettingsView \ No newline at end of file + + +window.recipessettingsView = recipessettingsView diff --git a/js/viewjs/shoppinglist.js b/js/viewjs/shoppinglist.js index a053ca71..a39b7b73 100644 --- a/js/viewjs/shoppinglist.js +++ b/js/viewjs/shoppinglist.js @@ -558,4 +558,6 @@ function shoppinglistView(Grocy, scope = null) } -window.shoppinglistView = shoppinglistView \ No newline at end of file + + +window.shoppinglistView = shoppinglistView diff --git a/js/viewjs/shoppinglistform.js b/js/viewjs/shoppinglistform.js index 4a29cf46..978062e8 100644 --- a/js/viewjs/shoppinglistform.js +++ b/js/viewjs/shoppinglistform.js @@ -1,4 +1,6 @@ -function shoppinglistformView(Grocy, scope = null) +import { WindowMessageBag } from '../helpers/messagebag'; + +function shoppinglistformView(Grocy, scope = null) { var $scope = $; if (scope != null) @@ -6,8 +8,6 @@ $scope = $(scope).find; } - import { WindowMessageBag } from '../helpers/messagebag'; - var userfields = Grocy.Use("userfieldsform"); $scope('#save-shopping-list-button').on('click', function(e) @@ -90,3 +90,6 @@ Grocy.FrontendHelpers.ValidateForm('shopping-list-form'); } + + +window.shoppinglistformView = shoppinglistformView diff --git a/js/viewjs/shoppinglistitemform.js b/js/viewjs/shoppinglistitemform.js index 30378bbe..94d29afa 100644 --- a/js/viewjs/shoppinglistitemform.js +++ b/js/viewjs/shoppinglistitemform.js @@ -10,6 +10,7 @@ function shoppinglistitemformView(Grocy, scope = null) var productamountpicker = Grocy.Use("productamountpicker"); var userfields = Grocy.Use("userfieldsform"); + var productpicker = Grocy.Use("productpicker"); Grocy.ShoppingListItemFormInitialLoadDone = false; @@ -281,4 +282,6 @@ function shoppinglistitemformView(Grocy, scope = null) } -window.shoppinglistitemformView = shoppinglistitemformView \ No newline at end of file + + +window.shoppinglistitemformView = shoppinglistitemformView diff --git a/js/viewjs/shoppinglistsettings.js b/js/viewjs/shoppinglistsettings.js index 3a35ce96..f1c65921 100644 --- a/js/viewjs/shoppinglistsettings.js +++ b/js/viewjs/shoppinglistsettings.js @@ -22,4 +22,6 @@ function shoppinglistsettingsView(Grocy, scope = null) } -window.shoppinglistsettingsView = shoppinglistsettingsView \ No newline at end of file + + +window.shoppinglistsettingsView = shoppinglistsettingsView diff --git a/js/viewjs/shoppinglocationform.js b/js/viewjs/shoppinglocationform.js index 41b82c1c..be9ec779 100644 --- a/js/viewjs/shoppinglocationform.js +++ b/js/viewjs/shoppinglocationform.js @@ -101,4 +101,6 @@ function shoppinglocationformView(Grocy, scope = null) } -window.shoppinglocationformView = shoppinglocationformView; \ No newline at end of file + + +window.shoppinglocationformView = shoppinglocationformView diff --git a/js/viewjs/shoppinglocations.js b/js/viewjs/shoppinglocations.js index 03ffe0de..a4cab1fc 100644 --- a/js/viewjs/shoppinglocations.js +++ b/js/viewjs/shoppinglocations.js @@ -25,3 +25,6 @@ '/shoppinglocations' ); } + + +window.shoppinglocationsView = shoppinglocationsView diff --git a/js/viewjs/stockentries.js b/js/viewjs/stockentries.js index a24bfe97..dae325b0 100644 --- a/js/viewjs/stockentries.js +++ b/js/viewjs/stockentries.js @@ -289,3 +289,6 @@ }); } + + +window.stockentriesView = stockentriesView diff --git a/js/viewjs/stockentryform.js b/js/viewjs/stockentryform.js index 4b776f1d..eb0f1946 100644 --- a/js/viewjs/stockentryform.js +++ b/js/viewjs/stockentryform.js @@ -132,4 +132,6 @@ function stockentryformView(Grocy, scope = null) } -window.stockentryformView = stockentryformView; \ No newline at end of file + + +window.stockentryformView = stockentryformView diff --git a/js/viewjs/stockjournal.js b/js/viewjs/stockjournal.js index a017f7cb..7564b663 100644 --- a/js/viewjs/stockjournal.js +++ b/js/viewjs/stockjournal.js @@ -60,3 +60,6 @@ }); } + + +window.stockjournalView = stockjournalView diff --git a/js/viewjs/stockjournalsummary.js b/js/viewjs/stockjournalsummary.js index 9b8d0e1b..319d2f0d 100644 --- a/js/viewjs/stockjournalsummary.js +++ b/js/viewjs/stockjournalsummary.js @@ -22,3 +22,6 @@ Grocy.FrontendHelpers.MakeFilterForColumn("#transaction-type-filter", 2, journalSummaryTable); Grocy.FrontendHelpers.MakeFilterForColumn("#user-filter", 3, journalSummaryTable); } + + +window.stockjournalsummaryView = stockjournalsummaryView diff --git a/js/viewjs/stockoverview.js b/js/viewjs/stockoverview.js index c5e8b9fc..43f0d31d 100755 --- a/js/viewjs/stockoverview.js +++ b/js/viewjs/stockoverview.js @@ -338,3 +338,6 @@ }); } + + +window.stockoverviewView = stockoverviewView diff --git a/js/viewjs/stocksettings.js b/js/viewjs/stocksettings.js index 7dd23d54..57956120 100644 --- a/js/viewjs/stocksettings.js +++ b/js/viewjs/stocksettings.js @@ -56,4 +56,6 @@ function stocksettingsView(Grocy, scope = null) } -window.stocksettingsView = stocksettingsView; \ No newline at end of file + + +window.stocksettingsView = stocksettingsView diff --git a/js/viewjs/taskcategories.js b/js/viewjs/taskcategories.js index c234f781..6ab7b856 100644 --- a/js/viewjs/taskcategories.js +++ b/js/viewjs/taskcategories.js @@ -25,3 +25,6 @@ '/taskcategories' ); } + + +window.taskcategoriesView = taskcategoriesView diff --git a/js/viewjs/taskcategoryform.js b/js/viewjs/taskcategoryform.js index 381c3c51..1e4ff1e5 100644 --- a/js/viewjs/taskcategoryform.js +++ b/js/viewjs/taskcategoryform.js @@ -1,4 +1,6 @@ -function taskcategoryformView(Grocy, scope = null) +import { WindowMessageBag } from '../helpers/messagebag'; + +function taskcategoryformView(Grocy, scope = null) { var $scope = $; if (scope != null) @@ -6,7 +8,7 @@ $scope = $(scope).find; } - import { WindowMessageBag } from '../helpers/messagebag'; + var userfields = Grocy.Use("userfieldsform"); $scope('#save-task-category-button').on('click', function(e) { @@ -98,3 +100,6 @@ Grocy.FrontendHelpers.ValidateForm('task-category-form'); } + + +window.taskcategoryformView = taskcategoryformView diff --git a/js/viewjs/taskform.js b/js/viewjs/taskform.js index 3d4878f2..1b3a6de8 100644 --- a/js/viewjs/taskform.js +++ b/js/viewjs/taskform.js @@ -1,4 +1,6 @@ -function taskformView(Grocy, scope = null) +import { WindowMessageBag } from '../helpers/messagebag'; + +function taskformView(Grocy, scope = null) { var $scope = $; if (scope != null) @@ -6,8 +8,6 @@ $scope = $(scope).find; } - import { WindowMessageBag } from '../helpers/messagebag'; - var datetimepicker = Grocy.Use("datetimepicker"); var userfields = Grocy.Use("userfieldsform"); @@ -106,3 +106,6 @@ Grocy.FrontendHelpers.ValidateForm('task-form'); } + + +window.taskformView = taskformView diff --git a/js/viewjs/tasks.js b/js/viewjs/tasks.js index e7297da0..28d8e440 100644 --- a/js/viewjs/tasks.js +++ b/js/viewjs/tasks.js @@ -172,3 +172,6 @@ RefreshStatistics(); } + + +window.tasksView = tasksView diff --git a/js/viewjs/taskssettings.js b/js/viewjs/taskssettings.js index 65ee5043..fffb15b7 100644 --- a/js/viewjs/taskssettings.js +++ b/js/viewjs/taskssettings.js @@ -13,3 +13,6 @@ RefreshLocaleNumberInput(); } + + +window.taskssettingsView = taskssettingsView diff --git a/js/viewjs/transfer.js b/js/viewjs/transfer.js index e60686f5..36fd11e4 100644 --- a/js/viewjs/transfer.js +++ b/js/viewjs/transfer.js @@ -495,4 +495,6 @@ function transferView(Grocy, scope = null) } -window.transferView = transferView; \ No newline at end of file + + +window.transferView = transferView diff --git a/js/viewjs/userentities.js b/js/viewjs/userentities.js index 0f2dd202..1bda7428 100644 --- a/js/viewjs/userentities.js +++ b/js/viewjs/userentities.js @@ -25,3 +25,6 @@ '/userentities' ); } + + +window.userentitiesView = userentitiesView diff --git a/js/viewjs/userentityform.js b/js/viewjs/userentityform.js index 5caade24..f98bf1a5 100644 --- a/js/viewjs/userentityform.js +++ b/js/viewjs/userentityform.js @@ -114,4 +114,6 @@ function userentityformView(Grocy, scope = null) } -window.userentityformView = userentityformView; \ No newline at end of file + + +window.userentityformView = userentityformView diff --git a/js/viewjs/userfieldform.js b/js/viewjs/userfieldform.js index 38346e24..dec9119a 100644 --- a/js/viewjs/userfieldform.js +++ b/js/viewjs/userfieldform.js @@ -129,4 +129,6 @@ function userfieldformView(Grocy, scope = null) } -window.userfieldformView = userfieldformView; \ No newline at end of file + + +window.userfieldformView = userfieldformView diff --git a/js/viewjs/userfields.js b/js/viewjs/userfields.js index a894d8e3..67ecde6c 100644 --- a/js/viewjs/userfields.js +++ b/js/viewjs/userfields.js @@ -52,3 +52,6 @@ } } + + +window.userfieldsView = userfieldsView diff --git a/js/viewjs/userform.js b/js/viewjs/userform.js index e3d17d8d..ec8dfea1 100644 --- a/js/viewjs/userform.js +++ b/js/viewjs/userform.js @@ -156,3 +156,6 @@ Grocy.FrontendHelpers.ValidateForm('user-form'); } + + +window.userformView = userformView diff --git a/js/viewjs/userobjectform.js b/js/viewjs/userobjectform.js index e315ab56..aea1d624 100644 --- a/js/viewjs/userobjectform.js +++ b/js/viewjs/userobjectform.js @@ -80,4 +80,6 @@ function userobjectformView(Grocy, scope = null) } -window.userobjectformView = userobjectformView; \ No newline at end of file + + +window.userobjectformView = userobjectformView diff --git a/js/viewjs/userobjects.js b/js/viewjs/userobjects.js index 9180c8a7..e0aa19c3 100644 --- a/js/viewjs/userobjects.js +++ b/js/viewjs/userobjects.js @@ -25,3 +25,6 @@ () => window.location.reload() ); } + + +window.userobjectsView = userobjectsView diff --git a/js/viewjs/userpermissions.js b/js/viewjs/userpermissions.js index 7c61fccb..aa3b6c3b 100644 --- a/js/viewjs/userpermissions.js +++ b/js/viewjs/userpermissions.js @@ -81,3 +81,6 @@ } } + + +window.userpermissionsView = userpermissionsView diff --git a/js/viewjs/users.js b/js/viewjs/users.js index 6f4f18a1..0447025b 100644 --- a/js/viewjs/users.js +++ b/js/viewjs/users.js @@ -25,3 +25,6 @@ '/users' ); } + + +window.usersView = usersView diff --git a/js/viewjs/usersettings.js b/js/viewjs/usersettings.js index 8affbf9f..a93cc6c1 100644 --- a/js/viewjs/usersettings.js +++ b/js/viewjs/usersettings.js @@ -11,3 +11,6 @@ RefreshLocaleNumberInput(); } + + +window.usersettingsView = usersettingsView