bgneal@312: tinyMCEPopup.requireLangPack(); bgneal@312: bgneal@312: var PasteTextDialog = { bgneal@312: init : function() { bgneal@312: this.resize(); bgneal@312: }, bgneal@312: bgneal@312: insert : function() { bgneal@312: var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; bgneal@312: bgneal@312: // Convert linebreaks into paragraphs bgneal@312: if (document.getElementById('linebreaks').checked) { bgneal@312: lines = h.split(/\r?\n/); bgneal@312: if (lines.length > 1) { bgneal@312: h = ''; bgneal@312: tinymce.each(lines, function(row) { bgneal@312: h += '

' + row + '

'; bgneal@312: }); bgneal@312: } bgneal@312: } bgneal@312: bgneal@312: tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); bgneal@312: tinyMCEPopup.close(); bgneal@312: }, bgneal@312: bgneal@312: resize : function() { bgneal@312: var vp = tinyMCEPopup.dom.getViewPort(window), el; bgneal@312: bgneal@312: el = document.getElementById('content'); bgneal@312: bgneal@312: el.style.width = (vp.w - 20) + 'px'; bgneal@312: el.style.height = (vp.h - 90) + 'px'; bgneal@312: } bgneal@312: }; bgneal@312: bgneal@312: tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog);