embed-chooser-modal.js 697 B

1234567891011121314151617181920212223
  1. EMBED_CHOOSER_MODAL_ONLOAD_HANDLERS = {
  2. 'chooser': function(modal, jsonData) {
  3. $('form.embed-form', modal.body).on('submit', function() {
  4. var formdata = new FormData(this);
  5. $.ajax({
  6. url: this.action,
  7. data: formdata,
  8. processData: false,
  9. contentType: false,
  10. type: 'POST',
  11. dataType: 'text',
  12. success: modal.loadResponseText
  13. });
  14. return false;
  15. });
  16. },
  17. 'embed_chosen': function(modal, jsonData) {
  18. modal.respond('embedChosen', jsonData['embed_html'], jsonData['embed_data']);
  19. modal.close();
  20. }
  21. };