author | Dan |
Sun, 24 Feb 2008 12:50:52 -0500 | |
changeset 459 | 31c23016ab62 |
parent 395 | fa4c5ecb7c9a |
child 476 | f26a69c40431 |
permissions | -rw-r--r-- |
395
fa4c5ecb7c9a
Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents:
335
diff
changeset
|
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
1 | 2 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
3 |
<head> |
|
395
fa4c5ecb7c9a
Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents:
335
diff
changeset
|
4 |
<title></title> |
1 | 5 |
<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
|
6 |
<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
|
7 |
<script type="text/javascript"> |
1 | 8 |
function patchCallback(settings, key) { |
9 |
if (settings[key]) |
|
10 |
settings[key] = "window.opener." + settings[key]; |
|
11 |
} |
|
12 |
||
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
|
13 |
var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings; |
1 | 14 |
|
15 |
// 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
|
16 |
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
|
17 |
settings[n] = paSe[n]; |
1 | 18 |
|
19 |
// 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
|
20 |
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
|
21 |
settings[n] = paSe.fullscreen_settings[n]; |
1 | 22 |
|
23 |
// Patch callbacks, make them point to window.opener |
|
24 |
patchCallback(settings, 'urlconverter_callback'); |
|
25 |
patchCallback(settings, 'insertlink_callback'); |
|
26 |
patchCallback(settings, 'insertimage_callback'); |
|
27 |
patchCallback(settings, 'setupcontent_callback'); |
|
28 |
patchCallback(settings, 'save_callback'); |
|
29 |
patchCallback(settings, 'onchange_callback'); |
|
30 |
patchCallback(settings, 'init_instance_callback'); |
|
31 |
patchCallback(settings, 'file_browser_callback'); |
|
32 |
patchCallback(settings, 'cleanup_callback'); |
|
33 |
patchCallback(settings, 'execcommand_callback'); |
|
34 |
patchCallback(settings, 'oninit'); |
|
35 |
||
36 |
// 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
|
37 |
delete settings.id; |
1 | 38 |
settings['mode'] = 'exact'; |
39 |
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
|
40 |
settings['add_unload_trigger'] = false; |
1 | 41 |
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
|
42 |
settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI(); |
1 | 43 |
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
|
44 |
settings['fullscreen_editor_id'] = window.opener.tinyMCE.activeEditor.id; |
1 | 45 |
settings['theme_advanced_resizing'] = false; |
459
31c23016ab62
Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents:
395
diff
changeset
|
46 |
settings['strict_loading_mode'] = true; |
31c23016ab62
Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents:
395
diff
changeset
|
47 |
|
31c23016ab62
Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents:
395
diff
changeset
|
48 |
settings.save_onsavecallback = function() { |
31c23016ab62
Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents:
395
diff
changeset
|
49 |
window.opener.tinyMCE.activeEditor.setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'}); |
31c23016ab62
Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents:
395
diff
changeset
|
50 |
window.opener.tinyMCE.activeEditor.execCommand('mceSave'); |
31c23016ab62
Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents:
395
diff
changeset
|
51 |
window.close(); |
31c23016ab62
Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents:
395
diff
changeset
|
52 |
}; |
1 | 53 |
|
54 |
function unloadHandler(e) { |
|
55 |
moveContent(); |
|
56 |
} |
|
57 |
||
58 |
function moveContent() { |
|
459
31c23016ab62
Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents:
395
diff
changeset
|
59 |
window.opener.tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent()); |
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 |
} |
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
|
61 |
|
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
|
62 |
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
|
63 |
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
|
64 |
window.close(); |
1 | 65 |
} |
66 |
||
67 |
// 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
|
68 |
tinymce.dom.Event.add(window, "beforeunload", unloadHandler); |
1 | 69 |
|
70 |
function doParentSubmit() { |
|
71 |
moveContent(); |
|
72 |
||
73 |
if (window.opener.tinyMCE.selectedInstance.formElement.form) |
|
74 |
window.opener.tinyMCE.selectedInstance.formElement.form.submit(); |
|
75 |
||
76 |
window.close(); |
|
77 |
||
78 |
return false; |
|
79 |
} |
|
80 |
</script> |
|
81 |
<base target="_self" /> |
|
82 |
</head> |
|
395
fa4c5ecb7c9a
Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents:
335
diff
changeset
|
83 |
<body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no"> |
fa4c5ecb7c9a
Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents:
335
diff
changeset
|
84 |
<form onsubmit="doParentSubmit();"> |
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> |
395
fa4c5ecb7c9a
Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents:
335
diff
changeset
|
87 |
|
fa4c5ecb7c9a
Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents:
335
diff
changeset
|
88 |
<script type="text/javascript"> |
fa4c5ecb7c9a
Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents:
335
diff
changeset
|
89 |
var e = document.getElementById('fullscreenarea'); |
459
31c23016ab62
Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents:
395
diff
changeset
|
90 |
e.value = window.opener.tinyMCE.activeEditor.getContent(); |
31c23016ab62
Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents:
395
diff
changeset
|
91 |
settings.width = window.innerWidth || document.body.clientWidth; |
31c23016ab62
Upgraded tinyMCE to 3.0.1 in hopes of fixing IE race conditions. Fixed a couple minor syntax errors in Javascript objects declared in various places.
Dan
parents:
395
diff
changeset
|
92 |
settings.height = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) - 18; |
395
fa4c5ecb7c9a
Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents:
335
diff
changeset
|
93 |
tinyMCE.init(settings); |
fa4c5ecb7c9a
Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents:
335
diff
changeset
|
94 |
</script> |
fa4c5ecb7c9a
Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
parents:
335
diff
changeset
|
95 |
|
1 | 96 |
</body> |
97 |
</html> |