diff options
author | till <till@php.net> | 2011-11-02 15:14:32 +0000 |
---|---|---|
committer | till <till@php.net> | 2011-11-02 15:14:32 +0000 |
commit | 4dd50a41ee477806745a05772d5abbf16d23db89 (patch) | |
tree | 3d65607d946f0eaecb468b8a21d40f147bc87fda /program/js/tiny_mce/plugins/paste/js/pastetext.js | |
parent | d6284b4d22d1e6912b01228b7d2a63e9fecbc5fb (diff) |
fix path/structure (my bad)
Diffstat (limited to 'program/js/tiny_mce/plugins/paste/js/pastetext.js')
-rw-r--r-- | program/js/tiny_mce/plugins/paste/js/pastetext.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/program/js/tiny_mce/plugins/paste/js/pastetext.js b/program/js/tiny_mce/plugins/paste/js/pastetext.js new file mode 100644 index 000000000..c524f9eb0 --- /dev/null +++ b/program/js/tiny_mce/plugins/paste/js/pastetext.js @@ -0,0 +1,36 @@ +tinyMCEPopup.requireLangPack();
+
+var PasteTextDialog = {
+ init : function() {
+ this.resize();
+ },
+
+ insert : function() {
+ var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines;
+
+ // Convert linebreaks into paragraphs
+ if (document.getElementById('linebreaks').checked) {
+ lines = h.split(/\r?\n/);
+ if (lines.length > 1) {
+ h = '';
+ tinymce.each(lines, function(row) {
+ h += '<p>' + row + '</p>';
+ });
+ }
+ }
+
+ tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h});
+ tinyMCEPopup.close();
+ },
+
+ resize : function() {
+ var vp = tinyMCEPopup.dom.getViewPort(window), el;
+
+ el = document.getElementById('content');
+
+ el.style.width = (vp.w - 20) + 'px';
+ el.style.height = (vp.h - 90) + 'px';
+ }
+};
+
+tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog);
|