1
0
mirror of https://github.com/aquatix/digimarks.git synced 2025-12-07 04:55:10 +01:00

Easy adding of tags by clicking/tapping tag tags

This commit is contained in:
2016-07-31 14:33:31 +02:00
parent 5f0e3bb730
commit 6be78117c2
3 changed files with 26 additions and 3 deletions

View File

@@ -19,6 +19,7 @@
<link href='https://fonts.googleapis.com/css?family=Roboto+Mono&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/css/materialize.min.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="{{ url_for('static', filename='css/digimarks.css') }}" type="text/css" rel="stylesheet" media="screen,projection"/>
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
</head>
<body class="grey lighten-4">
<nav class="green darken-3" role="navigation">
@@ -54,7 +55,6 @@
</div>
<!-- Scripts -->
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/js/materialize.min.js"></script>
<script src="{{ url_for('static', filename='js/init.js') }}"></script>

View File

@@ -56,6 +56,29 @@
<input placeholder="tags, divided by comma's" type="text" name="tags" id="tags" value="{{ bookmark.tags }}" class="validate" />
<label for="tags">Tags</label>
</div>
</div>
{% if tags %}
<div class="row">
<div class="col s12">
{% for tag in tags %}
<div class="chip" id="tag_{{ tag }}">
{{ tag }}
</div>
{% endfor %}
</div>
{% for tag in tags %}
<script type="text/javascript">
$(function () {
$('#tag_{{ tag }}').on('click', function () {
var text = $('#tags');
text.val(text.val() + ', {{ tag }}');
});
});
</script>
{% endfor %}
</div>
{% endif %}
<div class="row">
<div class="input-field col s12">
{#<i class="material-icons prefix">star</i>#}