autosubmit.js 895 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * 快捷键提交
  3. * @file
  4. * @since 1.2.6.1
  5. */
  6. /**
  7. * 提交表单
  8. * @command autosubmit
  9. * @method execCommand
  10. * @param { String } cmd 命令字符串
  11. * @example
  12. * ```javascript
  13. * editor.execCommand( 'autosubmit' );
  14. * ```
  15. */
  16. UE.plugin.register('autosubmit',function(){
  17. return {
  18. shortcutkey:{
  19. "autosubmit":"ctrl+13" //手动提交
  20. },
  21. commands:{
  22. 'autosubmit':{
  23. execCommand:function () {
  24. var me=this,
  25. form = domUtils.findParentByTagName(me.iframe,"form", false);
  26. if (form){
  27. if(me.fireEvent("beforesubmit")===false){
  28. return;
  29. }
  30. me.sync();
  31. form.submit();
  32. }
  33. }
  34. }
  35. }
  36. }
  37. });