]> git.joonet.de Git - adminer.git/commitdiff
Utilize location.protocol
authorJakub Vrana <jakub@vrana.cz>
Tue, 15 Feb 2011 17:11:24 +0000 (18:11 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 15 Feb 2011 17:11:43 +0000 (18:11 +0100)
adminer/include/design.inc.php
adminer/static/editing.js
adminer/static/functions.js
compile.php
editor/static/editing.js

index efdc7a9de4c096b8855b241e1f746e59fe2037f2..e921c0bd692629f09e57f454e6d4734ba4a17478 100644 (file)
@@ -7,7 +7,7 @@
 * @return null
 */
 function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
-       global $LANG, $HTTPS, $adminer, $connection, $drivers;
+       global $LANG, $adminer, $connection, $drivers;
        header("Content-Type: text/html; charset=utf-8");
        $adminer->headers();
        $title_all = $title . ($title2 != "" ? ": " . h($title2) : "");
@@ -15,7 +15,6 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
        if (is_ajax()) {
                header("X-AJAX-Title: " . rawurlencode($title_page));
        } else {
-               $protocol = ($HTTPS ? "https" : "http");
                ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <html lang="<?php echo $LANG; ?>" dir="<?php echo lang('ltr'); ?>">
@@ -29,7 +28,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
 <link rel="stylesheet" type="text/css" href="adminer.css">
 <?php } ?>
 
-<body class="<?php echo lang('ltr'); ?>" onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>', '<?php echo js_escape($_GET["ns"]); ?>');" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>', '<?php echo $protocol; ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
+<body class="<?php echo lang('ltr'); ?>" onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>', '<?php echo js_escape($_GET["ns"]); ?>');" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
 <script type="text/javascript" src="../adminer/static/functions.js"></script>
 <script type="text/javascript" src="static/editing.js"></script>
 
index a676abf7b5f483a1298709927282fc8f827d01e5..fcd9d9fde7270641f5562d6af86e3ba81dd9009e 100644 (file)
@@ -2,9 +2,8 @@
 
 /** Load syntax highlighting
 * @param string first three characters of database system version
-* @param string 'http' or 'https' - used after compilation
 */
-function bodyLoad(version, protocol) {
+function bodyLoad(version) {
        var jushRoot = '../externals/jush/';
        var script = document.createElement('script');
        script.src = jushRoot + 'jush.js';
index b494155a4bf8686a23ab6c9db168179571459ce6..680c16bdbfd8ad581c2197c6929c71f197b2e809 100644 (file)
@@ -23,12 +23,11 @@ function cookie(assign, days) {
 }
 
 /** Verify current Adminer version
-* @param string 'http' or 'https'
 */
-function verifyVersion(protocol) {
+function verifyVersion() {
        cookie('adminer_version=0', 1);
        var script = document.createElement('script');
-       script.src = protocol + '://www.adminer.org/version.php';
+       script.src = location.protocol + '//www.adminer.org/version.php';
        document.body.appendChild(script);
 }
 
index 39356558f4ef837b0a11023c07ecb804fb8a4179..f1dbbc57f74c89ca23dd77495b5b3287418d4cae 100644 (file)
@@ -265,7 +265,7 @@ foreach (array("adminer", "editor") as $project) {
        $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/([^\'"]*)~', '" . ' . $replace, $file);
-       $file = str_replace("'../externals/jush/'", "protocol + '://www.adminer.org/static/'", $file);
+       $file = str_replace("'../externals/jush/'", "location.protocol + '//www.adminer.org/static/'", $file);
        $file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
        $file = php_shrink($file);
 
index b49666b29d5c94c5ff394b940865f19360e07678..70998ba64391eebf68018f5b00040d9ea0331daa 100644 (file)
@@ -1,4 +1,4 @@
 // Editor specific functions
 
-function bodyLoad(version, protocol) {
+function bodyLoad(version) {
 }