equal
deleted
inserted
replaced
1 /** |
1 /** |
2 * $Id: editor_plugin_src.js 763 2008-04-03 13:25:45Z spocke $ |
2 * $Id: editor_plugin_src.js 870 2008-06-13 09:25:41Z spocke $ |
3 * |
3 * |
4 * @author Moxiecode |
4 * @author Moxiecode |
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. |
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. |
6 */ |
6 */ |
7 |
7 |
16 t.url = url; |
16 t.url = url; |
17 |
17 |
18 function isMediaElm(n) { |
18 function isMediaElm(n) { |
19 return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className); |
19 return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className); |
20 }; |
20 }; |
|
21 |
|
22 ed.onPreInit.add(function() { |
|
23 // Force in _value parameter this extra parameter is required for older Opera versions |
|
24 ed.serializer.addRules('param[name|value|_value]'); |
|
25 }); |
21 |
26 |
22 // Register commands |
27 // Register commands |
23 ed.addCommand('mceMedia', function() { |
28 ed.addCommand('mceMedia', function() { |
24 ed.windowManager.open({ |
29 ed.windowManager.open({ |
25 file : url + '/media.htm', |
30 file : url + '/media.htm', |
81 |
86 |
82 return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />' |
87 return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />' |
83 }); |
88 }); |
84 |
89 |
85 h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>'); |
90 h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>'); |
|
91 h = h.replace(/<embed([^>]*)\/>/gi, '<span class="mceItemEmbed" $1>'); |
86 h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>'); |
92 h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>'); |
87 h = h.replace(/<\/(object|embed)([^>]*)>/gi, '</span>'); |
93 h = h.replace(/<\/(object|embed)([^>]*)>/gi, '</span>'); |
88 h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_value=') + ' class="mceItemParam"></span>'}); |
94 h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_value=') + ' class="mceItemParam"></span>'}); |
89 h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>'); |
95 h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>'); |
90 |
96 |