Fixed bookmarklet problem related to Mozilla's bug 232605
parent
22d8669fa3
commit
ebbed3e47c
|
|
@ -1,44 +0,0 @@
|
|||
<?php
|
||||
if(!defined('entry'))define('entry', true);
|
||||
require('../entry.php');
|
||||
global $conf;
|
||||
session_start();
|
||||
|
||||
function isAjax() {
|
||||
return isset($_SERVER['HTTP_X_REQUESTED_WITH']) &&
|
||||
$_SERVER ['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest';
|
||||
}
|
||||
|
||||
function saveForm() {
|
||||
$type = getMethod();
|
||||
$id = ($type=='GET') ? $_GET['autosaveid'] : $_POST['autosaveid'];
|
||||
$_SESSION[$id] = $_SERVER['QUERY_STRING'];
|
||||
echo gmdate('H:i | d/m/y',time()+transform_offset($conf->offsetTime));
|
||||
}
|
||||
|
||||
function loadForm() {
|
||||
$type = getMethod();
|
||||
$id = ($type=='GET') ? $_GET['autosaveid'] : $_POST['autosaveid'];
|
||||
if(isset($_SESSION[$id]))
|
||||
echo $_SESSION[$id];
|
||||
}
|
||||
|
||||
function isLoad() {
|
||||
$type = getMethod();
|
||||
if($type=='GET' and isset($_GET['autosave'])) return true;
|
||||
elseif(isset($_POST['autosave'])) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function getMethod() {
|
||||
return $_SERVER['REQUEST_METHOD'];
|
||||
}
|
||||
|
||||
if(isAjax()) {
|
||||
if(isLoad()) loadForm();
|
||||
else saveForm();
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
|
|
@ -299,7 +299,7 @@ if ($user->isAdmin()) {
|
|||
<span style="color: rgb(136, 136, 136); margin-bottom: 10px; font-size: 10px;">
|
||||
<a href="http://hobix.com/textile/">Textile</a> <?php echo __("syntax is supported.")?>
|
||||
<br />
|
||||
Bookmarklet - <a href="javascript:g=window.getSelection();win=window.open('<?php echo $conf->urlGelato;?>/admin/bm.php?url='+encodeURIComponent(location.href)+'&sel='+encodeURIComponent(g),'w','toolbar=0,resizable=0,status=1,width=650,height=430'); void(win.document.close ())"><?php echo __("add to gelato")?></a>
|
||||
Bookmarklet - <a href="javascript:var w; setTimeout('w.focus()',100);w=window.open(' http://www.pecesama.net/quotes/admin/bm.php?url='+encodeURIComponent(location.href)+'&sel='+encodeURIComponent(window.getSelection()),'bookmarklet','toolbar=0,resizable=0,status=1,width=650,height=460,dependent=yes' ); w.focus();"><?php echo __("add to gelato")?></a>
|
||||
</span>
|
||||
</p>
|
||||
<p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue