1
0
mirror of https://github.com/moparisthebest/wallabag synced 2024-11-23 17:42:15 -05:00

Merge pull request #291 from banux/dev

Autoclose
This commit is contained in:
Nicolas Lœuillet 2013-10-28 00:38:05 -07:00
commit 05824223a9
3 changed files with 13 additions and 2 deletions

View File

@ -327,7 +327,7 @@ class Poche
/** /**
* Call action (mark as fav, archive, delete, etc.) * Call action (mark as fav, archive, delete, etc.)
*/ */
public function action($action, Url $url, $id = 0, $import = FALSE) public function action($action, Url $url, $id = 0, $import = FALSE, $autoclose = FALSE)
{ {
switch ($action) switch ($action)
{ {
@ -358,7 +358,11 @@ class Poche
} }
if (!$import) { if (!$import) {
Tools::redirect('?view=home'); if ($autoclose == TRUE) {
Tools::redirect('?view=home');
} else {
Tools::redirect('?view=home&closewin=true');
}
} }
break; break;
case 'delete': case 'delete':

View File

@ -8,3 +8,4 @@
<link rel="stylesheet" href="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/css/messages.css" media="all"> <link rel="stylesheet" href="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/css/messages.css" media="all">
<link rel="stylesheet" href="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/css/print.css" media="print"> <link rel="stylesheet" href="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/css/print.css" media="print">
<script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/jquery-2.0.3.min.js"></script> <script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/jquery-2.0.3.min.js"></script>
<script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/autoClose.js"></script>

View File

@ -0,0 +1,6 @@
$(document).ready(function() {
current_url = window.location.href
if (current_url.match("&closewin=true")) {
window.close();
}
});