PageRenderTime 43ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/editors/tiny_mce_3_4_3_1/plugins/example/js/dialog.js

#
JavaScript | 19 lines | 13 code | 4 blank | 2 comment | 0 complexity | 83245e76c97e24d466cf5df2308f9bf4 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  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);