modifications template et tinyMce dans libs
[mtweb] / mw / libs / tiny_mce / plugins / paste / js / pastetext.js
1 tinyMCEPopup.requireLangPack();\r
2 \r
3 var PasteTextDialog = {\r
4         init : function() {\r
5                 this.resize();\r
6         },\r
7 \r
8         insert : function() {\r
9                 var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines;\r
10 \r
11                 // Convert linebreaks into paragraphs\r
12                 if (document.getElementById('linebreaks').checked) {\r
13                         lines = h.split(/\r?\n/);\r
14                         if (lines.length > 1) {\r
15                                 h = '';\r
16                                 tinymce.each(lines, function(row) {\r
17                                         h += '<p>' + row + '</p>';\r
18                                 });\r
19                         }\r
20                 }\r
21 \r
22                 tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h});\r
23                 tinyMCEPopup.close();\r
24         },\r
25 \r
26         resize : function() {\r
27                 var vp = tinyMCEPopup.dom.getViewPort(window), el;\r
28 \r
29                 el = document.getElementById('content');\r
30 \r
31                 el.style.width  = (vp.w - 20) + 'px';\r
32                 el.style.height = (vp.h - 90) + 'px';\r
33         }\r
34 };\r
35 \r
36 tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog);\r