]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
changes to add url directly from poche
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Tue, 10 Sep 2013 12:41:58 +0000 (14:41 +0200)
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Tue, 10 Sep 2013 12:41:58 +0000 (14:41 +0200)
inc/poche/Poche.class.php
index.php
tpl/_menu.twig
tpl/config.twig
tpl/css/style.css
tpl/layout.twig

index 4fe938fba9ffd409af948a79cf9eca5141d7b9b8..5030c9aac7f943f9492ab6391c721bae0383b962 100644 (file)
@@ -182,7 +182,7 @@ class Poche
                 }
 
                 if (!$import) {
-                    Tools::redirect();
+                    Tools::redirect('?view=home');
                 }
                 break;
             case 'delete':
@@ -558,9 +558,4 @@ class Poche
         }
         return $version;
     }
-
-    function convertURLToBase64($plainurl){
-        $convertedURL = base64_encode($plainurl);
-        $this->action('add', new Url($convertedURL));
-   }
 }
\ No newline at end of file
index e81a92474179ecfe9a681f94f894dee62ea84323..7b775c41609868000250babef09c7e1cd77006ca 100644 (file)
--- a/index.php
+++ b/index.php
@@ -43,9 +43,10 @@ elseif (isset($_GET['import'])) {
 elseif (isset($_GET['export'])) {
     $poche->export();
 }
-
-if (isset($_GET['plainurl'])){
-  $poche->convertURLToBase64($_GET['plainurl']);}
+elseif (isset($_GET['plainurl']) && !empty($_GET['plainurl'])) {
+    $plain_url = new Url(base64_encode($_GET['plainurl']));
+    $poche->action('add', $plain_url);
+}
 
 # vars to send to templates
 $tpl_vars = array(
index b39ce35feddf6968e29b5e242d4ad9004fcfb664..523d63cc6e29e9457d058157650bd385e77c60eb 100644 (file)
@@ -3,13 +3,5 @@
                 <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li>
                 <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li>
                 <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li>
-               <li><a id="addurlbutton" onclick="showinput();" href="#" title="{% trans "addlink" %}">{% trans "addlink" %}</a></li>
-                   <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
-               </ul>
-               <div id="inputform">
-                       <form method="get" action="index.php">
-                               <label class="addurl" for="plainurl">Entrez ici votre URL</label><br />
-                               <input autofocus required placeholder="Ex:monsite.net/article" class="addurl" id="plainurl" name="plainurl" type="url" />
-                               <input type="submit" value="Envoyer" />
-                       </form>
-               </div>
\ No newline at end of file
+                <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
+                 </ul>
\ No newline at end of file
index c838c319bcb4e58b2d4bddaedd223b0054161f8f..e24e58d4150bda665faadceff521712c5a3060a6 100644 (file)
@@ -2,13 +2,7 @@
 
 {% block title %}{% trans "config" %}{% endblock %}
 {% block menu %}
-            <ul id="links">
-                <li><a href="./" {% if view == 'home' %}class="current"{% endif %}>{% trans "home" %}</a></li>
-                <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li>
-                <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li>
-                <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li>
-                <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
-            </ul>
+{% include '_menu.twig' %}
 {% endblock %}
 {% block content %}
             <h2>{% trans "Poching a link" %}</h2>
                 <li>firefox: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.xpi" title="download the firefox extension">download the extension</a></li>
                 <li>chrome: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.crx" title="download the chrome extension">download the extension</a></li>
                 <li>android: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/Poche.apk" title="download the application">download the application</a></li>
+                <li>
+                    <form method="get" action="index.php">
+                        <label class="addurl" for="plainurl">{% trans "by filling this field" %}:</label>
+                        <input autofocus required placeholder="Ex:mywebsite.com/article" class="addurl" id="plainurl" name="plainurl" type="url" />
+                        <input type="submit" value="{% trans "poche it!" %}" />
+                    </form>
+                </li>
                 <li>bookmarklet: drag & drop this link to your bookmarks bar <a id="bookmarklet" ondragend="this.click();" title="i am a bookmarklet, use me !" href="javascript:if(top['bookmarklet-url@inthepoche.com']){top['bookmarklet-url@inthepoche.com'];}else{(function(){var%20url%20=%20location.href%20||%20url;window.open('{{ poche_url }}?action=add&url='%20+%20btoa(url),'_self');})();void(0);}">{% trans "poche it!" %}</a></li>
             </ul>
 
index 7d2c143fcea2a37033f9ec41716d9b2bc59a1a9c..d644814d195a4002cdd015eaf09b1459cc200443 100644 (file)
@@ -258,13 +258,14 @@ footer {
     font-size: 0.8em;
 }
 
-#inputform{
+#inputform {
     display: none;
     text-align:center;
     max-width:300px;
     margin-left:auto;
     margin-right:auto;
     margin-top:5px;
+    padding-bottom: 5px;
     background-color: rgba(0, 0, 0, 0.9);
     opacity:0.8;
     color:white;
index b2484019f35a0524dc304e94e7a2488d7ff103a3..07ca231c004135b8ef3012cc9dd883e6515ad9c3 100644 (file)
@@ -12,7 +12,6 @@
         <![endif]-->
         <title>{% block title %}{% endblock %} - poche</title>
 {% include '_head.twig' %}
-<script src="./tpl/js/poche.js"></script>
 {% include '_bookmarklet.twig' %}
     </head>
     <body>