Bladeren bron

Fixed bookmarklet problem related to Mozilla's bug 232605

pecesama 16 jaren geleden
bovenliggende
commit
ebbed3e47c
2 gewijzigde bestanden met toevoegingen van 1 en 45 verwijderingen
  1. 0 44
      admin/form.autosave.php
  2. 1 1
      admin/index.php

+ 0 - 44
admin/form.autosave.php Bestand weergeven

@@ -1,44 +0,0 @@
1
-<?php
2
-if(!defined('entry'))define('entry', true);
3
-require('../entry.php');
4
-global $conf;
5
-session_start();
6
-
7
-function isAjax() { 
8
-	return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && 
9
-	$_SERVER ['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'; 
10
-}
11
-
12
-function saveForm() {
13
-	$type = getMethod();
14
-	$id = ($type=='GET') ? $_GET['autosaveid'] : $_POST['autosaveid'];
15
-	$_SESSION[$id] = $_SERVER['QUERY_STRING'];
16
-	echo gmdate('H:i | d/m/y',time()+transform_offset($conf->offsetTime));
17
-}
18
-
19
-function loadForm() {
20
-	$type = getMethod();
21
-	$id = ($type=='GET') ? $_GET['autosaveid'] : $_POST['autosaveid'];
22
-	if(isset($_SESSION[$id]))
23
-		echo $_SESSION[$id];
24
-}
25
-
26
-function isLoad() {
27
-	$type = getMethod();
28
-	if($type=='GET' and isset($_GET['autosave'])) return true;
29
-	elseif(isset($_POST['autosave'])) return true;
30
-	return false;
31
-}
32
-
33
-function getMethod() {
34
-	return $_SERVER['REQUEST_METHOD'];
35
-}
36
-
37
-if(isAjax()) {
38
-	if(isLoad()) loadForm();
39
-	else saveForm();
40
-}
41
-
42
-exit;
43
-
44
-?>

+ 1 - 1
admin/index.php Bestand weergeven

@@ -299,7 +299,7 @@ if ($user->isAdmin()) {
299 299
 									<span style="color: rgb(136, 136, 136); margin-bottom: 10px; font-size: 10px;">
300 300
                                     	<a href="http://hobix.com/textile/">Textile</a> <?php echo __("syntax is supported.")?>
301 301
                                         <br />
302
-                                        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>
302
+                                        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>
303 303
                                     </span>
304 304
 								</p>
305 305
 								<p>