author | Dan |
Sat, 20 Mar 2010 16:05:38 -0400 | |
changeset 1223 | 7dca925b0209 |
parent 1193 | e3b94bd055dc |
permissions | -rw-r--r-- |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff
changeset
|
1 |
tinyMCEPopup.requireLangPack(); |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff
changeset
|
2 |
|
1193 | 3 |
var PasteTextDialog = { |
4 |
init : function() { |
|
5 |
this.resize(); |
|
6 |
}, |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff
changeset
|
7 |
|
1193 | 8 |
insert : function() { |
9 |
var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff
changeset
|
10 |
|
1193 | 11 |
// Convert linebreaks into paragraphs |
12 |
if (document.getElementById('linebreaks').checked) { |
|
13 |
lines = h.split(/\r?\n/); |
|
14 |
if (lines.length > 1) { |
|
15 |
h = ''; |
|
16 |
tinymce.each(lines, function(row) { |
|
17 |
h += '<p>' + row + '</p>'; |
|
18 |
}); |
|
19 |
} |
|
20 |
} |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff
changeset
|
21 |
|
1193 | 22 |
tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); |
23 |
tinyMCEPopup.close(); |
|
24 |
}, |
|
25 |
||
26 |
resize : function() { |
|
27 |
var vp = tinyMCEPopup.dom.getViewPort(window), el; |
|
28 |
||
29 |
el = document.getElementById('content'); |
|
30 |
||
31 |
el.style.width = (vp.w - 20) + 'px'; |
|
32 |
el.style.height = (vp.h - 90) + 'px'; |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff
changeset
|
33 |
} |
1193 | 34 |
}; |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
diff
changeset
|
35 |
|
1193 | 36 |
tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); |