aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2015-02-04 23:37:37 +0100
committerThomas Citharel <tcit@tcit.fr>2015-02-04 23:37:37 +0100
commit1c91178932cd5b48d793261c6631697186853a93 (patch)
tree6bf890e40e92e100dcd5f86540d8d5934b7f4b4a
parent3fb0d44a67e9a88ad5669a4bf554069ad19877b0 (diff)
downloadwallabag-1c91178932cd5b48d793261c6631697186853a93.tar.gz
wallabag-1c91178932cd5b48d793261c6631697186853a93.tar.zst
wallabag-1c91178932cd5b48d793261c6631697186853a93.zip
fix autoclose (#984) and bookmarklet mode
-rwxr-xr-xinc/poche/Poche.class.php4
-rwxr-xr-xinc/poche/Routing.class.php3
-rwxr-xr-xthemes/baggy/config.twig2
-rwxr-xr-xthemes/default/config.twig2
4 files changed, 6 insertions, 5 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index f9928145..a601f0a8 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -195,9 +195,9 @@ class Poche
195 } 195 }
196 196
197 if ($autoclose == TRUE) { 197 if ($autoclose == TRUE) {
198 Tools::redirect('?view=home'); 198 Tools::redirect('?view=home&closewin=true');
199 } else { 199 } else {
200 Tools::redirect('?view=home&closewin=true'); 200 Tools::redirect('?view=home');
201 } 201 }
202 return $last_id; 202 return $last_id;
203 break; 203 break;
diff --git a/inc/poche/Routing.class.php b/inc/poche/Routing.class.php
index a8d00b89..709831d5 100755
--- a/inc/poche/Routing.class.php
+++ b/inc/poche/Routing.class.php
@@ -33,6 +33,7 @@ class Routing
33 $this->view = Tools::checkVar('view', 'home'); 33 $this->view = Tools::checkVar('view', 'home');
34 $this->action = Tools::checkVar('action'); 34 $this->action = Tools::checkVar('action');
35 $this->id = Tools::checkVar('id'); 35 $this->id = Tools::checkVar('id');
36 $this->autoclose = Tools::checkVar('autoclose',FALSE);
36 $_SESSION['sort'] = Tools::checkVar('sort', 'id'); 37 $_SESSION['sort'] = Tools::checkVar('sort', 'id');
37 $this->url = new Url((isset ($_GET['url'])) ? $_GET['url'] : ''); 38 $this->url = new Url((isset ($_GET['url'])) ? $_GET['url'] : '');
38 } 39 }
@@ -64,7 +65,7 @@ class Routing
64 $tplVars = array(); 65 $tplVars = array();
65 66
66 if (\Session::isLogged()) { 67 if (\Session::isLogged()) {
67 $this->wallabag->action($this->action, $this->url, $this->id); 68 $this->wallabag->action($this->action, $this->url, $this->id, FALSE, $this->autoclose);
68 $tplFile = Tools::getTplFile($this->view); 69 $tplFile = Tools::getTplFile($this->view);
69 $tplVars = array_merge($this->vars, $this->wallabag->displayView($this->view, $this->id)); 70 $tplVars = array_merge($this->vars, $this->wallabag->displayView($this->view, $this->id));
70 } elseif(isset($_SERVER['PHP_AUTH_USER'])) { 71 } elseif(isset($_SERVER['PHP_AUTH_USER'])) {
diff --git a/themes/baggy/config.twig b/themes/baggy/config.twig
index a5a61559..95e09734 100755
--- a/themes/baggy/config.twig
+++ b/themes/baggy/config.twig
@@ -27,7 +27,7 @@
27 </ul> 27 </ul>
28 <h3>{% trans "Bookmarklet" %}</h3> 28 <h3>{% trans "Bookmarklet" %}</h3>
29 <p> 29 <p>
30 {% trans "Drag &amp; drop this link to your bookmarks bar:" %} <a id="bookmarklet" ondragend="this.click();" href="javascript:if(top['bookmarklet-url@wallabag.org']){top['bookmarklet-url@wallabag.org'];}else{(function(){var%20url%20=%20location.href%20||%20url;window.open('{{ poche_url }}?action=add&url='%20+%20btoa(url),'_self');})();void(0);}">{% trans "bag it!" %}</a> 30 {% trans "Drag &amp; drop this link to your bookmarks bar:" %} <a id="bookmarklet" ondragend="this.click();" href="javascript:if(top['bookmarklet-url@wallabag.org']){top['bookmarklet-url@wallabag.org'];}else{(function(){var%20url%20=%20location.href%20||%20url;window.open('{{ poche_url }}?action=add&autoclose=true&url='%20+%20btoa(url),'_blank');})();void(0);}">{% trans "bag it!" %}</a>
31 </p> 31 </p>
32 32
33 <h2>{% trans "Feeds" %}</h2> 33 <h2>{% trans "Feeds" %}</h2>
diff --git a/themes/default/config.twig b/themes/default/config.twig
index bac563cf..87f964c9 100755
--- a/themes/default/config.twig
+++ b/themes/default/config.twig
@@ -27,7 +27,7 @@
27 </ul> 27 </ul>
28 <h3>{% trans "Bookmarklet" %}</h3> 28 <h3>{% trans "Bookmarklet" %}</h3>
29 <p> 29 <p>
30 {% trans "Drag &amp; drop this link to your bookmarks bar:" %} <a id="bookmarklet" ondragend="this.click();" href="javascript:if(top['bookmarklet-url@wallabag.org']){top['bookmarklet-url@wallabag.org'];}else{(function(){var%20url%20=%20location.href%20||%20url;window.open('{{ poche_url }}?action=add&url='%20+%20btoa(url),'_self');})();void(0);}">{% trans "bag it!" %}</a> 30 {% trans "Drag &amp; drop this link to your bookmarks bar:" %} <a id="bookmarklet" ondragend="this.click();" href="javascript:if(top['bookmarklet-url@wallabag.org']){top['bookmarklet-url@wallabag.org'];}else{(function(){var%20url%20=%20location.href%20||%20url;window.open('{{ poche_url }}?action=add&autoclose=true&url='%20+%20btoa(url),'_blank');})();void(0);}">{% trans "bag it!" %}</a>
31 </p> 31 </p>
32 32
33 <h2>{% trans "Feeds" %}</h2> 33 <h2>{% trans "Feeds" %}</h2>