fixup! [DeviceHome] Move to error.html if tau library isn't loaded 49/264849/5 submit/tizen/20211001.160019
authorYoungsoo Choi <kenshin.choi@samsung.com>
Fri, 1 Oct 2021 05:20:35 +0000 (22:20 -0700)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Fri, 1 Oct 2021 05:45:20 +0000 (22:45 -0700)
The file name causing network issue is added into the error message.

Change-Id: I49b845b75a467f9e5a5fc1f17795d0d7e98f1c5c
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
device_home/client/client.html
device_home/client/css/style.css
device_home/client/error.html

index c2c03c2..91f4fab 100755 (executable)
@@ -5,20 +5,20 @@
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, user-scalable=no">
        <title>My Device App</title>
-       <link href="http://taujs.org/1.2.9/mobile/theme/default/tau.min.css" rel="stylesheet" />
+       <script>
+               function error(this_) {
+                       location.replace(`client/error.html?src=${this_.src}`);
+               }
+       </script>
+       <link href="http://taujs.org/1.2.9/mobile/theme/default/tau.min.css" rel="stylesheet" onerror="error(this)" />
        <link rel="stylesheet" href="client/css/style.css" />
        <link rel="manifest" href="client/manifest.webmanifest">
        <link rel="shortcut icon" href="client/images/Icon.png">
-       <script src="https://unpkg.com/mustache@latest"></script>
-       <script src="http://taujs.org/1.2.9/mobile/js/tau.min.js"></script>
+       <script src="https://unpkg.com/mustache@latest" onerror="error(this)"></script>
+       <script src="http://taujs.org/1.2.9/mobile/js/tau.min.js" onerror="error(this)"></script>
        <script src="client/js/clipping-storage.js" type="module"></script>
        <script src="client/js/app.js" type="module"></script>
        <script src="client/js/myApps.js" type="module"></script>
-       <script>
-               if (typeof tau === 'undefined') {
-                       location.replace('client/error.html');
-               }
-       </script>
 </head>
 
 <body>
index f1d7d0a..3e7b5eb 100755 (executable)
 }
 
 .error-msg {
-    text-align: left;
-    line-height: 23px;
     color: #505050;
     display: block;
-    margin-top: 100px;
-    margin-left: 20px;
-    padding-bottom: 20px;
+    text-align: center;
 }
 
 body {
index 2de403f..b62d84e 100755 (executable)
                <h2 style="margin-left:10px">
                        Error
                </h2>
-               <div>
-                       <h4 class="error-msg">
-                               Service is not available due to network issue
-                       </h4>
+               <div class="error-msg">
+                       <h4>Service is not available</h4>
+                       <h4>due to network issue of</h4>
+                       <h4 id="error-msg"></h4>
                </div>
        </div>
+       <script>
+               const urlParams = new URLSearchParams(window.location.search);
+               const urlParamObj = Object.fromEntries(urlParams);
+               const msgElement = document.querySelector('#error-msg');
+               msgElement.innerText = urlParamObj.src;
+       </script>
 </body>
 
 </html>