Skip to content

Commit

Permalink
Add screenshot clipboard paste in the modal box.
Browse files Browse the repository at this point in the history
The previous commit added pase screenshot in screenshot/ pages. This adds it in the modal box that opens when Add Screenshot button clicked while checking individual strings.

Related: WeblateOrg#6710
  • Loading branch information
meel-hd committed Aug 5, 2024
1 parent fbbd53d commit 4d1ab52
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions weblate/templates/translate.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{% compress js %}
<script defer data-cfasync="false" src="{% static 'editor/base.js' %}{{ cache_param }}"></script>
<script defer data-cfasync="false" src="{% static 'editor/full.js' %}{{ cache_param }}"></script>
<script defer data-cfasync="false" src="{% static 'js/screenshots/clipboard-paste.js' %}{{ cache_param }}"></script>
{% endcompress %}
{% endblock %}

Expand Down Expand Up @@ -807,8 +808,14 @@ <h4 class="panel-title">{% blocktrans with existing=unit.get_source_plurals.0 %}
<button type="button" class="close" data-dismiss="modal" aria-label="{% trans "Close" %}"><span aria-hidden="true">&times;</span></button>
<h4 class="panel-title">{% trans "Add new screenshot" %}</h4>
</div>
<div class="modal-body">
{{ screenshot_form|crispy }}
<div class="panel-body">
<p id="paste-screenshot-info-label" class="text-center"></p>
<button id="paste-screenshot-btn" class="btn" type="button">
{% trans "Paste from clipboard" %}
</button>
<div id="screenshot-form-container">
{{ screenshot_form|crispy }}
</div>
<input type="hidden" name="source" value="{{ unit.pk }}" />
</div>
<div class="modal-footer">
Expand Down

0 comments on commit 4d1ab52

Please sign in to comment.