PageRenderTime 15ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 1ms 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
 1tinyMCEPopup.requireLangPack();
 2
 3var ExampleDialog = {
 4	init : function() {
 5		var f = document.forms[0];
 6
 7		// Get the selected contents as text and place it in the input
 8		f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});
 9		f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');
10	},
11
12	insert : function() {
13		// Insert the contents from the input into the document
14		tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);
15		tinyMCEPopup.close();
16	}
17};
18
19tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog);