annotate WebContent/jscripts/tiny_mce/plugins/example/js/dialog.js @ 5:0be9d53a6967

editor for annotations
author dwinter
date Tue, 13 Dec 2011 17:43:46 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
1 tinyMCEPopup.requireLangPack();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
2
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
3 var ExampleDialog = {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
4 init : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
5 var f = document.forms[0];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
6
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
7 // Get the selected contents as text and place it in the input
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
8 f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
9 f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
10 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
11
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
12 insert : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
13 // Insert the contents from the input into the document
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
14 tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
15 tinyMCEPopup.close();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
16 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
17 };
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
18
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
19 tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog);