diff options
author | banux <banux@helheim.net> | 2013-10-27 07:37:05 +0100 |
---|---|---|
committer | banux <banux@helheim.net> | 2013-10-27 07:37:05 +0100 |
commit | 363bc4eb8642d464cc0c099f7ab72a425b56b463 (patch) | |
tree | a749a4b5da749826752aaeb2ab8ee1c6c683427d | |
parent | 2b191d8c37bd774bd3eecbf42a5ac9d948ee61a9 (diff) | |
download | wallabag-363bc4eb8642d464cc0c099f7ab72a425b56b463.tar.gz wallabag-363bc4eb8642d464cc0c099f7ab72a425b56b463.tar.zst wallabag-363bc4eb8642d464cc0c099f7ab72a425b56b463.zip |
Add a autoclose parameters. When we use sharing method in plugins like the tiny tiny rss one or the firefox plugins we can passe the autoclose=true parameters that close the popup.
-rw-r--r-- | inc/poche/Poche.class.php | 8 | ||||
-rw-r--r-- | themes/default/_head.twig | 1 | ||||
-rw-r--r-- | themes/default/js/autoClose.js | 6 |
3 files changed, 13 insertions, 2 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 39d43761..5d807268 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -327,7 +327,7 @@ class Poche | |||
327 | /** | 327 | /** |
328 | * Call action (mark as fav, archive, delete, etc.) | 328 | * Call action (mark as fav, archive, delete, etc.) |
329 | */ | 329 | */ |
330 | public function action($action, Url $url, $id = 0, $import = FALSE) | 330 | public function action($action, Url $url, $id = 0, $import = FALSE, $autoclose = FALSE) |
331 | { | 331 | { |
332 | switch ($action) | 332 | switch ($action) |
333 | { | 333 | { |
@@ -358,7 +358,11 @@ class Poche | |||
358 | } | 358 | } |
359 | 359 | ||
360 | if (!$import) { | 360 | if (!$import) { |
361 | Tools::redirect('?view=home'); | 361 | if ($autoclose == TRUE) { |
362 | Tools::redirect('?view=home'); | ||
363 | } else { | ||
364 | Tools::redirect('?view=home&autoclose=true'); | ||
365 | } | ||
362 | } | 366 | } |
363 | break; | 367 | break; |
364 | case 'delete': | 368 | case 'delete': |
diff --git a/themes/default/_head.twig b/themes/default/_head.twig index d0cbd320..577cc693 100644 --- a/themes/default/_head.twig +++ b/themes/default/_head.twig | |||
@@ -8,3 +8,4 @@ | |||
8 | <link rel="stylesheet" href="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/css/messages.css" media="all"> | 8 | <link rel="stylesheet" href="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/css/messages.css" media="all"> |
9 | <link rel="stylesheet" href="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/css/print.css" media="print"> | 9 | <link rel="stylesheet" href="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/css/print.css" media="print"> |
10 | <script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/jquery-2.0.3.min.js"></script> | 10 | <script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/jquery-2.0.3.min.js"></script> |
11 | <script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/autoClose.js"></script> \ No newline at end of file | ||
diff --git a/themes/default/js/autoClose.js b/themes/default/js/autoClose.js new file mode 100644 index 00000000..3035d423 --- /dev/null +++ b/themes/default/js/autoClose.js | |||
@@ -0,0 +1,6 @@ | |||
1 | $(document).ready(function() { | ||
2 | current_url = window.location.href | ||
3 | if (current_url.match("&autoclose=true")) { | ||
4 | window.close(); | ||
5 | } | ||
6 | }); \ No newline at end of file | ||