]> git.joonet.de Git - adminer.git/commitdiff
Move loading indicator to the right, add CSS cursor: progress
authorJakub Vrana <jakubv@fb.com>
Fri, 17 Feb 2012 20:13:11 +0000 (12:13 -0800)
committerJakub Vrana <jakubv@fb.com>
Fri, 17 Feb 2012 23:48:33 +0000 (15:48 -0800)
adminer/include/design.inc.php
adminer/static/default.css
adminer/static/functions.js
changes.txt
compile.php

index f2345b45bd0dadfdd572306ae799b38cc0180773..f39ea46b97eccc84f9a6f79017f11b694a5c1161 100644 (file)
@@ -41,9 +41,10 @@ var noResponse = '<?php echo lang('No response from server.'); ?>';
 
 <body class="<?php echo lang('ltr'); ?> nojs"<?php echo ($_POST ? "" : " onclick=\"return bodyClick(event, '" . h(js_escape(DB) . "', '" . js_escape($_GET["ns"])) . "');\""); // avoid re-post confirmation after refreshing the next page in Google Chrome ?> onkeydown="bodyKeydown(event);" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion();"); ?>">
 <script type="text/javascript">
-document.body.className = document.body.className.replace(/(^|\s)nojs(\s|$)/, '$1js$2');
+document.body.className = document.body.className.replace(/ nojs/, ' js');
 </script>
 
+<div id="loader"><img src="../adminer/static/loader.gif" alt=""></div>
 <div id="content">
 <?php
        }
@@ -73,7 +74,6 @@ document.body.className = document.body.className.replace(/(^|\s)nojs(\s|$)/, '$
                        echo "$title\n";
                }
        }
-       echo "<span id='loader'></span>\n";
        echo "<h2>$title_all</h2>\n";
        restart_session();
        $uri = preg_replace('~^[^?]*~', '', $_SERVER["REQUEST_URI"]);
index 1d7b37076762967d4c488b07c6d5be3ca773c635..26f5a7e69de4def2ee73e8d5cf69d21d5d8bce1a 100644 (file)
@@ -20,6 +20,8 @@ code { background: #eee; }
 tbody tr:hover td, tbody tr:hover th { background: #eee; }
 pre { margin: 1em 0 0; }
 input[type=image] { vertical-align: middle; }
+.loading { cursor: progress; }
+.loading #loader { display: inline; }
 .version { color: #777; font-size: 67%; }
 .js .hidden, .nojs .jsonly { display: none; }
 .nowrap td, .nowrap th, td.nowrap { white-space: pre; }
@@ -47,7 +49,7 @@ input[type=image] { vertical-align: middle; }
 #content { margin: 2em 0 0 21em; padding: 10px 20px 20px 0; }
 #lang { position: absolute; top: 0; left: 0; line-height: 1.8em; padding: .3em 1em; }
 #breadcrumb { white-space: nowrap; position: absolute; top: 0; left: 21em; background: #eee; height: 2em; line-height: 1.8em; padding: 0 1em; margin: 0 0 0 -18px; }
-#loader { position: fixed; top: 0; left: 18em; z-index: 1; }
+#loader { display: none; position: fixed; top: 2px; right: 2px; z-index: 1; }
 #h1 { color: #777; text-decoration: none; font-style: italic; }
 #version { font-size: 67%; color: red; }
 #schema { margin-left: 60px; position: relative; }
index ed0f65ffe1fad10c45449923051667ac8d2175a5..fc386b6f2c784124fcbd5d5152406dccff7bc316 100644 (file)
@@ -199,7 +199,7 @@ function bodyKeydown(event, button) {
                if (ajaxXmlhttp.abort) {
                        ajaxXmlhttp.abort();
                }
-               setHtml('loader', '');
+               document.body.className = document.body.className.replace(/ loading/, '');
                onblur = function () { };
                if (originalFavicon) {
                        replaceFavicon(originalFavicon);
@@ -334,9 +334,9 @@ function ajaxSend(url, data, popState, noscroll) {
                if (!originalFavicon) {
                        originalFavicon = (document.getElementById('favicon') || {}).href;
                }
-               replaceFavicon('../adminer/static/loader.gif');
+               replaceFavicon(document.getElementById('loader').firstChild.src);
        };
-       setHtml('loader', '<img src="../adminer/static/loader.gif" alt="">');
+       document.body.className += ' loading';
        ajaxXmlhttp = ajax(url, function (xmlhttp) {
                if (!xmlhttp.aborted && currentState == ajaxState) {
                        var title = xmlhttp.getResponseHeader('X-AJAX-Title');
@@ -360,6 +360,7 @@ function ajaxSend(url, data, popState, noscroll) {
                                scrollTo(0, 0);
                        }
                        setHtml('content', (xmlhttp.status ? xmlhttp.responseText : '<p class="error">' + noResponse));
+                       document.body.className = document.body.className.replace(/ loading/, '');
                        var content = document.getElementById('content');
                        var scripts = content.getElementsByTagName('script');
                        var length = scripts.length; // required to avoid infinite loop
index aa22ba9f6f26fcae2fa76446e1aa5c663cb3e5a0..641d48090b007fb5502327653d67c1a660b5ca4d 100644 (file)
@@ -6,6 +6,7 @@ SET DEFAULT foreign key action
 Trim table and column names (bug #3405309)
 Error message with no response from server in AJAX
 Esc to cancel AJAX request
+Move AJAX loading indicator to the right
 Ability to disable export (customization)
 MySQL: set autocommit after connect
 PostgreSQL: fix alter foreign key
index f975d76b171921d57f3f67ff0b3454043a0873f9..de9590735647dc66dd1493acee490946e02d6b71 100644 (file)
@@ -272,9 +272,7 @@ foreach (array("adminer", "editor") as $project) {
        $file = str_replace('<script type="text/javascript" src="static/editing.js"></script>' . "\n", "", $file);
        $file = preg_replace_callback("~compile_file\\('([^']+)', '([^']+)'\\);~", 'compile_file', $file); // integrate static files
        $replace = 'h(preg_replace("~\\\\\\\\?.*~", "", ME)) . "?file=\\1&amp;version=' . $VERSION;
-       $file = preg_replace("~'\\.\\./adminer/static/(loader\\.gif)~", "location.pathname+'?file=\\1&amp;version=$VERSION", $file);
-       $file = preg_replace('~\\.\\./adminer/static/(loader\\.gif)~', "'+location.pathname+'?file=\\1&amp;version=$VERSION", $file);
-       $file = preg_replace('~\\.\\./adminer/static/(default\\.css|functions\\.js|favicon\\.ico)~', '<?php echo ' . $replace . '"; ?>', $file);
+       $file = preg_replace('~\\.\\./adminer/static/(default\\.css|functions\\.js|favicon\\.ico|loader\\.gif)~', '<?php echo ' . $replace . '"; ?>', $file);
        $file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . ' . $replace, $file);
        $file = str_replace("'../externals/jush/'", "location.protocol + '//www.adminer.org/static/'", $file);
        $file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);