From 4315b0086b14cd5266b4cb824c3bd95aa550240c Mon Sep 17 00:00:00 2001 From: svncommit Date: Tue, 11 Dec 2007 04:20:01 +0000 Subject: added ability to insert attached images in HTML editor --- program/js/tiny_mce/plugins/media/css/content.css | 52 +- program/js/tiny_mce/plugins/media/css/media.css | 136 +-- .../js/tiny_mce/plugins/media/editor_plugin_src.js | 864 +++++++------- .../js/tiny_mce/plugins/media/jscripts/embed.js | 146 +-- .../js/tiny_mce/plugins/media/jscripts/media.js | 1188 ++++++++++---------- program/js/tiny_mce/plugins/media/langs/en.js | 186 +-- program/js/tiny_mce/plugins/readme.txt | 2 +- program/js/tiny_mce/plugins/table/css/cell.css | 32 +- program/js/tiny_mce/plugins/table/css/row.css | 50 +- program/js/tiny_mce/plugins/table/css/table.css | 26 +- 10 files changed, 1341 insertions(+), 1341 deletions(-) (limited to 'program/js/tiny_mce/plugins') diff --git a/program/js/tiny_mce/plugins/media/css/content.css b/program/js/tiny_mce/plugins/media/css/content.css index 1f667e633..7873235e7 100644 --- a/program/js/tiny_mce/plugins/media/css/content.css +++ b/program/js/tiny_mce/plugins/media/css/content.css @@ -1,26 +1,26 @@ -.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia { - border: 1px dotted #cc0000; - background-position: center; - background-repeat: no-repeat; - background-color: #ffffcc; -} - -.mceItemShockWave { - background-image: url('../images/shockwave.gif'); -} - -.mceItemFlash { - background-image: url('../images/flash.gif'); -} - -.mceItemQuickTime { - background-image: url('../images/quicktime.gif'); -} - -.mceItemWindowsMedia { - background-image: url('../images/windowsmedia.gif'); -} - -.mceItemRealMedia { - background-image: url('../images/realmedia.gif'); -} +.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia { + border: 1px dotted #cc0000; + background-position: center; + background-repeat: no-repeat; + background-color: #ffffcc; +} + +.mceItemShockWave { + background-image: url('../images/shockwave.gif'); +} + +.mceItemFlash { + background-image: url('../images/flash.gif'); +} + +.mceItemQuickTime { + background-image: url('../images/quicktime.gif'); +} + +.mceItemWindowsMedia { + background-image: url('../images/windowsmedia.gif'); +} + +.mceItemRealMedia { + background-image: url('../images/realmedia.gif'); +} diff --git a/program/js/tiny_mce/plugins/media/css/media.css b/program/js/tiny_mce/plugins/media/css/media.css index 89c6bd5a0..62d666a5f 100644 --- a/program/js/tiny_mce/plugins/media/css/media.css +++ b/program/js/tiny_mce/plugins/media/css/media.css @@ -1,68 +1,68 @@ -#id, #name, #hspace, #vspace, #class_name, #align { - width: 100px; -} - -#hspace, #vspace { - width: 50px; -} - -#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { - width: 100px; -} - -#flash_base, #flash_flashvars { - width: 240px; -} - -#width, #height { - width: 40px; -} - -#src, #media_type { - width: 250px; -} - -#class { - width: 120px; -} - -#prev { - margin: 0; - border: 1px solid black; - width: 99%; - height: 230px; - overflow: auto; -} - -.panel_wrapper div.current { - height: 390px; - overflow: auto; -} - -#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { - display: none; -} - -.mceAddSelectValue { - background-color: #DDDDDD; -} - -#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { - width: 70px; -} - -#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { - width: 70px; -} - -#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { - width: 70px; -} - -#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { - width: 90px; -} - -#qt_qtsrc { - width: 200px; -} +#id, #name, #hspace, #vspace, #class_name, #align { + width: 100px; +} + +#hspace, #vspace { + width: 50px; +} + +#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { + width: 100px; +} + +#flash_base, #flash_flashvars { + width: 240px; +} + +#width, #height { + width: 40px; +} + +#src, #media_type { + width: 250px; +} + +#class { + width: 120px; +} + +#prev { + margin: 0; + border: 1px solid black; + width: 99%; + height: 230px; + overflow: auto; +} + +.panel_wrapper div.current { + height: 390px; + overflow: auto; +} + +#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { + display: none; +} + +.mceAddSelectValue { + background-color: #DDDDDD; +} + +#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { + width: 70px; +} + +#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { + width: 70px; +} + +#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { + width: 70px; +} + +#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { + width: 90px; +} + +#qt_qtsrc { + width: 200px; +} diff --git a/program/js/tiny_mce/plugins/media/editor_plugin_src.js b/program/js/tiny_mce/plugins/media/editor_plugin_src.js index 8bb7d5b59..ee7e13427 100644 --- a/program/js/tiny_mce/plugins/media/editor_plugin_src.js +++ b/program/js/tiny_mce/plugins/media/editor_plugin_src.js @@ -1,432 +1,432 @@ -/** - * $Id: editor_plugin_src.js 296 2007-08-21 10:36:35Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved. - */ - -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('media'); - -var TinyMCE_MediaPlugin = { - getInfo : function() { - return { - longname : 'Media', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; - }, - - initInstance : function(inst) { - // Warn if user has flash plugin and media plugin at the same time - if (inst.hasPlugin('flash') && !tinyMCE.flashWarn) { - alert('Flash plugin is deprecated and should not be used together with the media plugin.'); - tinyMCE.flashWarn = true; - } - - if (!tinyMCE.settings['media_skip_plugin_css']) - tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/media/css/content.css"); - }, - - getControlHTML : function(cn) { - switch (cn) { - case "media": - return tinyMCE.getButtonHTML(cn, 'lang_media_desc', '{$pluginurl}/images/media.gif', 'mceMedia'); - } - - return ""; - }, - - execCommand : function(editor_id, element, command, user_interface, value) { - // Handle commands - switch (command) { - case "mceMedia": - tinyMCE.openWindow({ - file : '../../plugins/media/media.htm', - width : 430 + tinyMCE.getLang('lang_media_delta_width', 0), - height : 470 + tinyMCE.getLang('lang_media_delta_height', 0) - }, { - editor_id : editor_id, - inline : "yes" - }); - - return true; - } - - // Pass to next handler in chain - return false; - }, - - cleanup : function(type, content, inst) { - var nl, img, i, ne, d, s, ci; - - switch (type) { - case "insert_to_editor": - img = tinyMCE.getParam("theme_href") + '/images/spacer.gif'; - content = content.replace(/]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, ''); - content = content.replace(/]*)>/gi, '
'); - content = content.replace(/]*)>/gi, '
'); - content = content.replace(/<\/(object|embed)([^>]*)>/gi, '
'); - content = content.replace(/]*)>/gi, '
'); - content = content.replace(new RegExp('\\/ class="mceItemParam"><\\/div>', 'gi'), 'class="mceItemParam">
'); - break; - - case "insert_to_editor_dom": - d = inst.getDoc(); - nl = content.getElementsByTagName("img"); - for (i=0; i', startPos); - attribs = TinyMCE_MediaPlugin._parseAttributes(content.substring(startPos + 4, endPos)); - - // Is not flash, skip it - if (!/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(attribs['class'])) - continue; - - endPos += 2; - - // Parse attributes - at = attribs['title']; - if (at) { - at = at.replace(/&(#39|apos);/g, "'"); - at = at.replace(/&#quot;/g, '"'); - - try { - pl = eval('x={' + at + '};'); - } catch (ex) { - pl = {}; - } - } - - // Use object/embed - if (!tinyMCE.getParam('media_use_script', false)) { - switch (attribs['class']) { - case 'mceItemFlash': - ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000'; - cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; - mt = 'application/x-shockwave-flash'; - break; - - case 'mceItemShockWave': - ci = '166B1BCA-3F9C-11CF-8075-444553540000'; - cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; - mt = 'application/x-director'; - break; - - case 'mceItemWindowsMedia': - ci = tinyMCE.getParam('media_wmp6_compatible') ? '05589FA1-C356-11CE-BF01-00AA0055595A' : '6BF52A52-394A-11D3-B153-00C04F79FAA6'; - cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; - mt = 'application/x-mplayer2'; - break; - - case 'mceItemQuickTime': - ci = '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; - cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; - mt = 'video/quicktime'; - break; - - case 'mceItemRealMedia': - ci = 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; - cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; - mt = 'audio/x-pn-realaudio-plugin'; - break; - } - - // Convert the URL - pl.src = tinyMCE.convertURL(pl.src, null, true); - - embedHTML = TinyMCE_MediaPlugin._getEmbed(ci, cb, mt, pl, attribs); - } else { - // Use script version - switch (attribs['class']) { - case 'mceItemFlash': - s = 'writeFlash'; - break; - - case 'mceItemShockWave': - s = 'writeShockWave'; - break; - - case 'mceItemWindowsMedia': - s = 'writeWindowsMedia'; - break; - - case 'mceItemQuickTime': - s = 'writeQuickTime'; - break; - - case 'mceItemRealMedia': - s = 'writeRealMedia'; - break; - } - - if (attribs.width) - at = at.replace(/width:[^0-9]?[0-9]+%?[^0-9]?/g, "width:'" + attribs.width + "'"); - - if (attribs.height) - at = at.replace(/height:[^0-9]?[0-9]+%?[^0-9]?/g, "height:'" + attribs.height + "'"); - - // Force absolute URL - pl.src = tinyMCE.convertURL(pl.src, null, true); - at = at.replace(new RegExp("src:'[^']*'", "g"), "src:'" + pl.src + "'"); - - embedHTML = ''; - } - - // Insert embed/object chunk - chunkBefore = content.substring(0, startPos); - chunkAfter = content.substring(endPos); - content = chunkBefore + embedHTML + chunkAfter; - } - break; - } - - return content; - }, - - handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { - if (node == null) - return; - - do { - if (node.nodeName == "IMG" && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(node, 'class'))) { - tinyMCE.switchClass(editor_id + '_media', 'mceButtonSelected'); - return true; - } - } while ((node = node.parentNode)); - - tinyMCE.switchClass(editor_id + '_media', 'mceButtonNormal'); - - return true; - }, - - _createImgFromEmbed : function(n, d, cl) { - var ne, at, i, ti = '', an; - - ne = d.createElement('img'); - ne.src = tinyMCE.getParam("theme_href") + '/images/spacer.gif'; - ne.width = tinyMCE.getAttrib(n, 'width'); - ne.height = tinyMCE.getAttrib(n, 'height'); - ne.className = cl; - - at = n.attributes; - for (i=0; i 0 ? ti.substring(0, ti.length - 1) : ti; - ne.title = ti; - - n.parentNode.replaceChild(ne, n); - }, - - _createImg : function(cl, d, n) { - var i, nl, ti = "", an, av, al = new Array(); - - ne = d.createElement('img'); - ne.src = tinyMCE.getParam("theme_href") + '/images/spacer.gif'; - ne.width = tinyMCE.getAttrib(n, 'width'); - ne.height = tinyMCE.getAttrib(n, 'height'); - ne.className = cl; - - al.id = tinyMCE.getAttrib(n, 'id'); - al.name = tinyMCE.getAttrib(n, 'name'); - al.width = tinyMCE.getAttrib(n, 'width'); - al.height = tinyMCE.getAttrib(n, 'height'); - al.bgcolor = tinyMCE.getAttrib(n, 'bgcolor'); - al.align = tinyMCE.getAttrib(n, 'align'); - al.class_name = tinyMCE.getAttrib(n, 'mce_class'); - - nl = n.getElementsByTagName('div'); - for (i=0; i 0 ? ti.substring(0, ti.length - 1) : ti; - ne.title = ti; - - return ne; - }, - - _getEmbed : function(cls, cb, mt, p, at) { - var h = '', n; - - p.width = at.width ? at.width : p.width; - p.height = at.height ? at.height : p.height; - - h += ''; - - // Add extra url parameter if it's an absolute URL on WMP - if (n == 'src' && p[n].indexOf('://') != -1 && mt == 'application/x-mplayer2') - h += ''; - } - } - - h += ']*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, ''); + content = content.replace(/]*)>/gi, '
'); + content = content.replace(/]*)>/gi, '
'); + content = content.replace(/<\/(object|embed)([^>]*)>/gi, '
'); + content = content.replace(/]*)>/gi, '
'); + content = content.replace(new RegExp('\\/ class="mceItemParam"><\\/div>', 'gi'), 'class="mceItemParam">
'); + break; + + case "insert_to_editor_dom": + d = inst.getDoc(); + nl = content.getElementsByTagName("img"); + for (i=0; i', startPos); + attribs = TinyMCE_MediaPlugin._parseAttributes(content.substring(startPos + 4, endPos)); + + // Is not flash, skip it + if (!/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(attribs['class'])) + continue; + + endPos += 2; + + // Parse attributes + at = attribs['title']; + if (at) { + at = at.replace(/&(#39|apos);/g, "'"); + at = at.replace(/&#quot;/g, '"'); + + try { + pl = eval('x={' + at + '};'); + } catch (ex) { + pl = {}; + } + } + + // Use object/embed + if (!tinyMCE.getParam('media_use_script', false)) { + switch (attribs['class']) { + case 'mceItemFlash': + ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000'; + cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; + mt = 'application/x-shockwave-flash'; + break; + + case 'mceItemShockWave': + ci = '166B1BCA-3F9C-11CF-8075-444553540000'; + cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; + mt = 'application/x-director'; + break; + + case 'mceItemWindowsMedia': + ci = tinyMCE.getParam('media_wmp6_compatible') ? '05589FA1-C356-11CE-BF01-00AA0055595A' : '6BF52A52-394A-11D3-B153-00C04F79FAA6'; + cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; + mt = 'application/x-mplayer2'; + break; + + case 'mceItemQuickTime': + ci = '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; + cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; + mt = 'video/quicktime'; + break; + + case 'mceItemRealMedia': + ci = 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; + cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; + mt = 'audio/x-pn-realaudio-plugin'; + break; + } + + // Convert the URL + pl.src = tinyMCE.convertURL(pl.src, null, true); + + embedHTML = TinyMCE_MediaPlugin._getEmbed(ci, cb, mt, pl, attribs); + } else { + // Use script version + switch (attribs['class']) { + case 'mceItemFlash': + s = 'writeFlash'; + break; + + case 'mceItemShockWave': + s = 'writeShockWave'; + break; + + case 'mceItemWindowsMedia': + s = 'writeWindowsMedia'; + break; + + case 'mceItemQuickTime': + s = 'writeQuickTime'; + break; + + case 'mceItemRealMedia': + s = 'writeRealMedia'; + break; + } + + if (attribs.width) + at = at.replace(/width:[^0-9]?[0-9]+%?[^0-9]?/g, "width:'" + attribs.width + "'"); + + if (attribs.height) + at = at.replace(/height:[^0-9]?[0-9]+%?[^0-9]?/g, "height:'" + attribs.height + "'"); + + // Force absolute URL + pl.src = tinyMCE.convertURL(pl.src, null, true); + at = at.replace(new RegExp("src:'[^']*'", "g"), "src:'" + pl.src + "'"); + + embedHTML = ''; + } + + // Insert embed/object chunk + chunkBefore = content.substring(0, startPos); + chunkAfter = content.substring(endPos); + content = chunkBefore + embedHTML + chunkAfter; + } + break; + } + + return content; + }, + + handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { + if (node == null) + return; + + do { + if (node.nodeName == "IMG" && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(node, 'class'))) { + tinyMCE.switchClass(editor_id + '_media', 'mceButtonSelected'); + return true; + } + } while ((node = node.parentNode)); + + tinyMCE.switchClass(editor_id + '_media', 'mceButtonNormal'); + + return true; + }, + + _createImgFromEmbed : function(n, d, cl) { + var ne, at, i, ti = '', an; + + ne = d.createElement('img'); + ne.src = tinyMCE.getParam("theme_href") + '/images/spacer.gif'; + ne.width = tinyMCE.getAttrib(n, 'width'); + ne.height = tinyMCE.getAttrib(n, 'height'); + ne.className = cl; + + at = n.attributes; + for (i=0; i 0 ? ti.substring(0, ti.length - 1) : ti; + ne.title = ti; + + n.parentNode.replaceChild(ne, n); + }, + + _createImg : function(cl, d, n) { + var i, nl, ti = "", an, av, al = new Array(); + + ne = d.createElement('img'); + ne.src = tinyMCE.getParam("theme_href") + '/images/spacer.gif'; + ne.width = tinyMCE.getAttrib(n, 'width'); + ne.height = tinyMCE.getAttrib(n, 'height'); + ne.className = cl; + + al.id = tinyMCE.getAttrib(n, 'id'); + al.name = tinyMCE.getAttrib(n, 'name'); + al.width = tinyMCE.getAttrib(n, 'width'); + al.height = tinyMCE.getAttrib(n, 'height'); + al.bgcolor = tinyMCE.getAttrib(n, 'bgcolor'); + al.align = tinyMCE.getAttrib(n, 'align'); + al.class_name = tinyMCE.getAttrib(n, 'mce_class'); + + nl = n.getElementsByTagName('div'); + for (i=0; i 0 ? ti.substring(0, ti.length - 1) : ti; + ne.title = ti; + + return ne; + }, + + _getEmbed : function(cls, cb, mt, p, at) { + var h = '', n; + + p.width = at.width ? at.width : p.width; + p.height = at.height ? at.height : p.height; + + h += ''; + + // Add extra url parameter if it's an absolute URL on WMP + if (n == 'src' && p[n].indexOf('://') != -1 && mt == 'application/x-mplayer2') + h += ''; + } + } + + h += ''; - - h += ''; + + h += ''); -} - -function init() { - var pl = "", f, val; - var type = "flash", fe, i; - - tinyMCEPopup.resizeToInnerSize(); - f = document.forms[0] - - fe = tinyMCE.selectedInstance.getFocusElement(); - if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(fe, 'class'))) { - pl = "x={" + fe.title + "};"; - - switch (tinyMCE.getAttrib(fe, 'class')) { - case 'mceItemFlash': - type = 'flash'; - break; - - case 'mceItemShockWave': - type = 'shockwave'; - break; - - case 'mceItemWindowsMedia': - type = 'wmp'; - break; - - case 'mceItemQuickTime': - type = 'qt'; - break; - - case 'mceItemRealMedia': - type = 'rmp'; - break; - } - - document.forms[0].insert.value = tinyMCE.getLang('lang_update', 'Insert', true); - } - - document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); - document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - - var html = getMediaListHTML('filebrowser','src','media','media'); - if (html == "") - document.getElementById("linklistrow").style.display = 'none'; - else - document.getElementById("linklistcontainer").innerHTML = html; - - // Resize some elements - if (isVisible('filebrowsercontainer')) - document.getElementById('src').style.width = '230px'; - - // Setup form - if (pl != "") { - pl = eval(pl); - - switch (type) { - case "flash": - setBool(pl, 'flash', 'play'); - setBool(pl, 'flash', 'loop'); - setBool(pl, 'flash', 'menu'); - setBool(pl, 'flash', 'swliveconnect'); - setStr(pl, 'flash', 'quality'); - setStr(pl, 'flash', 'scale'); - setStr(pl, 'flash', 'salign'); - setStr(pl, 'flash', 'wmode'); - setStr(pl, 'flash', 'base'); - setStr(pl, 'flash', 'flashvars'); - break; - - case "qt": - setBool(pl, 'qt', 'loop'); - setBool(pl, 'qt', 'autoplay'); - setBool(pl, 'qt', 'cache'); - setBool(pl, 'qt', 'controller'); - setBool(pl, 'qt', 'correction'); - setBool(pl, 'qt', 'enablejavascript'); - setBool(pl, 'qt', 'kioskmode'); - setBool(pl, 'qt', 'autohref'); - setBool(pl, 'qt', 'playeveryframe'); - setBool(pl, 'qt', 'tarsetcache'); - setStr(pl, 'qt', 'scale'); - setStr(pl, 'qt', 'starttime'); - setStr(pl, 'qt', 'endtime'); - setStr(pl, 'qt', 'tarset'); - setStr(pl, 'qt', 'qtsrcchokespeed'); - setStr(pl, 'qt', 'volume'); - setStr(pl, 'qt', 'qtsrc'); - break; - - case "shockwave": - setBool(pl, 'shockwave', 'sound'); - setBool(pl, 'shockwave', 'progress'); - setBool(pl, 'shockwave', 'autostart'); - setBool(pl, 'shockwave', 'swliveconnect'); - setStr(pl, 'shockwave', 'swvolume'); - setStr(pl, 'shockwave', 'swstretchstyle'); - setStr(pl, 'shockwave', 'swstretchhalign'); - setStr(pl, 'shockwave', 'swstretchvalign'); - break; - - case "wmp": - setBool(pl, 'wmp', 'autostart'); - setBool(pl, 'wmp', 'enabled'); - setBool(pl, 'wmp', 'enablecontextmenu'); - setBool(pl, 'wmp', 'fullscreen'); - setBool(pl, 'wmp', 'invokeurls'); - setBool(pl, 'wmp', 'mute'); - setBool(pl, 'wmp', 'stretchtofit'); - setBool(pl, 'wmp', 'windowlessvideo'); - setStr(pl, 'wmp', 'balance'); - setStr(pl, 'wmp', 'baseurl'); - setStr(pl, 'wmp', 'captioningid'); - setStr(pl, 'wmp', 'currentmarker'); - setStr(pl, 'wmp', 'currentposition'); - setStr(pl, 'wmp', 'defaultframe'); - setStr(pl, 'wmp', 'playcount'); - setStr(pl, 'wmp', 'rate'); - setStr(pl, 'wmp', 'uimode'); - setStr(pl, 'wmp', 'volume'); - break; - - case "rmp": - setBool(pl, 'rmp', 'autostart'); - setBool(pl, 'rmp', 'loop'); - setBool(pl, 'rmp', 'autogotourl'); - setBool(pl, 'rmp', 'center'); - setBool(pl, 'rmp', 'imagestatus'); - setBool(pl, 'rmp', 'maintainaspect'); - setBool(pl, 'rmp', 'nojava'); - setBool(pl, 'rmp', 'prefetch'); - setBool(pl, 'rmp', 'shuffle'); - setStr(pl, 'rmp', 'console'); - setStr(pl, 'rmp', 'controls'); - setStr(pl, 'rmp', 'numloop'); - setStr(pl, 'rmp', 'scriptcallbacks'); - break; - } - - setStr(pl, null, 'src'); - setStr(pl, null, 'id'); - setStr(pl, null, 'name'); - setStr(pl, null, 'vspace'); - setStr(pl, null, 'hspace'); - setStr(pl, null, 'bgcolor'); - setStr(pl, null, 'align'); - setStr(pl, null, 'width'); - setStr(pl, null, 'height'); - - if ((val = tinyMCE.getAttrib(fe, "width")) != "") - pl.width = f.width.value = val; - - if ((val = tinyMCE.getAttrib(fe, "height")) != "") - pl.height = f.height.value = val; - - oldWidth = pl.width ? parseInt(pl.width) : 0; - oldHeight = pl.height ? parseInt(pl.height) : 0; - } else - oldWidth = oldHeight = 0; - - selectByValue(f, 'media_type', type); - changedType(type); - updateColor('bgcolor_pick', 'bgcolor'); - - TinyMCE_EditableSelects.init(); - generatePreview(); -} - -function insertMedia() { - var fe, f = document.forms[0], h; - - if (!AutoValidator.validate(f)) { - alert(tinyMCE.getLang('lang_invalid_data')); - return false; - } - - f.width.value = f.width.value == "" ? 100 : f.width.value; - f.height.value = f.height.value == "" ? 100 : f.height.value; - - fe = tinyMCE.selectedInstance.getFocusElement(); - if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(fe, 'class'))) { - switch (f.media_type.options[f.media_type.selectedIndex].value) { - case "flash": - fe.className = "mceItemFlash"; - break; - - case "shockwave": - fe.className = "mceItemShockWave"; - break; - - case "qt": - fe.className = "mceItemQuickTime"; - break; - - case "wmp": - fe.className = "mceItemWindowsMedia"; - break; - - case "rmp": - fe.className = "mceItemRealMedia"; - break; - } - - if (fe.width != f.width.value || fe.height != f.height.height) - tinyMCE.selectedInstance.repaint(); - - fe.title = serializeParameters(); - fe.width = f.width.value; - fe.height = f.height.value; - fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : ''); - fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : ''); - fe.align = f.align.options[f.align.selectedIndex].value; - } else { - h = ' 0) { - var html = ""; - - html += ''; - - return html; - } - - return ""; -} - -function getType(v) { - var fo, i, c, el, x, f = document.forms[0]; - - fo = tinyMCE.getParam("media_types", "flash=swf;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'); - - // YouTube - if (v.indexOf('http://www.youtube.com/watch?v=') == 0 || v.indexOf('http://youtube.com/watch?v=') == 0) { - f.width.value = '425'; - f.height.value = '350'; - - v = v.replace('http://youtube.com/watch?v=', ''); - v = v.replace('http://www.youtube.com/watch?v=', ''); - - f.src.value = 'http://www.youtube.com/v/' + v; - return 'flash'; - } - - // Google video - if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) { - f.width.value = '425'; - f.height.value = '326'; - f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en'; - return 'flash'; - } - - for (i=0; i 0 ? s.substring(0, s.length - 1) : s; - - return s; -} - -function setBool(pl, p, n) { - if (typeof(pl[n]) == "undefined") - return; - - document.forms[0].elements[p + "_" + n].checked = pl[n]; -} - -function setStr(pl, p, n) { - var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n]; - - if (typeof(pl[n]) == "undefined") - return; - - if (e.type == "text") - e.value = pl[n]; - else - selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]); -} - -function getBool(p, n, d, tv, fv) { - var v = document.forms[0].elements[p + "_" + n].checked; - - tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'"; - fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'"; - - return (v == d) ? '' : n + (v ? ':' + tv + ',' : ':' + fv + ','); -} - -function getStr(p, n, d) { - var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; - var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; - - return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',"); -} - -function getInt(p, n, d) { - var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; - var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; - - return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ","); -} - -function jsEncode(s) { - s = s.replace(new RegExp('\\\\', 'g'), '\\\\'); - s = s.replace(new RegExp('"', 'g'), '\\"'); - s = s.replace(new RegExp("'", 'g'), "\\'"); - - return s; -} - -function generatePreview(c) { - var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh; - - p.innerHTML = ''; - - nw = parseInt(f.width.value); - nh = parseInt(f.height.value); - - if (f.width.value != "" && f.height.value != "") { - if (f.constrain.checked) { - if (c == 'width' && oldWidth != 0) { - wp = nw / oldWidth; - nh = Math.round(wp * nh); - f.height.value = nh; - } else if (c == 'height' && oldHeight != 0) { - hp = nh / oldHeight; - nw = Math.round(hp * nw); - f.width.value = nw; - } - } - } - - if (f.width.value != "") - oldWidth = nw; - - if (f.height.value != "") - oldHeight = nh; - - // After constrain - pl = serializeParameters(); - - switch (f.media_type.options[f.media_type.selectedIndex].value) { - case "flash": - cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; - codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; - type = 'application/x-shockwave-flash'; - break; - - case "shockwave": - cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000'; - codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; - type = 'application/x-director'; - break; - - case "qt": - cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; - codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; - type = 'video/quicktime'; - break; - - case "wmp": - cls = tinyMCE.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'; - codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; - type = 'application/x-mplayer2'; - break; - - case "rmp": - cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; - codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; - type = 'audio/x-pn-realaudio-plugin'; - break; - } - - if (pl == '') { - p.innerHTML = ''; - return; - } - - pl = eval('x={' + pl + '};'); - - if (!pl.src) { - p.innerHTML = ''; - return; - } - - pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src); - pl.width = !pl.width ? 100 : pl.width; - pl.height = !pl.height ? 100 : pl.height; - pl.id = !pl.id ? 'obj' : pl.id; - pl.name = !pl.name ? 'eobj' : pl.name; - pl.align = !pl.align ? '' : pl.align; - - h += ''; - - for (n in pl) { - h += ''; - - // Add extra url parameter if it's an absolute URL - if (n == 'src' && pl[n].indexOf('://') != -1) - h += ''; - } - - h += ''); +} + +function init() { + var pl = "", f, val; + var type = "flash", fe, i; + + tinyMCEPopup.resizeToInnerSize(); + f = document.forms[0] + + fe = tinyMCE.selectedInstance.getFocusElement(); + if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(fe, 'class'))) { + pl = "x={" + fe.title + "};"; + + switch (tinyMCE.getAttrib(fe, 'class')) { + case 'mceItemFlash': + type = 'flash'; + break; + + case 'mceItemShockWave': + type = 'shockwave'; + break; + + case 'mceItemWindowsMedia': + type = 'wmp'; + break; + + case 'mceItemQuickTime': + type = 'qt'; + break; + + case 'mceItemRealMedia': + type = 'rmp'; + break; + } + + document.forms[0].insert.value = tinyMCE.getLang('lang_update', 'Insert', true); + } + + document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); + document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var html = getMediaListHTML('filebrowser','src','media','media'); + if (html == "") + document.getElementById("linklistrow").style.display = 'none'; + else + document.getElementById("linklistcontainer").innerHTML = html; + + // Resize some elements + if (isVisible('filebrowsercontainer')) + document.getElementById('src').style.width = '230px'; + + // Setup form + if (pl != "") { + pl = eval(pl); + + switch (type) { + case "flash": + setBool(pl, 'flash', 'play'); + setBool(pl, 'flash', 'loop'); + setBool(pl, 'flash', 'menu'); + setBool(pl, 'flash', 'swliveconnect'); + setStr(pl, 'flash', 'quality'); + setStr(pl, 'flash', 'scale'); + setStr(pl, 'flash', 'salign'); + setStr(pl, 'flash', 'wmode'); + setStr(pl, 'flash', 'base'); + setStr(pl, 'flash', 'flashvars'); + break; + + case "qt": + setBool(pl, 'qt', 'loop'); + setBool(pl, 'qt', 'autoplay'); + setBool(pl, 'qt', 'cache'); + setBool(pl, 'qt', 'controller'); + setBool(pl, 'qt', 'correction'); + setBool(pl, 'qt', 'enablejavascript'); + setBool(pl, 'qt', 'kioskmode'); + setBool(pl, 'qt', 'autohref'); + setBool(pl, 'qt', 'playeveryframe'); + setBool(pl, 'qt', 'tarsetcache'); + setStr(pl, 'qt', 'scale'); + setStr(pl, 'qt', 'starttime'); + setStr(pl, 'qt', 'endtime'); + setStr(pl, 'qt', 'tarset'); + setStr(pl, 'qt', 'qtsrcchokespeed'); + setStr(pl, 'qt', 'volume'); + setStr(pl, 'qt', 'qtsrc'); + break; + + case "shockwave": + setBool(pl, 'shockwave', 'sound'); + setBool(pl, 'shockwave', 'progress'); + setBool(pl, 'shockwave', 'autostart'); + setBool(pl, 'shockwave', 'swliveconnect'); + setStr(pl, 'shockwave', 'swvolume'); + setStr(pl, 'shockwave', 'swstretchstyle'); + setStr(pl, 'shockwave', 'swstretchhalign'); + setStr(pl, 'shockwave', 'swstretchvalign'); + break; + + case "wmp": + setBool(pl, 'wmp', 'autostart'); + setBool(pl, 'wmp', 'enabled'); + setBool(pl, 'wmp', 'enablecontextmenu'); + setBool(pl, 'wmp', 'fullscreen'); + setBool(pl, 'wmp', 'invokeurls'); + setBool(pl, 'wmp', 'mute'); + setBool(pl, 'wmp', 'stretchtofit'); + setBool(pl, 'wmp', 'windowlessvideo'); + setStr(pl, 'wmp', 'balance'); + setStr(pl, 'wmp', 'baseurl'); + setStr(pl, 'wmp', 'captioningid'); + setStr(pl, 'wmp', 'currentmarker'); + setStr(pl, 'wmp', 'currentposition'); + setStr(pl, 'wmp', 'defaultframe'); + setStr(pl, 'wmp', 'playcount'); + setStr(pl, 'wmp', 'rate'); + setStr(pl, 'wmp', 'uimode'); + setStr(pl, 'wmp', 'volume'); + break; + + case "rmp": + setBool(pl, 'rmp', 'autostart'); + setBool(pl, 'rmp', 'loop'); + setBool(pl, 'rmp', 'autogotourl'); + setBool(pl, 'rmp', 'center'); + setBool(pl, 'rmp', 'imagestatus'); + setBool(pl, 'rmp', 'maintainaspect'); + setBool(pl, 'rmp', 'nojava'); + setBool(pl, 'rmp', 'prefetch'); + setBool(pl, 'rmp', 'shuffle'); + setStr(pl, 'rmp', 'console'); + setStr(pl, 'rmp', 'controls'); + setStr(pl, 'rmp', 'numloop'); + setStr(pl, 'rmp', 'scriptcallbacks'); + break; + } + + setStr(pl, null, 'src'); + setStr(pl, null, 'id'); + setStr(pl, null, 'name'); + setStr(pl, null, 'vspace'); + setStr(pl, null, 'hspace'); + setStr(pl, null, 'bgcolor'); + setStr(pl, null, 'align'); + setStr(pl, null, 'width'); + setStr(pl, null, 'height'); + + if ((val = tinyMCE.getAttrib(fe, "width")) != "") + pl.width = f.width.value = val; + + if ((val = tinyMCE.getAttrib(fe, "height")) != "") + pl.height = f.height.value = val; + + oldWidth = pl.width ? parseInt(pl.width) : 0; + oldHeight = pl.height ? parseInt(pl.height) : 0; + } else + oldWidth = oldHeight = 0; + + selectByValue(f, 'media_type', type); + changedType(type); + updateColor('bgcolor_pick', 'bgcolor'); + + TinyMCE_EditableSelects.init(); + generatePreview(); +} + +function insertMedia() { + var fe, f = document.forms[0], h; + + if (!AutoValidator.validate(f)) { + alert(tinyMCE.getLang('lang_invalid_data')); + return false; + } + + f.width.value = f.width.value == "" ? 100 : f.width.value; + f.height.value = f.height.value == "" ? 100 : f.height.value; + + fe = tinyMCE.selectedInstance.getFocusElement(); + if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(fe, 'class'))) { + switch (f.media_type.options[f.media_type.selectedIndex].value) { + case "flash": + fe.className = "mceItemFlash"; + break; + + case "shockwave": + fe.className = "mceItemShockWave"; + break; + + case "qt": + fe.className = "mceItemQuickTime"; + break; + + case "wmp": + fe.className = "mceItemWindowsMedia"; + break; + + case "rmp": + fe.className = "mceItemRealMedia"; + break; + } + + if (fe.width != f.width.value || fe.height != f.height.height) + tinyMCE.selectedInstance.repaint(); + + fe.title = serializeParameters(); + fe.width = f.width.value; + fe.height = f.height.value; + fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : ''); + fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : ''); + fe.align = f.align.options[f.align.selectedIndex].value; + } else { + h = ' 0) { + var html = ""; + + html += ''; + + return html; + } + + return ""; +} + +function getType(v) { + var fo, i, c, el, x, f = document.forms[0]; + + fo = tinyMCE.getParam("media_types", "flash=swf;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'); + + // YouTube + if (v.indexOf('http://www.youtube.com/watch?v=') == 0 || v.indexOf('http://youtube.com/watch?v=') == 0) { + f.width.value = '425'; + f.height.value = '350'; + + v = v.replace('http://youtube.com/watch?v=', ''); + v = v.replace('http://www.youtube.com/watch?v=', ''); + + f.src.value = 'http://www.youtube.com/v/' + v; + return 'flash'; + } + + // Google video + if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) { + f.width.value = '425'; + f.height.value = '326'; + f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en'; + return 'flash'; + } + + for (i=0; i 0 ? s.substring(0, s.length - 1) : s; + + return s; +} + +function setBool(pl, p, n) { + if (typeof(pl[n]) == "undefined") + return; + + document.forms[0].elements[p + "_" + n].checked = pl[n]; +} + +function setStr(pl, p, n) { + var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n]; + + if (typeof(pl[n]) == "undefined") + return; + + if (e.type == "text") + e.value = pl[n]; + else + selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]); +} + +function getBool(p, n, d, tv, fv) { + var v = document.forms[0].elements[p + "_" + n].checked; + + tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'"; + fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'"; + + return (v == d) ? '' : n + (v ? ':' + tv + ',' : ':' + fv + ','); +} + +function getStr(p, n, d) { + var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; + var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; + + return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',"); +} + +function getInt(p, n, d) { + var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; + var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; + + return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ","); +} + +function jsEncode(s) { + s = s.replace(new RegExp('\\\\', 'g'), '\\\\'); + s = s.replace(new RegExp('"', 'g'), '\\"'); + s = s.replace(new RegExp("'", 'g'), "\\'"); + + return s; +} + +function generatePreview(c) { + var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh; + + p.innerHTML = ''; + + nw = parseInt(f.width.value); + nh = parseInt(f.height.value); + + if (f.width.value != "" && f.height.value != "") { + if (f.constrain.checked) { + if (c == 'width' && oldWidth != 0) { + wp = nw / oldWidth; + nh = Math.round(wp * nh); + f.height.value = nh; + } else if (c == 'height' && oldHeight != 0) { + hp = nh / oldHeight; + nw = Math.round(hp * nw); + f.width.value = nw; + } + } + } + + if (f.width.value != "") + oldWidth = nw; + + if (f.height.value != "") + oldHeight = nh; + + // After constrain + pl = serializeParameters(); + + switch (f.media_type.options[f.media_type.selectedIndex].value) { + case "flash": + cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; + codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; + type = 'application/x-shockwave-flash'; + break; + + case "shockwave": + cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000'; + codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; + type = 'application/x-director'; + break; + + case "qt": + cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; + codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; + type = 'video/quicktime'; + break; + + case "wmp": + cls = tinyMCE.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'; + codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; + type = 'application/x-mplayer2'; + break; + + case "rmp": + cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; + codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; + type = 'audio/x-pn-realaudio-plugin'; + break; + } + + if (pl == '') { + p.innerHTML = ''; + return; + } + + pl = eval('x={' + pl + '};'); + + if (!pl.src) { + p.innerHTML = ''; + return; + } + + pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src); + pl.width = !pl.width ? 100 : pl.width; + pl.height = !pl.height ? 100 : pl.height; + pl.id = !pl.id ? 'obj' : pl.id; + pl.name = !pl.name ? 'eobj' : pl.name; + pl.align = !pl.align ? '' : pl.align; + + h += ''; + + for (n in pl) { + h += ''; + + // Add extra url parameter if it's an absolute URL + if (n == 'src' && pl[n].indexOf('://') != -1) + h += ''; + } + + h += '