()
| 580 | var hooks; |
| 581 | |
| 582 | function commandFn() { |
| 583 | if (!commandName) { |
| 584 | return; |
| 585 | } |
| 586 | if (editor.queryCommandSupported(commandName)) { |
| 587 | // 默认命令 |
| 588 | document.execCommand(commandName, false, commandValue); |
| 589 | } else { |
| 590 | // hooks 命令 |
| 591 | hooks = editor.commandHooks; |
| 592 | if (commandName in hooks) { |
| 593 | hooks[commandName](commandValue); |
| 594 | } |
| 595 | } |
| 596 | } |
| 597 | |
| 598 | this.customCommand(e, commandFn, callback); |
| 599 | }; |