From 6977090416dc975b2e7bca2bbbaa7e4e6536ee8e Mon Sep 17 00:00:00 2001 From: Lyndon Date: Thu, 13 Dec 2018 07:15:24 -0400 Subject: [PATCH] Refactoring --- BeWoPlanerMobil/BeWoPlanerMobil.csproj | 1 + BeWoPlanerMobil/Scripts/calendar.js | 15 +++++++++++ BeWoPlanerMobil/Scripts/mainView.js | 27 +++---------------- .../Scripts/serviceRecordValidation.js | 11 -------- 4 files changed, 19 insertions(+), 35 deletions(-) diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj b/BeWoPlanerMobil/BeWoPlanerMobil.csproj index 4812f262d..7569f28fb 100644 --- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj +++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj @@ -219,6 +219,7 @@ + diff --git a/BeWoPlanerMobil/Scripts/calendar.js b/BeWoPlanerMobil/Scripts/calendar.js index e6c9be8ac..1e48c4a6b 100644 --- a/BeWoPlanerMobil/Scripts/calendar.js +++ b/BeWoPlanerMobil/Scripts/calendar.js @@ -278,3 +278,18 @@ function LoadOnly(i, x) { } } } + + +function nextDayButtonClick() { + var nextdatum = new Date($("#KalenderDatum").val() + "T00:00:00Z"); + + nextdatum.setDate((nextdatum.getDate() + 1)); + + $("#KalenderDatum").val(toDateStringYearMonthDay(nextdatum)); + + var newtoday = getDateStringWithLeadingZeros(nextdatum); + + $("#KalenderDatumFormat").val(newtoday); + + loadAppointments(newtoday); +} \ No newline at end of file diff --git a/BeWoPlanerMobil/Scripts/mainView.js b/BeWoPlanerMobil/Scripts/mainView.js index 9b0aaadaa..f4de77395 100644 --- a/BeWoPlanerMobil/Scripts/mainView.js +++ b/BeWoPlanerMobil/Scripts/mainView.js @@ -1,8 +1,6 @@ var breitenGrad, langenGrad, date; var dataURL = ""; var blob, newday, longrider; -var xinner = $("#GeoLocSaveXCOOR"); -var yinner = $("#GeoLocSaveYCOOR"); var ZeiterfassungDatakonstrukt = []; var KlientDatakonstrukt = []; @@ -40,6 +38,9 @@ function actuallyBuildCollapsibleSet(kollektion, selectedGoalOids) { var level = 0; var collapsibleHtml; + +zeitRegEx = /^(2[0-3]|[01]?[0-9])(:|,|\.|#|;)?([0-5][0-9])$/; + function buildGoalTreeItem(goalItem, selectedGoalOids) { var goalOid = goalItem.ValueListEntryOid; var goalHeader = goalItem.Header; @@ -144,8 +145,6 @@ function resizeLabelColumns() { $("#tabLbl").css("width", $("#zieleLbl").css("width")); } -zeitRegEx = /^(2[0-3]|[01]?[0-9])(:|,|\.|#|;)?([0-5][0-9])$/; - function loadGoals(actionPath) { var selectedServiceRecord = $($("#scDropDown")).find(":selected").val(); @@ -728,26 +727,6 @@ function hideEditForm() { $("#StartDate").val(""); } - - - -function nextDayButtonClick() { - var nextdatum = new Date($("#KalenderDatum").val() + "T00:00:00Z"); - - nextdatum.setDate((nextdatum.getDate() + 1)); - - $("#KalenderDatum").val(toDateStringYearMonthDay(nextdatum)); - - var newtoday = getDateStringWithLeadingZeros(nextdatum); - - $("#KalenderDatumFormat").val(newtoday); - - loadAppointments(newtoday); -} - - - - function showServiceRecords() { location.reload(); diff --git a/BeWoPlanerMobil/Scripts/serviceRecordValidation.js b/BeWoPlanerMobil/Scripts/serviceRecordValidation.js index 7469f1fa1..e080fdb8e 100644 --- a/BeWoPlanerMobil/Scripts/serviceRecordValidation.js +++ b/BeWoPlanerMobil/Scripts/serviceRecordValidation.js @@ -1,15 +1,6 @@ var isValidRecord = true; function validateServiceRecordBeforeSubmit() { - function getLocation() { - if (navigator.geolocation) { - navigator.geolocation.getCurrentPosition(showPosition, showError); - } else { - console.log("Ortung wird von diesem Browser nicht unterstützt"); - showPosition(null); - } - } - var hasDokutext = false; if (window.isServiceRecordNoticeMandatory) { @@ -59,8 +50,6 @@ function validateServiceRecordBeforeSubmit() { makeAjaxCall("POST", window.checkRightsUrl, function (json) { $("#URLSave").val(dataURL); $("#TimeStampSave").val(newday); - $("#GeoLocSaveXCOOR").val(langenGrad); - $("#GeoLocSaveYCOOR").val(breitenGrad); if (json === "SessionTimeout") { window.location.href = redirectLink;