dialog.js 609 B

12345678910111213141516171819
  1. tinyMCEPopup.requireLangPack();
  2. var ExampleDialog = {
  3. init : function() {
  4. var f = document.forms[0];
  5. // Get the selected contents as text and place it in the input
  6. f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});
  7. f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');
  8. },
  9. insert : function() {
  10. // Insert the contents from the input into the document
  11. tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);
  12. tinyMCEPopup.close();
  13. }
  14. };
  15. tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog);