authentify_recorder.html.twig 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {% extends 'whispeakauth/view/record_audio.html.twig' %}
  2. {% block intro %}
  3. {% if show_form %}
  4. <form class="form-horizontal" action="#" method="post">
  5. <div class="form-group ">
  6. <label for="enter_username_username" class="col-sm-4 control-label">
  7. {{ 'Username'|get_lang }}
  8. </label>
  9. <div class="col-sm-8">
  10. <input class="form-control" name="username" type="text" id="username">
  11. </div>
  12. </div>
  13. </form>
  14. <hr>
  15. {% endif %}
  16. {{ parent() }}
  17. {% endblock %}
  18. {% block config_data %}
  19. {% if show_form %}
  20. $('#username').on('change', function () {
  21. $('#record-audio-recordrtc, #btn-start-record, #btn-stop-record, #btn-save-record').off('click', '');
  22. {% endif %}
  23. RecordAudio.init(
  24. {
  25. blockId: '#record-audio-recordrtc',
  26. btnStartId: '#btn-start-record',
  27. btnStopId: '#btn-stop-record',
  28. btnSaveId: '#btn-save-record',
  29. plyrPreviewId: '#record-preview',
  30. data: {
  31. action: 'authentify',
  32. username: $('#username').val()
  33. }
  34. }
  35. );
  36. {% if show_form %}
  37. });
  38. {% endif %}
  39. {% endblock %}