Applied VSCode JS formatting settings

This commit is contained in:
Bernd Bestel
2020-08-30 12:18:16 +02:00
parent e0e3212f13
commit 9cea0c77cd
68 changed files with 408 additions and 371 deletions

View File

@@ -318,7 +318,7 @@ $(document).on("click", ".add-product-button", function(e)
Grocy.IsMealPlanEntryEditAction = false;
});
$(document).on("click", ".edit-meal-plan-entry-button", function (e)
$(document).on("click", ".edit-meal-plan-entry-button", function(e)
{
var mealPlanEntry = JSON.parse($(this).parents(".fc-h-event:first").attr("data-meal-plan-entry"));
@@ -357,12 +357,12 @@ $("#add-recipe-modal").on("shown.bs.modal", function(e)
Grocy.Components.RecipePicker.GetInputElement().focus();
})
$("#add-note-modal").on("shown.bs.modal", function (e)
$("#add-note-modal").on("shown.bs.modal", function(e)
{
$("#note").focus();
})
$("#add-product-modal").on("shown.bs.modal", function (e)
$("#add-product-modal").on("shown.bs.modal", function(e)
{
Grocy.Components.ProductPicker.GetInputElement().focus();
})
@@ -371,7 +371,7 @@ $(document).on("click", ".remove-recipe-button, .remove-note-button, .remove-pro
{
var mealPlanEntry = JSON.parse($(this).parents(".fc-h-event:first").attr("data-meal-plan-entry"));
Grocy.Api.Delete('objects/meal_plan/' + mealPlanEntry.id.toString(), { },
Grocy.Api.Delete('objects/meal_plan/' + mealPlanEntry.id.toString(), {},
function(result)
{
window.location.reload();
@@ -481,11 +481,11 @@ $('#save-add-product-button').on('click', function(e)
if (Grocy.IsMealPlanEntryEditAction)
{
Grocy.Api.Put('objects/meal_plan/' + Grocy.MealPlanEntryEditObjectId.toString(), jsonData,
function (result)
function(result)
{
window.location.reload();
},
function (xhr)
function(xhr)
{
Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response)
}
@@ -506,7 +506,7 @@ $('#save-add-product-button').on('click', function(e)
}
});
$('#add-recipe-form input').keydown(function (event)
$('#add-recipe-form input').keydown(function(event)
{
if (event.keyCode === 13) //Enter
{
@@ -523,7 +523,7 @@ $('#add-recipe-form input').keydown(function (event)
}
});
$('#add-product-form input').keydown(function (event)
$('#add-product-form input').keydown(function(event)
{
if (event.keyCode === 13) //Enter
{
@@ -588,10 +588,10 @@ $(document).on('click', '.recipe-order-missing-button', function(e)
Grocy.FrontendHelpers.BeginUiBusy();
// Set the recipes desired_servings so that the "recipes resolved"-views resolve correctly based on the meal plan entry servings
Grocy.Api.Put('objects/recipes/' + objectId, { "desired_servings" : servings},
Grocy.Api.Put('objects/recipes/' + objectId, { "desired_servings": servings },
function(result)
{
Grocy.Api.Post('recipes/' + objectId + '/add-not-fulfilled-products-to-shoppinglist', { },
Grocy.Api.Post('recipes/' + objectId + '/add-not-fulfilled-products-to-shoppinglist', {},
function(result)
{
if (button.attr("data-recipe-type") == "normal")
@@ -634,11 +634,11 @@ $(document).on('click', '.product-consume-button', function(e)
var productId = $(e.currentTarget).attr('data-product-id');
var consumeAmount = parseFloat($(e.currentTarget).attr('data-product-amount'));
Grocy.Api.Post('stock/products/' + productId + '/consume', { 'amount': consumeAmount, 'spoiled': false },
Grocy.Api.Post('stock/products/' + productId + '/consume', { 'amount': consumeAmount, 'spoiled': false },
function(bookingResponse)
{
Grocy.Api.Get('stock/products/' + productId,
function (result)
function(result)
{
var toastMessage = __t('Removed %1$s of %2$s from stock', consumeAmount.toString() + " " + __n(consumeAmount, result.quantity_unit_stock.name, result.quantity_unit_stock.name_plural), result.product.name) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoStockTransaction(\'' + bookingResponse.transaction_id + '\')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>';
@@ -741,7 +741,7 @@ $(document).on("click", ".recipe-popup-button", function(e)
cancel: {
label: __t('Close'),
className: 'btn-secondary responsive-button',
callback: function ()
callback: function()
{
bootbox.hideAll();
}
@@ -797,12 +797,12 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
function UndoStockTransaction(transactionId)
{
Grocy.Api.Post('stock/transactions/' + transactionId.toString() + '/undo', { },
function (result)
Grocy.Api.Post('stock/transactions/' + transactionId.toString() + '/undo', {},
function(result)
{
toastr.success(__t("Transaction successfully undone"));
},
function (xhr)
function(xhr)
{
console.error(xhr);
}