diff options
| author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-12-05 12:12:45 +0100 | 
|---|---|---|
| committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-12-05 12:12:45 +0100 | 
| commit | e749bd08958a462f57b8492721a04128468656d0 (patch) | |
| tree | 1c3c7801ccc8985f7f4393daf8d275c5eed4a717 /python/gui/static/js/odr.js | |
| parent | 31b65e41043900c0cadd80961f4b22cdfc171e7d (diff) | |
| download | dabmod-e749bd08958a462f57b8492721a04128468656d0.tar.gz dabmod-e749bd08958a462f57b8492721a04128468656d0.tar.bz2 dabmod-e749bd08958a462f57b8492721a04128468656d0.zip  | |
Get calibration to work with GUI
Diffstat (limited to 'python/gui/static/js/odr.js')
| -rw-r--r-- | python/gui/static/js/odr.js | 48 | 
1 files changed, 19 insertions, 29 deletions
diff --git a/python/gui/static/js/odr.js b/python/gui/static/js/odr.js index 0bf7729..50c321c 100644 --- a/python/gui/static/js/odr.js +++ b/python/gui/static/js/odr.js @@ -27,19 +27,14 @@ function doApiRequestGET(uri, callback) {          dataType: 'json',          error: function(data) { -            if (data.status == 500) { -                var errorWindow = window.open("", "_self"); -                errorWindow.document.write(data.responseText); -            } -            else { -                console.log(data.responseText); +            console.log(data.responseText); -                $.gritter.add({ title: 'API', -                    text: "AJAX failed: " + data.statusText, -                    image: '/fonts/warning.png', -                    sticky: true, -                }); -            } +            $.gritter.add({ title: 'API', +                text: "AJAX failed: " + data.statusText, +                image: '/fonts/warning.png', +                sticky: false, +                time: 4000, +            });          },          success: function(data) {              if (data.status == 'ok') { @@ -50,7 +45,8 @@ function doApiRequestGET(uri, callback) {                      title: 'API',                      text: "API ERROR: " + data.reason,                      image: '/fonts/warning.png', -                    sticky: true, +                    sticky: false, +                    time: 4000,                  });              }          } @@ -66,22 +62,15 @@ function doApiRequestPOST(uri, data, callback) {          data: JSON.stringify(data),          error: function(data) { -            if (data.status == 500) { -                var windowObjectReference; -                var winFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes"; -                var errorWindow = window.open("", "Error 500", winFeatures); -                errorWindow.document.write(data.responseText); -            } -            else { -                console.log(data.responseText); +            console.log(data.responseText); -                $.gritter.add({ -                    title: 'API', -                    text: "AJAX failed: " + data.statusText, -                    image: '/fonts/warning.png', -                    sticky: true, -                }); -            } +            $.gritter.add({ +                title: 'API', +                text: "AJAX failed: " + data.statusText, +                image: '/fonts/warning.png', +                sticky: false, +                time: 4000, +            });          },          success: function(data_in) { @@ -93,7 +82,8 @@ function doApiRequestPOST(uri, data, callback) {                      title: 'API',                      text: "API ERROR: " + data_in.reason,                      image: '/fonts/warning.png', -                    sticky: true, +                    sticky: false, +                    time: 4000,                  });              }          }  | 
