Commit c3b0bfe4 authored by Michal Čihař's avatar Michal Čihař

Add button to copy word dictionary to target

parent f1977faa
......@@ -3,13 +3,22 @@
{% if dictionary %}
<table>
<thead>
<tr><th>{% trans "Source" %}</th><th>{% trans "Translation" %}</th></tr>
<tr>
<th>{% trans "Source" %}</th>
<th>{% trans "Translation" %}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for item in dictionary %}
<tr>
<td class="translatetext">{{ item.source }}</td>
<td class="translatetext">{{ item.target }}</td>
<td class="translatetext target">{{ item.target }}</td>
<td>
{% if perms.trans.save_translation %}
<a class="copydict small-button" title="{% trans "Copy word to translation" %}">{% trans "Copy" %}</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
......
......@@ -317,6 +317,10 @@ $(function() {
},
load: function (e, ui) {
$('a.mergebutton').button({text: true, icons: { primary: "ui-icon-check" }});
$('a.copydict').button({text: true, icons: { primary: "ui-icon-copy" }}).click(function () {
var text = $(this).parent().parent().find('.target').text();
$('#id_target').insertAtCaret(text);
});
}
});
$("div.tabs").tabs({
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment