]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Add a autoclose parameters. When we use sharing method in plugins like the tiny tiny...
authorbanux <banux@helheim.net>
Sun, 27 Oct 2013 06:37:05 +0000 (07:37 +0100)
committerbanux <banux@helheim.net>
Sun, 27 Oct 2013 06:37:05 +0000 (07:37 +0100)
inc/poche/Poche.class.php
themes/default/_head.twig
themes/default/js/autoClose.js [new file with mode: 0644]

index 39d43761f44cdaf0b5d2b9e18c8819148d5dc50e..5d807268e3a48f36b386537dca8fc0640d1531b3 100644 (file)
@@ -327,7 +327,7 @@ class Poche
     /**
      * 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)
         {
@@ -358,7 +358,11 @@ class Poche
                 }
 
                 if (!$import) {
-                    Tools::redirect('?view=home');
+                    if ($autoclose == TRUE) {
+                      Tools::redirect('?view=home');
+                    } else {
+                      Tools::redirect('?view=home&autoclose=true');
+                    }
                 }
                 break;
             case 'delete':
index d0cbd320be6688ef509893eace178bbc15486ab5..577cc693ca348eb07398d01c89ca29662c3e67eb 100644 (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/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/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 (file)
index 0000000..3035d42
--- /dev/null
@@ -0,0 +1,6 @@
+$(document).ready(function() {
+       current_url = window.location.href
+       if (current_url.match("&autoclose=true")) {
+               window.close();
+       }
+});
\ No newline at end of file