|
202 | 202 | <script type="text/javascript" src="{{STATIC_URL}}js/recordscript.js"></script>
|
203 | 203 |
|
204 | 204 | <script type='text/javascript'>
|
| 205 | + $('.quick_createstills').click(function(e) |
| 206 | + { |
| 207 | + var glossid = $(this).attr('data-glossid'); |
| 208 | + $.ajax({ |
| 209 | + url : url + "/dictionary/generate_video_stills_for_gloss/" + glossid, |
| 210 | + type: 'POST', |
| 211 | + data: { 'csrfmiddlewaretoken': csrf_token }, |
| 212 | + success : function(data) { |
| 213 | + var lookup = "#stills_gloss_video"; |
| 214 | + $(lookup).empty(); |
| 215 | + $.ajax({ |
| 216 | + url : url + "/dictionary/ajax/fetch_video_stills_for_gloss/" + glossid + "/", |
| 217 | + datatype: "json", |
| 218 | + async: true, |
| 219 | + data: { 'csrfmiddlewaretoken': csrf_token }, |
| 220 | + success : function(result) { |
| 221 | + var parsed = $.parseHTML(result); |
| 222 | + $(lookup).first().append(result); |
| 223 | + } |
| 224 | + }); |
| 225 | + } |
| 226 | + }); |
| 227 | + }); |
| 228 | + $('.choose_still').click(function(e) |
| 229 | + { |
| 230 | + var glossid = $(this).attr('data-glossid'); |
| 231 | + var lookup = "#stills_gloss_video"; |
| 232 | + var chosen_image = []; |
| 233 | + $(lookup).find('input[name="stillimage"]').each(function() { |
| 234 | + if (this.checked) { |
| 235 | + chosen_image.push(this.value); |
| 236 | + } |
| 237 | + }); |
| 238 | + if (!chosen_image.length > 0) { |
| 239 | + return; |
| 240 | + } |
| 241 | + var chosen = chosen_image[0]; |
| 242 | + $.ajax({ |
| 243 | + url : url + "/dictionary/save_chosen_still_for_gloss/" + glossid, |
| 244 | + type: 'POST', |
| 245 | + datatype: "json", |
| 246 | + data: { 'csrfmiddlewaretoken': csrf_token, |
| 247 | + 'imagepath': chosen }, |
| 248 | + success: function(data) { |
| 249 | + var stills_modal = '#stills_modal'; |
| 250 | + var lookup = "#stills_gloss_video"; |
| 251 | + $(lookup).empty(); |
| 252 | + $(stills_modal).modal("hide"); |
| 253 | + var redirect_url = data.redirect_url; |
| 254 | + window.location.replace(redirect_url); |
| 255 | + } |
| 256 | + }); |
| 257 | + }); |
205 | 258 | function play_perspective() {
|
206 | 259 | $('#videoplayer_middle').trigger('play');
|
207 | 260 | $('#videoplayer_left').trigger('play');
|
|
458 | 511 | textarea:focus {
|
459 | 512 | border: 1px solid red;
|
460 | 513 | }
|
| 514 | +.radio_stills label:has(+ input[type="radio"]:checked) > img { |
| 515 | + outline: 2px solid red; |
| 516 | +} |
| 517 | +.zoom { |
| 518 | + background-color: transparent; |
| 519 | + transition: transform .2s; /* Animation */ |
| 520 | + margin: 0 auto; |
| 521 | +} |
| 522 | +.zoom:hover { |
| 523 | + transform: scale(1.5); |
| 524 | + outline: 2px solid red; |
| 525 | +} |
461 | 526 | </style>
|
462 |
| - |
463 | 527 | {% endblock %}
|
464 | 528 |
|
465 | 529 | {% block content %}
|
@@ -1013,9 +1077,46 @@ <h4>{% trans "Upload New Citation Form Image" %}</h4>
|
1013 | 1077 | {% if gloss.has_video and "change_dataset" in dataset_perms %}
|
1014 | 1078 | <div class="editform">
|
1015 | 1079 | <h4>{% trans "Create Citation Form Image from Current Video" %}</h4>
|
1016 |
| - <a href="{% url 'dictionary:create_citation_image' gloss.id %}" class="btn btn-primary">Create</a> |
| 1080 | + <a href="{% url 'dictionary:create_citation_image' gloss.id %}" class="btn btn-primary">{% trans "Create" %}</a> |
| 1081 | + |
| 1082 | + <button id='choose_still_btn' class='btn btn-primary' style="width:auto;" |
| 1083 | + data-toggle='modal' |
| 1084 | + data-target='#stills_modal'>{% trans "Choose Still Image" %}</button> |
1017 | 1085 | </div>
|
| 1086 | + <div class="modal fade" id="stills_modal" tabindex="-1" role="dialog" aria-labelledby="#modalTitleStills" aria-hidden="true"> |
| 1087 | + <div class="modal-dialog modal-lg left-modal"> |
| 1088 | + <div class="modal-content"> |
| 1089 | + <div class='modal-header'> |
| 1090 | + <h2 id='modalTitleStills'>{% trans "Choose a Still Image" %}</h2> |
| 1091 | + </div> |
| 1092 | + <div class='modal-body'> |
1018 | 1093 |
|
| 1094 | + <div style="width:800px;"> |
| 1095 | + <button id='quick_create_stills' |
| 1096 | + class="quick_createstills btn btn-primary" style="width:auto;" |
| 1097 | + name='quick_createstills' |
| 1098 | + data-glossid='{{gloss.id}}' |
| 1099 | + type="submit" >{% trans "Generate Stills" %} |
| 1100 | + </button> |
| 1101 | + <table class='table table-condensed'> |
| 1102 | + <tbody class="tbody tbody-light"> |
| 1103 | + <tr> |
| 1104 | + <td id="stills_gloss_video"> |
| 1105 | + |
| 1106 | + </td> |
| 1107 | + </tr> |
| 1108 | + </tbody> |
| 1109 | + </table> |
| 1110 | + </div> |
| 1111 | + </div> |
| 1112 | + <div class="modal-footer"> |
| 1113 | + <input type="submit" class="choose_still btn btn-primary" id="choose_still" data-glossid="{{gloss.id}}" |
| 1114 | + style="width:auto;" value='{% trans "Choose Image" %}'> |
| 1115 | + <button type="button" class="btn btn-primary" data-dismiss="modal">{% trans "Dismiss" %}</button> |
| 1116 | + </div> |
| 1117 | + </div> |
| 1118 | + </div> |
| 1119 | + </div> |
1019 | 1120 | {% endif %}
|
1020 | 1121 |
|
1021 | 1122 | {% if "change_dataset" in dataset_perms %}
|
@@ -2244,7 +2345,7 @@ <h2 id='modalTitleBlend'>{% trans "Delete This Blend" %}</h2>
|
2244 | 2345 | data-target='#minimalpairs'>{% trans "Minimal Pairs" %}
|
2245 | 2346 | </div>
|
2246 | 2347 | <div id='minimalpairs' class='collapse'>
|
2247 |
| - <table class='table table-condensed' id = "header_mp_rows"> |
| 2348 | + <table class='table table-condensed' id="header_mp_rows"> |
2248 | 2349 |
|
2249 | 2350 | {% if minimalpairs %}
|
2250 | 2351 | <tr>
|
|
0 commit comments