fix autoclose (#984) and bookmarklet mode

This commit is contained in:
Thomas Citharel 2015-02-04 23:37:37 +01:00
parent 3fb0d44a67
commit 1c91178932
4 changed files with 6 additions and 5 deletions

View file

@ -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;

View file

@ -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'])) {

View file

@ -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>

View file

@ -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>