Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Refactor the function names so they are skipped.

Peter van der Does19c2d853dd44
diff --git a/wger/nutrition/static/js/nutrition.js b/wger/nutrition/static/js/nutrition.js
index 608656f7c..e765d1cc9 100644
--- a/wger/nutrition/static/js/nutrition.js
+++ b/wger/nutrition/static/js/nutrition.js
@@ -43,8 +43,7 @@ function updateIngredientValue(url) {
});
}
-// noinspection Eslint
-function initIngredientDetail(url) {
+function wgerInitIngredientDetail(url) {
// Prevent the form from being sent
$('#nutritional-values-form').submit(function (e) {
e.preventDefault();
@@ -62,8 +61,7 @@ function initIngredientDetail(url) {
/*
* Update the user's preferences
*/
-// noinspection Eslint
-function initIngredientAutocompleter() {
+function wgerInitIngredientAutocompleter() {
// Init the autocompleter
$('#id_ingredient_searchfield').devbridgeAutocomplete({
serviceUrl: '/api/v2/ingredient/search/',
@@ -110,8 +108,7 @@ function initIngredientAutocompleter() {
/*
* Draw the BMI chart
*/
-// noinspection Eslint
-function renderBodyMassIndex(w) {
+function wgerRenderBodyMassIndex(w) {
var svg;
var area;
var nest;
@@ -253,8 +250,7 @@ function renderBodyMassIndex(w) {
/*
* Calories calculator
*/
-// noinspection Eslint
-function initCaloriesCalculator() {
+function wgerInitCaloriesCalculator() {
$('#form-transfer-calories').click(function (e) {
var baseCalories;
e.preventDefault();
diff --git a/wger/nutrition/templates/bmi/form.html b/wger/nutrition/templates/bmi/form.html
index 35fe697f7..b756dc952 100644
--- a/wger/nutrition/templates/bmi/form.html
+++ b/wger/nutrition/templates/bmi/form.html
@@ -26,14 +26,14 @@ div.bmi-legend {
<script>
$(document).ready(function () {
- renderBodyMassIndex({% if flavour = 'mobile'%}$('#content').width() * 0.95{% endif %});
+ wgerRenderBodyMassIndex({% if flavour = 'mobile'%}$('#content').width() * 0.95{% endif %});
/*
* Process the form
*/
$("#bmi-form").click(function(e){
e.preventDefault();
- renderBodyMassIndex({% if flavour = 'mobile'%}$('#content').width() * 0.95{% endif %});
+ wgerRenderBodyMassIndex({% if flavour = 'mobile'%}$('#content').width() * 0.95{% endif %});
});
});
diff --git a/wger/nutrition/templates/ingredient/view.html b/wger/nutrition/templates/ingredient/view.html
index d20926346..4190af912 100644
--- a/wger/nutrition/templates/ingredient/view.html
+++ b/wger/nutrition/templates/ingredient/view.html
@@ -6,7 +6,7 @@
{% block header %}
<script>
$(document).ready(function() {
- initIngredientDetail("{% url 'api-ingredient-get-values' ingredient.id %}");
+ wgerInitIngredientDetail("{% url 'api-ingredient-get-values' ingredient.id %}");
});
</script>
{% endblock %}
diff --git a/wger/nutrition/templates/meal_item/edit.html b/wger/nutrition/templates/meal_item/edit.html
index 4ae155d55..8b3993104 100644
--- a/wger/nutrition/templates/meal_item/edit.html
+++ b/wger/nutrition/templates/meal_item/edit.html
@@ -11,7 +11,7 @@
<script type="text/javascript">
$(document).ready(function() {
// Init the autocompleter
- initIngredientAutocompleter();
+ wgerInitIngredientAutocompleter();
});
</script>
{% endblock %}
diff --git a/wger/nutrition/templates/mobile/plan/view.html b/wger/nutrition/templates/mobile/plan/view.html
index 27bc3b167..d41b14be4 100644
--- a/wger/nutrition/templates/mobile/plan/view.html
+++ b/wger/nutrition/templates/mobile/plan/view.html
@@ -26,7 +26,7 @@
function custom_modal_init()
{
// Init the autocompleter after loading the modal dialog
- initIngredientAutocompleter();
+ wgerInitIngredientAutocompleter();
}
$(document).ready(function() {
diff --git a/wger/nutrition/templates/plan/view.html b/wger/nutrition/templates/plan/view.html
index 93aa39ef3..1df629bf3 100644
--- a/wger/nutrition/templates/plan/view.html
+++ b/wger/nutrition/templates/plan/view.html
@@ -27,7 +27,7 @@
function custom_modal_init()
{
// Init the autocompleter after loading the modal dialog
- initIngredientAutocompleter();
+ wgerInitIngredientAutocompleter();
}
</script>
{% endblock %}
diff --git a/wger/nutrition/templates/rate/form.html b/wger/nutrition/templates/rate/form.html
index 19b4f2859..51b006d15 100644
--- a/wger/nutrition/templates/rate/form.html
+++ b/wger/nutrition/templates/rate/form.html
@@ -6,7 +6,7 @@
{% block header %}
<script>
$(document).ready(function() {
- initCaloriesCalculator();
+ wgerInitCaloriesCalculator();
});
</script>
{% endblock %}