/fa/jquery/jquery-ui/tiny_mce/plugins/example/js/dialog.js

https://bitbucket.org/gawel/fajquery · JavaScript · 19 lines · 13 code · 4 blank · 2 comment · 0 complexity · 83245e76c97e24d466cf5df2308f9bf4 MD5 · raw file

  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);