aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-09-10 14:41:58 +0200
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-09-10 14:41:58 +0200
commitce4a1dcc193d3124fc51c4942137621d3d806a19 (patch)
tree437baacae734dd62426329fa4fa830beb78c7aea
parentd5ce28df67fcddfb957ce28424f3e5751f433695 (diff)
downloadwallabag-ce4a1dcc193d3124fc51c4942137621d3d806a19.tar.gz
wallabag-ce4a1dcc193d3124fc51c4942137621d3d806a19.tar.zst
wallabag-ce4a1dcc193d3124fc51c4942137621d3d806a19.zip
changes to add url directly from poche
-rw-r--r--inc/poche/Poche.class.php7
-rw-r--r--index.php7
-rw-r--r--tpl/_menu.twig12
-rw-r--r--tpl/config.twig15
-rw-r--r--tpl/css/style.css3
-rw-r--r--tpl/layout.twig1
6 files changed, 17 insertions, 28 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 4fe938fb..5030c9aa 100644
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -182,7 +182,7 @@ class Poche
182 } 182 }
183 183
184 if (!$import) { 184 if (!$import) {
185 Tools::redirect(); 185 Tools::redirect('?view=home');
186 } 186 }
187 break; 187 break;
188 case 'delete': 188 case 'delete':
@@ -558,9 +558,4 @@ class Poche
558 } 558 }
559 return $version; 559 return $version;
560 } 560 }
561
562 function convertURLToBase64($plainurl){
563 $convertedURL = base64_encode($plainurl);
564 $this->action('add', new Url($convertedURL));
565 }
566} \ No newline at end of file 561} \ No newline at end of file
diff --git a/index.php b/index.php
index e81a9247..7b775c41 100644
--- a/index.php
+++ b/index.php
@@ -43,9 +43,10 @@ elseif (isset($_GET['import'])) {
43elseif (isset($_GET['export'])) { 43elseif (isset($_GET['export'])) {
44 $poche->export(); 44 $poche->export();
45} 45}
46 46elseif (isset($_GET['plainurl']) && !empty($_GET['plainurl'])) {
47if (isset($_GET['plainurl'])){ 47 $plain_url = new Url(base64_encode($_GET['plainurl']));
48 $poche->convertURLToBase64($_GET['plainurl']);} 48 $poche->action('add', $plain_url);
49}
49 50
50# vars to send to templates 51# vars to send to templates
51$tpl_vars = array( 52$tpl_vars = array(
diff --git a/tpl/_menu.twig b/tpl/_menu.twig
index b39ce35f..523d63cc 100644
--- a/tpl/_menu.twig
+++ b/tpl/_menu.twig
@@ -3,13 +3,5 @@
3 <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li> 3 <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li>
4 <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li> 4 <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li>
5 <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li> 5 <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li>
6 <li><a id="addurlbutton" onclick="showinput();" href="#" title="{% trans "addlink" %}">{% trans "addlink" %}</a></li> 6 <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
7 <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li> 7 </ul> \ No newline at end of file
8 </ul>
9 <div id="inputform">
10 <form method="get" action="index.php">
11 <label class="addurl" for="plainurl">Entrez ici votre URL</label><br />
12 <input autofocus required placeholder="Ex:monsite.net/article" class="addurl" id="plainurl" name="plainurl" type="url" />
13 <input type="submit" value="Envoyer" />
14 </form>
15 </div> \ No newline at end of file
diff --git a/tpl/config.twig b/tpl/config.twig
index c838c319..e24e58d4 100644
--- a/tpl/config.twig
+++ b/tpl/config.twig
@@ -2,13 +2,7 @@
2 2
3{% block title %}{% trans "config" %}{% endblock %} 3{% block title %}{% trans "config" %}{% endblock %}
4{% block menu %} 4{% block menu %}
5 <ul id="links"> 5{% include '_menu.twig' %}
6 <li><a href="./" {% if view == 'home' %}class="current"{% endif %}>{% trans "home" %}</a></li>
7 <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li>
8 <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li>
9 <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li>
10 <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
11 </ul>
12{% endblock %} 6{% endblock %}
13{% block content %} 7{% block content %}
14 <h2>{% trans "Poching a link" %}</h2> 8 <h2>{% trans "Poching a link" %}</h2>
@@ -17,6 +11,13 @@
17 <li>firefox: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.xpi" title="download the firefox extension">download the extension</a></li> 11 <li>firefox: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.xpi" title="download the firefox extension">download the extension</a></li>
18 <li>chrome: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.crx" title="download the chrome extension">download the extension</a></li> 12 <li>chrome: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.crx" title="download the chrome extension">download the extension</a></li>
19 <li>android: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/Poche.apk" title="download the application">download the application</a></li> 13 <li>android: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/Poche.apk" title="download the application">download the application</a></li>
14 <li>
15 <form method="get" action="index.php">
16 <label class="addurl" for="plainurl">{% trans "by filling this field" %}:</label>
17 <input autofocus required placeholder="Ex:mywebsite.com/article" class="addurl" id="plainurl" name="plainurl" type="url" />
18 <input type="submit" value="{% trans "poche it!" %}" />
19 </form>
20 </li>
20 <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> 21 <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>
21 </ul> 22 </ul>
22 23
diff --git a/tpl/css/style.css b/tpl/css/style.css
index 7d2c143f..d644814d 100644
--- a/tpl/css/style.css
+++ b/tpl/css/style.css
@@ -258,13 +258,14 @@ footer {
258 font-size: 0.8em; 258 font-size: 0.8em;
259} 259}
260 260
261#inputform{ 261#inputform {
262 display: none; 262 display: none;
263 text-align:center; 263 text-align:center;
264 max-width:300px; 264 max-width:300px;
265 margin-left:auto; 265 margin-left:auto;
266 margin-right:auto; 266 margin-right:auto;
267 margin-top:5px; 267 margin-top:5px;
268 padding-bottom: 5px;
268 background-color: rgba(0, 0, 0, 0.9); 269 background-color: rgba(0, 0, 0, 0.9);
269 opacity:0.8; 270 opacity:0.8;
270 color:white; 271 color:white;
diff --git a/tpl/layout.twig b/tpl/layout.twig
index b2484019..07ca231c 100644
--- a/tpl/layout.twig
+++ b/tpl/layout.twig
@@ -12,7 +12,6 @@
12 <![endif]--> 12 <![endif]-->
13 <title>{% block title %}{% endblock %} - poche</title> 13 <title>{% block title %}{% endblock %} - poche</title>
14{% include '_head.twig' %} 14{% include '_head.twig' %}
15<script src="./tpl/js/poche.js"></script>
16{% include '_bookmarklet.twig' %} 15{% include '_bookmarklet.twig' %}
17 </head> 16 </head>
18 <body> 17 <body>