Reenable bookmarking code.
Just disable it for webkit based browsers, because they do not allow to update any part of location without reload. bug#2937481
This commit is contained in:
@@ -131,12 +131,6 @@ header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
|
|||||||
var pma_text_default_tab = '<?php echo PMA_escapeJsString(PMA_getTitleForTarget($GLOBALS['cfg']['DefaultTabTable'])); ?>';
|
var pma_text_default_tab = '<?php echo PMA_escapeJsString(PMA_getTitleForTarget($GLOBALS['cfg']['DefaultTabTable'])); ?>';
|
||||||
var pma_text_left_default_tab = '<?php echo PMA_escapeJsString(PMA_getTitleForTarget($GLOBALS['cfg']['LeftDefaultTabTable'])); ?>';
|
var pma_text_left_default_tab = '<?php echo PMA_escapeJsString(PMA_getTitleForTarget($GLOBALS['cfg']['LeftDefaultTabTable'])); ?>';
|
||||||
|
|
||||||
// Restore location from hash for bookmarks
|
|
||||||
|
|
||||||
if (parent.location.hash != '') {
|
|
||||||
parent.location = 'index.php?' + parent.location.hash.substring(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// for content and navigation frames
|
// for content and navigation frames
|
||||||
|
|
||||||
var frame_content = 0;
|
var frame_content = 0;
|
||||||
@@ -165,6 +159,8 @@ header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
|
|||||||
};
|
};
|
||||||
// ]]>
|
// ]]>
|
||||||
</script>
|
</script>
|
||||||
|
<script src="./js/mootools.js" type="text/javascript"></script>
|
||||||
|
<script src="./js/helper.js" type="text/javascript"></script>
|
||||||
<script src="./js/common.js" type="text/javascript"></script>
|
<script src="./js/common.js" type="text/javascript"></script>
|
||||||
</head>
|
</head>
|
||||||
<frameset cols="<?php
|
<frameset cols="<?php
|
||||||
|
56
js/helper.js
Normal file
56
js/helper.js
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||||
|
/**
|
||||||
|
* Various helper scripts, using mootools.
|
||||||
|
*
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
var hash_to_set = "";
|
||||||
|
var hash_init_done = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets hash part in URL, either calls itself in parent frame or does the
|
||||||
|
* work itself. The hash is not set directly if we did not yet process old
|
||||||
|
* one.
|
||||||
|
*/
|
||||||
|
function setURLHash(hash) {
|
||||||
|
if (Browser.Engine.webkit) {
|
||||||
|
/*
|
||||||
|
* Setting hash leads to reload in webkit:
|
||||||
|
* http://www.quirksmode.org/bugreports/archives/2005/05/Safari_13_visual_anomaly_with_windowlocationhref.html
|
||||||
|
*/
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (window.parent != window && window.parent.setURLHash) {
|
||||||
|
window.parent.setURLHash(hash);
|
||||||
|
} else {
|
||||||
|
if (hash_init_done) {
|
||||||
|
window.location.hash = "PMAURL:" + hash;
|
||||||
|
} else {
|
||||||
|
hash_to_set = "PMAURL:" + hash;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handler for changing url according to the hash part, which is updated
|
||||||
|
* on each page to allow bookmarks.
|
||||||
|
*/
|
||||||
|
window.addEvent('load', function() {
|
||||||
|
/* Don't do anything if we're not root Window */
|
||||||
|
if (window.parent != window && window.parent.setURLHash) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/* Check if hash contains parameters */
|
||||||
|
if (window.location.hash.substring(0, 8) == '#PMAURL:') {
|
||||||
|
window.location = 'index.php?' + window.location.hash.substring(8);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/* Check if we should set URL */
|
||||||
|
if (hash_to_set != "") {
|
||||||
|
window.location.hash = hash_to_set;
|
||||||
|
hash_to_set = "";
|
||||||
|
}
|
||||||
|
/* Indicate that we're done (and we are not going to change location */
|
||||||
|
hash_init_done = 1;
|
||||||
|
})
|
@@ -34,7 +34,7 @@ if (function_exists('mcrypt_encrypt')) {
|
|||||||
if (empty($_COOKIE['pma_mcrypt_iv'])
|
if (empty($_COOKIE['pma_mcrypt_iv'])
|
||||||
|| false === ($iv = base64_decode($_COOKIE['pma_mcrypt_iv'], true))) {
|
|| false === ($iv = base64_decode($_COOKIE['pma_mcrypt_iv'], true))) {
|
||||||
srand((double) microtime() * 1000000);
|
srand((double) microtime() * 1000000);
|
||||||
$td = mcrypt_module_open(MCRYPT_BLOWFISH, '', MCRYPT_MODE_CBC, '');
|
$td = mcrypt_module_open(MCRYPT_BLOWFISH, '', MCRYPT_MODE_CBC, '');
|
||||||
if ($td === false) {
|
if ($td === false) {
|
||||||
trigger_error(PMA_sanitize(sprintf($strCantLoad, 'mcrypt')), E_USER_WARNING);
|
trigger_error(PMA_sanitize(sprintf($strCantLoad, 'mcrypt')), E_USER_WARNING);
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ if (function_exists('mcrypt_encrypt')) {
|
|||||||
function PMA_get_blowfish_secret() {
|
function PMA_get_blowfish_secret() {
|
||||||
if (empty($GLOBALS['cfg']['blowfish_secret'])) {
|
if (empty($GLOBALS['cfg']['blowfish_secret'])) {
|
||||||
if (empty($_SESSION['auto_blowfish_secret'])) {
|
if (empty($_SESSION['auto_blowfish_secret'])) {
|
||||||
// this returns 23 characters
|
// this returns 23 characters
|
||||||
$_SESSION['auto_blowfish_secret'] = uniqid('', true);
|
$_SESSION['auto_blowfish_secret'] = uniqid('', true);
|
||||||
}
|
}
|
||||||
return $_SESSION['auto_blowfish_secret'];
|
return $_SESSION['auto_blowfish_secret'];
|
||||||
@@ -186,17 +186,14 @@ function PMA_auth()
|
|||||||
$page_title = 'phpMyAdmin ';
|
$page_title = 'phpMyAdmin ';
|
||||||
require './libraries/header_meta_style.inc.php';
|
require './libraries/header_meta_style.inc.php';
|
||||||
?>
|
?>
|
||||||
|
<script src="./js/mootools.js" type="text/javascript"></script>
|
||||||
|
<script src="./js/helper.js" type="text/javascript"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
// show login form in top frame
|
// show login form in top frame
|
||||||
if (top != self) {
|
if (top != self) {
|
||||||
window.top.location.href=location;
|
window.top.location.href=location;
|
||||||
}
|
}
|
||||||
// Restore location from hash for bookmarks
|
|
||||||
|
|
||||||
if (parent.location.hash != '') {
|
|
||||||
parent.location = 'index.php?' + parent.location.hash.substring(1);
|
|
||||||
}
|
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
@@ -546,6 +546,7 @@ $_REQUEST['js_frame'] = PMA_ifSetOr($_REQUEST['js_frame'], '');
|
|||||||
*/
|
*/
|
||||||
$GLOBALS['js_include'] = array();
|
$GLOBALS['js_include'] = array();
|
||||||
$GLOBALS['js_include'][] = 'mootools.js';
|
$GLOBALS['js_include'][] = 'mootools.js';
|
||||||
|
$GLOBALS['js_include'][] = 'helper.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* holds locale messages required by JavaScript function
|
* holds locale messages required by JavaScript function
|
||||||
|
@@ -154,6 +154,7 @@ if (window.parent.frame_content) {
|
|||||||
//window.parent.frame_content.setAttribute('name', 'frame_content');
|
//window.parent.frame_content.setAttribute('name', 'frame_content');
|
||||||
//window.parent.frame_content.setAttribute('id', 'frame_content');
|
//window.parent.frame_content.setAttribute('id', 'frame_content');
|
||||||
}
|
}
|
||||||
|
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
@@ -166,10 +167,16 @@ if (!isset($GLOBALS['checked_special'])) {
|
|||||||
if (PMA_getenv('SCRIPT_NAME') && empty($_POST) && !$GLOBALS['checked_special']) {
|
if (PMA_getenv('SCRIPT_NAME') && empty($_POST) && !$GLOBALS['checked_special']) {
|
||||||
echo '<div id="selflink" class="print_ignore">' . "\n";
|
echo '<div id="selflink" class="print_ignore">' . "\n";
|
||||||
$url_params['target'] = basename(PMA_getenv('SCRIPT_NAME'));
|
$url_params['target'] = basename(PMA_getenv('SCRIPT_NAME'));
|
||||||
/* Store current location in hash part of URL to allow direct bookmarking */
|
?>
|
||||||
// Disabled for now, causes infinite loop with some Chrome based browsers
|
<script type="text/javascript">
|
||||||
// Should be converted to use mootools and onload event
|
//<![CDATA[
|
||||||
//echo '<script>parent.location.hash = "' . PMA_generate_common_url($url_params, 'text', '') . '";</script>';
|
|
||||||
|
/* Store current location in hash part of URL to allow direct bookmarking */
|
||||||
|
setURLHash("<?php echo PMA_generate_common_url($url_params, 'text', ''); ?>");
|
||||||
|
|
||||||
|
//]]>
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
|
||||||
echo '<a href="index.php' . PMA_generate_common_url($url_params) . '"'
|
echo '<a href="index.php' . PMA_generate_common_url($url_params) . '"'
|
||||||
. ' title="' . $GLOBALS['strOpenNewWindow'] . '" target="_blank">';
|
. ' title="' . $GLOBALS['strOpenNewWindow'] . '" target="_blank">';
|
||||||
|
Reference in New Issue
Block a user