]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
fix autoclose (#984) and bookmarklet mode
authorThomas Citharel <tcit@tcit.fr>
Wed, 4 Feb 2015 22:37:37 +0000 (23:37 +0100)
committerThomas Citharel <tcit@tcit.fr>
Wed, 4 Feb 2015 22:37:37 +0000 (23:37 +0100)
inc/poche/Poche.class.php
inc/poche/Routing.class.php
themes/baggy/config.twig
themes/default/config.twig

index f992814583ba7f7fb56f9805c1219b59910177c6..a601f0a86ab078d182d7c29f75896b39f2c62395 100755 (executable)
@@ -195,9 +195,9 @@ class Poche
                 }
 
                 if ($autoclose == TRUE) {
-                  Tools::redirect('?view=home');
+                    Tools::redirect('?view=home&closewin=true');
                 } else {
-                  Tools::redirect('?view=home&closewin=true');
+                    Tools::redirect('?view=home');
                 }
                 return $last_id;
                 break;
index a8d00b89806435ada989e973cbeefb736fbf4804..709831d501c405de05619773399499ef8e6da3e9 100755 (executable)
@@ -33,6 +33,7 @@ class Routing
         $this->view         = Tools::checkVar('view', 'home');
         $this->action       = Tools::checkVar('action');
         $this->id           = Tools::checkVar('id');
+        $this->autoclose    = Tools::checkVar('autoclose',FALSE);
         $_SESSION['sort']   = Tools::checkVar('sort', 'id');
         $this->url          = new Url((isset ($_GET['url'])) ? $_GET['url'] : '');
     }
@@ -64,7 +65,7 @@ class Routing
         $tplVars = array();
 
         if (\Session::isLogged()) {
-            $this->wallabag->action($this->action, $this->url, $this->id);
+            $this->wallabag->action($this->action, $this->url, $this->id, FALSE, $this->autoclose);
             $tplFile = Tools::getTplFile($this->view);
             $tplVars = array_merge($this->vars, $this->wallabag->displayView($this->view, $this->id));
         } elseif(isset($_SERVER['PHP_AUTH_USER'])) {
index a5a615597ec3cefb0dfd4e1c7822748eaa41e704..95e0973484e2ba7dc5f46d63508914abcc09fdd6 100755 (executable)
@@ -27,7 +27,7 @@
             </ul>
                 <h3>{% trans "Bookmarklet" %}</h3>
                 <p>
-                {% 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>
+                {% 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>
                 </p>
 
             <h2>{% trans "Feeds" %}</h2>
index bac563cf2d31a1fbe64667f2324d9f871411c7f3..87f964c9597c1a3817755d1c6a4875de5e900bea 100755 (executable)
@@ -27,7 +27,7 @@
             </ul>
                 <h3>{% trans "Bookmarklet" %}</h3>
                 <p>
-                {% 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>
+                {% 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>
                 </p>
 
             <h2>{% trans "Feeds" %}</h2>