added working indicator
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 20 Oct 2014 14:29:51 +0000 (16:29 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 20 Oct 2014 14:29:51 +0000 (16:29 +0200)
examples/giphy.gif [new file with mode: 0644]
examples/selfcheck.html
examples/selfcheck.js

diff --git a/examples/giphy.gif b/examples/giphy.gif
new file mode 100644 (file)
index 0000000..738e511
Binary files /dev/null and b/examples/giphy.gif differ
index f792ec0..efe2cff 100644 (file)
@@ -78,6 +78,15 @@ input[type=button] {
        text-align: center;
 }
 
+#working {
+       display: none;
+       position: absolute;
+       top: 50%;
+       left: 50%;
+       margin-left: -250px; /* 500 / 2 */
+       margin-top: -187px;  /* 375 / 2 */
+}
+
 </style>
 <script type="text/javascript" src="/examples/selfcheck.js"></script>
 </head>
@@ -98,6 +107,11 @@ Timeout in <span id="tick">99</span> seconds.
 </div>
 
 
+<div id="working">
+<img src="/examples/giphy.gif">
+</div>
+
+
 <div class="page" id="start">
 
 <!--
index 18b93f0..29ec92f 100644 (file)
@@ -138,9 +138,13 @@ function got_visible_tags(data,textStatus) {
        pending_jsonp--;
 };
 
+var wait_counter = 0;
+
 function scan_tags() {
        if ( pending_jsonp ) {
-               console.debug('scan_tags disabled ', pending_jsonp, ' requests waiting');
+               wait_counter++;
+               console.debug('scan_tags disabled ', pending_jsonp, ' requests waiting counter', wait_counter);
+               if ( wait_counter > 3 ) $('#working').show();
        } else {
                console.info('scan_tags', only_reader);
                pending_jsonp++;
@@ -148,6 +152,8 @@ function scan_tags() {
                        console.error('scan error pending jsonp', pending_jsonp);
                        pending_jsonp--;
                });
+               wait_counter = 0;
+               $('#working').hide();
        }
 
        if ( tick > 0 ) {