Procházet zdrojové kódy

Shift to traditional web app

Vijayakrishnan Krishnan před 3 týdny
rodič
revize
a91b6af2e1

+ 2 - 1
app/Http/Controllers/HomeController.php

@@ -1956,7 +1956,8 @@ WHERE measurement.label NOT IN ('SBP', 'DBP')
         if ($fragment) {
             $page = '/' . $fragment;
         }
-        return view('app/mc', compact('page'));
+        // return view('app/mc', compact('page'));
+        return redirect()->to($page);
     }
 
     public function blank(Request $request)

+ 41 - 10
js-dev/mc.js

@@ -1,5 +1,5 @@
 window.top.currentMcUrl = '';
-window.top.addEventListener('popstate', function (event) {
+/*window.top.addEventListener('popstate', function (event) {
     window.setTimeout(function () {
         hideMask();
         hideMoeFormMask();
@@ -12,7 +12,7 @@ window.top.addEventListener('popstate', function (event) {
         if (state[0] !== '/') state = '/' + state;
         if (!!state) fastLoad(state, false, true);
     }, 0);
-});
+});*/
 $(document).ready(function () {
 
     var originalLocationPath = window.location.pathname;
@@ -20,14 +20,14 @@ $(document).ready(function () {
     // TODO make it so if param 'xy' is passed in, it doesn't go to parent
     var noMcStuffOnLoad = originalLocationPath.indexOf('notes') >= 0;
 
-    if(!window.noMc){
+    /*if(!window.noMc){
         if (window.location.pathname === window.top.location.pathname) {
             window.top.location.href = '/mc' + window.location.pathname + window.location.search;
             return;
         }
     }
 
-    if(window.noMc) return;
+    if(window.noMc) return;*/
 
     // window.top.ensureRHS();
     $(document).on('click', '.stag_rhs_toggle', function () {
@@ -60,7 +60,7 @@ $(document).ready(function () {
     // }
 
     // populate history on fresh load
-    var target = window.top.location.pathname + window.top.location.search;
+    /*var target = window.top.location.pathname + window.top.location.search;
     if (target.indexOf('/mc') === 0) {
         target = target.split('/mc')[1];
     }
@@ -69,7 +69,7 @@ $(document).ready(function () {
     }
     if(!window.noMc){
         fastLoad(target, true, false, true);
-    }
+    }*/
 
 
 });
@@ -101,6 +101,8 @@ var fastCache = {};
 
 function initFastLoad(_parent = false) {
 
+    return false;
+
     var allAs = $('a[href]:not([onclick]):not([href="#"]):not([native]):not([open-in-stag-popup])');
     if (_parent) {
         allAs = _parent.find('a[href]:not([onclick]):not([href="#"]):not([native]):not([open-in-stag-popup])');
@@ -246,6 +248,11 @@ function appendRedirectUrl(_url) {
 }
 
 var fastReload = function(_target = null) {
+
+    // default behavior
+    window.location.reload();
+    return false;
+
     var targetLocation = window.top.location.pathname + window.top.location.search;
     if(targetLocation.indexOf('/mc') === 0) {
         targetLocation = targetLocation.substr(3);
@@ -257,6 +264,10 @@ var fastReload = function(_target = null) {
 
 function fastLoad(_href, _history = true, _useCache = true, _replaceState = false, _target = null) {
 
+    window.location.href = _href;
+    return false;
+
+    /*
     let domPro = $(window.top.document.body).attr('data-pro-uid'),
         lsPro = window.top.localStorage.currentProUid;
     if(lsPro && domPro && lsPro !== domPro) {
@@ -312,6 +323,7 @@ function fastLoad(_href, _history = true, _useCache = true, _replaceState = fals
             onFastLoaded(_jqXhr.status, _href, _history, _target);
         });
     }
+    */
 }
 
 function initPrimaryForm(_form = false) {
@@ -334,13 +346,32 @@ function initPrimaryForm(_form = false) {
 }
 
 function openInRHS(_url) {
-    window.top.showRHS();
-    var icon = $('.stag_rhs_toggle i');
-    icon.removeClass().addClass('fa fa-arrow-right');
-    window.top.openInRHS(_url);
+    alert('Deprecated');
     return false;
 }
 
+function openInLHS(_url) {
+    fastLoad(_url);
+    return false;
+}
+
+function ensureRHS() {
+    alert('Deprecated');
+}
+function toggleRHS() {
+    alert('Deprecated');
+}
+function showRHS() {
+    alert('Deprecated');
+}
+function hideRHS() {
+    alert('Deprecated');
+}
+function toggleVideoBar(_videoBar) {
+    alert('Deprecated');
+}
+
+
 function initCreateNote() {
     $(document)
         .off('click.create-note', '.create-auto-note-trigger')

+ 1 - 1
resources/views/app/dashboard-admin.blade.php

@@ -838,7 +838,7 @@
                     el: '#pro-dashboard-container',
                     delimiters: ['@{{', '}}'],
                     data: {
-                        tab: '{{ request()->input('tab') ? request()->input('tab') : 'measurements' }}',
+                        tab: '{{ request()->input('tab') ? request()->input('tab') : 'appointments' }}',
                         datesWithEvents: [],
                         selectedDate: '{{ date('Y-m-d') }}',
                         selectedStatus: 'PENDING',

+ 2 - 2
resources/views/app/patient/partials/quick-actions-buttons.blade.php

@@ -43,12 +43,12 @@
 			</form>
 		</span>
 	</div>
-	@if($pro->pro_type == 'ADMIN')
+	{{--@if($pro->pro_type == 'ADMIN')
 	<div>
 		<a href="#" start class="ml-2 d-block" show onclick="return openInRHS('/pro/check-video/{{ $patient->uid }}')"><i class="fa fa-eye mr-1"></i></a>
 	</div>
 	@endif
 	<div class="mr-2">
 		<a href="#" start class="ml-2 d-block" show onclick="return openInRHS('/pro/meet/{{ $patient->uid }}')"><i class="fa fa-video mr-1"></i></a>
-	</div>
+	</div>--}}
 </div>