Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Remove unused code

Roland Geider59dda5f1b515
diff --git a/wger/core/static/js/wger-core.js b/wger/core/static/js/wger-core.js
index 638a6ff74..877f01d70 100644
--- a/wger/core/static/js/wger-core.js
+++ b/wger/core/static/js/wger-core.js
@@ -59,78 +59,6 @@ function getCurrentLanguage() {
return $('#current-language').data('currentLanguage');
}
-/*
- Setup sortable to make the sets sortable
- */
-function wgerSetupSortable() {
- var elements = document.getElementsByTagName('tbody');
- $.each(elements, function (index, element) {
- Sortable.create(element, {
- handle: '.dragndrop-handle',
- animation: 150,
- onUpdate: function (event) {
- var dayId;
- dayId = $(event.target).parents('table').data('id');
- $.each(($(event.from).children('tr')), function (eventIndex, eventElement) {
- var trElement;
- var setId;
- trElement = $(eventElement);
-
- // The last table element has no ID attribute (has only the 'add exercise' link
- if (trElement.data('id')) {
- setId = trElement.data('id');
- $.ajax({
- url: '/api/v2/set/' + setId + '/',
- type: 'PATCH',
- data: {order: eventIndex + 1}
- });
- }
- });
-
- // Replace the content of the table with a fresh version that has
- // correct indexes.
- $.get('/' + getCurrentLanguage() + '/routine/day/' + dayId + '/view/');
- $('#div-day-' + dayId)
- .load('/' + getCurrentLanguage() + '/routine/day/' + dayId + '/view/');
- }
- });
- });
-}
-
-/*
- Functions related to the user's preferences
- */
-
-
-/*
- Updates a single field in the user profile
- */
-function setProfileField(field, newValue) {
- var dataDict = {};
- dataDict[field] = newValue;
- $.post({
- url: '/api/v2/userprofile/',
- data: dataDict
- });
-}
-
-/*
- Get a single field from the user's profile.
- Synchronous request, use sparingly!
- */
-function getProfileField(field) {
- var result;
- result = null;
- $.ajax({
- url: '/api/v2/userprofile/',
- type: 'GET',
- async: false,
- success: function (userprofile) {
- result = userprofile.results[field];
- }
- });
- return result;
-}
/*
Open a modal dialog for form editing
diff --git a/wger/core/templates/tags/render_day.html b/wger/core/templates/tags/render_day.html
index df12490b6..38a54d847 100644
--- a/wger/core/templates/tags/render_day.html
+++ b/wger/core/templates/tags/render_day.html
@@ -1,11 +1,5 @@
{% load i18n static wger_extras thumbnail %}
-<script>
- $(document).ready(function () {
- // Init the modal dialog to edit the exercise
- wgerFormModalDialog();
- })
-</script>
<table class="table table-bordered workout-table"
id="table-day-{{ day.id }}"
diff --git a/wger/core/templates/template.html b/wger/core/templates/template.html
index 1921b37f6..03d890add 100644
--- a/wger/core/templates/template.html
+++ b/wger/core/templates/template.html
@@ -70,8 +70,8 @@
<script src="{% static 'yarn/Sortable/Sortable.min.js' %}"></script>
<script src="{% static 'yarn/d3/dist/d3.js' %}"></script>
<script src="{% static 'yarn/popper.js/dist/umd/popper.js' %}"></script>
- <script
- src="{% static 'yarn/devbridge-autocomplete/dist/jquery.autocomplete.min.js' %}"></script>
+ <script src="{% static 'yarn/devbridge-autocomplete/dist/jquery.autocomplete.min.js' %}">
+ </script>
<script src="{% static 'yarn/masonry-layout/dist/masonry.pkgd.min.js' %}"></script>
<script src="{% static 'js/wger-core.js' %}"></script>
<script src="{% static 'js/nutrition.js' %}"></script>
diff --git a/yarn.lock b/yarn.lock
index 1e6b1b95b..9a04a2bc0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,11 +2,6 @@
# yarn lockfile v1
-"@popperjs/core@^2.11.8":
- version "2.11.8"
- resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f"
- integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==
-
"@types/jquery@^2.0.32":
version "2.0.54"
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-2.0.54.tgz#d7999245f77c3fab5d84e7d32b8a6c20bfd1f072"
@@ -353,6 +348,11 @@ outlayer@^2.1.0:
fizzy-ui-utils "^2.0.0"
get-size "^2.0.2"
+popper.js@^1.16.1:
+ version "1.16.1"
+ resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b"
+ integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==
+
robust-predicates@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/robust-predicates/-/robust-predicates-3.0.1.tgz#ecde075044f7f30118682bd9fb3f123109577f9a"