Last active
August 29, 2015 14:14
-
-
Save Simon-L/f35d641a417358dbfb90 to your computer and use it in GitHub Desktop.
Adding tagging on save in Wallabag and its Chrome extension the *very* hackish way!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function displayView($view, $id = 0) | |
... | |
case 'save': | |
$tpl_vars = array(); | |
if (isset($_GET['url'])){ | |
$tpl_vars['url'] = $_GET['url']; | |
} | |
if (isset($_GET['encoded_url'])){ | |
$tpl_vars['encoded_url'] = $_GET['encoded_url']; | |
} | |
break; | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In Chrome extension | |
- var if_url = base_url + '?action=add&url=' + btoa(url); | |
+ var if_url = base_url + '?view=save&url=' + url + '&encoded_url=' + btoa(url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% block content %} | |
<script src="{{ poche_url }}themes/_global/js/jquery-ui-1.10.4.custom.min.js"></script> | |
<script src="{{ poche_url }}themes/_global/js/autoCompleteTags.js"></script> | |
<link rel="stylesheet" href="{{ poche_url }}themes/_global/css/jquery-ui-1.10.4.custom.min.css" media="all"> | |
<form method="get" action="./" target="_blank" id="bagit-form-form"> | |
<h2>{% trans "Save a link" %}</h2> | |
<input type="hidden" name="action" value="add"/> | |
<input type="hidden" name="url" value="{{encoded_url}}"/> | |
<label for="value">{% trans "Url:" %}</label> | |
<input disabled value="{{url}}"/> | |
<br><br> | |
<label for="value">{% trans "Add tags:" %}</label> | |
<input type="text" placeholder="{% trans "interview" %}, {% trans "editorial" %}, {% trans "video" %}" id="tags" name="tags" /> | |
<p>{% trans "Start typing for auto complete." %}<br> | |
{% trans "You can enter multiple tags, separated by commas." %}</p> | |
<input type="submit" value="{% trans "save link!" %}" /> | |
</form> | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment