mirror of
https://github.com/moparisthebest/wallabag
synced 2024-11-30 04:42:19 -05:00
Implemented Add Button
Added a button to add an URL when directly into Poche. If JS isn't enabled, nothing happens.
This commit is contained in:
parent
3eb049036e
commit
693b3f8677
@ -558,4 +558,9 @@ class Poche
|
||||
}
|
||||
return $version;
|
||||
}
|
||||
|
||||
function convertURLToBase64($plainurl){
|
||||
$convertedURL = base64_encode($plainurl);
|
||||
$this->action('add', new Url($convertedURL))
|
||||
}
|
||||
}
|
@ -44,6 +44,9 @@ elseif (isset($_GET['export'])) {
|
||||
$poche->export();
|
||||
}
|
||||
|
||||
if (isset($_GET['plainurl'])){
|
||||
$poche->convertURLToBase64($_GET['plainurl']);}
|
||||
|
||||
# vars to send to templates
|
||||
$tpl_vars = array(
|
||||
'referer' => $referer,
|
||||
|
@ -4,4 +4,13 @@
|
||||
<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>
|
||||
<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>
|
@ -257,3 +257,16 @@ footer {
|
||||
.reading-time {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
#inputform{
|
||||
+ display: none;
|
||||
+ text-align:center;
|
||||
+ max-width:300px;
|
||||
+ margin-left:auto;
|
||||
+ margin-right:auto;
|
||||
+ margin-top:5px;
|
||||
+ background-color: rgba(0, 0, 0, 0.9);
|
||||
+ opacity:0.8;
|
||||
+ color:white;
|
||||
+ border-radius: 3px;
|
||||
+}
|
2
tpl/js/poche.js
Normal file
2
tpl/js/poche.js
Normal file
@ -0,0 +1,2 @@
|
||||
function showinput(){
|
||||
$('#inputform').fadeIn('fast');}
|
@ -12,6 +12,7 @@
|
||||
<![endif]-->
|
||||
<title>{% block title %}{% endblock %} - poche</title>
|
||||
{% include '_head.twig' %}
|
||||
<script src="./tpl/js/poche.js"></script>
|
||||
{% include '_bookmarklet.twig' %}
|
||||
</head>
|
||||
<body>
|
||||
|
Loading…
Reference in New Issue
Block a user