author | Dan |
Thu, 27 Dec 2007 22:09:33 -0500 | |
changeset 335 | 67bd3121a12e |
parent 1 | fe660c52c48f |
child 395 | fa4c5ecb7c9a |
permissions | -rw-r--r-- |
1 | 1 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
2 |
<head> |
|
3 |
<title>{$lang_fullscreen_title}</title> |
|
4 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
|
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:
1
diff
changeset
|
5 |
<script type="text/javascript" src="../../tiny_mce.js"></script> |
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:
1
diff
changeset
|
6 |
<script type="text/javascript"> |
1 | 7 |
function patchCallback(settings, key) { |
8 |
if (settings[key]) |
|
9 |
settings[key] = "window.opener." + settings[key]; |
|
10 |
} |
|
11 |
||
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:
1
diff
changeset
|
12 |
var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings; |
1 | 13 |
|
14 |
// Clone array |
|
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:
1
diff
changeset
|
15 |
for (var n in paSe) |
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:
1
diff
changeset
|
16 |
settings[n] = paSe[n]; |
1 | 17 |
|
18 |
// Override options for fullscreen |
|
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:
1
diff
changeset
|
19 |
for (var n in paSe.fullscreen_settings) |
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:
1
diff
changeset
|
20 |
settings[n] = paSe.fullscreen_settings[n]; |
1 | 21 |
|
22 |
// Patch callbacks, make them point to window.opener |
|
23 |
patchCallback(settings, 'urlconverter_callback'); |
|
24 |
patchCallback(settings, 'insertlink_callback'); |
|
25 |
patchCallback(settings, 'insertimage_callback'); |
|
26 |
patchCallback(settings, 'setupcontent_callback'); |
|
27 |
patchCallback(settings, 'save_callback'); |
|
28 |
patchCallback(settings, 'onchange_callback'); |
|
29 |
patchCallback(settings, 'init_instance_callback'); |
|
30 |
patchCallback(settings, 'file_browser_callback'); |
|
31 |
patchCallback(settings, 'cleanup_callback'); |
|
32 |
patchCallback(settings, 'execcommand_callback'); |
|
33 |
patchCallback(settings, 'oninit'); |
|
34 |
||
35 |
// Set options |
|
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:
1
diff
changeset
|
36 |
delete settings.id; |
1 | 37 |
settings['mode'] = 'exact'; |
38 |
settings['elements'] = 'fullscreenarea'; |
|
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:
1
diff
changeset
|
39 |
settings['add_unload_trigger'] = false; |
1 | 40 |
settings['ask'] = false; |
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:
1
diff
changeset
|
41 |
settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI(); |
1 | 42 |
settings['fullscreen_is_enabled'] = true; |
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:
1
diff
changeset
|
43 |
settings['fullscreen_editor_id'] = window.opener.tinyMCE.activeEditor.id; |
1 | 44 |
settings['theme_advanced_resizing'] = false; |
45 |
||
46 |
function unloadHandler(e) { |
|
47 |
moveContent(); |
|
48 |
} |
|
49 |
||
50 |
function moveContent() { |
|
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:
1
diff
changeset
|
51 |
window.opener.tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent({format : 'raw'})); |
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:
1
diff
changeset
|
52 |
} |
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:
1
diff
changeset
|
53 |
|
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:
1
diff
changeset
|
54 |
function closeFullscreen() { |
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:
1
diff
changeset
|
55 |
moveContent(); |
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:
1
diff
changeset
|
56 |
window.close(); |
1 | 57 |
} |
58 |
||
59 |
// Add onunload |
|
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:
1
diff
changeset
|
60 |
tinymce.dom.Event.add(window, "beforeunload", unloadHandler); |
1 | 61 |
|
62 |
function doParentSubmit() { |
|
63 |
moveContent(); |
|
64 |
||
65 |
if (window.opener.tinyMCE.selectedInstance.formElement.form) |
|
66 |
window.opener.tinyMCE.selectedInstance.formElement.form.submit(); |
|
67 |
||
68 |
window.close(); |
|
69 |
||
70 |
return false; |
|
71 |
} |
|
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:
1
diff
changeset
|
72 |
|
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:
1
diff
changeset
|
73 |
function init() { |
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:
1
diff
changeset
|
74 |
var e = document.getElementById('fullscreenarea'); |
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:
1
diff
changeset
|
75 |
e.value = window.opener.tinyMCE.activeEditor.getContent({format : 'raw'}); |
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:
1
diff
changeset
|
76 |
settings['width'] = e.clientWidth; |
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:
1
diff
changeset
|
77 |
settings['height'] = e.clientHeight; |
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:
1
diff
changeset
|
78 |
tinyMCE.init(settings); |
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:
1
diff
changeset
|
79 |
} |
1 | 80 |
</script> |
81 |
<base target="_self" /> |
|
82 |
</head> |
|
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:
1
diff
changeset
|
83 |
<body onload="init();" style="margin:0; overflow:hidden; height:100%;" scrolling="no" scroll="no"> |
1 | 84 |
<form onsubmit="doParentSubmit();" style="height: 100%"> |
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:
1
diff
changeset
|
85 |
<textarea id="fullscreenarea" style="width:100%; height:100%"></textarea> |
1 | 86 |
</form> |
87 |
</body> |
|
88 |
</html> |