Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Remove ubuntu unity JS file, this was never used

Roland Geider44c8baa9c714
diff --git a/wger/core/static/js/ubuntu-unity.js b/wger/core/static/js/ubuntu-unity.js
deleted file mode 100644
index 38c276a1d..000000000
--- a/wger/core/static/js/ubuntu-unity.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * This file is part of Workout Manager.
- *
- * Workout Manager is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Workout Manager is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- */
-
-/*
- * This file provides integration to Ubuntu's Unity interface with WebApps.
- *
- * For more details look at:
- * - http://developer.ubuntu.com/api/ubuntu-12.04/javascript/index.html
- * - http://developer.ubuntu.com/api/ubuntu-12.04/javascript/unity-web-api-reference.html
- * - http://developer.ubuntu.com/resources/app-developer-cookbook/unity/integrating-tumblr-to-your-desktop/
- */
-
-// helper function, taken from https://bazaar.launchpad.net/~webapps/webapps-applications/trunk/view/head:/common/utils.js.in
-function evalInPageContext(func) {
- var script = document.createElement('script');
- script.appendChild(document.createTextNode('(' + func + ')();'));
- (document.body || document.head || document.documentElement).appendChild(script);
-}
-
-// helper function, taken from https://bazaar.launchpad.net/~webapps/webapps-applications/trunk/view/head:/common/utils.js.in
-function makeRedirector(link) {
- return function () {
- evalInPageContext('function() {window.location = "' + link + '";}');
- };
-}
-
-// Do the actual integration, not much to do though
-function unityReady() {
- Unity.Launcher.removeActions();
- Unity.Launcher.addAction("Workouts", makeRedirector('http://wger.de/workout/overview'));
- Unity.Launcher.addAction("Weight chart", makeRedirector('http://wger.de/weight/overview/'));
- Unity.Launcher.addAction("Add weight entry", makeRedirector('http://wger.de/weight/add/'));
- Unity.Launcher.addAction("Nutrition plans", makeRedirector('http://wger.de/nutrition/overview/'));
-}
-
-// If we are using Ubuntu, call the Init method for Unity, otherwise, do nothing
-try
-{
- var Unity = external.getUnityObject(1);
-
- // Commented out till I make it work reliably
- /*
- Unity.init({name: "Workout Manager",
- iconUrl: "http://developer.ubuntu.com/wp-content/uploads/2012/08/icon1.png",
- onInit: unityReady,
- homepage: "http://gargancjan.lem:8000/"});
- */
-}
-catch(err)
-{
-
-}
diff --git a/wger/core/templates/template.html b/wger/core/templates/template.html
index 3dd1557e3..14573f136 100644
--- a/wger/core/templates/template.html
+++ b/wger/core/templates/template.html
@@ -62,7 +62,6 @@
<script src="{% static 'js/jquery-ui.js' %}"></script>
<script src="{% static 'bower_components/d3/d3.js' %}"></script>
<script src="{% static 'js/workout-manager.js' %}"></script>
- <script src="{% static 'js/ubuntu-unity.js' %}"></script>
<script src="{% static 'bower_components/bootstrap/dist/js/bootstrap.min.js' %}"></script>
<script src="{% static 'js/exercises.js' %}"></script>
<script src="{% static 'js/weight.js' %}"></script>